Beginner#01 · SELECT, ORDER BY
The price list
A customer asks for the full product price list. Return every product's name and unit_price, cheapest first. If two products cost the same, sort them by name.
Write your query in the lab. It runs in your browser and tells you exactly what's wrong if it doesn't match.
Solve it in the labHints
Hint 1
You only need the products table.
Hint 2
Sort with ORDER BY unit_price. Ascending is the default. Add a second sort column after a comma.
Expected output
Your result should match this, in this order (30 rows).
| name | unit_price |
|---|---|
| Screen Cleaning Kit | 9 |
| Cat6 Ethernet Cable 10m | 12 |
| Laptop Sleeve 14" | 25 |
| Pocket 256GB USB-C Drive | 29 |
| USB Wi-Fi 6 Adapter | 35 |
| Adjustable Laptop Stand | 39 |
| Precision Wireless Mouse | 39 |
| 65W GaN Charger | 45 |
| Gigabit 8-Port Switch | 45 |
| Slim Wireless Keyboard | 49 |
| USB-C 7-in-1 Hub | 49 |
| Ergo Vertical Mouse | 59 |
Showing 12 of 30 rows.
Model answer
Show the solution
SELECT name, unit_price FROM products ORDER BY unit_price, name;
Other queries that return the same rows are correct too. The lab checks your result, not your exact wording.