We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 2
Vavuniya Campus of the University of Jaffna
Second Examination in Applied Mathematics and Computing - 2017
Second Semester - March/April- 2019
082231 Practical for Database Systems
Answer All Questions
Time Allowed : Two Houra
Instructions: Create a text file and name it with your index number. Save SQL statements
and the answers for each of the querias in the text file,
1. Consider the following relational instances (Sailor, Boat and Reserves) for a boat-
booking management system databese. You sre required to create and mointein a
dotabasc named BookBoat for the given data.
Sailor
Sailorld | Saamo | Rating | Age
22 | Dustin |. 7 | 45.0
29 | Brut | 1 | 33.0
Bout .
BoatId | Bname | Bcolor 31 Lubber a 55.5
101 | Interlake | blue 32 Andy 8 25.5
102 || Interlake | red 58 Rusty 10 35.0 |
103 Clipper | green 64 Horatio z 35.0 |
104 Marine red Th Zorba 10 16.0
74 | Horatio| 9 | 35.0
85 "| Athesh | 3 | 25.5
95 Bob 3 | 83.6Reserves
Sailorld | Boat Dey -
22 1a [0/10/2018
20 102 | 10/10/2018
22 103 | 10/8/2018
22 lea | 10/7/2018
31 102 | 11/30/2018
31 103_| 11/6/2018
a 10a | sayaz/2016
6 1a_| g/sf2ois
4 102 | 9/a/onig
7 103 | 9/s/a018
(a) Create the database named BockBoat with the given relational instances using
‘MySQL command prompt. (30%]
(b) Write 81 statements for each of the following queries:
i. Display the data definition for eech of the relational instences
ii, Retrieve all the tuples for each of the relational instances,
iii, Compute the average age of all sailors,
iv. Retrieve the norces of sailors who heve roserved boat 108.
y. Retrieve the names of sailors who hava reserved a red boat.
vi, Find the colors of boats reserved by Lubber.
vi. Piad tho not 8 tboos who have sevecved least one boat
Vill, Pind the solos of the hot which lave been reserved in each month.
(Hint; MONTH(’2018/10/9") returns 10)
ix, Find the names of sailors who heve reserved a red boat and # green boat
x. Find the average age of sailors for each rating level that has atleast two sailors,
xi. Find the name and the ege of the youngest sailor.
xxi. Update all-the seilors? age by ding 0.8 year. (70%