← Quiz: Checking AI-Written SQL: all 10 questions
Quiz: Checking AI-Written SQL · Question 7 of 10
What is a correct fix for join fan-out?
What is a correct fix for join fan-out?
- A.Aggregate each one-to-many table separately (for example with subqueries), then combine
- B.Add DISTINCT inside SUM
- C.Replace LEFT JOIN with INNER JOIN
- D.Divide the total by 2
Answer & explanation
Correct answer: Aggregate each one-to-many table separately (for example with subqueries), then combine
SUM(DISTINCT) would also wrongly merge two genuine payments of the same amount.
Can you get the rest right without peeking?
Take the timed Quiz: Checking AI-Written SQL quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →