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 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) NUMBERStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started