Dbms Chapter Three Is304 Database Normalization
Dbms Chapter Three Is304 Database Normalization
Database Normalization
Contents
1. Purpose of Normalization
2. Data Redundancy and Update Anomalies
3. Functional Dependencies
4. Normalization Process
5. First Normal Form (1NF)
6. Second Normal Form (2NF)
7. Third Normal Form (3NF)
1
DBMS Chapter Three IS304
1. Purpose of Normalization
2
DBMS Chapter Three IS304
Updates to the data stored in the database are achieved with a minimal
number of operations thus reducing the opportunities for data
inconsistencies occurring in the database;
Reduction in the file storage space required by the base relations thus
minimizing costs.
Relations that have redundant data may have problems called update
anomalies, which are classified as insertion, deletion, or modification
anomalies.
o Example of relation that has redundancy and update anomalies:
o In the StaffBranch relation there is redundant data; the details of a branch are
repeated for every member of staff located at that branch. In contrast, the
branch details appear only once for each branch in the Branch relation, and
only the branch number (branchNo) is repeated in the Staff relation to
represent where each member of staff is located.
o Insert Anomalies :
To insert the details of new members of staff into the StaffBranch
relation, we must include the details of the branch at which the staff
are to be located. For example, to insert the details of new staff
located at branch number B007, we must enter the correct details of
3
DBMS Chapter Three IS304
branch number B007 so that the branch details are consistent with
values for branch B007 in other tuples of the StaffBranch relation.
To insert details of a new branch that currently has no members of
staff into the StaffBranch relation, it is necessary to enter nulls into
the attributes for staff, such as staffNo.
Deletion Anomalies:
If we delete a tuple from the StaffBranch relation that represents the
last member of staff located at a branch, the details about that branch
are also lost from the database.
Update Anomalies:
If we want to change the value of one of the attributes of a particular
branch in the StaffBranch relation, for example the address for branch
number B003, we must update the tuples of all staff located at that
branch. If this modification is not carried out on all the appropriate
tuples of the StaffBranch relation, the database will become
inconsistent.
3. Functional Dependencies
o Assume that a relational schema has attributes (A, B, C, . . . , Z) and that the
database is described by a single universal relation called R = (A, B, C, . . . ,
Z). This assumption means that every attribute in the database has a unique
name.
o Functional dependency describes the relationship between attributes in a
relation. For example, if A and B are attributes of relation R, B is
functionally dependent on A (denoted A → B), if each value of A is
4
DBMS Chapter Three IS304
associated with exactly one value of B. (A and B may each consist of one or
more attributes.)
Determinant Dependent
5
DBMS Chapter Three IS304
4. Normalization Process
o Normalization is a formal technique for analyzing relations based on their
primary key (or candidate keys) and functional dependencies.
o The technique involves a series of rules that can be used to test individual
relations so that a database can be normalized to any degree.
6
DBMS Chapter Three IS304
o When a requirement is not met, the relation violating the requirement must
be decomposed into relations that individually meet the requirements of
normalization.
o Three normal forms were initially proposed called First Normal Form (1NF),
Second Normal Form (2NF), and Third Normal Form (3NF). Subsequently,
R. Boyce and E.F. Codd introduced a stronger definition of third normal
form called Boyce Codd Normal Form (BCNF).
o With the exception of 1NF, all these normal forms are based on functional
dependencies among the attributes of a relation. Higher normal forms that go
beyond BCNF were introduced later such as Fourth Normal Form (4NF),
Fifth Normal Form (5NF) and Sixth Normal Form (6NF).
o Normalization is often executed as a series of steps. Each step corresponds
to a specific normal form that has known properties. As normalization
proceeds, the relations become progressively more restricted (stronger) in
format and also less vulnerable to update anomalies.
7
DBMS Chapter Three IS304
8
DBMS Chapter Three IS304
1NF Table:
9
DBMS Chapter Three IS304
11
DBMS Chapter Three IS304
12