Problem
Compensation analysis requires grouping employees into four salary bands. Using the employees table, return name, salary, and a quartile column (1 = lowest, 4 = highest), ordered by salary ascending.
Schema
employees
| column | type |
|---|
| id | INTEGER |
| name | TEXT |
| department | TEXT |
| salary | INTEGER |
Sample Data
| id | name | department | salary |
|---|
| 1 | Alice | Engineering | 120000 |
| 2 | Bob | Marketing | 60000 |
| 3 | Carol | Engineering | 100000 |
| 4 | Dave | HR | 50000 |
| 5 | Eve | Engineering | 140000 |
| 6 | Frank | Marketing | 80000 |
| 7 | Grace | HR | 70000 |
| 8 | Heidi | Engineering | 160000 |
Expected Output
| name | salary | quartile |
|---|
| Dave | 50000 | 1 |
| Bob | 60000 | 1 |
| Grace | 70000 | 2 |
| Frank | 80000 | 2 |
| Carol | 100000 | 3 |
| Alice | 120000 | 3 |
| Eve | 140000 | 4 |
| Heidi | 160000 | 4 |