Skip to content

Sorting and limiting

SQL · Free lesson · No account needed

Step 1 of 9 · Start here

Sorting and limiting

Start here

ORDER BY sorts the results by a column: smallest first, or A to Z. Add DESC for largest first.

LIMIT keeps only the first few rows. Together, they answer "top 3" questions:

SELECT title, price FROM books ORDER BY price DESC LIMIT 3;

You’re trying a free lesson. Your progress saves on this device. Create a free account to keep it everywhere and ask the AI tutor.