Question: SQL SQL management 2009-2014 The following query for a small business database is supposed to select the names and salaries of all marketing staff who
SQL
SQL management 2009-2014
The following query for a small business database is supposed to select the names and salaries of all marketing staff who earn more than the average salary.
However, is not working and retrieves 0 rows.
What is wrong with the query and how would you fix it?
SELECT name, salary FROM staff GROUP BY name, salary, department HAVING salary > AVG(salary) AND department = 'Marketing'
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
