2013 Exam
2013 Exam
That this examination paper assesses the ILOs defined in the module *
specification
That appropriate model answers were provided with this *
examination paper
That this examination paper has been proof-read and is approved for *
printing
That this examination paper follows the approved University *
template
Date of examination
Graph paper
Other
Page 1 of 1
13CSIS03C
Final Examination,
2013-2014
Module Title
Database Systems
Module Leader Semester
Dr. Doaa Elzanfaly One
Equipment allowed (for example
calculator) None
Instructions to Students
b. Discuss two significant impacts of handling redundant data. You may use
examples. [8 marks]
[8 marks]
[Total: 20 marks]
Q2
[4 marks]
[6 marks]
v. Supper Key
[10 marks]
[Total: 20 marks]
Page 1 of 5
Q3. The following ERD represents the relationship between students and the
Grade
Name Code Title
ID
M N
Student Studies Module
[5 marks]
[7 marks]
periods? Explain your choice with a justification of not choosing the other
one. …
d.
… … …
Overtime
1 M
Employee Has Overtime Employee
(i) (ii)
[8 marks]
[Total: 20 marks]
Page 2 of 5
Q4. Assume that we have a product database consisting of two relations with
Product(PID,PNAME)
Component(CID,CNAME,WEIGHT,COST,PID)
a. Formulate an SQL query that retrieves the product id, name and the
[6 marks]
What does this query mean (express the meaning in one short English
[8 marks]
[6 marks]
[Total: 20 marks]
Page 3 of 5
Q5.
algebra that retrieves the product id and name, the component id and
[5 marks]
b. Consider relation R(A, B) and S(A, C), where R has 200 tuple and S has
100 tuple, and A is a key for R. What is the estimated number of tuples for
ii. b (R)
v. RXS
[10 marks]
[5 marks]
[Total: 20 marks]
Page 4 of 5
Q6 Consider the following relation:
Assume that a car may be sold by multiple salesmen and hence {CAR#,
Price ―› Discount
Salesman# ―› Commission
relation.
[4 marks]
b. Is this relation in the 2NF? Justify your answer and decompose the
schema if necessary.
[8 marks]
perform it.
[8 marks]
[Total: 20 marks]
Page 5 of 5
Model Answer
Module Code
Final Examination,
2012-2013
Module Title
Database Systems
Module Leader Semester
Dr. Doaa Elzanfaly One
Equipment allowed (for example
calculator) None
Instructions to Students
Page 1 of 9
Q1. Controlling data redundancy and support of multiple views of data are two
b. Discuss two significant impacts of handling redundant data. You may use
examples.
Data redundancy leads to several problems. First, there is the need to perform a
single logical update—such as entering data on a new student—multiple times:
once for each file where student data is recorded. This leads to duplication of
effort. Second, storage space is wasted when the same data is stored
repeatedly, and this problem may be serious for large databases. Third, files that
represent the same data may become inconsistent. This may happen because
an update is applied to some of the files but not to others. Even if an update—
such as adding a new student—is applied to all the appropriate files, the data
concerning the student may still be inconsistent since the updates are applied
independently by each user group. On the other hand, data redundancy may be
useful for improving the performance of queries. By placing all the data together,
we do not have to search multiple files to collect this data. In such cases, the
DBMS should have the capability to control this redundancy so as to prohibit
inconsistencies among the files.
[4 marks for nominating two impacts and 4 marks for the appropriate level of
discussion]
[8 marks]
Page 2 of 9
c. Is there any contradiction between controlling redundant data and
providing multiple views of the same data in DBMSs? Justify your answer.
[Total: 20 marks]
Q2
The goal of the three-schema architecture is to separate the user application and
the physical database in order to fulfill the concept of data independence. Data
independence means, the capacity to change the schema at one level of
database system without having to change the schema at the next higher level.
[4 marks]
Page 3 of 9
[6 marks]
c. Explain, through an example, the following database concepts:
Q3. The following ERD represents the relationship between students and the
Grade
Name Code Title
ID
Student
M N Module
Studies
Page 4 of 9
a. Is it possible to use the hierarchal data model to represent this
periods? Explain your choice with a justification of not choosing the other
one. …
… … …
Overtime
Employee
1 M
Has Overtime Employee
(ii) (ii)
Page 5 of 9
Both schemas are correct. The week entity can be represented as a complex
attribute in the owner relation. The mapping will result in two relations one for the
employee and the other for his overtime periods with a composite primary key.
[3 marks for the correct answer and 5 for the justification]
[8 marks]
[Total: 20 marks]
Q4. Assume that we have a product database consisting of two relations with
Product(PID,PNAME)
Component(CID,CNAME,WEIGHT,COST,PID)
a. Formulate an SQL query that retrieves the product id, name and the
What does this query mean (express the meaning in one short English
The query retrieves the product name and its’ components names that weight
1.5, 2.5, or 3.5.
The equivalent query:
SELECT P.PNAME, C.CNAME
Page 6 of 9
FROM Product P, Component C
WHERE P.ID = C.PID
AND C.WIEGHT = ‘1.5’ OR C.WIEGHT = ‘2.5’ OR C.WIEGHT = ‘3.5’
[5 for the query meaning and 3 for the equivalent query]
[8 marks]
Q5.
algebra that retrieves the product id and name, the component id and
100 tuple, and A is a key for R. What is the estimated number of tuples
for the results of the following algebra operations? Explain your answers.
100 tuple or less because the select operation is used to select a subset of
the tuples from a relation that satisfy a selection condition.
Page 7 of 9
ii. b (R)
200 tuple or less because the project operation removes any duplicate
tuples.
200 tuple or less as the result of this operation is a relation that includes all
tuples that are in R but not in S.
300 tuple or less as the result of the union operation is a relation that
includes all tuples that are either in R or in S or in both R and S. Duplicate
tuples are eliminated.
v. RXS
The type of an entity is defined by the attributes it possess values and the
relationship types in which it participates. Because an entity in a subclass
represents the same real-world entity from the superclass, it should possess
values of its specific attributes as well as values of its attributes as a member of
the superclass. So, an entity that is a member of a subclass inherits all the
attributes of the entity as a member of the superclass. The entity also inherits
all the relationships in which the superclass participates.
[3 marks for the discussion and 2 marks for the reason]
[5 marks]
[Total: 20 marks]
Page 8 of 9
Q6 Consider the following relation:
Assume that a car may be sold by multiple salesmen and hence {CAR#,
Price ―› Discount
Salesman# ―› Commission
relation.
Update anomaly: Updating the primary key of this relation with a redundant or
null value.
[4 marks]
b. Is this relation in the 2NF? Justify your answer and decompose the
schema if necessary.
This schema is not in the 2NF as the Commission functionally depends on the
Salesman#. To be in the 2NF all non-key attributes should fully functionally
depend on the key attribute(s). The schema in the 2NF:
CAR_SALE( Car#, Salesman#, Date, Price, Discount)
Sales_Comm(Salesman#, Commission)
[8 marks]
c. Argue whether further normalization to 3NF is necessary, and if so,
perform it.
Page 9 of 9
Module Code: 13CSIS03C Title: Database Systems
Modular weight: 10 Examination weighting: 50 %
Prerequisite modules: CSCI02P
Reassessment: No restriction.
Module Leader: Assoc. Prof. Doaa El-Zanfaly
Semester taught: 1
Key words: Database Models, Database Management Systems DBMS, Relational
Databases, Entity- Relationship Model, ER Model, Querying Languages, SQL
Date of latest revision: Aug. 2013
Aims
The aim of the module is to give students a sound understanding of the
theoretical concepts and practical issues that influence the design and
implementation of database systems and associated querying languages, and
build an appreciation of the role of database systems in information
management. The module integrates database theory with a hands-on approach
to database design and implementation considering both the theory and the
applied design and implementation issues involved.
Intended Learning Outcomes
Upon successful completion of this module students should demonstrate
understanding and ability in:
Knowledge and understanding
1. The role of database systems in information management; [1]
2. Theoretical properties of relational databases and the methods for their
design and implementation; [1]
Subject-specific skills
3. Fundamental concepts of data modelling and identify the various models
available and the difference between them; [2]
4. Demonstrate a systematic method of using the concepts and properties of the
relational database model to develop simple database systems; [9]
5. Use Structured Query Language (SQL) to access and manipulate data in
relational databases; [5]
Key/transferable skills
6. Analyse requirements to develop appropriate problem solutions, which
will also help develop:
a. an analytical approach to interpreting problem specifications and
develop a systematic approach to problem-solving; and [3]
b. technical documentation and report writing skills; [12]
7. Develop interpersonal skills working, communicating and collaborating in
a team on assigned projects as well as planning and managing personal
time; and [13]