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?

  1. A. 2, 2, 3
  2. B. 3, 2, 3
  3. C. 3, 3, 3
  4. 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.

More Operations, Supply Chain & Business Analytics questions

Exams that ask this topic