AI engineering glossary · SQL databases
What is RANK (RANK and DENSE_RANK)?
RANK and DENSE_RANK (also called RANK, DENSE_RANK): Window functions that number rows by an ordering, giving tied rows the same rank. RANK then skips numbers after a tie (1, 1, 3), while DENSE_RANK does not (1, 1, 2).
RANK and DENSE_RANK: an example
Scores 90, 90, 80: RANK gives 1, 1, 3 and DENSE_RANK gives 1, 1, 2.
Related terms
More SQL databases terms
- Recursive CTE
- Referential integrity
- Relational algebra
- Relational database
- Replication
- Row
- ROW_NUMBER
- Schema
Where you learn it
RANK and DENSE_RANK is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.