GATE 2007 CS – Question 61
employee(empId, name, department, salary) has more than one employee in department5. We want employees paid more than anyone in department5. Which is TRUE for an arbitrary table?
-- Q1
SELECT e.empId FROM employee e
WHERE NOT EXISTS (SELECT * FROM employee s
WHERE s.department='5' AND s.salary>=e.salary);
-- Q2
SELECT e.empId FROM employee e
WHERE e.salary > ANY (SELECT DISTINCT salary
FROM employee s WHERE s.department='5');Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) Q1 is correct.
Explanation
We are sorry we couldn't write detailed soluition for this, we are working on it!, please consider asking your own AI, its just 2-3 clicks with very minimum effort
More Relational Model: Relational Algebra, Tuple Calculus, SQL questions
- GATE 2026 CS (CS1) Q30
- GATE 2026 CS (CS1) Q43
- GATE 2025 CS (CS1) Q39
- GATE 2025 CS (CS1) Q55
- GATE 2025 CS (CS2) Q54
- GATE 2024 CS (CS1) Q35
All Relational Model: Relational Algebra, Tuple Calculus, SQL questions →