You are on page 1of 7

EXAMINATION PAPER: ACADEMIC SESSION 2008/2009

Campus Maritime Greenwich

School Computing and Mathematical Sciences

Department Information System and Multimedia

Level Three

TITLE OF PAPER Database Design & Implementation

COURSE CODE COMP1302

Date and Time Monday 1st Dec 2008 (2 hours)

BAHRAIN 15:00 SAUDI ARABIA 16:00


BOTSWANA 15:00 SINGAPORE 18:30
GREECE 15:00 SRI LANKA 18:30
HONG KONG 18:30 SOUTH AFRICA 15:00
KENYA 16:00 SYRIA 14:00
LONDON 13:00 TANZANIA 16:00
MALAYSIA 18:30 TRINIDAD 09:30
MALTA 15:00 UAE 17:00
MAURITIUS 18:00 ZAMBIA 15:00

You MUST answer question 1 which is worth 40%.

Marks will be awarded for your best TWO answers to the remaining THREE questions.
Each question is worth 30% marks.

CALCULATORS AND ELECTRONIC DEVICES ARE OT PERMITTED


Final

1. (a) What are the objectives of query processing. Briefly discuss the most important
activity in this process.
[8 marks]

(b) Consider the diagram in Figure 1 below which shows occurrences of the
Interview relationship connecting occurrences of the entity types Interviewee
(candidate who apply for a job), Interviewer (the employee who conducts the
interview) and Job. Candidates can apply for more than one job and will be
given a date for an interview. After the interview takes place a record of the
interviewer and his/her decision will be kept in the DB.

Interviewee Interviewer
Interview
E1
R1
E2
R2
E3
R3
E4

J1

J2

J3

Figure 1 Job

(i) State the number of occurrences of the Interview relationship. [1 mark]

(ii) From the given occurrences diagram, identify the number of candidates
who had an interview. [2 marks]

(iii) What is the most popular job that most candidates applied for? [2 marks]

(iv) Given the further requirement that at least two interviewers must conduct
each interview and a candidate can apply and have an interview for one
job only, draw an Entity Relationship diagram showing the Interview
relationship between the three entity types Interviewee, Interviewer and
Job, including the cardinality and participation constraints. DO NOT
show any attributes on the diagram. [3 marks]

Database Design & Implementation


COMP1302
Page 2 of 7
Final

(c) Explain the difference between the natural join and the outer join. Illustrate your
answer with an example. [8 marks]

(d) The relational structure in Figure 2 below captures a snapshot of the database
tables of a small company database. A branch must have a manager and many
staff working in it. A staff can at most work in one branch.

Staff
staffNo fName lName position sex DOB salary branchNo
SA9 Mary Howe Assistant F 19/02/1970 9000 B007
SG14 David Ford Supervisor M 24/03/1958 18000 B003
SG37 Ann Beech Assistant F 10/11/1960 12000 B003
SG5 Susan Brand Manager F 03/06/1940 24000 B003
SG66 Ahmed Mansoor Manager M 19/08/2003 35000 B007
SL21 John White Manager M 01/10/1945 30000 B005
SL41 Julie Lee Assistant F 13/06/1965 9000 B005
SE65 Mohamed Abbas Driver M 29/10/1970 12000 B005

Branch
branchNo street city postcode
B002 56 Cover Drive London NW10 6EU
B003 163 Main Street Glasgow G11 9QX
B004 32 Manse Road Bristol BS99 1NZ
B005 22 Deer Road London SW1 4EH
B007 16 Argyll Street Aberdeen AB2 3SU

Figure 2—A snapshot of the database tables for a small company database

(i) Provide the output when the SQL code below is run against the database
snapshot. [4 marks]

SELECT f.fname+" "+f.lname as Fullname


FROM staff AS f, staff AS e
WHERE e.fname ='John' AND e.lname='White' AND
e.staffno <> f.staffno AND e.branchno = f.branchno;

(ii) Express the following request in SQL. [4 marks]


Find the number of male and females in each city.

Database Design & Implementation


COMP1302
Page 3 of 7
Final

