Normalization Detail
Normalization Detail
1NF,
2NF, 3NF Example
The inventor of the relational model Edgar Codd proposed the theory of
normalization of data with the introduction of the First Normal Form, and he
continued to extend theory with Second and Third Normal Form. Later he joined
Raymond F. Boyce to develop the theory of Boyce-Codd Normal Form.
The Theory of Data Normalization in MySQL server is still being developed further.
For example, there are discussions even on 6th Normal Form. However, in most
practical applications, normalization achieves its best in 3rd Normal Form. The
evolution of Normalization in SQL theories is illustrated below-
Database Normal
Forms
Here you see Movies Rented column has multiple values. Now let’s move into
1st Normal Forms:
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.
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
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!
Consider the table 1. Changing the non-key column Full Name may change
Salutation.
To move our 2NF table into 3NF, we again need to again divide our table.
3NF Example
Below is a 3NF example in SQL database:
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
Now our little example is at a level that cannot further be decomposed to attain
higher normal form types of normalization in DBMS. In fact, it is already in higher
normalization forms. Separate efforts for moving into next levels of normalizing
data are normally needed in complex databases. However, we will be discussing
next levels of normalisation in DBMS in brief in the following.
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.
Summary
Database designing is critical to the successful implementation of a
database management system that meets the data requirements of an
enterprise system.
Normalization in DBMS is a process which helps produce database systems
that are cost-effective and have better security models.
Functional dependencies are a very important component of the normalize
data process
Most database systems are normalized database up to the third normal
forms in DBMS.
A primary key uniquely identifies are record in a Table and cannot be null
A foreign key helps connect table and references a primary key