Write a subquery that finds average salary by each department. Check to find if employee 543’s salary satisfies =ANY, ANY, ALL condition against those departmental average salaries.
Use the N2 Corporation database tables to design the following subqueries. (Use the spooling method to capture all queries and results in the CHAP8SP1.LST file.)
```
SQL> SELECT Lname, Fname, Salary
2 FROM employee
3 WHERE EmployeeId = 543
4 AND Salary =ANY
5 (SELECT AVG(Salary)
6 FROM employee
7 GROUP BY DeptId);
no rows selected
SQL> 4
4* AND Salary =ANY
SQL> c/=/<
4* AND Salary
LNAME FNAME SALARY
--------------- --------------- ----------
Dev Derek 80000
SQL> 4
4* AND Salary
4* AND Salary >ANY
SQL> /
LNAME FNAME SALARY
--------------- --------------- ----------
Dev Derek 80000
SQL> 4
4* AND Salary >ANY
SQL> c/>ANY/
no rows selected
SQL> 4
4* AND Salary
4* AND Salary >ALL
SQL> /
no rows selected
```
You might also like to view...
Which of the following is not a consideration when purchasing software economically?
A) Although there are different bundles of Microsoft Office you can purchase, the primary difference between the bundles are the number of programs that are included and the fewer the programs, the lower the price. B) Another option for purchasing software is an integrated package, which provides the functionality of several separate programs within a single program. C) A software suite is software that you can download from a website without a fee. D) Shareware is software that you can download for a small fee or donation.
The following sentence is punctuated correctly.? Sites on the World Heritage List are chosen for outstanding universal value, consequently, the United Nations gives expert advice and sometimes money to help preserve them.
Answer the following statement true (T) or false (F)
__________ planning ensures that critical business functions can continue if a disaster occurs.
Fill in the blank(s) with the appropriate word(s).
Zooming in, or choosing a higher zoom ____, makes a document appear bigger on screen, but less of it fits on the screen at once.
A. aspect B. amount C. size D. percentage