(e) Only FOUR of the following statements are true. Write down the numbers of
the FOUR statements you believe to be true ONLY. Identifying more than
FOUR true statements will result in awarding ZERO for all this section.
DO NOT COPY ANY of the statements to your answer book.
[8 marks]

(i) A clustering index is usually specified on non-ordering, non-unique field


of a file.

(ii) In SQL the aggregate function Count(attributeame) includes all rows


with duplicate values in the specified attribute in the total calculated
number.

(iii) Cascade deletions means a row from the parent relation is deleted when
an associate row is deleted from another child relation.

(iv) A foreign key in a relation is always unique.

(v) Duplication of non-key fields should always be eliminated by applying


normalization techniques.

(vi) ODBC was created to enable connections to relational databases and


other table-like sources.

(vii) A composite object cannot be represented by a single relation.

(viii) For a one-to-many relationship between two objects, we place the key of
either relation into the other as a part of the primary key.

(ix) The World Wide Web is a network of distributed computers.

Database Design & Implementation


COMP1302
Page 4 of 7
Final

2. The relational structure below, Figure 3, captures a snapshot of the database tables of
a database system for a large veterinary practice. The practice keeps information on
Owner, Animal and Vaccines. Information on each animal vaccination is also stored.
These include the last and next vaccination date and the vet abbreviated name.
Vaccines are delivered in batches which are identified by their numbers.
There is only one owner for each animal. The primary key for each table is
underlined. That is, for tblOwner the primary key is Owner ID, for tblAnimal, is
Animal ID, for tblVaccine, it is Vaccine ID and for tblAnimalVaccine, it is the
composite key (Vaccine ID, Animal ID). The relationships diagram for this schema
is shown in figure 4 below.

tblAnimal tblAnimalVaccine
Animal_ID Name Gender Animal_Type Description Date_of_Birth Owner_ID Vaccine_ID Animal_ID Vaccination_Date Next_Vaccine Vet
3 Snoop M Dog Weimaraner 17/04/1985 13 8 21 01/04/2001 01/04/2003 NAZ
4 Nate M Dog Pointer 14/05/2000 6 9 3 17/04/2000 17/04/2004 DRE
10 Shaneinda M Cat Burmese 11/11/2001 12 10 10 28/12/2001 28/11/2002 JDE
11 Erikonia F Dog Dalmation 16/12/2001 13 12 16 09/03/2001 09/11/2002 JDE
12 Wanton M Gerbil Indian 12/12/1998 14 12 23 18/07/2001 18/07/2003 DRE
13 Knowles M Cat Balinesecat 03/05/1999 15 14 13 19/06/2000 19/06/2005 NAZ
16 Bertuolus F Rabbit English 08/02/2001 18 14 18 26/05/1999 26/05/2003 NAZ
18 Paloma F Cat Persian 11/06/2001 8 16 11 17/12/2001 17/12/2002 JDE
19 Pharoe Monch M Gerbil Mongolian 04/05/1994 9 21 4 29/06/2001 29/06/2004 JDE
21 Grinapose F Dog Poodle 29/09/1995 12 22 19 16/07/2001 16/07/2003 DRE
22 Grayben M Cat Siamese 24/02/1998 13
tblVaccine
23 Rizapus F Rabbit Dutch dwarf 22/12/1992 6
Vaccine_ID Vaccine Batch_Number
tblOwner 8 Neomix 1111
Owner_ID Title Initial Surname Address Postcode Telephone_Number 9 AntiParvovirus 1234
6 Mr B Rhymes 13 Gthang Street, Gthange, Welling WE1 3ER (02079) 589359 10 Liquamycin 5678
8 Mrs Y Keith 12 Westside, Yeam, Junina GA1 2ER (01322) 887669 11 Synovex 9876
9 Ms W Beotchie 12 Wah Street, Lil boon, Westside WE1 8WA (02079) 91993 12 Penicillin 6543
12 Mr X Carter 1001 Coolgroovers Street, East Wickham QQ1 2WE (0208 ) 999555 14 Tricat 1111
13 Ms L Kenedy 56 Dudeman Avenue, Where, Thereheare FK47 8FY (02432) 887870 16 Recombitek 6543
14 Dr P Poolinda 99 Duddley Road, Bexley, Kent DK84 9TU (54540) 454854 18 PureVax 9876
15 Master U Monche 66 Eatme, Noelled, Bizzletown FF35 9GG (21240) 436046 21 Virkon 6543
18 Dr L Bush 44 Wearehere, Eminda, London GG54 9GG (03015) 043415 22 Phoenectin 1234
23 Ivomec 6543

