Question 5
Consider the table Faculty(ID, Name, Department, Salary) and the two queries Q1 and Q2 given below. Our goal is to find the IDs of faculty members whose salary is greater than the highest salary in the Computer Science department. Assume that 'Computer Science' department has more than one faculty member. Which of the following queries will give the required output?
Q1:
select F.IDfrom Faculty as Fwhere F.salary>All(select distinct salary from Faculty as T where T.department='Computer Science')Q2:
select F.IDfrom Faculty as Fwhere not exists(select * from Faculty as T where T.department='Computer Science' and T.salary>=F.salary)Q1 is correct but Q2 is wrong
Q2 is correct but Q1 is wrong
Both Q1 and Q2 are wrong
Both Q1 and Q2 are correct