← Sales & Refund Reconciliation
Lesson 2 of 4
Resolve refund identity
Separate harmless retries from conflicting refund records.
Do the work
- refund_id is the business key; order_id alone is not, because partial refunds can share a sale.
- An exact repeat counts once. A conflicting field quarantines the entire key.
- Inspect all records for a key before selecting the reporting period.
See the method
Three identical copies of a receipt represent one refund.
Read every demonstration step
- Three identical copies of a receipt represent one refund.
- Two amounts under the same receipt ID are a conflict.
- DISTINCT over every column leaves both conflicting variants, so it is insufficient by itself.
Practice independently
Exercise 1
Find conflicting refund keys
Open practice →Exercise 2Produce canonical refund records
Open practice →Take it further
Add a conflict outside the reporting month and verify that its key is still quarantined.