OR means either test can pass
OR returns a row if it passes the left test or the right test — at least one must be true. Each side has to be a complete test on its own, so you write the column name again on both sides. That’s why category = 'coffee' OR category = 'tea' repeats the word category.
A tiny example
In plain English: Show me the drinks that are coffee or tea.
SELECT name, category
FROM menu_items
WHERE category = 'coffee'
OR category = 'tea';Query result
| name | category |
|---|---|
| Espresso | coffee |
| Earl Grey | tea |
| Latte | coffee |
Espresso and latte are coffee, while Earl Grey is tea, so each row passes one of the two tests.
Related SQL lessons
Practice OR step by step
The Foundations Track has beginner puzzles built around this idea. Tap tiles, see real results. No terminal, no setup.
practice this in the courseReady for a break?
A fresh, bite-sized SQL puzzle waits every morning. Tap tiles, see real results. No terminal, no setup, no timers.
Try today's free SQL puzzle