Assignment DBI
Assignment DBI
Assignment DBI
This is an individual Assignment. You are not permitted to work as a group when writing this
assignment.
Copying, Plagiarism: Plagiarism is the submission of somebody else’s work in a manner that gives
the impression that the work is your own. The Department of Computer Science and Information
Technology treats plagiarism very seriously. When it is detected, penalties are strictly imposed.
Students are referred to the Department of Computer Science and Information Technology’s
Handbook and policy documents with regard to plagiarism and assignment return, and also to the
section of ‘Academic Integrity’ on the subject learning guide.
No extensions will be given: Penalties are applied to late assignments (5% of total assignment mark
given is deducted per day, accepted up to 5 days after the due date only). If there are circumstances
that prevent the assignment being submitted on time, an application for special consideration may be
made. See Student Handbook for details. Note that delays caused by computer downtime cannot be
accepted as a valid reason for a late submission without penalty. Students must plan their work to
allow for both scheduled and unscheduled downtime.
PART A:
Task 1 [50 marks]: Construct an ER-Model for the following problem description. State any
assumptions that you make.
DSS (Dig, Set, Spike) Volleyball is an amateur volleyball association. Each team in the
association represents a particular suburb. Each suburb has its own sporting complex where
the team's home games are played. Teams are identified by their id and also have a name, a
contact person and a contact phone number. Each team has a maximum of ten players and a
minimum of seven players registered. Players are identified by a unique player id and their
name, address and contact phone number need to be recorded. Each team has a coach; some
have up to two coaches. Coaches also have unique ids, and their name, address, contact
phone number and coaching qualifications are required.
During the season, each team plays two games, one as the home team and one as the visitor,
against each of the other teams. For each game the date of the game, start time and final score
need to be recorded.
As a special treat at the end of the season the association holds a break-up party for the
players. At the break-up party treats are given out to all the players’ children who are under
12. The association therefore requires each child’s name and date of birth.
Get the file Assignment.sql from your lecturer. This file contains all the CREATE and
INSERT statements you will need for this assignment.
NOTE: YOU DO NOT NEED TO INSERT MORE DATA INTO THE TABLES.
b. Display the name of the client who has booked the reservation for the longest period.
c. Display the Room no, Room type, Room rate and No of guests for the reservation made by client(s)
having last name “Perez”.
d. Display the Name of the equipment and the name of their suppliers (if any) for the outdoor
activities with high risk level. You need to display all the equipment including equipment which is not
supplied by any supplier.
e. Display the name of the outdoor instructor who has the most duties as an activity supervisor.
f. Display the reservations (reservation number and duration) whose duration is greater than the
average duration of reservations.
g. For each reservation, display the total income coming from activities & total income coming from
accommodations along with the reservation number. (Do not consider the discount schemes but
consider every reservation even if it does not have any of the costs associated with it).
b. Write a stored function that uses the reservation number, activity ID, and date as input and returns
the Name of the supervisor assigned for that specific activity.
A Trigger which automatically raises an error whenever a client with Aqua phobia selects Rafting as
a preferred outdoor activity.