WHERE Filters: Comparison and Logic Operators
Filter rows with =, <>, , AND, OR, NOT and understand operator precedence and parentheses.
The Role of WHERE
WHERE filters rows before grouping or aggregation. Only rows where the predicate is TRUE are returned.
Comparison Operators
Standard comparisons work on all comparable types:
SELECT * FROM products WHERE price > 100;
SELECT * FROM products WHERE price >= 100;
SELECT * FROM products WHERE price < 50;
SELECT * FROM products WHERE price <= 50;
SELECT * FROM products WHERE category = 'books';
SELECT * FROM products WHERE category <> 'books'; -- != also worksAll lessons in this course
- Selecting Columns and Expressions
- WHERE Filters: Comparison and Logic Operators
- ORDER BY Single and Multiple Columns
- LIMIT, OFFSET and Pagination Basics