Database Management
Accenture PrimermediumDatabase Management07 Joins & Subquery

To display the names of employees who earns more than the average salary of all employees. SELECT last_name, first_name FROMemployee WHEREsalary > AVG(salary); Which change should you make to achieve the desired results?

Answer options

A
Move the function to the SELECT clause and add a GROUP BY clause and a HAVING claus
B
Use a subquery in the WHERE clause to compare the average salary valu
C
Move the function to the SELECT clause and add a GROUP BY claus

Correct answer: Use a subquery in the WHERE clause to compare the average salary valu

Explanation

A correlated subquery in WHERE is needed to compare each salary to the average.

Related Accenture Database Management questions

Practice more Accenture Database Management questions

PrimerDumps has 1400+ primer questions, 2026 mocks and coding hands-on — all free.