SQL
- A window function computes across related rows without collapsing them into one grouped row.
- PARTITION BY defines the group; ORDER BY defines sequence for ranking or running totals.
- ROW_NUMBER gives unique positions; RANK leaves gaps after ties; DENSE_RANK does not.
