Lab 5
Lab 5
Table created:
QUERIES to be performed are
✓ Write a SQL query to get all information of sailors who have reserved boat number
103
Select all rows from sailor and reserves table where boat id is 103.
To join the tables we wrote s.sid=r.sid.
✓ Write a SQL query to find the names of sailors who have reserved a blue boat, and list
in the order of ratings.
Select name from sailor table. Join reserves table with sailor and boat table.
Where blue is the boat color.
✓ Write a SQL query to find the names of sailors who have reserved at least two boat.
✓ Find the average age of sailors for each rating level that has at least two sailors
Group by rating attribute, which have atleast 2 rows for each rating value.