Calculate Salary Aggregates for Employees Table

Find the maximum, minimum, average, and total salary for each department.

sql

SELECT department_id, MAX(salary), MIN(salary), AVG(salary), SUM(salary) FROM employees GROUP BY department_id;

This query calculates the maximum, minimum, average, and total salary for each department by grouping the "employees" table by the "department_id" column.

PromptDB can make mistakes. Please double-check responses.