Management & CommerceModerateNMAT · SNAP

A table orders(id, cust, amt) has rows (1, A, 200), (2, B, 300), (3, A, 350), (4, C, 600), (5, B, 150), (6, A, 100). The query SELECT cust, SUM(amt) FROM orders GROUP BY cust HAVING SUM(amt) > 500 returns how many rows?

  1. A. 2
  2. B. 1
  3. C. 3
  4. D. 4

Correct answer: A. 2

Totals are A = 650, B = 450 and C = 600. HAVING filters groups, so A and C remain: 2 rows.

More Operations, Supply Chain & Business Analytics questions

Exams that ask this topic