How can we rank employees contiguously without skipping numbers after ties?
DENSE_RANK() assigns identical ranks to ties and continues sequentially without gaps (e.g. 1, 2, 2, 3).
Salary grade bands, top 3 unique compensation levels, leaderboard tiers.
SELECT
name,
salary,
DENSE_RANK() OVER (ORDER BY salary DESC) AS salary_rank
FROM employees;Practice typing production-grade SQL code for DENSE_RANK.