Consider a database with a table Employee having columns EmpID, Name,…
Consider a database with a table Employee having columns EmpID, Name, Department, and Salary. Which of the following queries will list the names of employees who have a salary greater than the average salary in their department?
- A.
SELECT Name FROM Employee WHERE Salary > (SELECT AVG(Salary) FROM Employee);
- B.
SELECT Name FROM Employee WHERE Salary > (SELECT AVG(Salary) FROM Employee GROUP BY Department);
- C.
SELECT Name FROM Employee WHERE Salary > (SELECT AVG(Salary) FROM Employee WHERE Department = Department);
- D.
SELECT Name FROM Employee E WHERE Salary > (SELECT AVG(Salary) FROM Employee WHERE Department = E.Department);
Attempted by 127 students.
Sign up free to check your answer
Sign up freeLoading lesson…

