You are on page 1of 5

UNIVERSITY OF MAURITIUS

FACULTY OF INFORMATION, COMMUNICATION AND


DIGITAL TECHNOLOGIES

SECOND SEMESTER EXAMINATIONS

May 2018

PROGRAMME BSc Computer Applications (Part-Time)

MODULE Database Systems I – SPECIAL PAPER


NAME

DATE (to be filled by Exam MODULE CODE CSE1005


Section)

TIME (to be filled by Exam DURATION 2 hours


Section)

NO. OF 4 NO. OF QUESTIONS 4


QUESTIONS TO BE ATTEMPTED
SET

INSTRUCTIONS TO CANDIDATES

Answer ALL questions.


Database Systems I – CSE 1005 (1)

Question 1 [Total 25 marks]


(a) Consider the following scenario:

Submitin is a Manuscript Submission Management System. A manuscript


is submitted by an academic, but it is authored by several academics. Once
a manuscript is submitted, it is assigned to an editor who handles
submissions belonging to a specifc area of research. An editor handles
manuscripts belonging to one research area at any point in time. However,
over the years, an editor may have handled several research areas.
A manuscript is characterized by a unique identifer, title, type, date, and a
set of keywords. An academic is characterized by an identifer and name.
An academic is affliated with an institution which is either a university or
a research centre, but not both. An institution is characterized by an
identifer, name, address. A research area is characterized by a unique
code and a name.

Create an Entity-Relationship diagram that captures the information given.


Be certain to identify all entities, attributes, primary keys, relationships and their
cardinality. In addition, be certain to identify (if any) weak entities, subclasses
and superclasses.
[15 marks]
(b) Consider the following Entity-Relationship (ER) diagram for a public library.

(Continued on next page)

Page 1 of 4
Database Systems I – CSE 1005 (1)

Question 1 Continued
1. Map the ER diagram into a relational database schema. Be certain to specify
all primary keys (solid underline) and foreign keys (dotted underline).
2. Using your database schema in part (1) as example, explain what Referential
integrity means.
[8 + 2 marks]
Question 2 [Total 25 marks]

Consider the following table CineMovieSales which shows sample data from the sale
of movie tickets across several cinemas in the UK. Each cinema has a manager who
records the sales fgure for each flm projected at his/her cinema. A manager may
manage more than one cinema. Note: the table gives a complete representation of the
scenario.

Film Film Cinema Cinema Cinema Manager Manager Sales


No Name No Name Location No Name
15 Arthur 1 Odeon Swansea M01 George Brown £220.00
15 Arthur 2 ABC Cardiff M01 George Brown £170.00
15 Arthur 3 Embassy Aberdeen M03 Jane Smith £500.00
45 Titanic 1 Odeon Swansea M01 George Brown £600.00
45 Titanic 2 ABC Cardiff M01 George Brown £880.00
45 Titanic 3 Embassy Aberdeen M03 Jane Smith £290.00
45 Titanic 4 Napoleon Edinburgh M03 Jane Smith £430.00
71 Rocky 1 Odeon Swansea M01 George Brown £180.00
71 Rocky 5 Gaumont Warwick M02 Sean Connery £125.00
78 Jaws 2 ABC Cardiff M01 George Brown £150.00
78 Jaws 3 Embassy Aberdeen M03 Jane Smith £200.00
78 Jaws 5 Gaumont Warwick M02 Sean Connery £290.00

Table CineMovieSales

(a) Briefy explain the purpose of normalization.


[2 marks]
(b) Briefy explain what lossless decomposition is.
[2 marks]
(c) State, with reason, in which normal form the table CineMovieSales is.
[2 marks]
(d) The table CineMovieSales is susceptible to modifcation anomalies: insertion,
deletion and update anomalies. Using examples from the table CineMovieSales,
explain each modifcation anomaly.
[3 x 3 marks]
(Continued on next page)

Page 2 of 4
Database Systems I – CSE 1005 (1)

Question 2 Continued
(e) Identify four full functional dependencies represented by the table CineMovie-
Sales.
[4 marks]
(f) Normalize the table CineMovieSales to 3NF. Describe all the steps. Identify the
primary and foreign keys in all your relations.
[6 marks]

Question 3 [Total 25 marks]


Consider the database “Shop” whose relations are given below. The database keeps
track of products, suppliers, orders and customers. Primary keys are underlined and
foreign keys are in italics.

customer(customerID, frstName, lastName, city)


supplier(supplierID, name, street, city, phone, email)
product(productID, name, unit_price, stock, supplierID)
order(customerID, productID, date, quantity)

(a) Write the following queries in Relational Algebra:

1. List the details of all products with a stock less than 50, and supplied by
supplierID ”S12”.
[3 marks]
2. For each supplier, give the number of products supplied.
[2 marks]
3. List the product ID and name of all products supplied by “Galaxy”.
[3 marks]
4. List the details of all products except “electric kettle”.
[3 marks]
(b) Write the following queries in SQL:

1. Add the following product to the database: name “heater”, productID


“P777”, price £100, stock level 10, and supplierID “S13”.
[2 marks]
2. Increment the stock of the product with ID “P777” by 100.
[2 marks]
3. List the details of products whose name consists of “electric kettle” and with
a stock of less than ten.
[3 marks]
4. For each supplier, give the number of products supplied.
[2 marks]
5. List the details of products supplied by “Galaxy” and which have been
ordered by customer “John Lewis”.
[5 marks]

Page 3 of 4
Database Systems I – CSE 1005 (1)

Question 4 [Total 25 marks]


(a) Defne the atomicity, durability, isolation, and consistency preservation
properties of a database transaction.
[4 x 2 marks]
(b) Briefy describe the following two potential problems which may occur when
database transactions are run concurrently in an uncontrolled manner.
1. Lost update problem
2. Uncommitted dependency (or dirty read) problem
[2 + 2 marks]
(c) State, with reason, the type of problem which occurs in the following database
schedule.
T1 T2
read(X)
read(Y)
If X> 1000 then Y=X-1000
read(Y)
read(Z)
Y=Y-Z
write(Y)
read(Z)
write(Y)
Z=X+500
write(Z)

[2 marks]
(d) Briefy describe four reasons why transactions fail.
[4 x 2 marks]
(e) Explain the purpose of a system log in transaction recovery.
[3 marks]

END OF QUESTION PAPER

Page 4 of 4

You might also like