3. Suppose we wish to find the ID's of the employees that are managed by people who are managed by the employee with ID 123. Here are two possible queries:
I.SELECT ee.empID FROM Emps ee, Emps ff
WHERE ee.mgrID = ff.empID AND ff.mgrID = 123;
II.SELECT empID FROM Emps
WHERE mgrID IN(SELECT empID FROM Emps WHERE mgrID = 123);
Which, if any, of the two queries above will correctly (in SQL2) get the desired set of employee ID's?
4. Suppose relation R(A,B) currently has tuples {(1,2), (1,3), (3,4)} and relation S(B,C) currently has {(2,5), (4,6), (7,8)}. Then the number of tuples in the result of the SQL query:
SELECT *FROM R NATURAL OUTER JOIN S;IS:
6. Relation R with an associated set of functional dependencies, F, is decomposed into BCNF. The redundancy (arising out of functional dependencies) in the resulting set of relations is