Question: Solve following database query problem: Please provide reason for why its correct and wrong? Question 8: Suppose we wish to find the ID's of the
Solve following database query problem: Please provide reason for why its correct and wrong?
Question 8: Suppose we wish to find the ID's of the employees who do not manage any employee named "Sally." Here are two possible queries: I. SELECT mgrID FROM Emps WHERE NOT EXISTS (SELECT FROM Emps WHERE NAME'Sally') II SELECT mgrID FROM Emps WHERE NOT (emp ID = ANY (SELECT EmpID FROM Emps WHERE name = Sally)) 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 norII Question 8: Suppose we wish to find the ID's of the employees who do not manage any employee named "Sally." Here are two possible queries: I. SELECT mgrID FROM Emps WHERE NOT EXISTS (SELECT FROM Emps WHERE NAME'Sally') II SELECT mgrID FROM Emps WHERE NOT (emp ID = ANY (SELECT EmpID FROM Emps WHERE name = Sally)) 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 norIIStep by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
