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
Up next · Lesson 6 of 27
Comparison Operators
1 min read
5 of 27 lessons done

Ask Byte about this lesson
A private chat about this lesson. Byte has read the whole lesson, answers in seconds, and shows the section each answer comes from. Ask follow-ups in any language.
Questions & Answers
Public questions about this lesson. The AI Tutor answers right away in your language, the FreeAcademy team checks answers, and every learner can read them.

