Multiple choice technology databases

I want my row numbers to come up as 1,2,2,2,3 while using a ranking function. Which ranking function should I use?

  1. ROW_NUMBER()

  2. RANK()

  3. DENSE_RANK()

  4. NTILE(integer_expression)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

DENSE_RANK() assigns consecutive ranks (1,2,2,2,3) without gaps after tied values, making it ideal for the requested pattern. ROW_NUMBER() always produces unique sequential numbers (1,2,3,4,5), while RANK() leaves gaps after ties (1,2,2,2,5). NTILE() divides rows into specified number of groups, producing a different pattern entirely.