In SQL, specify the following queries on the database specified in Figure 3.5 using the concept of nested queries and the concepts described in this chapter.

a. Retrieve the names of all employees who work in the department that has the employee with the highest salary among all employees.
b. Retrieve the names of all employees whose supervisor’s supervisor has '888665555' for Ssn.
c. Retrieve the names of employees who make at least $10,000 more than the employee who is paid the least in the company.

a) SELECT LNAME FROM EMPLOYEE WHERE DNO =
( SELECT DNO FROM EMPLOYEE WHERE SALARY =
( SELECT MAX(SALARY) FROM EMPLOYEE) )
b) SELECT LNAME FROM EMPLOYEE WHERE SUPERSSN IN
( SELECT SSN FROM EMPLOYEE WHERE SUPERSSN = ‘888665555’ )
c) SELECT LNAME FROM EMPLOYEE WHERE SALARY >= 10000 +
( SELECT MIN(SALARY) FROM EMPLOYEE)

Computer Science & Information Technology

You might also like to view...

_____________ software is used in a Linux environment to mount and write data only to NTFS partitions.?

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Inserting blank lines before or after HTML elements does not affect the structure of a webpage.?

Answer the following statement true (T) or false (F)

Computer Science & Information Technology