← SQL Operations Cases

Independent practice · SQLite

Find shared customer emails

My saved work →

Your work

Active 0:00 · Paused 0s

Show the reference answer
SELECT email,COUNT(*) AS customer_count FROM customers WHERE email IS NOT NULL AND email<>'' GROUP BY email HAVING COUNT(*)>1

The shared email has two customer IDs. Missing emails are not duplicate keys.