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

PYQ GATE 2006

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

The following SQL query is used for the linked question:

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'
)

Let n be the number of comparisons performed when the above SQL query is optimally executed. If linear search is used to locate a tuple in a relation using primary key, then n lies in the range

  1. A.

    36 - 40

  2. B.

    44 - 48

  3. C.

    60 - 64

  4. D.

    100 - 104

Attempted by 91 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…