Marketing Analytics Path · Mission 21 of 25Expert

Something's off with our numbers

Find duplicate customers by email address using GROUP BY HAVING

Back to Marketing Analytics

The Brief

Jordan LeeCEOexec-requests

Something's off with our customer numbers. Finance says we have 500 customers but the dedup count looks different. Can you find any duplicate customers in `dim_customers`? Show me the `email` addresses that appear more than once, and how many times each one shows up. I need this before the investor call.

You'll practice

GROUP BY HAVINGDeduplication

Tables available

dim_customers

Hints (3)

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

Hint 1

Group `dim_customers` by `email` and count: `SELECT email, COUNT(*) AS duplicate_count FROM dim_customers GROUP BY email`

Hint 2

Use `HAVING COUNT(*) > 1` to keep only emails that appear more than once — HAVING filters after GROUP BY (WHERE can't filter aggregates)

Hint 3

Add `ORDER BY duplicate_count DESC` to see the most duplicated emails first