Académique Documents
Professionnel Documents
Culture Documents
o
o
o
o
o
o
o
Textbook Resources
Connolly, Begg,
Holowczak
Ch. 8
Database
Systems:
Conolly&Begg
5th Ed: 13 and 14
6th Ed: 14 and 15
Ch. 4
Ch. 14 and 15
Ch. 5
Ch. 5 and A
B
What is Normalization?
1.
2.
3.
4.
5.
6.
A relation is a set of attributes with values for each attribute such that:
Each attribute (column) value must be a single value only.
All values for a given attribute (column ) must be of the same data type.
Each attribute (column) name must be unique.
The order of attributes (columns) is insignificant
No two tuples (rows) in a relation can be identical.
The order of the tuples (rows) is insignificant.
From our discussion of E-R Modeling, we know that an Entity typically
corresponds to a relation and that the Entitys attributes become attributes of the relation.
We also discussed how, depending on the relationships between entities, copies
of attributes (the identifiers) were placed in related relations as foreign keys.
The next step is to identify functional dependencies within each relation. Click on
the __Next Page link below to learn more about the normalization process.
Functional Dependencies
The attributes listed on the left hand side of the are called determinants.
One can read A B as, A determines B. Or more specifically: Given a value for A, we
can uniquely determine one value for B.
Key: One or more attributes that uniquely identify a tuple (row) in a relation.
The selection of keys will depend on the particular application being considered.
In most cases the key for a relation will already be specified during the conversion
from the E-R model to a set of relations.
Users can also offer some guidance as to what would make an appropriate key.
Recall that no two relations should have exactly the same values, thus a
candidate key would consist of all of the attributes in a relation.
Modification Anomalies
Once our E-R model has been converted into relations, we may find that some
relations are not properly specified. There can be a number of problems:
o
Deletion Anomaly: Deleting one fact or data point from a relation results
Anomaly Example 1
Name
Street
City
State PostalCo
C101
Bill Smith
New Brunswick
NJ
07101
C102
Mary Green
11 Birch St.
Old Bridge
NJ
07066
C103
Ted Jones
3 Academy St.
Old Bridge
NJ
07066
C104
Sally Taylor
New Brunswick
NJ
07101
C105
Mary Miller
44 Toga Ct.
Farmingdale
NY
11735
Deletion Anomaly: What happens if we delete customer C105: Then we not only
remove the customer information but we also remove (lose) the fact that Farmingdale,
NY has postal code 11735.
Modification Anomaly: It is possible that when a town grows in population, the zip
code will be split into two (or more) new zip codes.
For example, if Old Bridge, NJ splits its zip code, then we will have to update many
different tuples even though we are only changing one fact about Old Bridges zip code.
Anomaly Example 2
Our dutiful consultant creates the E-R Model directly matching the purchase
order:
When we follow the steps to convert to a set of relations this results in two
relations (keys are underlined):
PO_HEADER (PO_Number, PODate, Vendor, Ship_To, ...)
ItemNum
PartNum
Description
Price
O101
I01
P99
Plate
$3.00
O101
I02
P98
Cup
$1.00
O101
I03
P77
Bowl
$2.00
O102
I01
P99
Plate
$3.00
O102
I02
P77
Bowl
$2.00
O103
I01
P33
Fork
$2.50
1.
What happens if we want to add the fact that Order O103 has quantity 5 of
part P99 ?
2.
3.