ExamVeda
Login
Home
This question belongs to SQL Sql Miscellaneous
Sql Miscellaneous
?

Which of the following query finds colors of boats reserved by "Dustin"?

Answer & Solution
Correct Answer: Option B
To find the colors of boats reserved by "Dustin," you should use the SQL query SELECT DISTINCT b.color FROM boats b, reserves r, sailors s WHERE s.sname = 'Dustin' AND s.sid = r.sid AND r.bid = b.bid; (Option B). This query joins the "boats," "reserves," and "sailors" tables to find the colors of boats reserved by "Dustin." It ensures that the sailor's name is "Dustin" (s.sname = 'Dustin') and matches the sailor's ID to the reservation's sailor ID (s.sid = r.sid) and the reservation's boat ID to the boat's ID (r.bid = b.bid). The use of DISTINCT ensures you get unique boat colors. Option B is the correct choice for obtaining this information.
Examveda
Question posted by Examveda
Community

Join the Discussion

2 Comments
Abu Bakker
Abu Bakker 7 years ago
what is the meaning of sid and bid????
Vaishnavi Edukulla
Vaishnavi Edukulla 10 years ago
what bid here?????