Sitemap
CodeToDeploy

Tech Insights | Careers | Jobs

196. Delete Duplicate Emails Leetcode Sql Problem

Mastering Duplicate Removal in SQL Using Self-Join Logic

3 min readNov 19, 2025

--

Press enter or click to view image in full size

Looking For Remote Tech Roles?
Here’s the shortcut: No recruiters. No waiting.
Just verified $50–$120/hr jobs in:

  • Frontend / Backend / Full Stack
  • Mobile (iOS/Android)
  • AI / ML
  • DevOps & Cloud

If you want to work from anywhere, start here:
👉 Apply Here

SCHEMA

Table: Person

+-------------+---------+
| Column Name | Type |
+-------------+---------+
| id | int |
| email | varchar |
+-------------+---------+
id is the primary key (column with unique values) for this table.
Each row of this table contains an email. The emails will not contain uppercase letters.

DESCRIPTION

Write a solution to delete all duplicate emails, keeping only one unique email with the smallest id.

For SQL users, please note that you are supposed to write a DELETE statement and not a SELECT one.

For Pandas users, please note that you are supposed to modify Person in place.

--

--