Gate CS-2007 Question Paper With Solutions

Q. 40 Consider the table employee (empId, name, department, salary) and the two

queries Q1,Q2 below. Assuming that department 5 has more than one employee,

and we want to find the employees who get higher salary than anyone in the

department 5, which one of the statements is TRUE for any arbitrary employee

table?

Q1 : Select e. empId

From employee e

Where not exists

(Select*From employee s Where s. department=”5” and s.salay>=e.salary)
Q.2 : Select e. empId

From employee e

Where e.salary>Any

(Select distinct salary From employee s Where s. department=”5”)

Gate CS-2007 Question Paper With Solutions

Answer: (A)

Explanation:

Gate CS-2007 Question Paper With Solutions

Learn More:   Gate EE-2003 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here