← Years 7–8 Data & Information

Query criteria with comparison operators

A criterion that limits a query to records where the condition is true, so only Score values above 80 are shown. Compare with =, <>, <, >, <=, >=. Text goes in quotes.

Understanding Query criteria with comparison operators in Years 7–8 Data & Information

What it does: The = operator checks that the Year matches 8 exactly. Numbers do not need quotes. Text values such as Blue are written in quotes so the query treats them as text, not as a field name. > means strictly greater than, so 80 is left out. >= would include students who scored exactly 80. <> means 'not equal to'. Less than or equal to is written <=. A criterion is a test. Records that pass it (true) are shown and the rest are hidden. The data itself is not changed. <> excludes only Year 8, so Years 7, 9 and others are shown. < 8 would only show years below 8.

Common mistakes: The comment says only Score values above 80 should show, but < keeps scores below 80. It should be WHERE Score > 80;. A query criterion uses a single = to test for equal values. Double == is not used in a query. It should be WHERE Year = 7;.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

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.

Learning
Duo
Which criterion shows only students in Year 7?
WHERE Year = 7WHERE Year <> 7
Matches
WHERE Team = Blue
↓
The text value Blue is missing its quotes. It should be WHERE Team = "Blue".
Applying
Meanings
Term
WHERE Score > 80
Meaning
A criterion that limits a query to records where the condition is true, so only Score values above 80 are shown. Compare with =, <>, <, >, <=, >=. Text goes in quotes.
Practice
SELECT Name, Score
Testing
Gaps
Score > 80
Check Answer
Spots
1SELECT Name FROM Students
2WHERE Score < 80;

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Reindeer' badge — Dictionary Guide, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which criterion shows only students in Year 7?
A. WHERE Year = 7 ✓
B. WHERE Year <> 7
The = operator keeps only records where the value matches exactly. <> would keep every year except 7.
2. Which criterion shows students who scored MORE than 80 (80 is not included)?
A. WHERE Score >= 80
B. WHERE Score > 80 ✓
> means strictly greater than, so 80 is left out. >= would include students who scored exactly 80.
3. What does the operator <> mean in a query criterion?
A. Not equal to ✓
B. Less than or equal to
<> means 'not equal to'. Less than or equal to is written <=.
4. Which criterion correctly finds pets whose Type is dog?
A. WHERE Type = dog
B. WHERE Type = "dog" ✓
Text criteria must go inside quotes. Without quotes, the query treats dog as a field name and gets confused.
5. A query uses WHERE Age <= 13. Which student would be shown?
A. A student who is 13 ✓
B. A student who is 14
<= means less than or equal to, so an age of exactly 13 passes the test. 14 is greater than 13, so it is left out.

Match the Pairs

WHERE Score > 80 → Shows only records where the Score is greater than 80
WHERE Year <> 7 → Shows only records where the Year is not equal to 7
Show only students who are in Year 8 (a number criterion) → WHERE Year = 8
Text criteria must be put inside quotes → WHERE Team = "Blue"
WHERE Team = Blue → The text value Blue is missing its quotes. It should be WHERE Team = "Blue".
WHERE Score >= 80 (to find scores above 80 only) → The >= operator also includes 80. To get only scores above 80, use > instead: WHERE Score > 80.

Key Term

WHERE Score > 80
A criterion that limits a query to records where the condition is true, so only Score values above 80 are shown. Compare with =, <>, <, >, <=, >=. Text goes in quotes.

Fill in the Blanks

1. SELECT Name, Score FROM Students WHERE Score > 80
Hint: Type the keyword that starts the criterion and limits which records are shown.
2. SELECT Name FROM Students WHERE House = "Red"
Hint: Type the operator that checks a value is exactly equal to the text in quotes.
3. SELECT Name FROM Students WHERE Score <> 50
Hint: Type the operator that keeps only records that are not equal to the value.
4. SELECT Name FROM Students WHERE Score >= 80
Hint: Type the operator for greater than or equal to, so a score of exactly 80 is included.
5. SELECT Name FROM Students WHERE Age <= 12
Hint: Type the operator for less than or equal to, so students aged 12 or younger are shown.

Spot the Error

Question 1
A SELECT Name FROM Students
B WHERE Score < 80;
C -- Only Score above 80 shows
Line B — The comment says only Score values above 80 should show, but < keeps scores below 80. It should be WHERE Score > 80;
Question 2
A SELECT * FROM Students
B WHERE Year == 7;
C -- Only Year 7 records
Line B — A query criterion uses a single = to test for equal values. Double == is not used in a query. It should be WHERE Year = 7;
Question 3
A SELECT Name, Score
B FROM Results
C WHERE Score > 50;
D -- Pass mark is 50 or more
Line C — The pass mark is 50 or more, so students who scored exactly 50 must be included. > leaves them out. It should be WHERE Score >= 50;
Question 4
A SELECT Name
B FROM Students
C WHERE Town = Cairns;
Line C — Text criteria must go in quotes. Without quotes, Cairns looks like a field name. It should be WHERE Town = 'Cairns';
Question 5
A SELECT * FROM Pets
B WHERE Type >< 'Dog';
C -- Every pet except dogs
Line B — There is no >< operator. 'Not equal to' is written <>. It should be WHERE Type <> 'Dog';

Student with a class code? Join your class →