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 lab

Hints

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).

nameunit_price
Screen Cleaning Kit9
Cat6 Ethernet Cable 10m12
Laptop Sleeve 14"25
Pocket 256GB USB-C Drive29
USB Wi-Fi 6 Adapter35
Adjustable Laptop Stand39
Precision Wireless Mouse39
65W GaN Charger45
Gigabit 8-Port Switch45
Slim Wireless Keyboard49
USB-C 7-in-1 Hub49
Ergo Vertical Mouse59

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.

Next challenge: Customers in Lisbon →