Skip to main content
Admissions guidance, study banks, and career tools โ€” get started on Shalyam

Delete Duplicate Emails

Write a DELETE statement that removes duplicate emails from the Person table, keeping only the row with the smallest id for each email.

Table schema

Person(id INT PRIMARY KEY, email VARCHAR(100))

Sample data

id | email
1 | a@x.com
2 | b@x.com
3 | a@x.com

Discussion

No discussions yet.

Rewards ยท v2.1

Join Shalyam Newsletter

Get exclusive insights with every issue: education, research and innovation news.

One email a week. Unsubscribe any time.