Consider the following schema: Sailors(sid, sname, rating, age) Reserve(sid, bid, day) Boats(bid, bname, size) Reserve.sid is a foreign key to Sailors and Reserves.bid is a foreign key to Boats.bid. We are given the following information about the database: Reserves contains 10,000 records with 40 records per page. Sailors contains 1000 records with 20 records per page. Boats contains 100 records with 10 records per page. There are 50 values for Reserves.bid. There are 10 values for Sailors.rating in the range of [1, 10]. There are 10 values for Boat.size in the range of [1,10] There are 500 values for Reserves.day from Jan 1, 2003 to May 14, 2004 (all the 500 days in this range). SELECT S.sid, S.sname, B.bname FROM Sailors S, Reserves R, Boats B WHERE S.sid=R.sid AND R.bid = B.bid AND B.size>5 AND R.day=DATE ‘July 4, 2003’ Consider the following SQL query for the remaining questions: SELECT S.sid, S.sname, B.bname
Consider the following schema: Sailors(sid, sname, rating, age)
Reserve(sid, bid, day)
Boats(bid, bname, size)
Reserve.sid is a foreign key to Sailors and Reserves.bid is a foreign key to Boats.bid. We are given the following information about the
Reserves contains 10,000 records with 40 records per page.
Sailors contains 1000 records with 20 records per page.
Boats contains 100 records with 10 records per page.
There are 50 values for Reserves.bid.
There are 10 values for Sailors.rating in the range of [1, 10].
There are 10 values for Boat.size in the range of [1,10]
There are 500 values for Reserves.day from Jan 1, 2003 to May 14, 2004 (all the 500 days in this range).
SELECT S.sid, S.sname, B.bname
FROM Sailors S, Reserves R, Boats B
WHERE S.sid=R.sid AND R.bid = B.bid AND B.size>5 AND R.day=DATE ‘July 4, 2003’
Consider the following SQL query for the remaining questions:
SELECT S.sid, S.sname, B.bname
FROM Sailors S, Reserves R, Boats B WHERE S.sid=R.sid AND R.bid = B.bid
Write down all possible left-deep (logical) plans for the query (i.e., no need to specify the join
Please give detailed solution.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images