Database Normalization

Database normalization is a database schema design technique, by which an existing schema is modified to minimize redundancy and dependency of data.

Normalization split a large table into smaller tables and define relationships between them to increases the clarity in organizing data.

Some Facts About Database Normalization

  • The words normalization and normal form refer to the structure of a database.
  • Normalization was developed by IBM researcher E.F. Codd In the 1970s.
  • Normalization increases the clarity in organizing data in Database.

Normalization of a Database is achieved by following a set of rules called 'forms' in creating the database.

Database Normalization Rules

First Normal Form (1NF)

Each column is unique in 1NF.

Example:

Sample Employee table, it displays employees are working with multiple departments.

EmployeeAgeDepartment
Melvin32Marketing, Sales
Edward45Quality Assurance
Alex36Human Resource

Employee table following 1NF:

EmployeeAgeDepartment
Melvin32Marketing
Melvin32Sales
Edward45Quality Assurance
Alex36Human Resource

Second Normal Form (2NF)

The entity should be considered already in 1NF, and all attributes within the entity should depend solely on the unique identifier of the entity.

Example:

Sample Products table:

productIDproductBrand
1MonitorApple
2MonitorSamsung
3ScannerHP
4Head phoneJBL

Product table following 2NF:
Products Category table:

productIDproduct
1Monitor
2Scanner
3Head phone

Brand table:

brandIDbrand
1Apple
2Samsung
3HP
4JBL

Products Brand table:

pbIDproductIDbrandID
111
212
323
434

Second Normal Form (2NF)


Third Normal Form (3NF)

The entity should be considered already in 2NF, and no column entry should be dependent on any other entry (value) other than the key for the table.

If such an entity exists, move it outside into a new table.

3NF is achieved considered as the database is normalized.


Boyce-Codd Normal Form (BCNF)

3NF and all tables in the database should be only one primary key.


Fourth Normal Form (4NF)

Tables cannot have multi-valued dependencies on a Primary Key.


Fifth Normal Form (5NF)

A composite key shouldn't have any cyclic dependencies.

Well, this is a highly simplified explanation for Database Normalization. One can study this process extensively though. After working with databases for some time, you'll automatically create Normalized databases, as it's logical and practical.


Here are few other related articles for you to read:

Courses
Subscribe Updates via Email

Join 49,000+ W3schools lovers and get all the latest tutorials, programs, algorithms in your inbox.