Management & CommerceVery hardBusiness analyst · KPO · MBA placement pattern
Table orders(dt, amount) has rows (1 Jan, 100), (2 Jan, 50), (2 Jan, 70), (3 Jan, 30). A query adds SUM(amount) OVER (ORDER BY dt) with no frame clause. What running-total value appears on the row (2 Jan, 50)?
- A. 150
- B. 170
- C. 220
- D. 250
Correct answer: C. 220
With ORDER BY and no frame, the default frame is RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, which includes all peer rows with the same dt. Both 2 Jan rows therefore show 100 + 50 + 70 = 220. 150 (or 170) is what a ROWS frame would give, depending on the row order; 250 is the grand total.
Practise more Operations, Supply Chain & Business Analytics questionsOperations, Supply Chain & Business Analytics: notes and key points
More Operations, Supply Chain & Business Analytics questions
- Table monthly(m, mon, rev) holds Jan 200, Feb 240, Mar 210, Apr 260 (m = 1–4). A query computes ROUND(100.0 (rev − LAG(rev) OVER (ORDER BY…
- An e-commerce funnel for one month: 50,000 visits → 12,000 product views → 3,600 add-to-carts → 1,080 checkouts → 756 purchases. What is…
- Funnel: 50,000 visits → 12,000 product views (24%) → 3,600 add-to-carts (30%) → 1,080 checkouts (30%) → 756 purchases (70%). Three…
- Signup cohorts and active users — Jan: 1,000 signups; month 1: 600, month 2: 450, month 3: 400. Feb: 1,500 signups; month 1: 840, month 2…
- Signup cohorts and active users — Jan: 1,000 signups; month 1: 600, month 2: 450, month 3: 400. Feb: 1,500 signups; month 1: 840, month 2…
- A retail chain finds that stores running its new loyalty programme have 18% higher sales than stores without it. The programme was…