Brightlane's marketing team is launching a domestic renewal campaign and needs the current active US customer base as the audience list.
Write a query to return the name and email of every active customer registered in the United States.
Assumptions:
- The
customerstable contains every customer Brightlane has on file. - US customers are identified by
country = 'US'. - Active customers are identified by
is_active = true; deactivated customers haveis_active = false.
Output:
- One row per active US customer, with columns
nameandemail.
Schema · ecommerce 5 tables
Run previews · Check grades
Write a query, then run it to see results here.
Worked solution Try it yourself first
SELECT
name,
email
FROM
customers
WHERE
country = 'US'
AND is_active = TRUE The shape
Two equality checks joined by AND — each row reaches the result only when both the country and the active flag match what the renewal campaign needs.
Clause by clause
SELECT name, emailnames the two columns the audience list needs. Thecustomerstable has plenty of other columns; only these two come back.FROM customersreads the customer table. There's no join here — every column referenced in the filter and the output lives on this one table.WHERE country = 'US' AND is_active = trueis the compound condition.country = 'US'keeps US rows;is_active = truekeeps active rows. TheANDrequires both to be true on the same row, so a US customer who is inactive is dropped, and a UK customer who is active is also dropped. Only rows that satisfy both conditions reachSELECT.
Why AND and not two separate conditions
There's no way to write "both of these must hold" without AND. Listing the two comparisons separated by a comma, or stacking two WHERE clauses, is a syntax error. AND is the operator that joins two booleans into a single boolean, and WHERE accepts exactly one boolean expression.
You practiced combining two conditions with AND so a row passes only when both are true. AND is the everyday shape of a multi-criteria filter — the recurring choice when an audience must satisfy every requirement at once.