Consider the following relational schema Sailors(sid, sname, rating, age)…
PYQ Coal India Management Trainee CBT 2019
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)
- A.
SELECT S.sname, S.rating
FROM Sailors S, Reserves R
WHERE S.sid = R.sid AND R.bid = B.bid AND B.color = 'red'
- 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'
- C.
SELECT S.sname
FROM Sailors S, Reserves R, Boats B
WHERE S.sid = R.sid AND B.color = 'red' - D.
SELECT S.sname
FROM Sailors S, Reserves R, Boats B
WHERE R.bid = B.bid AND B.color = 'red'
Attempted by 525 students.
Sign up free to check your answer
Sign up freeLoading lesson…

