BETWEEN and IN in a WHERE clause
Tests if a value is inside a range, including both limits. Its partner IN (a, b, c) checks a value against a list, replacing repeated OR. NOT IN excludes the list.
Understanding BETWEEN and IN in a WHERE clause in ACARA Digital Technologies Years 9–10
What it does: This single IN list does the same job as yearLevel = 7 OR yearLevel = 9 OR yearLevel = 10. NOT IN keeps only rows whose value is not in the list, so Red and Blue students are left out. BETWEEN needs the word AND between the low and high values. A comma is a syntax error. BETWEEN is inclusive. Both the low value (100) and the high value (120) match. The list after IN must sit inside brackets, with the items separated by commas. NOT goes before IN, so the order is NOT IN. It excludes every value in the list.
Common mistakes: BETWEEN needs the low value first and the high value second. With 120 AND 100 no number can fit the range, so no rows come back. It should be BETWEEN 100 AND 120. BETWEEN joins its low and high limits with the keyword AND, not a comma. It should be BETWEEN 2 AND 10.
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 459–475) and word search (Modules 459–534).
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
BETWEEN low AND highFill in the Blanks
Spot the Error
Student with a class code? Join your class →