Before a company enters budget negotiations, the HR team calculates the average salary to establish a baseline for raises and benchmarking against industry data. This single-number query is one of the most common aggregation tasks in HR analytics and compensation planning. Using the employees table, return the average salary across all employees as avg_salary.
employees
| column | type |
|---|---|
| id | INTEGER |
| name | TEXT |
| department | TEXT |
| salary | INTEGER |
| id | name | department | salary |
|---|---|---|---|
| 1 | Alice | Engineering | 90000 |
| 2 | Bob | Marketing | 70000 |
| 3 | Carol | HR | 60000 |
| 4 | Dave | Engineering | 110000 |
| avg_salary |
|---|
| 82500 |
(90000 + 70000 + 60000 + 110000) / 4 = 82500