Management & CommerceVery hardMBA placement (Analytics)

orders(oid, amt) has (1, 100) and (2, 200); payments(oid, paid) has (1, 60), (1, 40) and (2, 200). An analyst runs SELECT SUM(o.amt) FROM orders o JOIN payments p ON o.oid = p.oid to get total order value. What does it return?

  1. A. 300
  2. B. 500
  3. C. 400
  4. D. 600

Correct answer: C. 400

Order 1 matches two payment rows, so the join repeats its ₹100 and the sum is 100 + 100 + 200 = 400, overstating the true total of 300. Aggregate payments per order first (or sum orders without the join) to avoid this fan-out.

More Operations, Supply Chain & Business Analytics questions

Exams that ask this topic