Management & CommerceModerateBusiness analyst · KPO · MBA placement pattern
Table emp_sales(rep, region, amount) has 8 rows: (Asha, North, 500), (Ravi, North, 700), (Meena, North, 700), (Kiran, North, 300), (Dev, South, 400), (Sara, South, 900), (John, South, 400), (Neha, South, 200). A query computes, within each region ordered by amount descending, RANK(), DENSE_RANK() and ROW_NUMBER(). What values does Asha get, in that order?
- A. 2, 2, 3
- B. 3, 2, 3
- C. 3, 3, 3
- D. 3, 2, 2
Correct answer: B. 3, 2, 3
North sorted: Ravi 700, Meena 700, Asha 500, Kiran 300. RANK gives the tie 1, 1 and then skips to 3 for Asha. DENSE_RANK does not skip, so Asha is 2. ROW_NUMBER numbers rows 1, 2, 3, 4 regardless of ties, so Asha is 3.
Practise more Operations, Supply Chain & Business Analytics questionsOperations, Supply Chain & Business Analytics: notes and key points
More Operations, Supply Chain & Business Analytics questions
- Table empsales(rep, region, amount) has 8 rows: (Asha, North, 500), (Ravi, North, 700), (Meena, North, 700), (Kiran, North, 300), (Dev…
- 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…
- 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…