0% found this document useful (0 votes)
11 views2 pages

Assignment4 IT 502A - Solutions

The document contains solutions to an assignment on database normalization, discussing functional dependencies and normalization into BCNF, 2NF, and 3NF. It provides detailed examples of relations and their decompositions, illustrating the identification of keys and transitive dependencies. Additionally, it addresses specific cases of candidate keys and the normalization status of a relation named REFRIG.

Uploaded by

abdurrafiqit
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)
11 views2 pages

Assignment4 IT 502A - Solutions

The document contains solutions to an assignment on database normalization, discussing functional dependencies and normalization into BCNF, 2NF, and 3NF. It provides detailed examples of relations and their decompositions, illustrating the identification of keys and transitive dependencies. Additionally, it addresses specific cases of candidate keys and the normalization status of a relation named REFRIG.

Uploaded by

abdurrafiqit
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/ 2

Concordia University of Edmonton

IT 502A: Databases, Fall 2022


Assignment 4 - Solutions

Q1. (20 marks)

Consider a relation schema R={A, B} with two attributes. The only possible (non-trivial)
FDs are {A} ->{B} and {B} ->{A}. There are four possible cases:
(i) No FD holds in R. In this case, the key is {A, B} and the relation satisfies BCNF.
(ii) Only {A} ->{B} holds. In this case, the key is {A} and the relation satisfies BCNF.
(iii) Only {B} ->{A} holds. In this case, the key is {B} and the relation satisfies BCNF.
(iv) Both {A} ->{B} and {B} ->{A} hold. In this case, there are two keys {A} and {B} and
the relation satisfies BCNF.
Hence, any relation with two attributes is in BCNF.

Q2. (30 marks)

A minimal set of attributes whose closure includes all the attributes in R is a key. (One
can also apply algorithm 15.4a (see chapter 15 in the textbook)). Since the closure of
{A, B}, {A, B}+ = R, one key of R is {A, B} (in this case, it is the only key).
To normalize R intuitively into 2NF then 3NF, we take the following steps (alternatively,
we can apply the algorithms discussed in Chapter 15):
First, identify partial dependencies that violate 2NF. These are attributes that are
functionally dependent on either parts of the key, {A} or {B}, alone. We can calculate the
closures {A}+ and {B}+ to determine partially dependent attributes:
{A}+ = {A, D, E, I, J}. Hence {A} -> {D, E, I, J} ({A} -> {A} is a trivial dependency)
{B}+ = {B, F, G, H}, hence {A} -> {F, G, H} ({B} -> {B} is a trivial dependency)
To normalize into 2NF, we remove the attributes that are functionally dependent on part
of the key (A or B) from R and place them in separate relations R1 and R2, along with
the part of the key they depend on (A or B), which are copied into each of these relations
but also remains in the original relation, which we call R3 below:
R1 = {A, D, E, I, J}, R2 = {B, F, G, H}, R3 = {A, B, C}
The new keys for R1, R2, R3 are underlined. Next, we look for transitive dependencies
in R1, R2, R3. The relation R1 has the transitive dependency {A} -> {D} -> {I, J}, so we
remove the transitively dependent attributes {I, J} from R1 into a relation R11 and copy
the attribute D they are dependent on into R11. The remaining attributes are kept in a
relation R12. Hence, R1 is decomposed into R11 and R12 as follows:
R11 = {D, I, J}, R12 = {A, D, E}
The relation R2 is similarly decomposed into R21 and R22 based on the transitive
dependency {B} -> {F} -> {G, H}:
R2 = {F, G, H}, R2 = {B, F}
The final set of relations in 3NF are {R11, R12, R21, R22, R3}
Q3. (15 marks)

a. manufacturer, serialNumber ® model, batch, capacity, retailer


b. model ® manufacturer
c. manufacturer, batch ® model

Q4. (35 marks)


a)
- {M} IS NOT a candidate key since it does not functionally determine attributes Y or P.
- {M, Y} IS a candidate key since it functionally determines the remaining attributes P, MP,
and C.
i.e.
{M, Y} P, But M MP
By augmentation {M, Y} MP
Since MP C, by transitivity M MP, MP C, gives M C
By augmentation {M, Y} C
Thus {M, Y} P, MP, C and {M, Y} can be a candidiate key
- {M, C} IS NOT a candidate key since it does not functionally determine attributes Y or P.

b)
REFRIG is not in 2NF, due to the partial dependency {M, Y} MP (since {M} MP
holds). Therefore, REFRIG is neither in 3NF nor in BCNF.
Alternatively: BCNF can be directly tested by using all of the given dependencies and
finding out if the left-hand side of each is a superkey (or if the right-hand side is a prime
attribute). In the two fields in REFRIG: M MP and MP C. Since neither M nor MP
is a superkey, we can conclude that REFRIG is is neither in 3NF nor in BCNF

You might also like