Sid Sname Rating Age
Sid Sname Rating Age
table definitions: Sailors (sid: integer, sname: string, rating: integer, age: real) Boats (bid: integer, bname: string, color: string) Reserves (sid: integer, bid: integer, day: date) Sailors
sid 22 29 31 32 58 64 71 74 85 95 sname Dustin Brutus Lubber Andy Rusty Horatio Zorba Horatio Art Bob rating 7 age 45 33 55.5 25.5 35 35 16 40 25.5 63.5
Boats bid 101 102 103 104 bname Interlake Interlake Clipper Marine color blue red green red
Reserves sid 22 22 22 22 31 31 31 64 64 74 bid 101 102 103 104 102 103 104 101 102 103 day
10-10-2011
1 8 8 10 7 10 9 3 3
Define the following tables and populate it with the relevant data shown above and write the SQL statements for the following queries. #1 #2 #3 #4 #5 #6 Find the names and ages of all sailors. Find all the sailors with rating above 7. Find the names of all sailors who have reserved boat number 103. Find the sids of sailors who have reserved a red boat. Find the colors of boats reserved by Lubber. Find the names of sailors who have reserved at least one boat.
#7 #8 #9 #10
Find the names of sailors who have reserved a red or a green boat. Find the sids of sailors with age over 20 who have not reserved a red boat. Find the names of sailors who have reserved all boats. Find the sailor name, boat id, and reservation date for each reservation.