Gate CS-2010 Question Paper With Solutions

Q. 19 A relational schema for a train reservation database is given below.

Passenger (pid, pname, age)
Reservation (pid, class, tid)

Gate CS-2010 Question Paper With Solutions

What pids are returned by the following SQL query for the above instance of the tables?

SLECT pid
FROM Reservation ,
WHERE class ‘AC’ AND
    EXISTS (SELECT *
       FROM Passenger
       WHERE age > 65 AND
       Passenger. pid = Reservation.pid)

(A) 1,0

(B) 1, 2

(C) 1, 3

(D) 1, 5

Answer: (c)

Explanation:

Gate CS-2010 Question Paper With Solutions

Learn More:   Gate CS-2003 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here