Normalization
Normalization
A table is in 1 NF iff:
0-55-123456-9 Main Street Small House 714-000-0000 $22.95 0-55-123456-9 Jones 123-333-3333
Example 1
ISBN Title Price Table Scheme: {ISBN, Title, Price}
0-321-32132-1 Balloon $34.00 Functional Dependencies: {ISBN} {Title}
0-55-123456-9 Main Street $22.95
{ISBN} {Price}
0-123-45678-0 Ulysses $34.00
Example 3
AuID AuName AuPhone
1 Sleepy 321-321-1111
Table Scheme: {AuID, AuName, AuPhone}
2 Snoopy 232-234-1234
Functional Dependencies: {AuId} {AuPhone}
3 Grumpy 665-235-6532
{AuId} {AuName}
4 Jones 123-333-3333
{AuName, AuPhone} {AuID}
5 Smith 654-223-3455
6 Joyce 666-666-6666
7 Roman 444-444-4444
Second Normal Form (2NF)
For a table to be in 2NF, there are two requirements
– The database is in first normal form
– All nonkey attributes in the table must be functionally dependent on the
entire primary key
Note: Remember that we are dealing with non-key attributes
Contractor
Example 3 (Not in 3NF) BuildingID Fee
2. Each manager can have more than one child Mary NULL Adam
26
Fourth Normal Form (4NF)
• Multi-valued Dependency (MVD)
– Dependency between attributes (for example, A, B,
and C) in a relation, such that for each value of A
there is a set of values for B and a set of values for C.
However, the set of values for B and C are
independent of each other.
27
Fourth Normal Form (4NF)
• MVD between attributes A, B, and C in a
relation using the following notation:
A −>> B
A −>> C
28
Fourth Normal Form (4NF)
• A multi-valued dependency can be further defined as being trivial
or nontrivial.
A MVD A −>> B in relation R is defined as being trivial if (a) B is a
subset of A or (b) A B = R.
A MVD is defined as being nontrivial if neither (a) nor (b) are satisfied.
A trivial MVD does not specify a constraint on a relation, while a
nontrivial MVD does specify a constraint.
29
Fourth Normal Form (4NF)
• Defined as a relation that is in Boyce-Codd
Normal Form and contains no nontrivial multi-
valued dependencies.
30
4NF - Example
31
Fifth Normal Form (5NF)
• Fifth normal form is satisfied when all tables are broken into
as many tables as possible in order to avoid redundancy.
Once it is in fifth normal form it cannot be broken into
smaller relations without changing the facts or the meaning.
Domain Key Normal Form (DKNF)
• The relation is in DKNF when there can be no insertion or
deletion anomalies in the database.
Fifth Normal Form (5NF)
• A relation decompose into two relations must have the lossless-
join property, which ensures that no spurious tuples are generated
when relations are reunited through a natural join operation.
34
Fifth Normal Form (5NF)
• Defined as a relation that has no join
dependency.
35
5NF - Example
36
5NF - Example
37