Consider the following relation schema
Sailors(sid, sname, rating, age)
Reserve(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
SELECT S.sname, S.rating
FROM Sailors S, Reserves R
WHERE S.sid = R.sid AND R.bid = B.bid AND B.color = ‘red’2
SELECT S.sname
FROM Sailors S, Reserves R, Boats B
WHERE S.bid = B.bid AND B.color = ‘red’
3
SELECT S.sname
FROM Sailors S, Reserves R, Boats B
WHERE S.sid = R.sid AND B.color = ‘red’
4
SELECT S.sname
FROM Sailors S, Reserves R, Boats B
WHERE S.sid = R.sid AND R.bid = B.bid AND B.color = ‘red’