Skip to content
RED SAGSkills
medium10 pts · first answer countssqlwindow-functions

RANK and DENSE_RANK with ties

Scores are a=90, b=85, c=90, d=80, e=85. What are RANK() and DENSE_RANK() for d when ordered by score descending?

SELECT name,
  RANK() OVER (ORDER BY score DESC) AS r,
  DENSE_RANK() OVER (ORDER BY score DESC) AS dr
FROM scores;
Choose one answer