Blog · Guide

How SQL WHERE Works (Filter Rows)

WHERE keeps only the rows that match a condition — city, age, status, and more. With a clear before/after picture.

all rows WHERE kept rows
WHERE keeps only the rows that match your condition.

Filter after you choose the table

SELECT first_name, city
FROM customers
WHERE city = 'Austin';

Only rows where city equals Austin survive. Everyone else is dropped from the result — the table itself isn’t modified.

Comparisons you’ll use constantly

Text matches are usually quoted: 'Austin'. Numbers are not: age >= 30.

Try it yourself

The fastest way to lock this in is a short drill on the same Northstar Market tables.

Practice WHERE filters

Related guides