SELECT MAX(salary),MIN(salary),AVG(salary),SUM(salary)
from employees;
SELECT job_id,MAX(salary),MIN(salary),AVG(salary),SUM(salary)
FROM employees
GROUP BY job_id;
SELECT job_id,COUNT(*)
FROM employees
GROUP BY job_id;
SELECT MAX(salary),MIN(salary),MAX(salary)-MIN(salary) difference
FROM employees
SELECT manager_id,MIN(salary)
FROM employees
WHERE manager_id IS NOT NULL
GROUP BY manager_id
HAVING MIN(salary)>=6000;
SELECT department_name,location_id,COUNT(*),AVG(salary)
FROM employees e RIGHT JOIN departments d
ON e.department_id=d.department_id
GROUP BY department_name,location_id
ORDER BY AVG(salary) DESC;