0% found this document useful (0 votes)
2 views30 pages

550 Lecture14

The document discusses normalization in database design, detailing the process of decomposing relations to minimize redundancy and anomalies. It outlines various normal forms (1NF, 2NF, 3NF, BCNF) and their definitions, emphasizing the importance of functional dependencies and the conditions required to achieve each normal form. Examples and exercises are provided to illustrate the normalization process and its application in practical scenarios.
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)
2 views30 pages

550 Lecture14

The document discusses normalization in database design, detailing the process of decomposing relations to minimize redundancy and anomalies. It outlines various normal forms (1NF, 2NF, 3NF, BCNF) and their definitions, emphasizing the importance of functional dependencies and the conditions required to achieve each normal form. Examples and exercises are provided to illustrate the normalization process and its application in practical scenarios.
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/ 30

Lecture 14

Normalization
Normalization
• The process of decomposing unsatisfactory
"bad" relations by breaking up their attributes
into smaller relations
• The process of analyzing the given relation
schemas based on their FDs and primary keys
to achieve the desirable properties:
– Minimizing redundancy
– Minimizing the insertion, deletion, and update
anomalies
Normal Forms
• If a relation is in a certain normal form
(BCNF, 3NF etc.), it is known that certain
kinds of problems are avoided
• Normal Form: the highest normal form
condition that it meets, and hence indicates
the degree to which it has been normalized
1NF
• 1NF: disallows multivalued attributes,
composite attributes and their combinations
• The only attribute values permitted by 1NF
are single atomic values
• Considered to be part of the definition of
relation
Example 1: Normalization into 1NF
Example 2: Normalization into 1NF
Prime or Nonprime Attributes
• Prime attribute: a member of some
candidate key
• Nonprime attribute: not a prime attribute
(not a member of any candidate key)
Full or Partial Functional Dependency

• X®Y is a full functional dependency if


removal of any attribute A from X means
that the dependency does not hold any
more
• X®Y is a partial functional dependency if
some attribute A can be removed from X
and the dependency still holds
2NF
• 2NF: if it is in 1NF and every nonprime attribute
A in R is fully functionally dependent on the
primary key
• Normalize 1NF relations to 2NF: remove partial
functional dependencies by placing the RHS
attribute(s) in a new relation along with a copy of
the determinant(s)
Example: Normalization into 2NF
3NF
• Transitive functional dependency: If A ®B and B
®C, then C is transitively dependent on A via B
• 3NF: if it is in 2NF and no nonprime attribute A in
R is transitively dependent on the primary key
• Normalize 2NF relations to 3NF: remove
transitive dependencies by placing the RHS
attribute(s) in a new relation along with a copy of
the determinant(s)
Example: Normalization into 3NF
General Definitions of 2NF and 3NF

• Take all candidate keys of a relation into


account
• 2NF: every nonprime attribute A in a
relation schema R is not partially
dependent on any key of R
• 3NF: it is in 2NF and every nonprime
attribute A is not transitively dependent on
any key of R
BCNF (Boyce-Codd Normal Form)
• BCNF: if every determinant is a superkey
of R
• Each normal form is strictly stronger than
the previous one
– Every 2NF relation is in 1NF
– Every 3NF relation is in 2NF
– Every BCNF relation is in 3NF
BCNF (Cont.)
• Test BCNF: identify all the determinants and
make sure that they are the superkeys
• For a functional dependency A ® B:
– 3NF allows this dependency in a relation if B is a
prime attribute and A is not a superkey
– BCNF insists that A must be a superkey for this
dependency to remain in a relation
• BCNF is a stronger form of 3NF
– Every relation in BCNF is also in 3NF
– A relation in 3NF not necessarily in BCNF
Summary
• 1NF: removes repeating groups
• 2NF: removes partial dependencies on
any key
• 3NF: removes transitive dependencies on
any key
• BCNF: removes remaining anomalies
Exercise 1
• Lots(Property_id#, County_name, Lot#, Area,
Price, Tax_rate)
• FDs:
– Primary key: Property_id#
– Candidate key: {County_name, Lot#}
– County_name ® Tax_rate
– Area ® Price
Exercise 2
• (Property#, Idate, Itime, Paddress, Comments,
Staff#, Sname, Car_reg)
• FDs:
– Property# ® Paddress
– Staff# ® Sname
– {Idate, Staff#} ® Car_reg
– Candidate key:
• {Idate, Itime, Car_reg}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy