Skip to content
Justice Tech School

WHERE

WHERE keeps only the rows that match a condition. Comparison operators are =, <> (or !=), <, >, <= and >=. Text values go in single quotes.

Example
SELECT name, score
FROM students
WHERE country = 'Nigeria';

Result

name   | score
Ada    | 92
Amina  | 85
Tunde  | 71
Zainab | 88
Example
SELECT name, score
FROM students
WHERE score >= 85;

Result

name   | score
Ada    | 92
Amina  | 85
Zainab | 88

Exercise

Keep only rows with a score above 80.

SELECT * FROM students  score > 80;

Quiz Test

Which operator means "not equal"?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.