Aggregating Data with GROUP BY:

SELECT department_id, AVG(salary) AS avg_salary
FROM employees
GROUP BY department_id;

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *