Excel to SQL · Lesson 2 of 12

Filter rows with WHERE

In Excel, you'd reach for
fxData > Filter, then ticking values in the dropdown

In Excel you click the filter arrow and untick what you don't want. In SQL you write WHERE and describe the rows you do want.

Text goes in single quotes: 'Germany'. Numbers don't need quotes. Dates in this database are text written as YYYY-MM-DD, so they sort and compare correctly.

Try itEdit the query, then Run
namecountrysignup_date
Tara AliGermany2026-01-07
Kavya SmithGermany2026-01-20
Elena GarciaGermany2026-01-28
Olivia SmithGermany2026-02-17
Ines GarciaGermany2026-03-13
Aisha MensahGermany2026-03-15
Sam CohenGermany2026-03-17
Arjun MüllerGermany2026-03-20
Wei TanakaGermany2026-04-03
Farid IyerGermany2026-04-03

Showing 10 of 29 rows. Press Run to see them all.

Combine conditions with AND (both must be true) and OR (either). Handy shortcuts:

  • WHERE signup_date BETWEEN '2026-03-01' AND '2026-03-31' for a date range
  • WHERE country IN ('India', 'Canada') for "any of these", like ticking several boxes
  • WHERE email LIKE '%@example.com' for "text contains or ends with" (% means anything)

Your turn

Find every customer from India who signed up in or after 2026-04-01. Show their name and signup_date.

This page on one card

Filter rows with WHERE: the Excel way (Data > Filter) and the SQL query, side by side
Filter rows with WHERE, on one card: the Excel way and the SQL. Download · Save to Pinterest
The practice data (7 tables)

See every column and sample rows