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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!