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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!