WHERE keeps only the rows you want
Without WHERE, a query hands back every row in the table. WHERE adds a test, and the database checks it one row at a time. Rows that pass the test come back. Rows that don't are left behind. Picking columns is still SELECT's job — WHERE only decides which rows.
A tiny example
In plain English: Show me the names of the students who are in grade 12.
SELECT name
FROM students
WHERE grade = 12;What comes back
| name |
|---|
| Amara |
| Theo |
| Jin |
Amara, Theo, and Jin are the only students in grade 12, so they're the only rows that come back.
Related SQL lessons
Ready for a break?
Take on today's cozy puzzle. A fresh, bite-sized query waits every morning — no timers, no pressure.
play today's sip