Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved 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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

5. Do you have any foreign language proficiency?

Answered: 1 week ago