Database Management
primer-original-v2mediumDatabase Management07 Joins & Subqueryprimer-original-v2

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

Quick AnswerThe correct answer is Use a subquery in the WHERE clause to compare the average salary valu because it directly addresses the core logic of Database Management.

This question has been retained as-is due to its unique context.

Related Database Management questions

Practice more Database Management questions

PrimerPrep has independently reviewed practice questions and coding exercises — all free.