0% found this document useful (0 votes)
19 views19 pages

2013 Exam

The document is an examination paper for the Database Systems module, confirming that the paper has been proofed and approved for printing. It includes instructions for students, the structure of the exam, and a series of questions related to database concepts and practices. The exam is two hours long, and students are required to answer five out of six questions.

Uploaded by

qfzg7f99qd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views19 pages

2013 Exam

The document is an examination paper for the Database Systems module, confirming that the paper has been proofed and approved for printing. It includes instructions for students, the structure of the exam, and a series of questions related to database concepts and practices. The exam is two hours long, and students are required to answer five out of six questions.

Uploaded by

qfzg7f99qd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Examination Paper Proofing &

Printing Confirmation Sheet

Module Title : Module Code:


Database Systems 13CSIS03C
Module Leader Semester
Dr. Doaa Elzanfaly One
Proofed by Date of examination
Dr. Omar Karam
I hereby confirm:

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

Signed (Proof Reader): Dr. Omar Karam

Printing instructions & stationery requirements

Number of copies of examination paper to be printed

Date of examination

Number required per


student
Stationery Requirement(s) 8 page answer book

12 page answer book

Graph paper

Other

Signed (Module Leader) Dr. Doaa Elzanfaly

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

 You are required to attempt only FIVE questions out of SIX.


 The exam paper is 5 pages long.
 The approximate allocation of marks is shown in brackets by the
questions.
 This examination is 2 hours long.

This examination is ____Two_____ hours long.

[Turn Over (only when instructed to do so)/]


Q1. Controlling data redundancy and support of multiple views of data are two

main characteristics to differentiate between managing data using the DBMS

approach and the traditional file system.

a. Define these two characteristics? [4 marks]

b. Discuss two significant impacts of handling redundant data. You may use

examples. [8 marks]

c. Is there any contradiction between controlling redundant data and providing

multiple views of the same data in DBMSs? Justify your answer.

[8 marks]

[Total: 20 marks]

Q2

a. What is the main goal of using three-schema architecture (external,

internal, and conceptual schemas) when developing a database?

[4 marks]

b. Explain the difference between these three schemas

[6 marks]

c. Explain, through an example, the following database concepts:

i. Entity integrity constraint

ii. Participation constraint

iii. Database Recovery

iv. Multi-valued attribute

v. Supper Key
[10 marks]

[Total: 20 marks]

Page 1 of 5
Q3. The following ERD represents the relationship between students and the

modules they are studying.

Grade
Name Code Title
ID

M N
Student Studies Module

a. Is it possible to use the hierarchal data model to represent this

relationship? Justify your answer.

[5 marks]

b. Explain the implementation of such a relationship in the relational model.

[7 marks]

c. Which of the following two ER schemas is more appropriate for

representing the relationship between an employee and his overtime

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

the following schemas (primary keys are underlined):

Product(PID,PNAME)

Component(CID,CNAME,WEIGHT,COST,PID)

a. Formulate an SQL query that retrieves the product id, name and the

number of components that each product consists of.

[6 marks]

b. Consider the following query:

SELECT P.PNAME, C.CNAME

FROM Product P JOIN Component C ON P.PID=C.PID

WHERE C.WEIGHT IN (‘1.5’, ‘2.5’, ‘3.5’)

What does this query mean (express the meaning in one short English

sentence)? Write an equivalent SQL query without using the IN operator

and the JOIN clause.

[8 marks]

c. It is often claimed that the join operator is the bottleneck in relational

database query processing. Why? Suggest how queries involving joins

may be optimised heuristically.

[6 marks]

[Total: 20 marks]

Page 3 of 5
Q5.

a. Using the product database schema in Q4, formulate a query in relational

algebra that retrieves the product id and name, the component id and

name, and the weight of the product

