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)
You might also like to view...
Answer the following statements true (T) or false (F)
1. The length of the arrows in a PERT diagram has a direct relationship with the duration of the activity. 2. The critical path is defined as the most expensive path. 3. PERT diagrams occasionally need to use dummy activities to preserve the logic. 4. An advantage of PERT diagrams is the easy determination of slack time. 5. A PERT diagram does not allow for easy identification of the critical path and thus critical activities.
The Tabulating Machine Company later changed its name to ________
Fill in the blank(s) with correct word
The Format Cells dialog box can be used to apply a variety of different formats that are not displayed on the ________ toolbar
A) Quick Access B) Formatting C) Style D) Number
A ____, also called an index, is a number that indicates the position of a particular item within an array.
A. superscript B. key C. placeholder D. subscript