Management & CommerceHardBusiness analyst · KPO · MBA placement pattern
Table daily(day, amount) has rows (1, 120), (2, 80), (3, 100), (4, 160), (5, 140). What values does AVG(amount) OVER (ORDER BY day ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) give for day 2 and day 5?
- A. 100 and 133.33
- B. 66.67 and 133.33
- C. NULL and 133.33
- D. 100 and 120.00
Correct answer: A. 100 and 133.33
The frame for day 2 has only days 1–2 (no earlier row exists), so AVG = (120 + 80) ÷ 2 = 100 — AVG divides by the rows present, not by 3. Day 5 averages days 3–5: (100 + 160 + 140) ÷ 3 ≈ 133.33. 120 is the mean of all five days.
Practise more Operations, Supply Chain & Business Analytics questionsOperations, Supply Chain & Business Analytics: notes and key points
More Operations, Supply Chain & Business Analytics questions
- 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…
- 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…