Question: Question 4 . [ 6 MARKS ] Consider the following schema. Primary keys are underlined. The following syntactically correct queries in SQL and relational algebra

Question 4.
[6 MARKS]
Consider the following schema. Primary keys are underlined.
The following syntactically correct queries in SQL and relational algebra attempt to return the set (i.e.,
with no duplicates) of all SIDs of all Sailors who have never reserved a red boat. For each, circle one
answer to indicate whether it is correct or incorrect. Note that the symbol > means "not equal to" or .
select S.SID
from Sailor S
where S.SID not in ( select R.SID
from Reserve R, Boat B
where B.Color = 'red')
Circle one: correct incorrect
select distinct S.SID
from Sailor S, Reserve R, Boat B
where S.SID = R.SID and R.BID = B.BID and B.Color > 'red'
Circle one: correct incorrect
select S.SID
from Sailor S
where not exists ( select R.SID
from Reserve R, Boat B
where S.SID = R.SID and R.BID = B.BID and B.Color = 'red' )
Circle one: correct incorrect
select distinct R.SID
from Reserve R, Boat B
where R.BID=B.BID and B.color = 'red'
group by R.SID
having count(**)1
Circle one: correct incorrect
Sailor
Question 4 . [ 6 MARKS ] Consider the following

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 Accounting Questions!