A duplicate join key doubles the reported total
A fictional analyst joins transaction rows to a customer-classification table. The supplied classification data contains two records for one customer key, even though the analyst intended one current classification per customer. After the join, that customer’s transactions appear twice, and a revenue aggregation rises without any new sale. A colleague proposes accepting the higher result because the query ran without a syntax error. Another constructs a tiny example and checks the expected relationship and row counts. This written case accesses no real records and changes no dataframe. It asks why valid syntax can produce an invalid business total and what key/relationship evidence is needed before choosing a justified correction.
1. What caused the extra counted revenue?
Read the worked answer
The duplicate matching classification key produced multiple joined rows for the same transaction. A successful join operation did not enforce the intended one-classification relationship.
2. What should the analyst verify?
Read the worked answer
Check intended key uniqueness, valid current-record rules, unmatched rows and expected aggregation grain. Correct the actual relationship with justified evidence rather than blindly dropping arbitrary duplicates.