Free Essay

Masud Parves Wants You to Be a Farmhand!

In:

Submitted By masud992
Words 314
Pages 2
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

Sailors Table:- sid | sname | rating | age | 1 | Rana | 8 | 45 | 2 | Tipu | 10 | 36 | 3 | Kamal | 4 | 25 | 4 | Zia | 6 | 28 | 5 | Faysal | 7 | 32 |

Boats Table:- Bid | bname | Color | 101 | Sonar Tori | red | 102 | Ruposhi Bangla | Blue | 103 | Digonto | Green | 104 | Samolima | red | 105 | Moon light | yellow |

Reservation Table:- sid | bid | date | 1 | 103 | 12-25-2013 | 1 | 104 | 12-15-2015 | 2 | 101 | 12-15-2013 | 3 | 105 | 12-30-2013 | 5 | 104 | 1-1-2013 |

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;

Similar Documents