You are on page 1of 2

# IS302 Database Design

## Divine Word University

Tutorial 6: Solution
1.

How do the general definitions of 2NF and 3NF, which consider all keys of a relation, differ from those that
consider only primary keys?
In order for a relation schema R to be in 2NF, all non-prime attributes must fully functionally depend on
the primary. However, in order for R to meet the general definition of 2NF, R must be in 1NF and all the
non-prime attributes must be fully functionally dependent on all the keys of the R. If a non-prime attribute
of R partially depends on one of the keys, the R is not in 2NF.
In order for a R to be in 3NF, all non-prime attributes must not transitively depend on the primary key.
However, in order for R to meet the general definition of 3NF, if for all FD X -> Y that holds on R, either X is
a superkey of R or Y is a prime attribute.
A relation schema R violates the general definition of 2NF if a functional dependency X -> Y holds on R that
violates both conditions.

2.

Show three related relations that are in the third normal form.
Empoyee relation
EmployeeNo
Firstname
Lastname
Department
1111
Joe
Blow
1212
2222
Peter
Mark
1313
3333
James
Berry
1212
Department relation
DepartmentNo
Name
1212
Human Resource
1313
Finance
Dependent relation
Employee
DepFirst
1111
John
2222
Mary
3333
Gary

Phone
8521212
8521313

Relationship
Son
Daughter
Son

3.

## What undesirable dependencies are avoided when a relation is in 3NF?

Transitive dependencies

4.

How does BCNF differ from 3NF? Why is it considered a stronger form of 3NF?
In order for a relation schema R to be in BCNF, if for every FD X Y that holds on R, X is a superkey of R.
According to the definition of 3NF, a relations schema R is in 3NF if and only if every dependency X->Y that
holds on R, at least ONE of the following criteria:
X->Y is trivial (i.e. Y is a subset of X)
X is a superkey
Y is a subset of a candidate key
BCNF doesn't permit the third condition. Therefore BCNF is said to be stronger than 3NF because 3NF permits
some dependencies which BCNF does not.

Page | 1

5.

## Consider the following relation schema and functional dependencies.

R (E, F, G, H, I, J)
{E} -> {F, G, H, I, J}
{F, G} -> {E, H, I, J}
{H} -> {I, J}
a.
b.

c.

6.

## What are the candidate keys?

{E}, {F,G}
Which candidate key should be chosen as the primary key? Hint: Choose one with the less number of
attributes.
{E}
Is the relation schema is 3NF? If not, justify and decompose the relation into 3NF relations.
Not in 3NF because {E} -> {I, J} is transitive. Therefore, 2 relations after decomposition are:
R1(E, F, G, H)
R2(H, I, J)

Consider the following relation for published books and functional dependencies that hold on this relation
schema.
BOOK(ISBN, Title, Author, YearofPublication, Edition, Publisher, PublisherLocation)
{ISBN} -> {Title, Author, YearofPublication, Edition, Publisher, PublisherLocation}
{Title, Edition} -> {ISBN, Author, YearofPublication, Publisher, PublisherLocation}
{Publisher} -> {PublisherLocation}
a.
b.

c.

## What are the candidate keys?

{ISBN}, {Title, Edition}
Which candidate key should be chosen as the primary key? Hint: Choose one with the less number of
attributes.
{ISBN}
Is the relation schema is 3NF? If not, justify and decompose the relation into 3NF relations.
Not in 3NF because {ISBN} -> {PublisherLocation} is transitive.

Page | 2