GATE 2015 CS (CS3) – Question 29
Cinema(theater,address,capacity) stores theaters. Complete the query to always return addresses of maximum-capacity theaters, assuming non-NULL capacities:
SELECT P1.address FROM Cinema P1
-- clause herePractise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) WHERE P1.capacity >= ALL (SELECT P2.capacity FROM Cinema P2)
Explanation
A row has maximum capacity exactly when its capacity is at least every capacity in the relation, giving A. ANY admits rows merely exceeding the minimum. The strict greater-than comparisons with the maximum exclude every row, including tied maxima.
More Relational Model: Relational Algebra, Tuple Calculus, SQL questions
- GATE 2021 CS (CS2) Q41
- 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
All Relational Model: Relational Algebra, Tuple Calculus, SQL questions →