Combining conditions: AND, OR, BETWEEN, IN
Build richer filters from simple ones.
Combine conditions
Join conditions with AND (both true) and OR (either true). Use parentheses when you mix them:
SELECT title FROM books
WHERE genre = 'fiction' AND price < 15;
Two shorthands save typing:
- BETWEEN a AND b — inclusive range: price BETWEEN 10 AND 20.
- IN (...) — matches any value in a list: genre IN ('poetry', 'history').
Both read better than the long OR chains they replace.