dbms2.docx

2
SET d s i d sname rat ing ag e 2 2 Dusti n 7 45 .0 2 9 Brutu s 1 33 .0 3 1 Lubbe r 8 55 .5 3 2 Andy 8 25 .5 5 8 Rusty 10 35 .0 6 4 Horat io 7 35 .0 7 1 Zorba 10 16 .0 7 4 Horat io 9 40 .0 8 5 Art 3 25 .5 9 5 Bob 3 63 .5 Sailors table S Reserves table R bi d bname colo r 10 1 Interl ake Blue 10 2 Interl ake Red 10 3 Clippe r Gree n 10 4 Marine red Boats table B s i d bi d day 2 2 10 1 10/10/ 98 2 2 10 2 10/10/ 98 2 2 10 3 10/8/9 8 2 2 10 4 10/7/9 8 3 1 10 2 11/10/ 98 3 1 10 3 11/6/9 8 3 1 10 4 11/12/ 98 6 4 10 1 9/5/98 6 4 10 2 9/8/98 7 4 10 3 9/8/98

Upload: aishwarya

Post on 17-Feb-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: dbms2.docx

SET d

sid sname rating age22 Dustin 7 45.029 Brutus 1 33.031 Lubber 8 55.532 Andy 8 25.558 Rusty 10 35.064 Horatio 7 35.071 Zorba 10 16.074 Horatio 9 40.085 Art 3 25.595 Bob 3 63.5Sailors table S Reserves table R

bid bname color101 Interlak

eBlue

102 Interlake

Red

103 Clipper Green104 Marine redBoats table B

Write SQL Query for the following:

(1) Find the age of all sailors.(2) Find all sailors with a rating below 7.(3) Find the name of sailors who have reserved boat number 104.(4) Find the name of sailors whose name end with y .

sid bid day22 101 10/10/9822 102 10/10/9822 103 10/8/9822 104 10/7/9831 102 11/10/9831 103 11/6/9831 104 11/12/9864 101 9/5/9864 102 9/8/9874 103 9/8/98