Duplicate Emails

EasySQLSQL

Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.

Practice this as a mock interviewFree to start, no account needed

Problem

A sign-up bug let some people register more than once. Table users: id INTEGER primary key email TEXT never NULL Return every email that appears on more than one row, with the number of rows it appears on. Columns, in this order: email, how many times it appears. Order by email, ascending.

Examples

Input: users id | email 1 | ana@example.com 2 | ben@example.com 3 | ana@example.com
Output: ana@example.com | 2

Constraints

  • Emails are compared exactly as stored.
  • If no email repeats, return no rows.

What the interviewer grades

A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.

More SQL problems