Figure 3 —A snapshot of the database tables for the medical research institute

Figure 4 — Relationships diagram for the above database

Database Design & Implementation


COMP1302
Page 5 of 7
Final

(a) A set of applications has been planned against the database. You have been
asked to express the following requests in SQL (Structured Query Language).
Referential integrity (cascade, delete & update) is maintained automatically by
the system. [5 marks each]

(i) Remove all information for any unused vaccines.

(ii) A new vet, AAZ, has been appointed to take over treatments of all cats.
Modify the DB so all cats are only treated by AAZ.

(iii) List the identification numbers of all owners who owns more than one
animal.

(b) Another set of applications has been already coded in SQL. For each of the
given SQL code statements below produce the output using the data from the
above tables. Present your answer in a table format using column headers as
they appear in the query. Ignore any data modification that might have resulted
from executing the SQL statements that you have produced in section (a)
above. [3 marks each]

(i) SELECT A.Name, A.Description, A.Date_of_Birth


FROM tblAnimal A, tblAnimalVaccine AV
WHERE AV.Vet='JDE'
AND AV.Animal_ID = A.Animal_ID
AND A.Animal_Type like 'Dog' ;

(ii) SELECT Animal_Type, Count(*) AS TotalNumber


FROM tblAnimal GROUP BY Animal_Type;

(iii) SELECT Vaccine_ID, Vaccine


FROM tblVaccine
WHERE Vaccine_ID IN
(SELECT Vaccine_ID FROM tblAnimalVaccine
GROUP BY Vaccine_ID HAVING Count(*) > 1);

(iv) SELECT AV.Animal_ID, AV.Next_Vaccine, O.Owner_ID, O.Surname,


O.Telephone_Number As Tel
FROM tblOwner AS O, tblAnimal AS A, tblAnimalVaccine AS AV
WHERE A.Animal_ID = AV.Animal_ID
AND A.Owner_ID = O.Owner_ID AND AV.Next_Vaccine < Now();
/* Note: the function now() returns the current date of the system --
assume today’s date is 29/11/2002 */

(v) SELECT Vaccine_ID, Vaccine


FROM tblVaccine
WHERE Batch_Number IN
(SELECT Batch_Number FROM tblVaccine
GROUP BY Batch_Number
HAVING Count(Vaccine_ID)=1);

Database Design & Implementation


COMP1302
Page 6 of 7
Final

3. (a) Computer Aided Software Engineering (CASE) tools are used to provide users
with facilities for capturing requirement specification, information modelling
and the design and evolution of the developed system.
Most existing CASE tools use relational database technologies as part of their
environment to support their operations. The relational technology is limited in
its support and cannot cater for new applications requirements such as dealing
with complex variable large objects, versioning, composite objects, associative
access with browsing ability, etc.
Discuss the suitability of Object Oriented Database technology over relational
technology in supporting the development of the new generation of CASE
tools. [15 marks]

(b) Security and recovery are two important functions of a database management
system, which are also involved with database administration. Various
facilities can be provided to aid both these functions. Explain what these
facilities are and use examples to demonstrate their role in database
administration. [15 marks]

4. You have been consulted by a team of developers building a data warehouse for a
large international company with many specialised departments all over the country
who would maintain some degree of autonomy. The team’s main objective is to
provide access to vast quantities of data in a cost-effective manner for a large number
of users.

(a) Explain a suitable implementation strategy that could be used to achieve this
objective and identify any issues associated with the development of this
strategy. [10 marks]

(b) Discuss the advantages that could be gained by implementing the proposed
strategy and give examples to illustrate your answer. [12 marks]

(c) Contrast your proposed implementation strategy in (a) above to a similar


technique that is used in building a Distributed Database to gain similar
advantages. [8 marks]

Database Design & Implementation


COMP1302
Page 7 of 7

You might also like