0% found this document useful (0 votes)
82 views

Normalization With Examples

This document discusses database normalization from 1NF to BCNF. It begins by introducing the objectives of normalization and what it aims to achieve. It then provides examples to illustrate each normal form, starting with a single table in 1NF and decomposing it into multiple tables to achieve 2NF and 3NF by eliminating transitive dependencies. BCNF and higher normal forms up to 6NF are also briefly introduced. The key aspects of each normal form are defined through practical examples to provide an understanding of normalization concepts and techniques.

Uploaded by

rosalia
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views

Normalization With Examples

This document discusses database normalization from 1NF to BCNF. It begins by introducing the objectives of normalization and what it aims to achieve. It then provides examples to illustrate each normal form, starting with a single table in 1NF and decomposing it into multiple tables to achieve 2NF and 3NF by eliminating transitive dependencies. BCNF and higher normal forms up to 6NF are also briefly introduced. The key aspects of each normal form are defined through practical examples to provide an understanding of normalization concepts and techniques.

Uploaded by

rosalia
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Normalization 1NF, 2NF, 3NF & BCNF

with Examples
The International University of Management
By: P. Mubanga
Normalization 1NF, 2NF, 3NF & BCNF with Examples

Objectives
In this class, you will learn-
• First Normal Form (1NF)
• Second Normal Form (2NF)
• Third Normal Form (3NF)
Normalization 1NF, 2NF, 3NF & BCNF with Examples
What is Normalization?
• NORMALIZATION is a database design technique that organizes tables
in a manner that reduces redundancy and dependency of data.
• Normalization divides larger tables into smaller tables and links them
using relationships.
• The purpose of Normalization is to eliminate redundant (useless) data
and ensure data is stored logically.
Normalization 1NF, 2NF, 3NF & BCNF with Examples
Database Normal Forms
• The Theory of Data Normalization in SQL is still being developed
further. However, in most practical applications, normalization
achieves its best in 3rd Normal Form.
• Database Normalization Example:
Database Normalization Example:
Assume, a video library maintains a database of movies rented out.
Without any normalization, all information is stored in one table as
shown below.
Normalization 1NF
1NF (First Normal Form) Rules
• Each table cell should contain a single value.
• Each record needs to be unique.
The above table in 1NF-
Database Keys
Before we proceed let's understand a few things --
What is a KEY?
• A KEY is a value used to identify a record in a table uniquely. A KEY
could be a single column or combination of multiple columns
What is a Primary Key?
• A primary is a single column value used to identify a database record
uniquely.
It has following attributes
• A primary key cannot be NULL
• A primary key value must be unique
• The primary key values should rarely be changed
• The primary key must be given a value when a new record is inserted
Database Keys
What is Composite Key?
• A composite key is a primary key composed of multiple columns used
to identify a record uniquely
• In our database, we have two people with the same name Robert
Phil, but they live in different places.
• Hence, we require both Full Name and Address to identify a record
uniquely. That is a composite key.
Normalization 2NF
Let's move into second normal form 2NF
2NF (Second Normal Form) Rules
• Rule 1- Be in 1NF
• Rule 2- Single Column Primary Key
It is clear that we can't move forward to make our simple database in
2nd Normalization form unless we partition the table above.
Normalization 2NF

• We have divided our 1NF table into two tables viz. Table 1 and Table2. Table 1
contains member information. Table 2 contains information on movies rented.
• We have introduced a new column called Membership_id which is the primary
key for table 1. Records can be uniquely identified in Table 1 using membership
id
Database Keys
Database - Foreign Key
In Table 2, Membership_ID is the Foreign Key
Foreign Key references the primary key of another Table! It helps
connect your Tables
• A foreign key can have a different name from its primary key
• It ensures rows in one table have corresponding rows in another
• Unlike the Primary key, they do not have to be unique. Most often
they aren't
• Foreign keys can be null even though primary keys can not 
Normalization 2NF
Database Keys
Database Keys
Why do you need a foreign key?
• Suppose, a novice inserts a record in Table B such as
• You will only be able to insert values into your foreign key that exist in
the unique key in the parent table. This helps in referential integrity. 
Transitive Functional Dependencies
• The above problem can be overcome by declaring membership id
 from Table2  as foreign key of membership id from Table1
• Now, if somebody tries to insert a value in the membership id field
that does not exist in the parent table, an error will be shown!

What are transitive functional dependencies?


• A transitive functional dependency is when changing a non-key
column, might cause any of the other non-key columns to change.
Transitive Functional Dependencies
Consider the table 1. Changing the non-key column Full Name may
change Salutation.
Normalization 3NF
Let's move into 3NF
3NF (Third Normal Form) Rules
• Rule 1- Be in 2NF
• Rule 2- Has no transitive functional dependencies
To move our 2NF table into 3NF, we again need to again divide our
table.
Normalization 3NF
Normalization 3NF
We have again divided our tables and created a new table which stores
Salutations. 
• There are no transitive functional dependencies, and hence our table
is in 3NF
• In Table 3 Salutation ID is primary key, and in Table 1 Salutation ID is
foreign to primary key in Table 3
• Now our example is at a level that cannot further be decomposed to
attain higher forms of normalization.
Normalization BCNF and Higher
Separate efforts for moving into next levels of normalizing data are
normally needed in complex databases. 
The next levels of normalizations are as follows:
1. BCNF (Boyce-Codd Normal Form) - Even when a database is in
3rd Normal Form, still there would be anomalies resulted if it has
more than one Candidate Key.
• Sometimes is BCNF is also referred as 3.5 Normal Form.
Normalization BCNF and Higher
1. 4NF (Fourth Normal Form) Rules - If no database table instance
contains two or more, independent and multivalued data describing
the relevant entity, then it is in 4th Normal Form.
2. 5NF (Fifth Normal Form) Rules - A table is in 5th Normal Form only if
it is in 4NF and it cannot be decomposed into any number of
smaller tables without loss of data.
3. 6NF (Sixth Normal Form) Proposed - 6th Normal Form is not
standardized, yet however, it is being discussed by database experts
for some time. Hopefully, we would have a clear & standardized
definition for 6th Normal Form in the near future...
That's all to Normalization!!!

You might also like