Question: With the schemas given above, please provide SQL code to answer the following questions. Q1: List the name of the employee whose salary is above

 With the schemas given above, please provide SQL code to answer

With the schemas given above, please provide SQL code to answer the following questions.

Q1: List the name of the employee whose salary is above his departments average salary, which is higher than the maximum salary of another department.

Q2: List the name of the employee and his department name where the employees salary is below the average pay of his department that have more than five workers.

Q3: List the name of the employee and his department name where the employee receives the second highest pay of the department whose average salary is higher than the average salary of another department.

EMPLOYEES Name EMP ID FIRST NAME LAST NAME JOB MGR HIRE DATE SALARY COMM PCT DEPT ID Null? Typ NOT NULL NUMBER(4) VARCHAR2(10) VARCHAR2(10) VARCHAR2(9 NUMBER(4) DATE NOT NULL INUMBER NUMBER(7,2 NUMBER(2) DEPARTMENTS Name DEPT ID DEPT NAME DEPT LOC ID Null? Type 11? NUMBER(2) VARCHAR2(20) NUMBER

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!