SELECT AVG(DISTINCT salary) FROM employees;
SELECT ROUND(AVG(DISTINCT salary), 2) FROM employees;
SELECT AVG(DISTINCT salary) FROM employees WHERE department_id = 5;
SELECT AVG(salary) FROM employees WHERE job_id = 6;
SELECT department_id, AVG(salary) FROM employees GROUP BY department_id;
SELECT e.department_id, department_name, AVG(salary) FROM employees e INNER JOIN departments d ON d.department_id = e.department_id GROUP BY e.department_id;
SELECT e.department_id, department_name, AVG(salary) FROM employees e INNER JOIN departments d ON d.department_id = e.department_id GROUP BY e.department_id ORDER BY AVG(salary) DESC;
SELECT AVG(employee_sal_avg) FROM ( SELECT AVG(salary) employee_sal_avg FROM employees GROUP BY department_id ) t;