How a field's data type changes sorting
In a text field, '10' sorts before '9' because text sorts letter by letter. Number and date fields sort by true value, so 9 comes before 10 and dates follow time order.
Understanding How a field's data type changes sorting in ACARA Digital Technologies Years 7–8
What it does: Text compares the first characters '1' and '9', and '1' comes first, so '10' sorts before '9'. With an integer or floating point field the whole value is compared, so 9 is smaller than 10 and sorts first. Only text fields sort letter by letter. Integer fields would give 2, 10, 100. A real date field sorts by time. Earlier dates come before later dates. YYYY-MM-DD is written biggest unit first, so letter-by-letter sorting matches time order. Formats like DD/MM/YYYY would not. ORDER BY uses the field's data type. Numbers stored as text will sort in the wrong order.
Common mistakes: FORM is a typo. The keyword is FROM. The price field is a number type, so ORDER BY price sorts by true value (4 before 12). The clause needs the word BY. It should be ORDER BY orderDate ASC; so the dates sort in time order.
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 365–411) and word search (Modules 331–411).
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
'10' < '9'Fill in the Blanks
Spot the Error
Student with a class code? Join your class →