Last updated

SQL WHERE

Definition: The WHERE clause filters rows — only the rows that match its condition are returned.

Example 1 — a text condition

Text values go inside single quotes:

SELECT * FROM Customers
WHERE Country = 'Germany';

Example 2 — a number condition

Numbers are written without quotes:

SELECT * FROM Customers
WHERE Age > 40;

The comparison operators

=equal<>not equal
>greater<less
>=greater or equal<=less or equal

Example 3 — using an operator

SELECT CustomerName, Age FROM Customers
WHERE Age <= 30;

💡 Remember: text in single quotes ('Germany'), numbers without quotes (40).

Try it Yourself
Output

          
Ad · responsive