sql for average salary of department code example
Example 1: find below average salary in sql
SELECT first_name, salary FROM employees
WHERE salary <= (SELECT AVG(salary) FROM employees);
Example 2: above average salary in sql
SELECT FIRST_NAME FROM EMPLOYEES
WHERE SALARY > (SELECT AVG(SALARY) FROM EMPLOYEES);