Exercise 20.9 Consider two ways to compute the names of employees who earn more than $100,000 and whose age is equal to their manager’s age. First, a nested query:
SELECT E1.enameFROM Emp E1WHERE E1.sal > 100 AND E1.age = ( SELECT E2.age FROM Emp E2, Dept D2 WHERE E1.dname = D2.dname AND D2.mgr = E2.ename )
Second, a query that uses a view definition:
SELECT E1.enameFROM Emp E1, MgrAge AWHERE E1.dname = A.dname AND E1.sal > 100 AND E1.age = A.ageCREATE VIEW MgrAge (dname, age) AS SELECT D.dname, E.age FROM Emp E, Dept D WHERE D.mgr = E.ename
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.