Professional Documents
Culture Documents
Level Three
Marks will be awarded for your best TWO answers to the remaining THREE questions.
Each question is worth 30% marks.
1. (a) What are the Database Administrator (DBA) ? List three of them with brief
explanations.
If we assume that the DBA is never interested in running his or her own
queries, does the DBA still need to understand query optimisation? Justify your
answer.
[8 marks]
(b) Consider the diagram in Figure 1 below which shows occurrences of the
WorksIn relationship connecting occurrences of the entity types Person,
Department and Location.
Person Department
WorksIn
P1
D1
P2
D2
P3
D3
P4
L1
L2
L3
Location
Figure 1
(ii) From the given occurrences diagram, identify the degree of the WorksIn
relationship. [1 mark]
(iii) From the given occurrences diagram, list the departments that are located
at location “L2”. [2 marks]
(iv) From your answer to (iii) and given the further requirement that a
Department must have a location and at least one employee working in it,
draw an Entity Relationship diagram showing the WorksIn relationship
between the three entity types Person, Department and Location,
including the cardinality and participation constraints. DO NOT show
any attributes on the diagram. [4 marks]
(c) A newsagent’s shop is one in a chain of 500 shops that is part of a national
company. Each shop typically offers for sale supplies of twelve daily newspapers,
six Sunday papers with supplements, and eighty monthly magazines. Each shop
holds details of each newspaper or magazine on the computer in a flat file with
fixed length records. Some titles are shared between newspapers and magazines.
For each of the following sections, write down the letter corresponding to the
statement you believe to be true. DO NOT COPY the statement to your answer
book.
(i) At each shop and for each record in the above file a two-character code
representing the title is introduced to speed up processing. This code should
be defined as:
(a) Required and Unique for each newspaper or magazine.
(b) Required but Not Unique for each newspaper or magazine.
(c) Required and Unique for each newspaper but not for magazine.
(e) Required and Unique for each magazine but not for newspaper.
[1 mark]
(ii) The manager of each shop evaluates various specialized packages and
Database management systems for the running of a newsagent’s shop. All
mangers agree to purchase a Relational Database management system. The
advantage of using the DBMS rather than a tailor-made software package in
the running of a newsagent’s shop:
(a) is readily available and has large user-base.
(b) has built-in facilities that satisfy the newsagent’s shop.
(c) incurs no extra cost for building the system.
(d) is already tested and customized.
[1 mark]
(iii) The newsagent’s shop has between 100 and 500 customers who have
accounts. These customers have papers delivered and magazines ordered
regularly. Their individual accounts are payable weekly. A customer who
order many newspapers and magazines, get them delivered in the
appropriate round. The newsagents update their filing system to use a
relational database. Potential entities are Customer, Newspaper, Account
and Round. The relationship between Customer and Newspaper tables
would be:
(a) 1:1 (b) 1:N (c) N:1 (d) M:N
[2 marks]
(iv) In the relational schema for the above application, Account_ID should
appear in which table(s)?
(a) Account Table (b) Customer Table
(c) In all tables of the database (d) Both (a) and (b)
[2 marks]
(v) The newsagent is part of a national company that runs 500 shops. Its local
server is connected to a computer network at the company’s head office. At
the end of each day, sales data is transferred electronically to the head office
computer. When the data has arrived from all of the shops, the head office
computer runs a routine to update its master files. The major characteristic
of this type of processing is, it:
(a) has large volume of similar transactions.
(b) has large volume of different types transactions.
(c) requires human interaction as data entry clerks.
(d) can commence processing once part of the data ready.
[2 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
SL21 John White Manager M 01/10/1945 30000 B005
SL41 Julie Lee Assistant F 13/06/1965 9000 B005
SG66 Ahmed Mansoor Manager M 19/08/2003 35000 B007
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 m.fname+" "+m.lname as Fullname
FROM staff AS m, staff AS e
WHERE e.fname ='Mary' AND e.lname='Howe' AND
e.staffno <> m.staffno AND e.branchno = m.branchno AND
m.position = 'Manager';
(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) Not all queries written in SQL can be expressed in Relational Algebra or
Relational Calculus.
(iv) Logical Data Independence is achieved through the separation of the two
abstraction levels defined in the conceptual & physical schemas.
(v) In an ERD, a fan trap may occur when 1:m relationships fan in from a
single entity.
2. The relational structure below, Figure 3, captures a snapshot of the database tables of
a medical research institute. Most patients’ information is kept in tblPatient but
sensitive information is kept in tblPtConfidential. Some patients have no confidential
information at all. Access to the information in tblPtConfidential could be more
restricted than for tblPatient. A patient may be covered by multiple insurance plans,
and an insurance company covers multiple patients. Figure 4 below shows the logical
data model for this DB.
tblInsurer
InsurerId CompanyName Address City State ZipCode Phone
678 Smith Sisters Co 908 Mockingbird Lane Ft. Myers FL 78989 8134567897
13909 First Insurance 3456 22nd Road Alexandria VA 22182 7039086543
45790 Total Health 8027 Leesburg Pike Flint MI 45980 3137899988
tblPtConfidential
tblPatient
tblPtInsurancePgm
PatientId BirthDate Sex ECGClass DiagCode EntryDate
PatientId InsurerId
342 25/04/58 M 3 1 16/12/95
342 678
345 20/07/50 F 4 2 17/12/95 345 678
346 30/11/68 M 1 1 17/12/95 345 45790
350 10/10/35 F 5 13 20/12/95 346 13909
351 08/12/54 M 1 4 01/03/00 350 13909
352 06/01/42 F 2 4 04/01/96 350 45790
Figure 3 —A snapshot of the database tables for the medical research institute
(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]
(ii) List the full details of those patients who have no confidential
information.
(iii) List the name of all insurance companies and the number of patients
who are insured by them.
(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]
(b) You have been approached by an agent of Open Telecoms to discuss their
proposal for adopting and building a Data Warehouse. After discussions with
the agents of Open Telecoms, it occurs to you that Open Telecoms is facing a
problem of customer retention. Customers are free to move between
telecommunications providers and many regularly change suppliers. Such
customers are known as churn in the telecommunications industry. Open
Telecoms has a high churn rate with 20% of their customers changing suppliers
per annum. Therefore, the management of Open Telecoms has placed a high
emphasis on trying to find new ways of reducing this by trying to find answers
to the following questions:
• What is it that makes a customer churn?
• Are some customers more likely to churn than others?
• How can we identify these customers before they churn?
The agent further reveals to you that the directors of Open Telecoms think that
the information that would help them is locked away in their operational
database. Part of the Relational Schema of the Open Telecoms database is
given below:
After analysing the above relational schema, you suggest to the directors that it
might help if the Open Telecoms could trace the customers’ usage of the
network. The directors are in agreement with your suggestion and have
mandated you to proceed with the design of a data warehouse which should
help the company answer the three questions about churn. You are therefore
(i) Identify a suitable subject area for Open Telecoms’s data warehouse.
[3 marks]
(ii) Describe the facts you would record about the subject you have identified
in (i). [6 marks]
(iii) State the dimensions you would consider for the analysis. [6 marks]
or
(ii) building a database using affordable and relatively easy to use DBMS
such as Microsoft Access.
Write a report comparing and contrasting the above two options. Your discussion
should give a high-level overview of how various factors influence your choice
between using the different tools. In your answer, give relevant examples using
suitable applications to support your argument for each the above options.
[30 marks]