SQL interview question: Filter a Price Range With BETWEEN
Mid-Range Product Filter
Sales wants to promote mid-tier products priced between $50 and $200.
Find all products with prices in the $50-$200 range (inclusive).
Return product_id, product_name, and price. Order by price.
Skills: BETWEEN operator for range filtering
Tables
products 20 rows
- product_id integer PK
- product_name text
- category text
- price real
- rating real
| product_id | product_name | category | price | rating |
|---|---|---|---|---|
| 1 | MacBook Pro | Electronics | 1999.99 | 4.8 |
| 2 | iPad Air | Electronics | 599.99 | 4.8 |
| 3 | AirPods Pro | Electronics | 249.99 | 4.7 |