Sorting query results
Sorts query results by the Score field from highest to lowest. Use ASC for lowest to highest. Add a second field after a comma to sort ties, like ORDER BY Score DESC, Name.
Understanding Sorting query results in Years 7–8 Data & Information
What it does: Sorting the Score field in descending order puts the best scores at the top of the results. The second field after the comma is only used to sort rows that have the same value in the first field. DESC means descending, so the biggest values come first. ASC puts the smallest first. ASC means ascending, so results go from lowest to highest. Ascending order for text is alphabetical, from A to Z. The field name comes first, then the direction: ORDER BY Points DESC.
Common mistakes: The word BY is missing. Sorting needs ORDER BY, so the line should be ORDER BY Score DESC;. DOWN is not a sort direction. Use DESC for highest to lowest, so the line should be ORDER BY Score DESC.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 47–80) and word search (Modules 9–80).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
ORDER BY Score DESCFill in the Blanks
Spot the Error
Student with a class code? Join your class →