CS FundamentalsVery hardWipro Elite · LTIMindtree

W(d, x) holds (1, 10), (2, 20), (2, 30), (3, 40). What value does SUM(x) OVER (ORDER BY d) give on the row (2, 20)?

  1. A. 30
  2. B. 50
  3. C. 100
  4. D. 60

Correct answer: D. 60

The default frame is RANGE UNBOUNDED PRECEDING to CURRENT ROW, which includes all peers with the same d: 10 + 20 + 30 = 60.

More DBMS and SQL questions

Exams that ask this topic