Professional Documents
Culture Documents
Normalization 2
Normalization 2
Normalization 2
Introduction to Introduction to
l Objectives
Normalization Normalization
of
Database
of
Database
4 The idea of Dependencies of Attributes
Tables
Normalization of Database Tables Tables
4 Normalization and Database Design
4 Understand concepts of normalization
(Higher-Level Normal Forms)
ISM 602 4 Learn how to normalize tables
Dr. Hamid Nemati 4 Understand normalization and database
design issues
4 Denomalization
l Normalization is a process for assigning attributes l The attribute values in a relational table should
Introduction to
to entities. It reduces data redundancies and helps Introduction to
be functionally dependent (FD) on the primary
Normalization
of
eliminate the data anomalies. Normalization
of
key value.
Database Database
Tables l Normalization works through a series of stages Tables u A relationship is functionally dependent when one
called normal forms: attribute value implies or determines the attribute
u First normal form (1NF) value for the other attribute.
l EM_SS_NUM --> EM_NAME
u Second normal form (2NF)
l Corollaries
u Third normal form (3NF)
u Corollary 1: No repeating groups allowed in
l The highest level of normalization is not always relational tables.
desirable.
u Corollary 2: A relational table should not have
attributes involved in a transitive dependency
relationship with the primary key.
l Problems with the Table 5.1 l Occurs when the removal of a record results in a
Introduction to
u The project number is intended to be a primary key, Introduction to loss of important information about an entity.
Normalization
of
but it contains nulls. Normalization
of l Example:
Database Database
Tables u The table displays data redundancies. Tables l All the information about a customer is contained in an order
u The table entries invite data inconsistencies. file, if the order is canceled, all the customer information
could be lost when the order record is deleted
u The data redundancies yield the following
anomalies: l Solution:
l Update anomalies. l Create two tables--one table contains order information and
the other table contains customer information.
l Addition anomalies.
l Deletion anomalies.
Update Anomaly Insertion Anomaly
l Occurs when a change of a single attribute in one l Occurs when there does not appear to be any
Introduction to record requires changes in multiple records Introduction to reasonable place to assign attribute values to
Normalization Normalization
of l Example: of records in the database. Probably have
Database Database
Tables
uA staff person changes their telephone number Tables overlooked a critical entity.
and every potential customer that person ever l Example:
worked with has to have the corrected number u Adding new attributes or entire records when they
inserted. are not needed. Where do you place information
l Solution: on new Evaluator’s? Do you create a dummy
u Put the employees telephone number in one Lead.
location--as an attribute in the employee table. l Solution:
u Create a new table with a primary key that
contains the relevant or functional dependent
attributes.
Summary
Denormalization
A Journey of Normalization
First Normal Form Remove l Normalization is only one of many database design
(1NF) “Repeating Groups” goals.
Introduction to Introduction to
Normalization Normalization
of of l Normalized (decomposed) tables require additional
Database Remove Database
Tables Second Normal Form “Partial Functional Tables processing, reducing system speed.
(2NF) Dependency” l Normalization purity is often difficult to sustain in
Remove the modern database environment. The conflict
Third Normal Form “Transitive Functional between design efficiency, information
(3NF) Dependency” requirements, and processing speed are often
resolved through compromises that include
Remove
denormalization.
Higher order Normal “All Remaining Functional
Forms Dependency”