An HR team wants a quick snapshot of salary spread within each department to spot underpaid or overpaid outliers. Using the employees table, return the minimum and maximum salary for each department as min_salary and max_salary, sorted alphabetically by department.
employees
| column | type |
|---|---|
| id | INTEGER |
| name | TEXT |
| department | TEXT |
| salary | NUMERIC |
| id | name | department | salary |
|---|---|---|---|
| 1 | Alice | Engineering | 95000 |
| 2 | Bob | Engineering | 80000 |
| 3 | Carol | Marketing | 70000 |
| 4 | Dave | Marketing | 65000 |
| 5 | Eve | HR | 60000 |
| department | min_salary | max_salary |
|---|---|---|
| Engineering | 80000 | 95000 |
| HR | 60000 | 60000 |
| Marketing | 65000 | 70000 |
Engineering has salaries 80000 and 95000, so min is 80000 and max is 95000. HR has one employee, so min and max are both 60000. Marketing has 65000 and 70000.