Problem · Database
Duplicate Emails
Problem statement
You are given a table named contacts. Each row contains a unique contact_id and a non-null lowercase email.
Return every email that appears in more than one row. Include each duplicated email exactly once and sort the result by email in ascending order.
Table schema
MySQLPostgreSQL
Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.
contacts
| Column | Type | Nullable | Description |
|---|---|---|---|
| contact_idPK | Integer | No | — |
| Text | No | — |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| Text | No | — |
Row order: must match exactly. Numeric tolerance: 0.
Constraints
contactscontains at most10^5rows.contact_idis unique and non-null.emailis non-null lowercase text.- Email equality uses the exact stored value; do not trim or otherwise normalize it.