You are on page 1of 2

ETH Zurich

Systems Group
Prof. D. Kossmann

FS 2014
Data Modeling and Databases
Exercise Sheet 5

Normal Forms I
1

Functional Dependencies and Keys

Consider the following relation:


Order (Product ID, Product Name, Customer ID, Customer Name, Date,
Item Price, Amount, VAT, Gross Total, Net Total)
Note:
The tax value can vary from product to product (e.g. 8% for books, 16% for luxury items)
Customer orders on the same day are combined. We only have one order per customer and per day
Questions:
1. Determine all non-trivial functional dependencies of the relation Order.
2. What are the key candidates?

Closure of Attributes

Given a relation (A,B,C,D,E,G) with the following eight functional dependencies F :


AB C
BC D

D EG
CG BD

CA
ACD B

BE C
CE AG

We define = BD.
Find the closure of attributes + of (F, )

Minimal Basis

Find a minimal basis of the following sets of functional dependencies.


1. (a) A BC
(b) B C
(c) A B
(d) AB C
1

2. (a) AB C
(b) C A
(c) BC D
(d) ACD B
(e) BE C
(f) CE F A
(g) CF BD
(h) D EF

Decomposition

Consider the following relation R and its decomposition into R1 and R2.
Table Name
R
R1
R2

Attributes
(Student ID, Date Enrolled, Course ID, Room NR, Professor)
(Student ID,Date Enrolled,Course ID)
(Date Enrolled, Room NR, Professor)

1. Show that the decomposition of R to R1 and R2 is a lossy decomposition? It will help to find the
functional dependencies first.
2. Find and explain a losless decomposition of the same relation.
For this exercise, assume that courses are taught only by one professor and take place in just one
room.

You might also like