Home » Database » Database miscellaneous » Question

Database miscellaneous

  1. Consider the following relation
    Cinema (theater, address, capacity)
    Which of the following options will be needed at the end of the SQL query
    SELECT P1. address
    FROM Cinema P1
    Such that it always finds the addresses of theaters with maximum capacity?
    1. WHERE P1. capacity >= All (select P2. capacity from Cinema P2)
    2. WHERE P1. capacity >= Any (select P2. capacity from Cinema P2)
    3. WHERE P1. capacity > All (select max(P2. capacity) form Cinema P2)
    4. WHERE P1. capacity > Any (select max (P2. capacity) from Cinema P2)
Correct Option: A

Inner query collects capacities of all the theatres and in outer query we are filtering the tuples with the condition “capacity>=All”. So the theatres which are having maximum capacity will be satisfy the conductivity and they will.



Your comments will be displayed only after manual approval.