0% found this document useful (0 votes)
14 views4 pages

Lab 5

Uploaded by

Pinak Tendulkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views4 pages

Lab 5

Uploaded by

Pinak Tendulkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Registration number: 20BCE2484

Name: Pinak Dinesh Tendulkar

MIDTERM LAB,24TH NOV,DBMS, L15+L16, By S S Roy

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.

Group by sid having more than 2 bid columns.

✓ Find the name and the age of the oldest sailor.

Select name and age of the sailor having max age.

✓ 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.

You might also like