Consider a database with three relation instances shown below. The primary…

GATE · 2006 · IT

Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars relation are did and cid respectively and the records are stored in ascending order of these primary keys as given in the tables. No indexing is available in the database.

2006_84_852006_84_85_22006_84_85_3

What is the output of the following SQL query?

select D.dname
from Drivers D
where D.did in  (
                        select R.did
                        from Cars C, Reserves R
                        where R.cid = C.cid and C.colour = 'red'
                        intersect
                        select R.did
                        from Cars C, Reserves R
                        where R.cid  = C.cid and C.colour = 'green'
                         )

  1. A.

    Karthikeyan, Boris

  2. B.

    Sachin, Salman

  3. C.

    Karthikeyan, Boris, Sachin

  4. D.

    Schumacher, Senna

Attempted by 134 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…