You are on page 1of 14

Identifying the Primary Key using Functional Dependencies

Identify Candidate Keys

the attribute (or group of attributes) that uniquely identifies each tuple in the relation

Identify the primary Key

One of the Candidate Keys is selected as the Primary Key


Identifying the Primary Key using Functional Dependencies

Determinants:
staffNo,
branchNo,
bAddress,
(branchNo, position),
(bAddress, position).
Identifying the Primary Key using Functional Dependencies

Determinants: Determinants:
A, the attributes of a determinant either
B, (A, B). individually or working together must be
C, able to functionally determine all the
(A, B). other attributes in the relation
Consider the following table of data r(R) of the relation schema R(ABCDE)

ABCD → E ?

What kind of dependencies can we observe among the attributes in the above table?
the values of E are always the same
Rules of Functional Dependencies

Armstrong’s axioms are a set of inference rules used to infer all the functional
dependencies on a relational database. They were developed by William W. Armstrong.

Let A, B, and C be subsets of the attributes of relation R.

Reflexivity

If B is a subset of A, then A  B

Augmentation

If A  B, then A,C  B,C


Rules of Functional Dependencies

Transitivity

If A  B and B  C, then A  C

Decomposition

If A  BC then A  B and A  C

Union

If A  B and A  C, then A  BC
Process of Normalization

Purpose: to identify a suitable set of relations that support the data


requirements of an enterprise.
Characteristics(relations).
the minimal number of attributes
attributes with a close logical relationship
minimal redundancy with each attribute

Process: analyzing relations based on;


their primary key
their functional dependencies
Normal Forms

Normalization is executed as a series of steps. Each step corresponds to a


specific normal form that has known properties

1NF
2NF
3NF
BCNF
4NF rare
5NF
Advantages

- Reduction of data redundancy within tables:


- Reduce data storage space
- Reduce inconsistency of data
- Reduce update cost
- Remove many-to-many relationship
- Improve flexibility of the system

9
Disadvantages

- Increase join
- Reduce efficiency
- Increase use of indexes
- Increase complexity of the system

10
Normal Forms

11
UNF
A table that contains one or more repeating groups

Key: ClientNo
Repeating Group = (propertyNo, pAddress, rentStart, rentFinish, rent, ownerNo, oName)12
there are multiple values at the intersection of certain rows and columns.
1NF
A relation in which the intersection of each row and column contains a single value.

ClientRental (clientNo, propertyNo, cName, pAddress, rentStart, rentFinish, rent, ownerNo, oName)

significant data redundancy


update anomalies
1NF

significant data redundancy


update anomalies

Client (clientNo, cName)

PropertyRentalOwner (clientNo, propertyNo, pAddress, rentStart, rentFinish, rent,ownerNo, oName)

You might also like