🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: SQL Interview Queries: all 10 questions

Quiz: SQL Interview Queries · Question 7 of 10

To delete duplicate emails but keep the first sign-up of each, which rows are kept?

To delete duplicate emails but keep the first sign-up of each, which rows are kept?

  1. A.The rows with MAX(id) per email
  2. B.All rows
  3. C.The rows with MIN(id) per email
  4. D.Only emails that appear once
Answer & explanation

Correct answer: The rows with MIN(id) per email

DELETE ... WHERE id NOT IN (SELECT MIN(id) FROM signups GROUP BY email) keeps the lowest id.

Can you get the rest right without peeking?

Take the timed Quiz: SQL Interview Queries quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →