×

sql · level 1 · unit 3 · lesson 1

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

sorts your result, like lining up by height.

Rows come back in the order they were stored. To sort them, add ORDER BY and a column name at the end of your query, after any WHERE.

The normal order is : smallest first, or A to Z for text. Add DESC for , biggest first. ASC means ascending, if you want to say it out loud.

Sorting only changes the order of the result. The table itself stays exactly as it was.

SELECT player, points FROM scores ORDER BY points DESC;

ORDER BY goes after WHERE, because you sieve the rows first and then sort them.