0% found this document useful (0 votes)
54 views

Sid Sname Rating Age

The document provides the schema and sample data for three database tables - Sailors, Boats, and Reserves. It also lists 10 SQL queries to run on the tables. The tables store information about sailors, boats, and reservations sailors have made for boats. The queries return information like names and ages of sailors, sailors with high ratings, reservations by sailor name or boat color.

Uploaded by

Bittu Sharma
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Sid Sname Rating Age

The document provides the schema and sample data for three database tables - Sailors, Boats, and Reserves. It also lists 10 SQL queries to run on the tables. The tables store information about sailors, boats, and reservations sailors have made for boats. The queries return information like names and ages of sailors, sailors with high ratings, reservations by sailor name or boat color.

Uploaded by

Bittu Sharma
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Institute of Engineering And Technology DAVV III year Computer Science Engineering Lab Assignment 1 Consider the following

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

10-10-2011 8-10-2011 7-10-2011 10-11-2011 6-11-2011 12-11-2011 5-9-2011 8-9-2011 8-9-2011

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.

You might also like