Sorting & Limiting2 / 10
Up next

Sort descending

CREATE TABLE product (id INTEGER, name TEXT, price REAL);
INSERT INTO product VALUES (1, 'Lamp', 20.0), (2, 'Pen', 1.5), (3, 'Mug', 8.0);
-- DESC sorts from high to low
SELECT name, price
FROM product
ORDER BY price DESC;
What you're solving

DESC reverses the order