0% found this document useful (0 votes)
196 views

Inheritance PDF

The document provides information about a database exam for a Software Engineering program, including: 1) The exam is for the module Database Systems, to be held on May 14th 2014 from 09:30-12:30 for BSc (Hons) Software Engineering students. 2) The exam contains 5 questions of equal mark value, and students must answer all questions. 3) Question 1 involves deriving a relational schema from an ER diagram describing a property management company and normalizing a table to 3NF. 4) Question 2 involves writing relational algebra and SQL queries on tables describing employees, aircrafts, flights and employee certifications. 5) Questions 3-5 involve constructing

Uploaded by

Gajadhur Amisha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
196 views

Inheritance PDF

The document provides information about a database exam for a Software Engineering program, including: 1) The exam is for the module Database Systems, to be held on May 14th 2014 from 09:30-12:30 for BSc (Hons) Software Engineering students. 2) The exam contains 5 questions of equal mark value, and students must answer all questions. 3) Question 1 involves deriving a relational schema from an ER diagram describing a property management company and normalizing a table to 3NF. 4) Question 2 involves writing relational algebra and SQL queries on tables describing employees, aircrafts, flights and employee certifications. 5) Questions 3-5 involve constructing

Uploaded by

Gajadhur Amisha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

UNIVERSITY OF MAURITIUS

FACULTY OF ENGINEERING

SECOND SEMESTER EXAMINATIONS

MAY 2014

PROGRAMME BSc (Hons) Software Engineering

MODULE NAME Database Systems

DATE Wednesday MODULE CODE CSE 1012Y(1)


14 May 2014

TIME 09:30 – 12:30 Hrs DURATION 3 hours

NO. OF 5 NO. OF QUESTIONS 5


QUESTIONS SET TO BE ATTEMPTED

INSTRUCTIONS TO CANDIDATES

Answer ALL questions.

All questions carry equal marks.


DATABASE SYSTEMS – CSE 1012Y(1)

Question 1 [Total 20 Marks]

Database Design consists mainly of the creation of an accurate representation of data,


relationships between the data and constraints on the data that is pertinent to the
enterprise. Two techniques used consist of Entity-Relationship (ER) Modeling and
Normalization.

(a) Consider the ER model for the following scenario:

A residential property management company employs a number of staff and has


a number of properties on its books. Each member of staff has a unique staff id,
name, address, contact number and date of employment. Each staff may belong to
one or more department. The name and location of each department need to be
stored. The date that an employee joined a department also need to be stored.
Each property is given a unique id on being taken on by the estate agent. In
addition it has an address, area, type (for example, detached, apartment or
terraced), number of bedrooms, rent per month and lease period in months. Each
property is allocated to one member of staff who may manage a number of
properties. Each property belongs to one customer, who is either the owner or the
tenant, but not both. One customer can own or rent more than one property.
Customers have a unique customer id, name and contact number. In addition, all
owners have an address and bank details and all tenants have a deposit balance.

Derive a relational schema (database tables) from the ER diagram. Specify all
necessary primary keys, foreign keys and any other constraints.
[10 marks]

…/Cont’d next page

Page 1 of 6
DATABASE SYSTEMS – CSE 1012Y(1)

Question 1 [Cont’d]

(b) Normalization is the process of decomposing unsatisfactory “bad” relations by


breaking up their attributes into smaller relations. Table 1 below displays the
details of the roles played by actors/actresses in films.

Table 1

filmNo fTitle dirNo director actorNo aName role timeOnScreen


F1100 Happy D101 Jim Alan A1020 Sheila Jean 15.45
Days Toner Simson
D101 Jim Alan A1222 Peter Watt Tom 25.38
Kinder
D101 Jim Alan A1020 Sheila Silvia 22.56
Toner Simpson
F1109 Snake D076 Sue A1567 Steven Tim Rosey 19.56
Bite Ramsay McDonald
D076 Sue A1222 Peter Watt Archie Bold 10.44
Ramsay

Normalize Table 1 to 3NF, showing all the intermediate normal forms, relations
and functional dependencies. Clearly specify all assumptions made.
[10 marks]

Page 2 of 6
DATABASE SYSTEMS – CSE 1012Y(1)

Question 2 [Total 20 Marks]

