A table can hold thousands of rows. WHERE lets you keep only the ones you care about.
1 The row filter
WHERE tests a condition on each row. Rows that pass go to the result; the rest are skipped.
2 Comparison operators
=, <>, < and >= compare values. score >= 85 is true only for strong results.
3 AND / OR
AND needs both conditions true. OR is satisfied when at least one holds.
4 Empty is fine
A WHERE that matches nothing returns an empty result — not an error.
Asking narrower questions
The row filter1WHERE tests a condition on each row. Rows that pass go to the result; the rest are skipped.
Comparison operators2=, <>, < and >= compare values. score >= 85 is true only for strong results.
AND / OR3AND needs both conditions true. OR is satisfied when at least one holds.
Empty is fine4A WHERE that matches nothing returns an empty result — not an error. 4 building blocks make up Asking narrower questions
Press play: each student faces the score >= 85 test. Failing rows dim out and never reach the result.
SELECT name, score
FROM students
WHERE score >= 85;
students
| id | name | score | city |
|---|
| 1 | Ava | 92 | Oslo |
| 2 | Ben | 82 | Oslo |
| 3 | Chloe | 85 | Lima |
| 4 | Dev | 68 | Lima |
| 5 | Emma | 95 | Oslo |
| 6 | Finn | 88 | Paris |
Step 1/7Row 1: is 92 >= 85? True — Ava passes and lands in the result.
For every row the engine asks the same two questions: any rows left, and does the condition hold?
process decision input / output start / end A stricter rule for the same six students. Who survives this WHERE?
Your predicted output — one line per console line
Hint: Both sides of the AND must hold. Check every row — some fail only one side.
Click an operator, then click its meaning to lock the pair.
5 conceptsTap a card to expand ?= (equals)drops into place
?<> (not equal)drops into place
?>= (at least)drops into place
?ANDdrops into place
?ORdrops into place
01WHERE filters rows one by one before anything reaches the result.
02Failing rows are skipped, not errors — the table is never changed.
03AND requires both conditions; OR is satisfied by a single one.
04A WHERE matching zero rows simply returns an empty grid.
05Numbers compare as numbers: 85 >= 85 is true — the boundary counts.