Question: Database Schema: Sailors ( sid, sname, rating, age) Boats ( bid , color) Reserve ( sid, bid, date ) For each red boat, find the
Database Schema:
Sailors (sid, sname, rating, age)
Boats (bid, color)
Reserve (sid, bid, date)
For each red boat, find the number of reservations for this boat
What do we get if we remove B.color=red from the WHERE clause and add a HAVING clause with this condition? If there is a problem, how to fix it?
SELECT B.bid, COUNT (*) AS scount
FROM Boats B, Reserves R
WHERE R.bid=B.bid AND B.color=red GROUP BY B.bid
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
