Synopsis: Pseudo Key Neat-Freak

Let’s get introduced to the issues that arise because of having gaps in the data.

Imagine the following scenario. Your manager approaches you, holding two report printouts. “The bean counters are saying we have discrepancies between this quarter’s report and the last quarter’s report. I’m looking at them, and they’re absolutely right. Most of the later assets have disappeared. What happened?”

You look at the reports, and the pattern of discrepancies rings a bell. “No, everything is still there. You asked me to clean up the rows in the database, so there are no missing rows. You said the accountants kept asking you questions about missing assets because of gaps in the numbering. So, I renumbered some of the rows to make them all fit into the places where there were missing rows before. There aren’t any missing rows now — every number between 1 and about 12,340 is used. They’re all still there, but some have just changed the number and moved up. You told me to do this.”

Your manager shakes their head. “But that’s not what I want. The accountants have to track depreciation by the asset numbers. The number for each piece of equipment has to stay the same in each quarterly report. Besides, all the asset ID numbers are printed on labels on each piece. It’d take weeks to relabel everything in the company. Can you please change all the ID numbers back to their original values?”

You want to be cooperative, so you turn back to your keyboard to start working, but suddenly you think of a new problem. “What about new assets we bought this month after I consolidated the asset IDs? The new assets have been assigned ID values that were in use before I did the renumbering. If I change the asset IDs back to their old values, what should I do about the duplicates?”

Objective: Tidy up the data

There’s a certain type of person who is unnerved by a gap in a series.

Get hands-on with 1400+ tech skills courses.