A table 'student' with schema (roll, name, hostel, marks), and another table…

2005

A table 'student' with schema (roll, name, hostel, marks), and another table 'hobby' with schema (roll, hobbyname) contains records as shown below:

image.png

The following SQL query is executed on the above tables:

select hostel
from student natural join hobby
where marks > = 75 and roll between 2000 and 3000;

Relations S and H with the same schema as those of these two tables respectively contain the same information as tuples. A new relation S’ is obtained by the following relational algebra operation:
S’ = ∏hostel ((σs.roll = H.rollmarks > 75 and roll > 2000 and roll < 3000 (S)) X (H)) The difference between the number of rows output by the SQL statement and the number of tuples in S’ is  

  1. A.

    6

  2. B.

    4

  3. C.

    2

  4. D.

    0

Attempted by 17 students.

Show answer & explanation

Correct answer: B

image.png

Explore the full course: Gate Guidance By Sanchit Sir