Management & CommerceHardBusiness analyst · SQL test

Table r(region, rev) has N 200, S 300, E 500. What does ROUND(100.0 * rev / SUM(rev) OVER (), 1) return for region S?

  1. A. 30.0
  2. B. 100.0
  3. C. 60.0
  4. D. 33.3

Correct answer: A. 30.0

SUM(rev) OVER () with an empty window is the grand total over all rows (1,000), repeated on every row, so S's share is 300/1,000 = 30%. Unlike GROUP BY, the window keeps every row. 33.3 would be a simple one-in-three share.

More Operations, Supply Chain & Business Analytics questions

Exams that ask this topic