# DENSE_RANK

A window function assigning equal rank to peers without leaving gaps after ties.

## What is **DENSE_RANK** in a relational database?

**DENSE_RANK** — A window function assigning equal rank to peers without leaving gaps after ties.

```sql
SELECT student_id,
       DENSE_RANK() OVER (ORDER BY score DESC) AS score_rank
FROM exam_result;
```

Level: Journeyman · [More Database terms at this level](https://www.ask-codey.com/glossary/subjects/database/journeyman)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/dense-rank
