Anda di halaman 1dari 3

MAY 2016 EXAMINATION DIET

SCHOOL OF COMPUTER SCIENCE


MODULE CODE:

CS1003

MODULE TITLE:

Programming with Data

EXAM DURATION:

2 HOURS

EXAM INSTRUCTIONS: The examination is in two parts. Section A is to be answered on the


Multiple Choice Answer Sheet and Section B is to be answered in
the script book.
Section A: (Worth 50% of the total marks). Suggested time 1 hour.
Attempt all 25 multiple choice questions from this section. Each question carries 2 marks. There is no additional penalty for answering a
question incorrectly.
Make sure your Matriculation Number is on the Multiple Choice
Answer Sheet and it is left along with your answer script book when
you leave the examination hall.
Section B: (Worth 50% of the total marks). Suggested time 1 hour.
Attempt the two questions from this section by answering them in your
script book. Each question carries 25 marks.

YOU MUST HAND IN THIS EXAM PAPER AT THE END OF THE EXAM.
DO NOT TURN OVER THIS EXAM PAPER UNTIL
YOU ARE INSTRUCTED TO DO SO.
Page 1 of 13

SECTION B
Attempt both questions in this section; each is worth 25 marks.
1.

A database will be made to store information about patients in a hospital.


On arrival, each patients personal details (name, address, and telephone
number) are recorded where possible, and they are given an admission
number. They are then assigned to a particular ward (Accident and Emergency, Cardiology, Oncology, etc.). In each ward there are a number of doctors and nurses. A patient will be treated by one doctor and several nurses
over the course of their stay, and each doctor and nurse may be involved
with several patients at any given time.
(a) Identify the entities, attributes and relationships in the above description.For
each relationship indicate if it is one-to-one, one-to-many or many-to-many.
[6 marks]
(b) Draw an entity-relationship diagram showing the items you identified.
[6 marks]
(c)

Explain carefully how you would represent the relationship between patients
and nurses by tables in an SQL database.
[2 marks]

(d) Outline how you might represent this scenario using a document-oriented
database such as CouchDB.
[6 marks]
(e)

Give five advantages or disadvantages of the approach suggested in part (d),


compared to an SQL database.
[5 marks]
[Total marks 25]

Page 12 of 13

2. (a) What is the difference between transient and persistent data?

[2 marks]

(b) Explain a total of eight advantages or disadvantages of using files instead of


relational databases for storing persistent data. Do not address Java-specific
issues in this part of the question.
[4 marks]
(c)

State whether you would use files or a relational database to implement the
following, and explain your decisions:
storage of the high score in a game
a record of modules offered by a university, and the students taking them
[4 marks]

(d) Name a mechanism that allows a Java program to interact with a relational
database using SQL, and describe briefly how it is used.
[4 marks]
(e)

Name another mechanism that allows a Java program to interact with a relational
database without using SQL, and describe briefly how it is used.
[4 marks]

(f)

Compare the advantages and disadvantages of the approaches mentioned in


parts (d) and (e).
[3 marks]

(g) If you were required to implement each of the examples in part (c) using Java
and a relational database, which of the above approaches would you use, and
why?
[4 marks]
[Total marks 25]

*** END OF PAPER ***

Page 13 of 13

Anda mungkin juga menyukai