EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • All Courses
    • All Specializations
  • Blog
  • Enterprise
  • Free Courses
  • All Courses
  • All Specializations
  • Log in
  • Sign Up
Home Data Science Data Science Tutorials DBMS Tutorial Normal Forms in DBMS
 

Normal Forms in DBMS

Priya Pedamkar
Article byPriya Pedamkar

Updated March 28, 2023

Normal Forms in DBMS

 

 

Introduction To Normal Forms in DBMS

Database is a storage for the structured collection of data. These data can be accessed and manipulated across various locations within the database. The wide range of storage leads to the problem of data redundancy wherein a piece of the same data information is stored or replicated in multiple locations within the database. Database with redundancy is at a disadvantage w.r.t to its storage, consistency and data manipulation. One of the techniques used to eliminate the issues of data redundancy within a given database is Normalization.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

Normalization in DBMS is the process of effectively organizing data into multiple relational tables to minimize data redundancy.

What are Normal Forms in DBMS?

Before understanding the normal forms it is necessary to understand Functional dependency.

A functional dependency defines the relationship between two attributes, typically between a prime attribute (primary key) and non-prime attributes. If for a table X containing attributes A and B, among which the attribute A is a primary key then the functional dependency is defined as:

DBMS

Example for Functional Dependency:

DBMS2

Explanation: Emp_Name, Contact, and Address depends on Emp_ID, i.e. given an Emp_ID we can get the information on the employee details corresponding to the emp_id.

Example to Implement Normal Forms in DBMS

Now that the definition of Functional Dependency is covered, Let’s look into the draw backs of data redundancy and more concerning issues or rather anomalies w.r.t Insertion, Deletion, and Updating data.

Normal Forms in DBMS - 1

1. Insertion Anomaly

Caused by updating the same set of repeated information again and again. This becomes a problem as the entries for a table increases with time.

Example: for the table in Img1, if a new employee must be added to the table, then the corresponding information of the manager and manager’s information must be repeated leading to the insertion anomaly which will increase with the increase in the entries to the Employee table.

2. Deletion Anomaly

It causes loss of data within the database due to its removal in some other related data set.

Example: for the table in Img1, if the information of Manager, Mr.X is deleted, then this leads to the deletion of the information corresponding to the employees associated with Mr.X leading to loss of employee information for the deleted employee details.

3. Updating Anomaly

In case of an update, it’s very crucial to make sure that the given update happens for all the rows associated with the change. Even if a single row gets missed out it will lead to inconsistency of data.

Example: for the table in Img1, if the manager Mr.X’s name has to be updated, the update operation must be applied to all the rows that Mr.X is associated with. Missing out even a single row causes inconsistency of data within the database

The above-mentioned anomalies occur because inadvertently we are storing two or more pieces of information in every row of a table. To avoid this, Data Normalization comes to the rescue. Data Normalization ensures data dependency makes sense.

Manager Table

For the normalization process to happen it is important to make sure that the data type of each data throughout an attribute is the same and there is no mix up within the data types. For example, an attribute ‘Date-of-Birth’ must contain data only with ‘date’ data type. Let’s dive into the most trivial types of Normal Forms.

Types of Normal Forms

Below are the types to explain the Normal Forms:

1st Normal Form (1NF)

It is Step 1 in the Normalization procedure and is considered as the most basic prerequisite to get started with the data tables in the database. If a table in a database is not capable of forming a 1NF, then the database design is considered to be poor. 1NF proposes a scalable table design that can be extended easily in order to make the data retrieval process much simpler.

For a table in its 1NF,

  1. Data Atomicity is maintained. The data present in each attribute of a table cannot contain more than one value.
  2. For each set of related data, a table is created and data set value in each is identified by a primary key applicable to the data set.

Example:

Illustration after 1NF

The multiple values from EMP_CONTACt made atomic based on the EMP_ID to satisfy the 1NF rules.

2nd Normal Form (2NF)

The basic prerequisite for 2NF is:

  1. The table should be in its 1NF,
  2. The table should not have any partial dependencies

Partial Dependency: It is a type of functional dependency that occurs when non-prime attributes are partially dependent on part of Candidate keys.

Example:

Employe Table before 2NF

  • In the employee table(Img3), if manager details are to be fetched for an employee, multiple results are returned when searched with EMP_ID, in order to fetch one result, EMP_ID and PROJECT_ID together are considered as the Candidate Keys.
  • Here the manager depends on PROJECT_ID and not on EMP_ID, this creates a partial dependency.
  • There are multiple ways to eliminate this partial dependency and reduce the table to its 2nd normal form, one such method is adding the Manager information to the project table as shown in Img5:

after 2NF

3rd Normal Form (3NF)

3NF ensures referential integrity, reduce the duplication of data, reduces data anomaly and makes the data model more informative. The basic prerequisite for 3NF is,

  1. The table should be in its 2NF, and
  2. The table should not have any transitive dependencies

Transitive dependency: It occurs due to an indirect relationship within the attributes when a non-prime attribute has a functional dependency on a prime attribute.

Example:

Normal Forms in DBMS - 8

  • For the table in Img5, the PERFORMANCE_SCORE depends on both employee and project that he is associated, but the last column HIKE depends on PERFORMANCE_SCORE.
  • The hike changes with performance and here the attribute performance score is not a primary key. This forms a transitive dependency
  • To eliminate the transitive dependency created, and to satisfy the 3NF, the table is broken as illustrated in Img6

Normal Forms in DBMS - 9

Boyce-Codd Normal Form BCNF or 3.5 NF

BCNF deals with the anomalies that 3 NF fails to address. For a table to be in BCNF, it should satisfy two conditions:

  1. The table should be in its 3 NF form
  2. For any dependency, A à B, A should be a super key i.e. A cannot be a non-prime attribute when B is a prime attribute.

Example:

Normal Forms in DBMS - 10

In the table in Img7, the EMP_ID and PROJECT_ID together can fetch the Department details associated with the employee. i.e.

  • EMP_ID + PROJECT_ID → DEPARTMENT
  • (Candidate keys)
  • DEPARTMENT which is not a super key is dependent only on PROJECT_ID but not dependent on EMP_ID
  • Department → Project_ID
  • (Non-prime attribute) (prime attribute)

To make this table satisfy BCNF, we need to break the table as shown in Img8

Normal Forms in DBMS - 11

Here the department table is created such that each department id is unique to the department and project associated with it.

Conclusion

It is very crucial to ensure that the data stored in the database is meaningful and the chances of anomalies are minimal to zero. Normalization helps in reducing the data redundancy and help make the data more meaningful. Normalization follows the principle of ‘Divide and Rule’ wherein the tables are divided until a point where the data present in it makes actual sense. It is also important to note that normalization does not fully eliminate the data redundancy but rather its goal is to minimize the data redundancy and the problems associated with it.

Recommended Articles

This is a guide to Normal Forms in DBMS. Here we discuss an introduction, what is Normal Forms in DBMS, with an example to implement and types of in detail explanation. You can also go through our other related articles to learn more –

  1. Normalization in DBMS
  2. Relational Database Model
  3. First Normal Form
  4. Fourth Normal Form
  5. Serializability in DBMS | Types with Examples
Primary Sidebar
Footer
Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

🚀 Limited Time Offer! - 🎁 ENROLL NOW