Consider the following schema Sailors (sid, sname, rating, age) Boats

Duration: 3 min

2017

Consider the following schema :

Sailors (sid, sname, rating, age)
Boats (bid, bname, colour)
Reserves (sid, bid, day)

Two boats can have the same name but the colour differentiates them. The two relations

ρ (Tempsids, (Ⲡ  sid, bid  Reserves)/(Ⲡ bid ( σ bname ='Ganga' Boats))),
Ⲡ sname (Tempsids ⋈ Sailors)

If / is division operation, the above set of relations represents the query

  1. A.

    Names of sailors who have reserved all boats called Ganga

  2. B.

    Names of sailors who have not reserved any Gangaboat

  3. C.

    Names of sailors who have reserved at least one Gangaboat

  4. D.

    Names of sailors who have reserved at most one Ganga boat

Attempted by 178 students.

Show answer & explanation

Correct answer: A

The expression uses the relational division operator (/), which retrieves tuples that match all values in the divisor relation.

The divisor is Ⲡ bid ( σ bname ='Ganga' Boats), representing the set of boat IDs for boats named 'Ganga'.

The dividend is Ⲡ sid, bid Reserves. Dividing this by the divisor yields sailor IDs (sid) that have reserved every boat in the 'Ganga' set.

Finally, joining with Sailors and projecting sname returns the names of sailors who have reserved all boats named 'Ganga'.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Dsssb Tgt Computer Science Paper 2