Professional Documents
Culture Documents
CONTENT
Database Tables and Normalization
The Need for Normalization
Normalization Process
Higher Level Normal Form (BCNF)
Normalization and Database Design
Denormalization
minimal redundancy with each attribute represented only once with the important
exception of attributes that form all or part of foreign keys, which are essential for
the joining of related relations.
The benefits of using a database that has a suitable set of relations is that
the database will be easier for the user to access and maintain the data,
and take up minimal storage
Update anomaly: exists when one or more instances of duplicated data is updated,
but not all. Eg: there are 3 duplicated records in database, but only one is updated
with the current data.
Delete anomaly: exists when certain attributes are lost because of the deletion of
other attributes. Eg: if the data is the only information left in the database, once it is
deleted, the information will be forever gone.
The semantics indicate how attributes relate to one another, and specify the
functional dependencies between attributes.
Tbl_Branch
Full functional dependency - Indicates that if A and B are attributes of a
relation, B is fully functionally dependent on A if B is functionally dependent
on A, but not on any proper subset of A.
staffID →branchID
Previously we have:
staffID →branchID
1NF 2 NF
BCNF 3 NF
• Every • 2 NF and no
determinant is a transitive
candidate key dependencies
(special case of
3 NF)
THE NEED FOR NORMALIZATION
Example: company that manages building projects
Charges its clients by billing hours spent on each contract
Hourly billing rate is dependent on employee’s position
Periodically, a report is generated that contains information displayed in Table
5.1
Unfortunately, the report may yield different results, depending on what data
anomaly has occurred
1 NF
Step 2:
Step 3:
Identify the
Primary Key Identify All
Dependencies
STEP 1: ELIMINATE THE REPEATING GROUPS
Present data in a tabular format, where each cell has a single value and there
are no repeating groups
Two steps
Step 2:
Step 1: Write Each
Assign
Corresponding
2 NF Key Component
on a Separate Line
Dependent
Attributes
It is in 1NF and
3 NF
Step 2: Step 3:
Identify the Dependent Remove the Dependent
Attributes Attributes from
Transitive Dependencies
Determinant
It is in 2NF and
Data entries in Table 5.2 are inappropriate because they duplicate existing
records
The table is not in BCNF as if we know the offering number we know who the teacher
is.
Each offering can only have one teacher!
Offering# T_Code
Data updates are less efficient because programs that read and update tables
must deal with larger tables
Unnormalized tables yield no simple strategies for creating virtual tables known
as views
Fundamental of Database Management Systems, Mark L. G., 2nd Edition, 2012, John
Wiley.