Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exercises Find the names of sailors who’ve reserved boat #103 { N |  S  Sailors (S.name = N.name   R  Reserves(S.sid = R.sid  R.bid = 103)) }

Similar presentations


Presentation on theme: "Exercises Find the names of sailors who’ve reserved boat #103 { N |  S  Sailors (S.name = N.name   R  Reserves(S.sid = R.sid  R.bid = 103)) }"— Presentation transcript:

1 Exercises Find the names of sailors who’ve reserved boat #103 { N |  S  Sailors (S.name = N.name   R  Reserves(S.sid = R.sid  R.bid = 103)) }

2 Exercises Find the names of sailors who’ve reserved any red boat { N |  S  Sailors (S.name = N.name   R  Reserves (S.sid = R.sid   B  Boats(B.color = “Red”  B.bid = R.bid))) }

3 Exercises Find sailors who’ve reserved a red boat or a green boat { S | S  Sailors  (  R  Reserves (S.sid = R.sid   B  Boats(B.bid = R.bid  (B.color = “Red”   B.color = “Green” )))) }

4 Exercises Find sailors who’ve reserved a red boat and a green boat { S | S  Sailors  ((  R  Reserves (S.sid = R.sid   B  Boats(B.color = “Red”  B.bid = R.bid)))  (  R  Reserves (S.sid = R.sid   B  Boats(B.color = “Green”  B.bid = R.bid)))) }

5 Exercises Find sailors who’ve reserved all red boats {S | S  Sailors   B  Boats(B.color = ‘red’   R(R  Reserves  S.sid = R.sid  B.bid = R.bid))} {S | S  Sailors   B  Boats (B.color  ‘red’   R(R  Reserves  S.sid = R.sid  B.bid = R.bid))} Alternatively ….(remember that a  b is the same as ¬a  b)


Download ppt "Exercises Find the names of sailors who’ve reserved boat #103 { N |  S  Sailors (S.name = N.name   R  Reserves(S.sid = R.sid  R.bid = 103)) }"

Similar presentations


Ads by Google