Combining query criteria with AND and OR
AND needs both conditions to be true, like Year = 7 AND Score > 80. OR needs at least one to be true, like Pet = "Cat" OR Pet = "Dog". They let a query match several conditions at once.
Understanding Combining query criteria with AND and OR in VCE Spreadsheets, SQL & Visualisation
What it does: AND makes both the Year and Score conditions have to be true for a record to show. Each row of criteria in query design is a separate option, so a record matching either row is shown. This works like OR. OR needs at least one condition to be true. A student with a Dog matches the second condition, so they are shown. Criteria on the same row are joined with AND. Criteria on different rows are joined with OR. AND needs both to be true, which is impossible for one field value. OR should be used instead.
Common mistakes: The fields in a SELECT list must be separated by a comma. It should be SELECT Name, Score. Text values in query criteria need quote marks. It should be WHERE Pet = "Cat".
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
AND / ORFill in the Blanks
Spot the Error
Student with a class code? Join your class →