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).

Level: intermediateTopic: SQL databases

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.