Averaging averages and COUNT(DISTINCT) after a join: why SQL results mislead and how to guard against it
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks why averaging group averages and using COUNT(DISTINCT) after a join can give misleading SQL results, and how to prevent both. Tests understanding of group weighting, join fan-out, query grain, and the checks that catch silent aggregation bugs.