🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Aggregate each one-to-many table separately (for example with subqueries), then combine
  2. B.Add DISTINCT inside SUM
  3. C.Replace LEFT JOIN with INNER JOIN
  4. 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 →