Database-Management-System
August 29, 2024Database-Management-System
August 29, 2024Database-Management-System
|
Question 375
|
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)
|
SELECT S.sname, S.rating
FROM Sailors S, Reserves R WHERE S.sid=R.sid AND R.bid = B.bid AND B.color=’red’ |
|
|
SELECT S.sname
FROM Sailors S, Reserves R, Boats B WHERE S.sid=R.sid AND R.bid = B.bid AND B.color=’red’ |
|
|
SELECT S.sname
FROM Sailors S, Reserves R, Boats B WHERE S.sid=R.sid AND B.color=’red’ |
|
|
SELECT S.sname
FROM Sailors S, Reserves R, Boats B WHERE R.bid=B.bid AND B.color=’red’ |
Question 375 Explanation:
The given relational algebra query is equivalent to the sql query given in option B.
Correct Answer: B
Question 375 Explanation:
The given relational algebra query is equivalent to the sql query given in option B.
