Preparation
To start normalization, you need a set of data elements with a
name and a primary key.
Apply these three steps to identify the simplest set of attributes
(relations) for storing the data elements.
In the end, each relation has to have a name,
a unique primary key (P-KEY) and attributes. |
Translate User View
into a "Relation"
| Name: "Invoice" |
| Attributes: |
| P-KEY:
Invoice#
Customer Name
Service Address
Account#
Date Due
Amount Due |
Date
Svc ID
Description
Amount
Service From
Service To |
|
|
|
|
| 1st Normal Form
- Remove all repeating groups (lines) and create a separate set
of attributes (relation). Include the primary key of the original
set in this group.
- Create a unique key for the new relation by combining the original
set's primary key with one or more attributes that make an occurrence
of the new group unique. Name the new group.
|
Each
Invoice Can Have Multiple Services
| Name: "Invoice" |
| Attributes: |
P-KEY: Invoice#
Customer Name
Service Address
Account#
Date Due
Amount Due |
Date
Svc ID
Description
Amount
Service From
Service To
|
|
Therefore We Create a New Relation
| Name: "Transaction" |
| Attributes: |
P-KEY:
Invoice#
P-KEY: Date
P-KEY: Svc ID
Service Description
Amount |
|
|
|
| 2nd Normal Form
- Examine the relations that have more than one attribute in their
key.
- Remove all non-key attributes that describe only part of the
key.
- Create a separate relation with this part of the key as its
primary key and name it.
- Do not remove any key attributes from a relation.
|
The
Transaction Relation Has Multiple Keys
The two attributes "Service Description" and "Amount"
describe only the Key "Svc ID"
| Name: "Transaction" |
| Attributes: |
P-KEY:
Invoice#
P-KEY: Date
P-KEY: Svc ID
Service Description
Amount |
Therefore We Create a New Relation
| Name: "Service" |
| Attributes: |
P-KEY:
Svc ID
Service Description
Amount |
|
|
|
|
3rd Normal Form
- Examine all relations.
- Remove all attributes that do not describe the primary key,
create a new relation for them with a primary key and a name.
- Replace the attributes in the original relation with the primary
key of the new relation as a foreign key (F-KEY).
- Do not remove any key attributes from a relation.
|
No
Change to the "Service" Relation
| Name: "Service" |
| Attributes: |
P-KEY:
Svc ID
Service Description
Amount |
This is the Final "Transaction"
Relation
| Name: "Transaction" |
| Attributes: |
P-KEY:
Invoice#
P-KEY: Date
P-KEY: Svc ID |
Customer Name, Account #, and Service
Address Do Not Describe the Key "Invoice"
| Name: "Invoice" |
| Attributes: |
P-KEY: Invoice#
Customer Name
Service Address
F-KEY: Account#
|
Date Due
Amount Due
Service From
Service To |
|
Therefore We Create a New Relation "Customer"
| Name: "Customer" |
| Attributes: |
P-KEY:
Account#
Customer Name
Service Address |
|
 |