HR wants to see how every employee stacks up on pay. Using the employees table, return name, salary, and a salary_rank column where rank 1 is the highest salary. Order the results by rank.
employees
| column | type |
|---|---|
| id | INTEGER |
| name | TEXT |
| department | TEXT |
| salary | INTEGER |
| id | name | department | salary |
|---|---|---|---|
| 1 | Alice | Engineering | 120000 |
| 2 | Bob | Marketing | 80000 |
| 3 | Carol | Engineering | 120000 |
| 4 | Dave | HR | 65000 |
| name | salary | salary_rank |
|---|---|---|
| Alice | 120000 | 1 |
| Carol | 120000 | 1 |
| Bob | 80000 | 3 |
| Dave | 65000 | 4 |
Alice and Carol tie at rank 1. RANK() skips rank 2, so Bob lands at rank 3.