0% found this document useful (0 votes)
32 views2 pages

Dbms Assignment1

The document defines tables for sailors, boats, and reservations and populates them with sample data. It then lists 10 SQL queries to run on the tables: 1) Find names and ages of all sailors 2) Find sailors with rating above 10 3) Find names of sailors who reserved boat with ID 352 4) Find IDs of sailors who reserved a red boat 5) Find colors of boats reserved by Rubber 6) Find names of sailors who reserved at least one boat 7) Find names of sailors who reserved a red or green boat 8) Find IDs of sailors over 20 who did not reserve a red boat 9) Find names of sailors who reserved all boats 10) Find sailor

Uploaded by

joshAISH
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)
32 views2 pages

Dbms Assignment1

The document defines tables for sailors, boats, and reservations and populates them with sample data. It then lists 10 SQL queries to run on the tables: 1) Find names and ages of all sailors 2) Find sailors with rating above 10 3) Find names of sailors who reserved boat with ID 352 4) Find IDs of sailors who reserved a red boat 5) Find colors of boats reserved by Rubber 6) Find names of sailors who reserved at least one boat 7) Find names of sailors who reserved a red or green boat 8) Find IDs of sailors over 20 who did not reserve a red boat 9) Find names of sailors who reserved all boats 10) Find sailor

Uploaded by

joshAISH
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/ 2

Institute of Engineering And Technology DAVV

III year Computer Science Engineering


Lab Assignment 1
Consider the following table definitions:
Sailors (sid: integer, sname: string, rating: integer, age: real)
Boats (bid: integer, bname: string, color: string)
Reserves (sid: integer, bid: integer, day: date)
Sailors Boats eser!es
sid sname rating age
22 Dustin !"
2# Brutus $ %%
%$ &ubber ' ""("
%2 )ndy ' 2"("
"' Rusty $* %"
+! ,oratio %"
$ -orba $* $+
! ,oratio # !*
'" )rt % 2"("
#" Bob % +%("
bid bname color
$*$ .nterla/e blue
$*2 .nterla/e red
$*% Cli00er green
$*! 1arine red
sid bid day
22 $*$ $*2$*22*$$
22 $*2 $*2$*22*$$
22 $*% '2$*22*$$
22 $*! 2$*22*$$
%$ $*2 $*2$$22*$$
%$ $*% +2$$22*$$
%$ $*! $22$$22*$$
+! $*$ "2#22*$$
+! $*2 '2#22*$$
! $*% '2#22*$$
Define the follo"ing tables and populate it "ith the rele!ant data sho"n abo!e and "rite the S#L
statements for the follo"ing $ueries%
3$ 4ind the names and ages of all sailors(
32 4ind all the sailors with rating above (
3% 4ind the names of all sailors who have reserved boat number $*%(
3! 4ind the sids of sailors who have reserved a red boat(
3" 4ind the colors of boats reserved by &ubber(
3+ 4ind the names of sailors who have reserved at least one boat(
3 4ind the names of sailors who have reserved a red or a green boat(
3' 4ind the sids of sailors with age over 2* who have not reserved a red boat(
3# 4ind the names of sailors who have reserved all boats(
3$* 4ind the sailor name, boat id, and reservation date for each reservation(

You might also like