OR means either test can pass
OR is the easygoing one: a row comes back if it passes the left test or the right test. Each side has to be a complete test on its own, so you write the column name again on both sides. That's why grade = 11 OR grade = 12 repeats the word grade.
A tiny example
In plain English: Show me the names of the students who are in grade 11 or grade 12.
SELECT name
FROM students
WHERE grade = 11 OR grade = 12;What comes back
| name |
|---|
| Zoe |
| Sam |
| Eli |
Zoe is in grade 11 and Sam and Eli are in grade 12, so each of the three passes one of the two tests.
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