Duplicate or not?

Ten pairs of contact records that may or may not be the same person. Sort them, match six purposes to the right key column, then answer seven questions about choosing a key and merging records safely.

Exercise20 minBachelor +2CC BY 4.0
3 tasks · 20 min

What you will learn

  • Decide when two records describe the same person
  • Choose a key column for removing duplicates
  • Know when a person has to decide instead of a tool
  • Merge two records without losing information or an opt-out

Before a list can be cleaned, someone has to decide what counts as "the same". A computer compares values; it does not know that "Fabrikam Inc." and "Fabrikam Inc" are one company, or that two people can share a name. This exercise trains that decision. It takes about 20 minutes. All names and addresses are made up.

Three questions to ask

  1. What is one row supposed to be? One person, one company, one order? The answer decides the key column.

  2. Do the key values really differ, or only in noise? Capitals, spaces at the start and end, and punctuation are usually noise.

  3. If they really differ, is there a safe way to tell? If not, a person checks before anything is merged.

The key column is the column, or set of columns, that identifies a record. Two rows with the same key, after the noise is removed, are duplicates.

Extension for fast finishers

Write a short rule for a school office that keeps a list of parents' contact details. In three sentences, say what one row stands for, which column is the key, and what happens when two rows look alike but the key differs.

Model answer for the extension

"One row stands for one parent or guardian. The key is the email address, compared without capitals and spaces. If two rows have the same name but different addresses, the office calls or writes to the parent before anything is merged, and an opt-out in either row is kept."

Teacher notes

How to run it (20 minutes). 5 minutes: read "Three questions to ask" together and show two rows from a real-looking list on the board. 10 minutes: learners do the three tasks alone. 5 minutes: discuss the "not sure" cases, especially Farid Haddad and the info@ address.

Typical mistakes.

  • Putting the two Luis Kleins under "same person" because the names match.

  • Putting info@fabrikam.example and Julia Klein together because they share a company. A shared inbox is not a person.

  • Thinking that merging means deleting one row. Good merging keeps the best information from both, and always keeps an opt-out.

About capitals in email addresses. Strictly, the part before the @ may be case-sensitive under the email standard, but almost every mail provider treats it as case-insensitive. Treating ANNA@ and anna@ as the same is the safe practical choice.

Follow-up questions.

  • Who should decide the key column in a company: IT, sales or both?

  • What could go wrong if a hospital merged two patients with the same name and birthday?

  • Why do many systems give every record its own ID number?

Differentiation.

  • Easier: do the sort task together on the board, then let learners do the match and the quiz.

  • Harder: learners try the same decisions on a real file in the contact list worksheet with the free CSV Deduplicator.

Use it with a class
  1. 1. Copy the class link and share it with your class.
  2. 2. Learners finish the exercise and get a result code.
  3. 3. Paste the codes into Class results to see everyone at once.
Change the tasks in the builder

Reuse this material

CC BY 4.0

You may copy, adapt and share it, also commercially, as long as you credit ManyPI and link back.

"Duplicate or not?" by ManyPI (https://manypi.com/edu/duplicate-or-not), licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)