SQLRepPath
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
00/60 solved

The Basics · WHERE · AND

2. Active Canadian customers

Concept: WHERE · ANDshow

WHERE keeps only the rows where a condition is true. Combine conditions with AND (both must hold) or OR (either can). Text values go in single quotes: 'Canada'.

Example (different data):

SELECT title
FROM products
WHERE category = 'books' AND in_stock = 1;

Your task

Marketing is launching a Canada-only promo and needs a clean contact list. Churned customers must not be emailed.

Return the name and email of every active customer in Canada, sorted alphabetically by name.

Solution unlocks after 3 more tries

Starting Postgres in your browser…

query.sql
Output

Write a query and press Run Query (Ctrl/⌘ + Enter).