[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

the results of the following algebra operations? Explain your answers.

i. <selection condition> (S)

ii.  b (R)

iii. R – S (assuming type compatibility)

iv. R U S (assuming type compatibility)

v. RXS

[10 marks]

c. The enhanced Entity Relationship (EER) model incorporates some object–

oriented concepts, such as inheritance, into the ER model. Discuss,

through an example, the mechanism of attribute and relationship

inheritance. Why is it useful?

[5 marks]
[Total: 20 marks]

Page 4 of 5
Q6 Consider the following relation:

CAR_SALE( Car#, Salesman#, Date, Price, Commission, Discount)

Assume that a car may be sold by multiple salesmen and hence {CAR#,

SALESMAN#} is the primary key. Additional dependencies are:

Price ―› Discount

Salesman# ―› Commission

a. Show one example for an insertion or update anomaly on the above

relation.

[4 marks]

b. Is this relation in the 2NF? Justify your answer and decompose the

schema if necessary.

[8 marks]

c. Argue whether further normalization to 3NF is necessary, and if so,

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

 You are required to attempt only FIVE questions out of SIX.


 The exam paper is 6 pages long.
 The approximate allocation of marks is shown in brackets by the
questions.
 This examination is 2 hours long.

This examination is ____Two_____ hours long.

Page 1 of 9
Q1. Controlling data redundancy and support of multiple views of data are two

main characteristics to differentiate between managing data using the

DBMS approach and the traditional file system.

a. Define these two characteristics?

Data redundancy is a data management issue that means storing unnecessary


duplicates of data. While providing multiple views of data means that a multiuser
DBMS whose users have a variety of applications must provide facilities for
defining multiple views. A view may be a subset of the database or it may contain
virtual data that is derived from the database files but is not explicitly stored.
[2 marks for explaining each characteristic]
[4 marks]

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.

There is no any contradiction between controlling redundant data and providing


multiple views for different users when using the database approach. The views
of different user groups are integrated during database design. For consistency,
we should have a database design that stores each logical data item—such as a
student’s name or birth date—in only one place in the database. This does not
permit inconsistency, and it saves storage space.
[4 marks for the right answer and 4 marks for the justification]
[8 marks]

[Total: 20 marks]

Q2

a. What is the main goal of using three-schema architecture (external,

internal, and conceptual schemas) when developing a database?

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]

b. Explain the difference between these three schemas

The difference between the three schemas:


 The internal schema uses a physical data model to describe the physical
structure of the database along with it the complete details of the data
storage and its access paths.
 The conceptual schema uses representational data model to describe the
whole structure of the database for a community of users. It hides the
details of the physical storage structure and concentrates on describing
entities, data types, relationships, user operations and constraints.
 The external schema describes the part of a database that a particular
user group is interested in and hides the rest of the database from that
user group. External schemas usually use the same representational
model that is used to represent the conceptual schema.
[2 for each schema level]

Page 3 of 9
[6 marks]
c. Explain, through an example, the following database concepts:

i. Entity integrity constraint

To preserve entity integrity, guaranteeing that all tuples in a relation can be


uniquely identified, it is required that no primary key is assigned a NULL value.
ii. Participation constraint

The participation constraint states if an entity has to be a member of a


relationship type or not. Total participation states that all entities have to have at
least one relationship of the type and partial participation means that not all
entities must have a relationship of the type.
iii. Database Recovery

Data recovery is the process of reconstructing a database back to the last


consistent state before a transaction failure.
iv. Multi-valued attribute

A multi-valued attribute is an attribute that holds multiple values for each


occurrence of an entity type.
v. Supper Key

A supper key is an attribute, or set of attributes, that uniquely identifies tuples of


a relation.
[1 mark for each definition and 1 mark for each example]
[10 marks]
[Total: 20 marks]

Q3. The following ERD represents the relationship between students and the

modules they are studying.

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

relationship? Justify your answer.

The hierarchical model is not appropriate for this relationship because it


represents data in a tree like structure where the father can have more than one
child while the child can have one and only one father. So the hierarchical data
model is appropriate for representing 1:1 and 1:N but not the M:N relationship.
The relationship between the student and the modules he studies can’t be
represented because the student can study more than one module and a module
can be studied by more than one student.
[2 marks for the right answer and 3 marks for the justification]
[5 marks]

b. Explain the implementation of such a relationship in the relational model.

In the relational model, a binary M:N relationship type is implemented by creating


a new relation to represent the relationship. This new relation includes, as foreign
key attributes, the primary keys of the relations that represent the participating
entity types; their combination will form the primary key of the new relation. Also
we can include any simple attributes of the M:N relationship type (or simple
components of composite attributes) as attributes of the new relation. So in this
question, the M:N relationship will be mapped as follows:
Student {ID, Name}
Module {Code, Title}
Study {ID, Code, Grade}
[7 marks]

c. Which of the following two ER schemas is more appropriate for

representing the relationship between an employee and his overtime

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

the following schemas (primary keys are underlined):

Product(PID,PNAME)

Component(CID,CNAME,WEIGHT,COST,PID)

a. Formulate an SQL query that retrieves the product id, name and the

number of components that each product consists of.

SELECT P.PID,P.PNAME, COUNT(*)


FROM Product P, Component C
WHERE P.PID = C.PID
GROUP BY PID,PNAME
[4 for right query and 2 for aggregation and grouping]
[6 marks]

b. Consider the following query:

SELECT P.PNAME, C.CNAME

FROM Product P JOIN Component C ON P.PID=C.PID

WHERE C.WEIGHT IN (‘1.5’, ‘2.5’, ‘3.5’)

What does this query mean (express the meaning in one short English

sentence)? Write an equivalent SQL query without using the IN operator

and the JOIN clause.

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]

c. It is often claimed that the join operator is the bottleneck in relational

database query processing. Why? Suggest how queries involving joins

may be optimised heuristically.

The Join operation considered to be the bottleneck of relational database query


processing as it defines a relation containing tuples that satisfy a specific
predicate from the Cartesian product of two relations. The Cartesian product
operation is the most time-consuming operation to process. Two heuristic steps
can be used while optimising queries involving join operation: Move selection
down the query tree and apply the more restrictive SELECT operations first. In
other words, perform selections as early as possible to reduce the number of
tuples in the joined relations.
[2 mark for the reason and 4 marks for heuristics]
[6 marks]
[Total: 20 marks]

Q5.

a. Using the product database schema in Q5, formulate a query in relational

algebra that retrieves the product id and name, the component id and

name, and the weight of the product

 PID,PNAME,CID,CNAME,WEIGHT (PRODUCT ⋈ PID=PID COMPONENT)


[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 the results of the following algebra operations? Explain your answers.

i. <selection condition> (S)

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.

iii. R – S (assuming type compatibility)

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.

iv. R U S (assuming type compatibility)

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

2000 tuples as The CARTESIAN (or cross product) operation is used to


combine tuples from two relations in a combinatorial fashion.

[2 marks for each]


[10 marks]

c. The enhanced Entity Relationship (EER) model incorporates some

object–oriented concepts, such as inheritance, into the ER model.

Discuss, through an example, the mechanism of attribute and relationship

inheritance. Why is it useful?

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:

CAR_SALE( Car#, Salesman#, Date, Price, Commission, Discount)

Assume that a car may be sold by multiple salesmen and hence {CAR#,

SALESMAN#} is the primary key. Additional dependencies are:

Price ―› Discount

Salesman# ―› Commission

a. Show one example for an insertion or update anomaly on the above

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.

This schema isn’t in the 3NF as the Discount is functionally determined by


the Price which means that there is a transitive dependency on the key
attribute. The
CAR_SALE( Car#, Salesman#, Date, Price)
Sales_Comm(Salesman#, Commission)
Discount(Price, Discount)
[8 marks]
[Total: 20 marks]

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]

Contents: Part 1 : Database System Fundamental and Conceptual Data


Modelling Rationale behind database systems, system concepts and
architecture, the database systems development life cycle, principles of data
management and concepts of data modelling; including different models such as:
relational, object-oriented and object-relational data models.
Part 2 : Relational Model: Concepts, Constraints, Querying
Language
Design and Implementation
Database modelling and design using the Entity-Relationship – ER Model;
focus on Relational database system design and use, including: relations,
domains, attributes, keys, dependencies, data normalisation, relationships
between relations, transforming ER diagrams into relational databases, relational
algebra and querying languages SQL.
Part 3 : Database Management Issues
Overview of issues relating to: concurrency, security, integrity; database
recovery; transaction semantics; data management requirements, distributed
database systems.
Methods of Learning, Teaching and Assessment
Total student effort for the module: 100 hours on average.
Learning and Teaching
This module is grounded in practical exercise, offering a hands-on approach
towards developing the relevant skills for database system development and
design. Module content is delivered through a series of formal lectures supported
by supervised laboratory sessions involving database development and
demonstrations. Self-directed learning is facilitated by directed reading, tutorial
material and programming assignments.
1. 12, 2h lectures, informing learning outcomes 1, 2, 3.
2. 12, 2h workshops/labs, informing learning outcomes 4, 5, 6, 7.
3. 52 h private study, informing learning outcomes 1-7.
Assessment
1. One development group-project, of 2-3 students, involving the designing
and implementation of a complete application assessed by written reports
and demonstration. This includes three interim reports each of which is of
300 words (approx) and a final report of 1500 words (approx) accompanied
by the developed system code. This method carries 50% of the total mark
and aims to develop and assess learning outcomes 4-7.
2. One 2-hour unseen written final examination to assess students' knowledge
of the theoretical aspects of database model, system development and
querying languages, and their understanding and critical appraisal of the
role of database systems in information management. This method carries
50% of the total mark and assesses learning outcomes 1-5.

Feedback given to students in response to assessed work

• Addressing common mistakes on assignments and class tests during


teaching sessions
• Using feedback form on the e-learning for the project phases
Reading List
 El Masri, R and Navathe, S., “Fundamentals of Database Systems”, 5th
Edition, Pearson Int Edition, Addison Wesley, ISBN: 0-321-4150-X (2007).
 Connolly, T. and Begg, C., “Database Systems: a Practical Approach to
Design, Implementation and Management”, 4th Edition, Addison-Wesley,
ISBN-10: 0321210255 (2004).
 Hofer, J., McFadden, F. and Prescott M., “Modern Database
Management”, 7th Edition, Pearson/Prentice Hall, ISBN-10: 0131453203
(2005).

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy