🛡️Data Uniqueness
Also known as Uniqueness (Data Quality), Duplicate Records
Whether each thing is in the data just once.
Think of it like
Each child in class has one name tag. If two tags say Emma, someone gets counted twice.
Example
A retried load adds the same 500 orders a second time. A uniqueness check on order_id catches it before the report runs.
Why it matters
Copies make every count and total too big. Sales look higher than they were.
Definition
Example code
sql
SELECT order_id, COUNT(*) AS copies
FROM orders
GROUP BY order_id
HAVING COUNT(*) > 1;Common mistake
Key takeaways
- 1Once per thing. One row for each real item.
- 2Check the key. Group by the business key.
- 3Easy to test. One query finds every copy.