DB2 - Find the count of departments having average salary greater than maximum salary of department 50

 Posted by Bandi on 11/30/2013 | Category: Others Interview questions | Views: 4250 | Points: 40
Answer:

SELECT COUNT (DEPARTMENT_ID) FROM
(SELECT DEPARTMENT_ID FROM EMPLOYEES GROUP BY DEPARTMENT_ID HAVING AVG (SALARY) > (SELECT MAX (SALARY) FROM EMPLOYEES
WHERE DEPARTMENT_ID=50)
)


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response