Can anyone help correct this query.
The question is Write a query that returns all departments with average salary higher than 5000
so I attempted to find the average as follows:
SELECT Avg(salary)
FROM employees
WHERE salary > 5000
this returns
9298,27586206896551724137931034482758621
I tried to write a nested query on the same table as gollows
select department
from employees
where salary in (SELECT Avg(DISTINCT salary)
FROM employees
WHERE salary > 5000);
However this is returning "No data found"
Please help
The question is Write a query that returns all departments with average salary higher than 5000
so I attempted to find the average as follows:
SELECT Avg(salary)
FROM employees
WHERE salary > 5000
this returns
9298,27586206896551724137931034482758621
I tried to write a nested query on the same table as gollows
select department
from employees
where salary in (SELECT Avg(DISTINCT salary)
FROM employees
WHERE salary > 5000);
However this is returning "No data found"
Please help