0% found this document useful (0 votes)
13 views10 pages

Normalization-DBMS

Normalization is the process of organizing data in a database to eliminate redundancy and ensure data integrity, proposed by Edgar Codd through various normal forms. The objectives include removing duplicate data, reducing complexity, and avoiding anomalies such as insert, update, and delete anomalies. Different normal forms (1NF, 2NF, 3NF, BCNF, 4NF, 5NF, and DKNF) define the levels of normalization required to achieve a well-structured database.

Uploaded by

riyadadhich07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views10 pages

Normalization-DBMS

Normalization is the process of organizing data in a database to eliminate redundancy and ensure data integrity, proposed by Edgar Codd through various normal forms. The objectives include removing duplicate data, reducing complexity, and avoiding anomalies such as insert, update, and delete anomalies. Different normal forms (1NF, 2NF, 3NF, BCNF, 4NF, 5NF, and DKNF) define the levels of normalization required to achieve a well-structured database.

Uploaded by

riyadadhich07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Normalization

Normalization is the process of organizing data in a database. This includes creating tables and establishing
relationships between those tables according to rules designed both to protect the data and to make the
database more flexible by eliminating redundancy and inconsistent dependency.

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.

Objectives of Normalization

1. It is used to remove the duplicate data and database anomalies from the relational table.
2. Normalization helps to reduce redundancy and complexity.
3. It is helpful to divide the large database table into smaller tables and link them using relationship.
4. It avoids duplicate data or no repeating groups into a table.

Data redundancy occurs in a relational database when two or more rows or columns have the same value or
repetitive value leading to unnecessary utilization of the memory.

Student Table:

StudRegistration CourseID StudName Address Course


205 6204 James Los Angeles Economics
205 6247 James Los Angeles Economics
224 6247 Trent Bolt New York Mathematics
230 6204 Ritchie Rich Egypt Computer
230 6208 Ritchie Rich Egypt Accounts

There are two students in the above table, 'James' and 'Ritchie Rich', whose records are repetitive when we
enter a new CourseID. Hence it repeats the studRegistration, StudName and address attributes.

Row Level Duplicacy

S_ID S_Name Age


1 Ram 20
2 Varun 25
1 Ram 20

Column Level Dulpicacy

S_ID S_Name Course_Id Course_Name Faculty_Id Faculty_Name Salary


1 Ram C1 DBMS F1 John 30000
2 Ravi C2 Java F2 Bob 40000
3 Nitin C1 DBMS F1 John 30000
4 Amit C1 DBMS F1 John 30000
Anomalies in a Database

When the design of a database isn’t perfect, it may consist of anomalies.

Types of Anomalies

1. Insert Anomaly: An insert anomaly occurs in the relational database when some attributes or data items
are to be inserted into the database without existence of other attributes. For example, In the Student table, if
we want to insert a new courseID, we need to wait until the student enrolled in a course. In this way, it is
difficult to insert new record in the table. Hence, it is called insertion anomalies.

2. Update Anomalies: The anomaly occurs when duplicate data is updated only in one place and not in all
instances. Hence, it makes our data or table inconsistent state. For example, suppose there is a student 'James'
who belongs to Student table. If we want to update the course in the Student, we need to update the same in
the course table; otherwise, the data can be inconsistent. And it reflects the changes in a table with updated
values where some of them will not.

3. Delete Anomalies: An anomaly occurs in a database table when some records are lost or deleted from the
database table due to the deletion of other records. For example, if we want to remove Trent Bolt from the
Student table, it also removes his address, course and other details from the Student table. Therefore, we can
say that deleting some attributes can remove other attributes of the database table.

Types of Normal Form

First Normal Form

Second Normal Form

Third Normal Form

Boyce Codd Normal Form

Fourth Normal Form

Fifth Normal Form

Domain Key Normal Form

First Normal Form -

If a relation contain composite or multi-valued attribute, it violates first normal form or a relation is in first
normal form if it does not contain any composite or multi-valued attribute. A relation is in first normal form
if every attribute in that relation is singled valued attribute.

Example 1 – Relation STUDENT in table 1 is not in 1NF because of multi-valued attribute STUD_PHONE. Its
decomposition into 1NF
Second Normal Form -

To be in second normal form, a relation must be in first normal form and relation must not contain any partial
dependency. A relation is in 2NF if it has No Partial Dependency, i.e., no non-prime attribute (attributes
which are not part of any candidate key) is dependent on any proper subset of any candidate key of the table.

Partial Dependency – If the proper subset of candidate key determines non-prime attribute, it is called
partial dependency.

Example-

Customer Table

Cust_ID Store_ID Location


1 1 Delhi
1 3 Mumbai
2 1 Delhi
3 2 Banglore
4 3 Mumbai

Table 1

Cust_ID Store_ID
1 1
1 3
2 1
3 2
4 3

