
You are asked to explain how to handle duplicate records created by a many-to-many join in SQL. Focus on why row multiplication happens, how it affects aggregates, and how you would structure a safer query for reporting datasets used in JPMorganChase dashboard surfaces.
Understanding of join cardinalityAbility to prevent double counting in aggregatesUse of CTEs or pre-aggregation to control grainJudgment on when `DISTINCT` is and is not appropriateA strong answer should go beyond definitions. You should describe the target grain, show how to reduce tables before joining, and explain how you would validate that the final output no longer overstates counts or sums.