Guides/SQL WHERE
📘
SQL Guide

SQL WHERE

Filter rows before they reach your result set.

What & Why

The WHERE clause is used to filter rows based on a condition. WHERE translates a business rule into row-level criteria. It is how analysts narrow a table to active users, paid campaigns, high-value accounts, or a specific date range.

See how it works

A growth team wants only active Pro users, not every signup.

SELECT
  id,
  country,
  channel
FROM growth.users
WHERE plan = 'pro'
  AND churned_at IS NULL;

Syntax pattern

See explanation
SELECT column_1, column_2
FROM schema.table_name
WHERE condition;
  • WHERE runs before GROUP BY and aggregation.
  • Text values need single quotes in SQL.
  • Combine multiple filters with AND or OR.
Now You Try

Practice this concept hands-on

Run SQL against real datasets right here in the browser and get instant AI feedback. Join the waitlist to get access.

Join the waitlist