Table 2
Store_ID Location
1 Delhi
2 Banglore
3 Mumbai

Third Normal Form -

A relation is in third normal form, if there is no transitive dependency for non-prime attributes as well as it
is in second normal form.
A given relation is called in Third Normal Form (3NF) if and only if-

1. Relation already exists in 2NF.


2. No transitive dependency exists for non-prime attributes.

Transitive Dependency

A → B is called a transitive dependency if and only if-

1. A is not a super key.


2. B is a non-prime attribute.

If any one condition fails, then it is not a transitive dependency.

Student Table

Score_Id Stud_Id Sub_Id Marks Exam_Id Exam_Name Total


Marks
101 201 1 16 A\1 Mid 20
102 201 2 69 B\1 Final 80
103 202 1 19 A\1 Mid 20

Table 1

Score_ Stud_ Sub_ Mar Exam_


Id Id Id ks Id

Table 2
Exam_Id Exam_Name Total
Marks

Example-

Employee Employee Employee Employee


Code Name Zipcode City
101 John 110033 Model Town
101 John 110044 Badarpur
102 Ryan 110028 Naraina
103 Stephanie 110064 Hari Nagar

Solution: Table 1

Employee Employee Employee


Code Name Zipcode
101 John 110033
101 John 110044
102 Ryan 110028
103 Stephanie 110064

Table 2
Employee Employee
Zipcode City
110033 Model Town
110044 Badarpur
110028 Naraina
110064 Hari Nagar

Boyce-Codd Normal Form -

A given relation is called in BCNF if and only if-

1. Relation already exists in 3NF.


2. For each functional dependency A → B, A is a super key of the relation.

Example:

Employee Code Project ID Project Leader


101 P03 Grey
101 P01 Christian
102 P04 Hudson
103 P02 Petro

Solution: Table 1 Table 2

Employee Code Project ID Project Leader Project ID


101 P03 Grey P03
101 P01 Christian P01
102 P04 Hudson P04
103 P02 Petro P02

Fourth Normal Form -

 A relation will be in 4NF if it is in Boyce Codd normal form and has no multi-valued dependency.
 For a dependency A → B, if for a single value of A, multiple values of B exists, then the relation will
be a multi-valued dependency.

Example

STUDENT

STU_ID COURSE HOBBY


21 Computer Dancing

21 Math Singing
34 Chemistry Dancing

74 Biology Cricket
59 Physics Hockey
STUDENT_COURSE

STU_ID COURSE
21 Computer
21 Math
34 Chemistry
74 Biology
59 Physics

STUDENT_HOBBY
STU_ID HOBBY
21 Dancing
21 Singing
34 Dancing
74 Cricket
59 Hockey

Fifth Normal Form -

 A relation is in 5NF if it is in 4NF and not contains any join dependency and joining should be
lossless.
 5NF is satisfied when all the tables are broken into as many tables as possible in order to avoid
redundancy.
 5NF is also known as Project-join normal form (PJ/NF).

Example - Subject Table

SUBJECT LECTURER SEMESTER


Computer Anshika Semester 1
Computer John Semester 1
Math John Semester 1
Math Akash Semester 2
Chemistry Praveen Semester 1

Table 1

SEMESTER SUBJECT
Semester 1 Computer
Semester 1 Math
Semester 1 Chemistry
Semester 2 Math

Table 2
SUBJECT LECTURER
Computer Anshika
Computer John
Math John
Math Akash
Chemistry Praveen

Table 3

SEMSTER LECTURER
Semester 1 Anshika
Semester 1 John
Semester 1 John
Semester 2 Akash
Semester 1 Praveen

Domain Key Normal Form –


A relation is in DKNF when insertion or delete anomalies are not present in the database. Domain-Key Normal Form is
the highest form of Normalization. The reason is that the insertion and deletion anomalies are removed. The
constraints are verified by the domain and key constraints.

Domain Constraint

Values of an attribute had some set of values, for example, EmployeeID should be four digits long −

Emp_ID Emp_Name Emp_Age


0921 Tom 33
0922 Jack 31

Key Constraint

An attribute or its combination is a candidate key, which make the record unique means it doesn’t allow the
duplicate value.

Normal Forms
Normal Form Description

1NF A relation is in 1NF if it contains an atomic value.

2NF A relation will be in 2NF if it is in 1NF and all non-key attributes are fully
functional dependent on the primary key.

3NF A relation will be in 3NF if it is in 2NF and no transition dependency exists.

BCNF A stronger definition of 3NF is known as Boyce Codd's normal form.


4NF A relation will be in 4NF if it is in Boyce Codd's normal form and has no
multi-valued dependency.

5NF A relation is in 5NF. If it is in 4NF and does not contain any join dependency,
joining should be lossless.

DKNF Remove Insertion and Deletion anomalies

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy