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?

  1. A.

    SELECT Name FROM Employee WHERE Salary > (SELECT AVG(Salary) FROM Employee);

  2. B.

    SELECT Name FROM Employee WHERE Salary > (SELECT AVG(Salary) FROM Employee GROUP BY Department);

  3. C.

    SELECT Name FROM Employee WHERE Salary > (SELECT AVG(Salary) FROM Employee WHERE Department = Department);

  4. 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 free

Explore the full course: Isro

Loading lesson…