Easy Aggregation Free

SQL interview question: List Unique Values per Category

List Unique Product Categories

The catalog team needs a clean list of all product categories without duplicates.

Return unique categories and the price range (min and max price) for each.

Return category, min_price, and max_price. Order by category.

Skills: DISTINCT with GROUP BY and aggregate functions

Tables

products 20 rows
  • product_id integer PK
  • product_name text
  • category text
  • price real
  • rating real
product_idproduct_namecategorypricerating
1MacBook ProElectronics1999.994.8
2iPad AirElectronics599.994.8
3AirPods ProElectronics249.994.7

Keep going