Question 181Asked in CIL MT Systems, 27 Feb 2020 (8:00 AM)

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

Consider the following relational schema Sailors(sid, sname, rating, age) Reserves(sid, bid, day) Boats(bid, bname, color) What is the equivalent of following relational algebra query in SQL query π_sname ((σ_color='red' Boats) ⋈ Reserves ⋈ Sailors)
  1. ASELECT S.sname, S.rating FROM Sailors S, Reserves R WHERE S.sid = R.sid AND R.bid = B.bid AND B.color = 'red'
  2. BSELECT S.sname FROM Sailors S, Reserves R, Boats B WHERE S.sid = R.sid AND R.bid = B.bid AND B.color = 'red'
  3. CSELECT S.sname FROM Sailors S, Reserves R, Boats B WHERE S.sid = R.sid AND B.color = 'red'
  4. DSELECT S.sname FROM Sailors S, Reserves R, Boats B WHERE R.bid = B.bid AND B.color = 'red'
Show answerHide answer

Correct answer: (B) SELECT S.sname FROM Sailors S, Reserves R, Boats B WHERE S.sid = R.sid AND R.bid = B.bid AND B.color = 'red'

From CIL MT Systems PYQ, 27 Feb 2020 (8:00 AM)

This is question 181 of CIL MT Systems PYQ, 27 Feb 2020 (8:00 AM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.