SpinTheMic
Pro

Explain it in 60 seconds

ROW_NUMBER, RANK and DENSE_RANK

Data Analyst · SQL for Analytics · Beginner

What is the difference between ROW_NUMBER, RANK and DENSE_RANK?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • ROW_NUMBER: unique 1,2,3 even for ties.
  • RANK: ties share rank, then gaps (1,1,3).
  • DENSE_RANK: ties share, no gaps (1,1,2).
  • Use for top-N per group.
  • Deduplication with ROW_NUMBER.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics