Unique Category–Supplier Pairs in the Mid Price Range
Unique Category–Supplier Pairs in the Mid Price Range
A buyer at "Kotomarket" is planning purchases and wants to know which suppliers cover which categories in the mid price range.
The products table stores the shop's items: title, category, supplier, price, and stock on hand.
Return the unique combinations of category and supplier (category, supplier) only for items that satisfy both conditions at the same time:
- the price (price) is in the range from 500 to 2500 inclusive;
- the category (category) is one of: 'мебель', 'корм', 'игрушки'.
Each category–supplier pair must appear in the result exactly once (no duplicates). Sort the result by category, then by supplier (ascending).
Constraints: only SELECT … WHERE … ORDER BY with DISTINCT, BETWEEN, and IN. No aggregates, GROUP BY, JOIN, subqueries, or window functions.
Expected columns: category, supplier.
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. Your answer must use the same column names as this sample — alias them with AS if needed.
| category | supplier |
|---|---|
| игрушки | ИграйЛап |
| корм | ЗооМир |
| корм | МурКорм |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in