SELECT SUM(salary) FROM employees;
SELECT SUM(salary) FROM employees WHERE department_id = 5;
SELECT department_id, SUM(salary) FROM employees GROUP BY department_id;
SELECT e.department_id, department_name, SUM(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, SUM(salary) FROM employees e INNER JOIN departments d ON d.department_id = e.department_id GROUP BY e.department_id ORDER BY SUM(salary) DESC;
SELECT e.department_id, department_name, SUM(salary) FROM employees e INNER JOIN departments d ON d.department_id = e.department_id GROUP BY e.department_id HAVING SUM(salary) > 30000 ORDER BY SUM(salary) DESC;