WHERE Clause Basics
The WHERE clause filters rows based on conditions. Instead of getting all data, you get only the rows that match your criteria.
Basic WHERE Syntax
SELECT columns FROM table WHERE condition;
The condition compares a column value to something you specify.
Exercises
Loading exercise...
Loading exercise...
Loading exercise...
Important Notes
- Text values must be in single quotes:
WHERE city = 'Boston' - Numbers don't need quotes:
WHERE age = 25 - Comparison is exact:
'new york'won't match'New York'
Loading exercise...
Free Practice
Loading SQL editor...
Try these queries:
- Find users from different cities
- Find users of a specific age
- Find a user by their exact name

