← SQL Operations Cases

Lesson 4 of 4

Diagnose duplicate customer keys

Find shared nonblank emails without deleting records.

Do the work

  1. Two customer IDs may share an email.
  2. Exclude NULL and empty text from this diagnostic.
  3. Report the duplicate key and its count.

See the method

Avery and Morgan share team@example.test.

Read every demonstration step
  1. Avery and Morgan share team@example.test.
  2. Group by email and filter COUNT(*) > 1.
  3. Keep the original customer records unchanged.

Practice independently

Take it further

A shared email can be legitimate; flag it for review instead of merging automatically.