Why Did My Totals Double?
Talk it through out loud with your AI coach.
The problem
- medium
- Pro
A report joins orders to both their line items and their payments, then sums the order totals, and the revenue comes out far too high. Explain why joining to two one-to-many tables multiplies rows, and how you'd fix the report.
What a strong answer covers
- How a one-to-many join repeats the parent row.
- What happens when two such joins are combined in one query.
- A restructuring that keeps totals correct.
- A habit that catches this problem before a report ships.
Common mistake: Hiding the problem with distinct, which can also drop genuine duplicate amounts and still leaves the query fragile.
Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.
Practise it out loud