FastPrepDuplicate Emails
Problem · Database

Duplicate Emails

EasyWorld Wide Technology logoWorld Wide TechnologyINTERNPHONE SCREEN

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

ColumnTypeNullableDescription
contact_idPKIntegerNo
emailTextNo

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
emailTextNo

Row order: must match exactly. Numeric tolerance: 0.

Constraints

  • contacts contains at most 10^5 rows.
  • contact_id is unique and non-null.
  • email is non-null lowercase text.
  • Email equality uses the exact stored value; do not trim or otherwise normalize it.

More World Wide Technology problems