FREE LESSON PREVIEW
Define rows, keys and rules
Before cleaning, state what one row represents. An order table might include order_id, customer_id, time and amount. Customer ID is not an order key because one customer can place many orders. A schema declares field types, required values and allowed categories.
Keep raw data unchanged and log every rule. A negative amount might be a valid refund, while a negative age often signals an error. Validity depends on meaning. Identical-looking purchases can be legitimate repeated events; remove duplicates only against a documented key and source rule.
Try it yourself
A customer places three orders. Which ID should uniquely identify each row?
Worked answer
Order ID. Using customer ID alone would incorrectly collapse separate purchases.
