Exam Paper Stationery

UNIVERSITY OF EAST ANGLIA
School of Computing Sciences
January PG Examination 2014-15
DATABASE MANIPULATION
CMPSMB11
Time allowed: 3 hours
Answer THREE questions.
All questions carry equal weight.
Notes are not permitted in this examination
Do not turn over until you are told to do so by the invigilator.
CMPSMB11
Module Contact: Dr Beatriz de la Iglesia (CMP)
Copyright of the University of East Anglia
Version 2
-2-
1)
(a) Briefly describe five of the limitations of the file-based approach to data
management.
[15 marks]
(b) Moving from the file-based to the database approach there is a paradigm
shift that affects database design. Explain the paradigm shift.
[9 marks]
(c) Read Appendix A on page 8 entitled Scenario information for Q1.
Considering that EDS currently use a paper-based system, explain how a
Database Management System (DBMS) could help improve their
operation, in particular, in the context of answering the following queries:
i)
The names and telephone numbers of the Manager of each office.
ii)
The total number of clients (past and present) in each city.
iii)
The timetable of appointments for a given instructor next week.
iv)
The names of clients who passed the driving test in January 2010.
[16 marks]
Total [40 marks]
CMPSMB11
Version 2
-3-
2) Read Appendix A on page 8 entitled Scenario information for Q1 and Q2 and
Appendix B on page 9 entitled Additional scenario information for Q2.
(a) Identify all the main entities of the system and define an initial list of suitable
attributes for each entity.
[18 marks]
(b) Identify the relations among entities including their cardinality and participation
constraints. State any assumptions you will need to make.
[10 marks]
(c) Draw an Entity Relationship diagram or an Enhanced Entity Relationship
diagram to represent EDS’ conceptual model.
[4 marks]
(d) Discuss the main reasons for introducing enhanced semantic constructs in your
ER model.
[8 marks]
Total [40 marks]
PLEASE TURN OVER
CMPSMB11
Version 2
-4-
3) A University has a booking system for its rooms. The system contains a
relational database with information on events, organisers, rooms and room
bookings. The tables are:
event (eventID, type, duration)
organiser (organiserID, firstName, lastName, email)
room (roomID, capacity, projector, whiteBoard)
booking (eventID*, organiserID*,roomID*, bookingDate, bookingStartTime)
where eventID is the unique event identifier;
type is either Lec (for Lecture), Sem (for Seminar) or Lab (for Laboratory);
duration is the event planned duration given in whole hours; the maximum
duration is 4 hours;
organiserID is the unique identifier for the event organiser, i.e. a lecturer;
first name, last name and email record details of the organiser;
roomID is the unique room identifier;
capacity specifies the maximum number the room can accommodate;
projector/whiteboard are Booleans specifying whether the room has the said
facilities;
bookingDate/bookingStartTime are the required date/time for the booking
For simplicity, events can only start on the hour; thus bookingStartTime is an integer
variable representing the hour the booking commences using the 24-hour clock
format. A given event can have a number of bookings on different dates. It is
assumed, however, that the same event is not booked more than once per day.
An organizer can be associated with any number of bookings. A room may also be
associated with a number of bookings.
Answer the following questions using relational algebra to write queries:
(a) List the organiser’s first name and last name.
[2 marks]
CMPSMB11
Version 2
-5-
(b) Produce a list of rooms that have both a projector and a whiteboard.
[2 marks]
(c) Produce a list of the rooms that are booked in February 2015.
[8 marks]
(d) For an event with eventID= 205, create a timetable which includes the type
of event followed by details of all bookings for the event including the
organiserID, roomID and beginning time of each activity.
[6 marks]
(e) List organisers’ IDs together with the details of the events (type, duration and
date) that have been booked in February 2015. The list should include all
organisers.
[10 marks]
(f) Produce a list of the rooms that have either been booked by organiser ‘A123’
or have not been booked.
[12 marks]
Total [40 marks]
PLEASE TURN OVER
CMPSMB11
Version 2
-64)
(a) Define physical database design.
[4 marks]
(b) Briefly outline the steps of physical database design.
[12 marks]
(c) What criteria will you use to choose a “wish-list” of indexes for a given database
design?
[16 marks]
(d) Consider the following SQL query to be performed very frequently on the relation
Staff (StaffNO, fName,lName,BranchNo*, Salary):
SELECT branchNo, AVG(salary)
FROM Staff
GROUP by branchNo;
Primary key is underlined; foreign key is marked by *.
What primary and secondary indexes would you suggest? Explain your answer.
[8 marks]
Total [40 marks]
CMPSMB11
Version 2
-7-
5)
(a) In the context of the relational data model, describe the characteristics of a
table that makes it a relation.
[12 marks]
(b) Why may duplicate data in a relation lead to data integrity problems? Explain
briefly how normalization addresses some of these problems.
[12 marks]
(c) Consider the following table:
STUDENT (RegNo, StudentName, RoomType, RoomNo, RoomCost, Sibling,
Hobby)
The composite primary key is underlined. Assume that students pay different
room costs depending on the type of room they are occupying. Also assume
that a student may have a number of siblings and a number of hobbies.
i) State any multivalued dependencies in STUDENT.
[2 marks]
ii) State the functional dependencies in STUDENT.
[5 marks]
iii) Transform the table into two or more tables such that each table is in
Boyce-Codd Normal Form (BCNF) and in Fourth Normal Form (4NF). State
the primary keys for each normalized table.
[9 marks]
Total [40 marks]
END OF PAPER
PLEASE TURN OVER
CMPSMB11
Version 2
-8-
APPENDIX A
Scenario information for Q1 and Q2
The EasyDrive School of Motoring (EDS) was established in Norwich in 2010.
Since then, the school has grown steadily and now has several offices in a
number of locations in East Anglia. The school is now requiring more
administrative staff to cope with the ever-increasing paperwork. Furthermore,
the communication and sharing of information between the offices, even in the
same city, is poor.
Each office has a Manager (who may be also a Senior Instructor), several
Senior and Junior Instructors and Administrative staff. Clients must first
register at an office. They fill a paper form for this with all their details. They
are then introduced to an instructor but can request a change if they wish as
they progress through the course. After an interview, the first lesson is booked.
They may then request individual lessons or book a block of lessons for a
reduced fee. Once ready, a client applies for a driving test date. The instructor
records the outcome of the test.
CMPSMB11
Version 2
-9-
APPENDIX B
Additional scenario information for Q2

Details of the office such as address, telephone and fax number should be kept.

Personal details (e.g. name, address, telephone number, email) are stored for each
member of staff.

Clients first register with one office giving their personal details (similar to those of
staff), which are stored.

Before the first lesson, a client is requested to attend an interview with an instructor
to assess the needs of the client and to check that the client holds a valid
provisional driving license. If the check is positive, this is recorded and the
provisional driving license number is stored for the customer. The instructor also
records any relevant comments.

A client is free to request a change of instructor through the process of learning to
drive. This will generate another interview with the new instructor.

An individual lesson is for one or two hours, and will begin and end at the same
address (e.g. the address of the client or other address of his/her choosing).

A lesson is with a particular instructor in a particular car at a given time.

After each lesson, the instructor records the progress made by the client and notes
the mileage used during the lesson.

The school has a pool of cars adapted for teaching. The school records the car
registration number, make and model and the registration date. Each instructor is
allocated to a particular car. The cars are inspected at regular intervals and a
status variable is updated as ‘ok’ or ‘faulty’.
CMPSMB11
Version 2