#689

Price category without CASE or IF (Yandex Praktikum)

A Yandex Praktikum trainer module runs a mini-project on a stationery store. Students receive an order catalog and must tell which price tier each item belongs to. The constraint: no CASE, no IF — the category must come from a range JOIN. Three tables: - orders(order_id, last_name, product, ordered_at)ordered_at TIMESTAMPTZ - prices(product, price)price NUMERIC(15,2) - categories(category, price_range)category VARCHAR(20), price_range NUMRANGE with bounds [limit_1, limit_2) For each order, pull the item's price and the category whose price_range contains it. Remember: no CASE, no IF — JOIN only.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.

priceproductcategorylast_name
120.00NotebookcheapIvanova
15.00PencheapPetrov
3500.00BackpackmediumSokolova
Yandex Praktikum

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid