Guides/SQL AND
📘
SQL Guide

SQL AND

Require multiple filter conditions to be true.

What & Why

The AND operator is used to require every condition in a WHERE clause to be true. AND narrows a population. It is the right choice when a row must satisfy every business condition, such as active and paid and in a target region.

See how it works

Find Pro users who are activated and still active.

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

Syntax pattern

See explanation
WHERE condition_a
  AND condition_b
  • Every AND condition must evaluate true.
  • Stack one condition per line for readability.
  • AND usually reduces row count as conditions are added.
Now You Try

Practice this concept hands-on

Sign up for a free account to run SQL against real datasets right here in the browser and get instant AI feedback. No credit card required.

Sign up free