task CASE · easy
Price bands
Return name and price_band for every catalog item: 'budget' when price is under 25, 'standard' from 25 up to (not including) 100, 'premium' at 100 or more.
what to return
- Columns
nameprice_bandin this order- Rows
- 13 rows · any order
- Watch for
- An item priced exactly 25 is standard.
- Skill
- Bucket values with CASE. Refresher: Make decisions with CASE →
expected result
Your query should return exactly these columns and values. Run it and compare.
expected result13 rows · any order
| name | price_band |
|---|---|
| Desk Lamp | standard |
| Floor lamp | standard |
| String Lights | budget |
first 3 of 13 rows
data you can query
Sample rows from each table. Each column shows its type underneath; → marks a link to another table.
catalog_items4 columns · 13 rows
| idinteger · key | nametext | categorytext | pricereal |
|---|---|---|---|
| 1 | Desk Lamp | Lighting | 39 |
| 2 | Floor lamp | Lighting | 89 |
| 3 | String Lights | Lighting | 19.5 |
| 4 | Chef Knife | Kitchen | 59 |
| 5 | Cast Iron Pan | Kitchen | 45 |
showing 5 of 13 rows
solution.sql
Hints and the answer are always available. Using them counts the question as solved with help.