The following tables form part of a database held in a Relational Database Management
System:
Employee (empNo, eName, salary, position)
Aircraft (aircraftNo, aName, flyingRange)
Flight (flightNo, from, to, flightDistance, departTime, arriveTime)
Certified (empNo, aircraftNo)
Where
 Employee contains details of all employees (pilots and non-pilots) and empNo is
the key.
 Aircraft contains details of aircraft and aircraftNo is the key.
 Flight contains details of the flights and flightNo is the key.
 Certified contains details of the staff who are certified to fly an aircraft, and
empNo/aircraftNo form the key.

(a) Formulate the following queries in Relational Algebra:

(i) List the employee numbers of pilots certified for Boeing aircraft.
[3 marks]

(ii) List the aircraft that can fly nonstop from Glasgow to New York. Note that
the flying range of the aircraft is greater than the flight distance.
[4 marks]

(b) Write SQL statements for the following queries:

(i) List the names of pilots certified for Boeing aircraft.


[3 marks]

(ii) List the employee numbers of employees who have the highest salary.
[3 marks]

(c) Consider the details of the employee table below:

Column Data type Nullability


empNo char(3) Not null
eName varchar(30) Not null
salary integer Not null
position varchar(30) Not null

Write a stored procedure sp_del_emp that takes an employee number and deletes
the employee if he/she exists. An appropriate message is displayed indicating if
deletion is successful or not. In case any error is raised, it is notified in the form of
an error message.
[7 marks]

Page 3 of 6
DATABASE SYSTEMS – CSE 1012Y(1)

Question 3 [Total 20 Marks]

(a) Dynamic Multilevel Indexes can be implemented using B+ trees. In a B+ tree, data
pointers are stored only at the leaf nodes of the tree, which are usually linked
together for ordered access on the search field.

(i) Construct a B+ tree of order p=3 and pleaf=2 for the following set of key
values, inserted in the order in which they appear: 2, 3, 5, 7, 11, 17, 19, 23,
29.
[8 marks]

(ii) From your resulting B+ tree of part (i) delete the following key values in
the given order: 29, 23
[4 marks]

(b) Hashing is a technique that provides fast access to records on certain search
conditions.

(i) Describe two methods in internal hashing which can be used to resolve
collisions when records hash to a bucket which is already full.
[2 x 2 marks]

(ii) Give two advantages of extendible hashing compared to static hashing.

[2 x 2 marks]

Page 4 of 6
DATABASE SYSTEMS – CSE 1012Y(1)

Question 4 [Total 20 Marks]

One of the most desirable features for a Database Management System (DBMS) is
concurrency control. Locks are used in DBMSs to control concurrency in transaction
processing systems.

(a) Two types of locking commonly used by DBMSs are Binary Locks and
Read/Write Locks. Explain how Read/Write Locks are better than binary locks.
[4 marks]

(b) Consider the following transactions T1 and T2 for a banking application (Table 2)
and a possible concurrent execution of the two transactions (Table 3)

T1: Transfer Rs100 from account X to account Y.


T2: Calculate the total balance of all accounts.

T1 T2 T1 T2

Table 2

Table 3

(i) Assume that the initial values of A, B and C are 200, 300 and 100. If the
transactions did not execute concurrently, the final value of Sum would be
600. However, with the interleaving of T1 and T2 shown in Table 3 above,
the final value of Sum would be 500. Describe the problem that occurred in
Table 3.
[4 marks]
(ii) Add lock and unlock instructions to T1 and T2 which satisfy Two-Phase
Locking protocol (2PL). Assume that locks are requested only when they
are required and are released as soon as possible. Your answer should also
show a possible interleaving such that the problem in (b) (i) no longer
arises.
[12 marks]
Page 5 of 6
DATABASE SYSTEMS – CSE 1012Y(1)

Question 5 [Total 20 Marks]

(a) Describe the three levels of the Three-Schema Architecture of a DBMS.


[6 marks]

(b) A data warehouse integrates multiple databases and other information sources
into a single repository. It is well equipped for providing the data for data mining.

(i) Discuss how a data warehouse is different from traditional databases.


[4 marks]

(ii) Explain what the purpose of data mining is.


[4 marks]

(c) Distributed Databases integrates of Database Systems and Computer Networks


to produce more powerful system than either one alone. Two major promises of
Distributed Databases are: Higher Reliability and Improved Performance.
Explain how Distributed Databases are more reliable and have better performance
than Centralized Databases.
[6 marks]

END OF QUESTION PAPER


/ph

Page 6 of 6

You might also like