Skip to content
RED SAGSkills

Duplicate Signup Emails

Some users signed up more than once with the same email, sometimes typed in different letter case (Ana@Mail.com and ana@mail.com are the same address).

Find every email used by more than one account, comparing emails case-insensitively. Report the email in lowercase.

Return columns email, account_count. Order by account_count descending, then email ascending.

Schema

CREATE TABLE users (
  user_id INTEGER PRIMARY KEY,
  email TEXT NOT NULL,
  created_at TEXT NOT NULL
);

Sample data

users

user_idemailcreated_at
1ana@mail.com2026-01-01
2bilal@corp.io2026-01-02
3Ana@Mail.com2026-01-05
4chloe@web.net2026-01-06
5BILAL@corp.io2026-01-07
6bilal@corp.io2026-01-09
7dev@site.org2026-01-10
Hint 1

Group by LOWER(email) so differently-cased copies fall into the same group.

Hint 2

HAVING filters groups after aggregation; WHERE cannot see COUNT(*).

Good practice for: Data Analyst, Data Engineer, Backend Developer, Database Administrator

SQL (SQLite)

Run checks your query on the sample data (Ctrl + '). Submit also checks hidden databases.