Assignment on Database Management System
Submitted To
Md. Zahidul Hasan
Senior Lecturer in CSE Department of Business Studies NUB
Submitted by Name | ID | Md. Rifat Ajim Anik | BBA-120104473 | Md. Masud Parves | BBA-120104491 | Md. Ranju Ahmed | BBA-120104487 | Ashik Bhuiyan | BBA-090303346 |
Date of Submission
30th August, 2015
Write the following quaries in sql- 1) Print the name and age of all sailors whose age are below 35 years. 2) Find sailors who have reserved a red color boat for 12-15-2015. 3) Print maximum, minimum and average age of sailors where rating >8. 4) Print the name of sailor who is younger than 30 or older than 35 and have a reservation. 5) Delete all reservation for sailors with rating <6. 6) Update the age of the sailors with sid 3 to be 5o years.
Assignment:- Answer No 1
Select sname,age
From sailors
Where ages<35;
Answer No 2
Select *
From sailors,boats,reserves
Where sailors.sid=reserves.sid and reserves.bid=boats.bid and color=”red” and date=12-15-2013;
Answer No 3
Select MAX(age) as maximum_age,MIN(age) as minimum_age,AVG(age) average_age from salary where eating >8;
Answer no 4
Select sname
From sailors
Where age Between 30 And 35;
Answer no 5
Delete from reserves where rating <6;
Answer No 6
Update sailors set sid=3 where age=50;