Question

A table Orders(order_id, customer_id, order_date, amount) needs a query that returns each order alongside a running cumulative total of that customer's order amounts, ordered by order_date. Which SQL construct is specifically designed for this kind of calculation?

A A window function such as SUM(amount) OVER (PARTITION BY customer_id ORDER BY order_date)
B A GROUP BY clause combined with the SUM aggregate function applied across the entire table
C A HAVING clause filtering groups where the summed amount exceeds a fixed threshold value
D A correlated subquery placed inside the SELECT list without any partitioning specified at all
E A UNION ALL combining separate per-customer queries executed independently against the same base table
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)