What catches a plausible query that joins or aggregates the wrong rows?
Check the result against independently calculated rows and totals. A syntactically valid query can silently multiply or discard business events.
Work through the decision
One order split into two shipments is counted twice. A second order with no shipment disappears with an inner join.
| Step | Evidence to keep |
|---|---|
| Construct counterexamples | Use one split order and one unshipped order. |
| Compute the oracle | Write down revenue per order before running the query. |
| Inspect row multiplicity | Compare per-order results before comparing the total. |
What changes the decision
Keep the seed, expected rows and query together. Aggregate equality on a larger sample can conceal overcounts and undercounts that cancel.