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?
a) Both I and II
b) I only
c) II only
d) Neither I nor I
Answer: a
Explanation: The query can be satisfied by any of the two options.
Related Posts
People overcome natural language problems by _____________
The integrated circuit was invented by Jack Kilby of _____________
Research scientists all over the world are taking steps towards building computers with circuits patterned after the complex interconnections existing among the human brain’s nerve cells. What name is given to such type of computers?
Which type of actuator generates a good deal of power but tends to be messy?
In LISP, the function evaluates both and is _____________
Which of the following have people traditionally done better than computers?
A bidirectional feedback loop links computer modeling with _____________
Join The Discussion