task ORDER BY · warm-up
Catalog from most to least expensive
Return the name and price of every catalog item, most expensive first.
what to return
- Columns
namepricein this order- Rows
- 13 rows · in the order asked
- Watch for
- When two items have the same price, list them by name A→Z.
- Skill
- Sort descending and break ties with a second key. Refresher: Sort & limit →
expected result
Your query should return exactly these columns and values. Run it and compare.
expected result13 rows · in this order
| name | price |
|---|---|
| Ergonomic Chair | 249 |
| Floor lamp | 89 |
| Monitor Arm | 89 |
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.