Marketing Analytics Path · Mission 20 of 25Hard

Customers who never opened an email

Use NOT IN with a subquery to find exclusions

Back to Marketing Analytics

The Brief

Priya PatelAnalytics Leadmarketing-analytics

How many customers received emails but never opened a single one? These are our 'unreachable' segment. I need a count of distinct customers who have sends where opened = 0 but never appear in any send where opened = 1.

You'll practice

NOT INSubqueries

Tables available

fact_sends

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

First find who DID open: `SELECT DISTINCT customer_id FROM fact_sends WHERE opened = 1`

Hint 2

Then find customers with sends who are NOT in that list: `WHERE customer_id NOT IN (...)` and filter to `opened = 0`

Hint 3

Count distinct customers: `SELECT COUNT(DISTINCT customer_id) AS never_opened` — a customer may have multiple unopened sends