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.



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
- A.
36 - 40
- B.
44 - 48
- C.
60 - 64
- D.
100 - 104
Attempted by 91 students.
Sign up free to check your answer
Sign up freeLoading lesson…

