# Remove Duplicate Emails

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/3083/remove-duplicate-emails
Source observed: 2026-11-04T21:34:37.342Z
Last checked: 2026-11-04T21:34:37.342+00:00
Indexed: 2026-11-05T01:51:07.867+00:00

---

# Remove Duplicate Emails

We provide interview-preparation questions for technical and data roles. This medium-difficulty SQL question asks you to clean duplicate records from a `users` table.

## Question

A `users` table contains duplicate email addresses. Treat emails as duplicates when they match after removing leading and trailing whitespace and ignoring letter case. For example, `john@example.com` and `JOHN@EXAMPLE.COM` are duplicates.

The table schema is:

```sql
CREATE TABLE users (
    id INTEGER PRIMARY KEY,
    email TEXT NOT NULL
);
```

Write a SQL query that:

- Treats email addresses as duplicates after accounting for case and whitespace.
- Keeps exactly one record for each normalized email address: the record with the smallest `id`.
- Returns the cleaned records ordered by `id`.

### Example output

| id | email |
|---:|---|
| 1 | user@example.com |
| 4 | john.doe@example.com |
| 8 | jane.smith@example.com |

The page includes an editor with SQLite selected, plus Output, Test Results, and Console panels. Running code requires signing up: [Sign up to run code](https://www.aced.io/signup?src=lesson). The detailed solution is locked behind the Solution tab; the page records no community-contributed answers.

## Question metadata

- Difficulty: Medium
- Classification: Coding and SQL
- Associated roles: [Data Engineer](https://www.aced.io/questions?role=data-engineer), [Data Scientist](https://www.aced.io/questions?role=data-science), [Backend Engineer](https://www.aced.io/questions?role=backend-engineer), and [Data Analyst](https://www.aced.io/questions?role=data-analyst)
- Associated companies: [IBM](https://www.aced.io/questions?company=ibm) and [Google](https://www.aced.io/questions?company=google)
- Page collection: [All Questions](https://www.aced.io/questions)
- Detailed company statistics: [Upgrade](https://www.aced.io/upgrade?src=questions)

## Interview experience

One shared experience concerns a Google Data Analyst, Mid Level / L4 interview, recorded as three years ago. The contributor described a resume screen, recruiter call, behavioral hiring assessment, an initial technical SQL round, later Googleyness and role-related rounds, and a final round with the director. [Read the Google Data Analyst interview experience](https://www.aced.io/experiences/google-data-analyst-interview-e50be1).

## Related questions

- [Remove duplicates in an array of objects.](https://www.aced.io/questions/5441/remove-duplicates-array-objects)
- [How would you remove duplicates in a string?](https://www.aced.io/questions/3814/remove-duplicates-in-string)

## Related courses

### [Data Analyst Interview Prep](https://www.aced.io/courses/data-analytics)

![Data Analyst Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/72OTqij57b2TklhaD2vrdV/be0dae6242904970d1696e5a4d858e18/AdobeStock_1357126576.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for data analyst interviews across product, marketing, and business analyst roles through take-home case studies, technical and dashboarding practice, and strategies from interviewers at technology companies and startups.

### [Data Science Interview Prep](https://www.aced.io/courses/data-science)

![Data Science Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/3U4C5C0OkDR0UeGch4AmlE/7ad489430b676a088cb973307fe77884/Data_Science_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for data science roles at Google, Amazon, Microsoft, Meta, Apple, and other companies with mock interviews, frameworks, and advice from senior candidates. Practice areas include statistics, experimentation, coding, SQL, machine learning, behavioral interviews, and more.

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3083%2Fremove-duplicate-emails&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3083%2Fremove-duplicate-emails). Opening a form does not execute a tool.