Show names for all employees with a salary greater than average
select name from employee where salary > ( select avg ( salary ) from employee )
Great, could you tell me the average salary?
select avg ( salary ) from employee
Could you show me a list of employees with a salary less than the average?
select name from employee where salary < ( select avg ( salary ) from employee )
how many employees earn above the average salary?
select count ( * ) from employee where salary > ( select avg ( salary ) from employee )
how many earn below the average?
select count ( * ) from employee where salary < ( select avg ( salary ) from employee )