SQL WHERE conditions
An SQL clause that keeps only the rows meeting a condition, such as WHERE age >= 15 or WHERE town = 'Perth'. Text goes in quotes, and AND or OR can combine conditions.
Understanding SQL WHERE conditions in VCE Spreadsheets, SQL & Visualisation
What it does: Text such as Maths goes inside single quotes so SQL treats it as a value, not a column name. With AND, a student must be at least 15 and in Year 10 to be included in the results. The 'greater than or equal to' operator is written >= in SQL. => is not a valid comparison operator. WHERE filters the rows. Only records where the condition is true are included in the results. AND means both conditions must be true. OR would also include Year 9 students who are 16 or over, or Year 10 students who are younger than 16.
Common mistakes: WHILE is not an SQL clause. The keyword that filters rows by a condition is WHERE, so the line should be SELECT name FROM pets WHERE. => is not a valid comparison operator. 'Greater than or equal to' is written >=, so the line should be AND age >= 15;.
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 45–54) and word search (Modules 35–54).
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
WHEREFill in the Blanks
Spot the Error
Student with a class code? Join your class →