SlideShare a Scribd company logo
2
Most read
Normalization in Database
Functional Dependency, DBMS Normalization,
Normalization Rules
By Roshni Singh
1/1/2017
Database Normalization
Database Normalization
Functional Dependency
Functional dependency (FD) is a set of constraints between two attributes in
a relation. Functional dependency says that if two tuples have same values
for attributes A1, A2,..., An, then those two tuples must have to have same
values for attributes B1, B2, ..., Bn.
Functional dependency is represented by an arrow sign (→) that is, X→Y,
where X functionally determines Y. The left-hand side attributes determine
the values of attributes on the right-hand side.
Armstrong's Axioms
If F is a set of functional dependencies then the closure of F, denoted as F+
,
is the set of all functional dependencies logically implied by F. Armstrong's
Axioms are a set of rules, that when applied repeatedly, generates a closure
of functional dependencies.
 Reflexive rule − If alpha is a set of attributes and beta is_subset_of alpha,
then alpha holds beta.
 Augmentation rule − If a → b holds and y is attribute set, then ay → by also
holds. That is adding attributes in dependencies, does not change the basic
dependencies.
 Transitivity rule − Same as transitive rule in algebra, if a → b holds and b → c
holds, then a → c also holds. a → b is called as a functionally that determines b.
Trivial Functional Dependency
 Trivial − If a functional dependency (FD) X → Y holds, where Y is a subset of X,
then it is called a trivial FD. Trivial FDs always hold.
 Non-trivial − If an FD X → Y holds, where Y is not a subset of X, then it is
called a non-trivial FD.
Database Normalization
 Completely non-trivial − If an FD X → Y holds, where x intersect Y = Φ, it is
said to be a completely non-trivial FD.
Normalization
If a database design is not perfect, it may contain anomalies, which are like
a bad dream for any database administrator. Managing a database with
anomalies is next to impossible.
 Update anomalies − If data items are scattered and are not linked to each
other properly, then it could lead to strange situations. For example, when we
try to update one data item having its copies scattered over several places, a
few instances get updated properly while a few others are left with old values.
Such instances leave the database in an inconsistent state.
 Deletion anomalies − We tried to delete a record, but parts of it was left
undeleted because of unawareness, the data is also saved somewhere else.
 Insert anomalies − We tried to insert data in a record that does not exist at
all.
Normalization is a method to remove all these anomalies and bring the
database to a consistent state.
Normalization Rule
Normalization rule are divided into following normal form.
1. First Normal Form
2. Second Normal Form
3. Third Normal Form
4. BCNF
First Normal Form
First Normal Form is defined in the definition of relations (tables) itself. This
rule defines that all the attributes in a relation must have atomic domains.
The values in an atomic domain are indivisible units.
Database Normalization
We re-arrange the relation (table) as below, to convert it to First Normal
Form.
Each attribute must contain only a single value from its pre-defined domain.
Second Normal Form
Before we learn about the second normal form, we need to understand the
following −
 Prime attribute − An attribute, which is a part of the prime-key, is known as a
prime attribute.
 Non-prime attribute − An attribute, which is not a part of the prime-key, is
said to be a non-prime attribute.
If we follow second normal form, then every non-prime attribute should be
fully functionally dependent on prime key attribute. That is, if X → A holds,
then there should not be any proper subset Y of X, for which Y → A also
holds true.
Database Normalization
We see here in Student_Project relation that the prime key attributes are
Stu_ID and Proj_ID. According to the rule, non-key attributes, i.e.
Stu_Name and Proj_Name must be dependent upon both and not on any of
the prime key attribute individually. But we find that Stu_Name can be
identified by Stu_ID and Proj_Name can be identified by Proj_ID
independently. This is called partial dependency, which is not allowed in
Second Normal Form.
We broke the relation in two as depicted in the above picture. So there
exists no partial dependency.
Database Normalization
Third Normal Form
For a relation to be in Third Normal Form, it must be in Second Normal form
and the following must satisfy −
 No non-prime attribute is transitively dependent on prime key
attribute.
 For any non-trivial functional dependency, X → A, then either −
o X is a superkey or
o A is prime attribute.
We find that in the above Student_detail relation, Stu_ID is the key and
only prime key attribute. We find that City can be identified by Stu_ID as
well as Zip itself. Neither Zip is a superkey nor is City a prime attribute.
Additionally, Stu_ID → Zip → City, so there exists transitive dependency.
To bring this relation into third normal form, we break the relation into two
relations as follows −
Database Normalization
Boyce-Codd Normal Form (BCNF)
Boyce-Codd Normal Form (BCNF) is an extension of Third Normal Form on
strict terms. BCNF states that −
 For any non-trivial functional dependency, X → A, X must be a super-
key.
In the above image, Stu_ID is the super-key in the relation Student_Detail
and Zip is the super-key in the relation ZipCodes. So,
Stu_ID → Stu_Name, Zip and Zip → City
This confirms that both the relations are in BCNF.

More Related Content

What's hot (20)

PDF
Relational algebra in dbms
Vignesh Saravanan
 
PPT
Databases: Normalisation
Damian T. Gordon
 
PPTX
joins in database
Sultan Arshad
 
PPTX
Normal forms
Samuel Igbanogu
 
PPTX
Access Modifier.pptx
Margaret Mary
 
PPTX
Database Concept - Normalization (1NF, 2NF, 3NF)
Oum Saokosal
 
PPTX
Functional dependencies and normalization
daxesh chauhan
 
PPTX
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
PDF
Normalization in DBMS
Hitesh Mohapatra
 
PPT
Normalization
momo2187
 
PPTX
The Relational Database Model
Shishir Aryal
 
PPTX
Normalization 1 nf,2nf,3nf,bcnf
Shriya agrawal
 
PDF
Nested Queries Lecture
Felipe Costa
 
PPTX
Introduction to database & sql
zahid6
 
PDF
Additional Relational Algebra Operations
A. S. M. Shafi
 
PPT
Relational algebra in dbms
shekhar1991
 
PPTX
Dbms normalization
Pratik Devmurari
 
PPT
7. Relational Database Design in DBMS
koolkampus
 
PPTX
Relational model
Dabbal Singh Mahara
 
PPT
11. Storage and File Structure in DBMS
koolkampus
 
Relational algebra in dbms
Vignesh Saravanan
 
Databases: Normalisation
Damian T. Gordon
 
joins in database
Sultan Arshad
 
Normal forms
Samuel Igbanogu
 
Access Modifier.pptx
Margaret Mary
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Oum Saokosal
 
Functional dependencies and normalization
daxesh chauhan
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
Normalization in DBMS
Hitesh Mohapatra
 
Normalization
momo2187
 
The Relational Database Model
Shishir Aryal
 
Normalization 1 nf,2nf,3nf,bcnf
Shriya agrawal
 
Nested Queries Lecture
Felipe Costa
 
Introduction to database & sql
zahid6
 
Additional Relational Algebra Operations
A. S. M. Shafi
 
Relational algebra in dbms
shekhar1991
 
Dbms normalization
Pratik Devmurari
 
7. Relational Database Design in DBMS
koolkampus
 
Relational model
Dabbal Singh Mahara
 
11. Storage and File Structure in DBMS
koolkampus
 

Viewers also liked (20)

PPTX
Functional dependencies and normalization for relational databases
Jafar Nesargi
 
PPTX
Normalization in DBMS
Prateek Parimal
 
PDF
Database design & Normalization (1NF, 2NF, 3NF)
Jargalsaikhan Alyeksandr
 
PPTX
Functional dependency
Tamajit Chakraborty
 
PPTX
Normalization
Salman Memon
 
PPTX
Shashi DATABASE FUNCTIONAL DEPENDENCY QUESTION
Shashi Kumar
 
PPT
DBMS - Normalization
Jitendra Tomar
 
PPTX
Database Dependency with NetVisn
Envisn
 
PPTX
DBMS Lecture 8 - Normalization
Ericka Tagarda
 
PPT
Normalization
vinayakanegundi
 
PPTX
1 fn dependency
Mr Patrick NIYISHAKA
 
PPT
Multivalued dependency
avniS
 
PPTX
Normalization in a Database
Bishrul Haq
 
ZIP
Algorithm Introduction #18 B-Tree
Satoshi Asano
 
PPTX
An Introduction To Software Development - Architecture & Detailed Design
Blue Elephant Consulting
 
PPTX
Theory of dependencies in relational database
Jyoti Ranjan Pattnaik
 
PPTX
Ism normalization pine valley 2012
Akshit R Shah
 
DOC
Data flowtesting doc
vamshi batchu
 
DOC
software testing
vamshi batchu
 
PDF
C++ material
vamshi batchu
 
Functional dependencies and normalization for relational databases
Jafar Nesargi
 
Normalization in DBMS
Prateek Parimal
 
Database design & Normalization (1NF, 2NF, 3NF)
Jargalsaikhan Alyeksandr
 
Functional dependency
Tamajit Chakraborty
 
Normalization
Salman Memon
 
Shashi DATABASE FUNCTIONAL DEPENDENCY QUESTION
Shashi Kumar
 
DBMS - Normalization
Jitendra Tomar
 
Database Dependency with NetVisn
Envisn
 
DBMS Lecture 8 - Normalization
Ericka Tagarda
 
Normalization
vinayakanegundi
 
1 fn dependency
Mr Patrick NIYISHAKA
 
Multivalued dependency
avniS
 
Normalization in a Database
Bishrul Haq
 
Algorithm Introduction #18 B-Tree
Satoshi Asano
 
An Introduction To Software Development - Architecture & Detailed Design
Blue Elephant Consulting
 
Theory of dependencies in relational database
Jyoti Ranjan Pattnaik
 
Ism normalization pine valley 2012
Akshit R Shah
 
Data flowtesting doc
vamshi batchu
 
software testing
vamshi batchu
 
C++ material
vamshi batchu
 
Ad

Similar to Normalization in Database (20)

PDF
Database normalization
Asar Theen
 
DOCX
Normalization
Bathshebaparimala
 
PPT
DBMS e evevevevevevevbebrbbrbrbrbrbrbrb 4.ppt
7c7fs5n555
 
PDF
Assignment#11
Sunita Milind Dol
 
PPTX
database Normalization
Harsiddhi Thakkar
 
PPTX
Database Design and Normalization Techniques
Nishant Munjal
 
PDF
functionaldependenciesandnormalization-150628061940-lva1-app6891.pdf
Anvesha Joshi
 
PDF
Relational Theory for Budding Einsteins -- LonestarPHP 2016
Dave Stokes
 
PDF
Dependencies in various topics like normalisation and its types
nsrChowdary1
 
DOCX
Research gadot
Jotham Gadot
 
PDF
Impact of Normalization in Future
ijtsrd
 
PPT
Normalization
Altafsoomro
 
PDF
Normalization in DBMS
Pyingkodi Maran
 
PPTX
normalization ppt.pptx
AbdusSadik
 
PPT
Normalization_BCA_
Bhavini Shah
 
PPTX
Normalisation
Soumyajit Dutta
 
PPT
Normalization
rehanlko007
 
PDF
eaxmple of Normalisation
Sharda University Greater Noida
 
Database normalization
Asar Theen
 
Normalization
Bathshebaparimala
 
DBMS e evevevevevevevbebrbbrbrbrbrbrbrb 4.ppt
7c7fs5n555
 
Assignment#11
Sunita Milind Dol
 
database Normalization
Harsiddhi Thakkar
 
Database Design and Normalization Techniques
Nishant Munjal
 
functionaldependenciesandnormalization-150628061940-lva1-app6891.pdf
Anvesha Joshi
 
Relational Theory for Budding Einsteins -- LonestarPHP 2016
Dave Stokes
 
Dependencies in various topics like normalisation and its types
nsrChowdary1
 
Research gadot
Jotham Gadot
 
Impact of Normalization in Future
ijtsrd
 
Normalization
Altafsoomro
 
Normalization in DBMS
Pyingkodi Maran
 
normalization ppt.pptx
AbdusSadik
 
Normalization_BCA_
Bhavini Shah
 
Normalisation
Soumyajit Dutta
 
Normalization
rehanlko007
 
eaxmple of Normalisation
Sharda University Greater Noida
 
Ad

Recently uploaded (20)

PPTX
Alan Turing - life and importance for all of us now
Pedro Concejero
 
PPTX
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
PDF
mbse_An_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PPTX
template.pptxr4t5y67yrttttttttttttttttttttttttttttttttttt
SithamparanaathanPir
 
PPTX
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
PDF
William Stallings - Foundations of Modern Networking_ SDN, NFV, QoE, IoT, and...
lavanya896395
 
PDF
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
PDF
3rd International Conference on Machine Learning and IoT (MLIoT 2025)
ClaraZara1
 
PPTX
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
PPTX
darshai cross section and river section analysis
muk7971
 
PPTX
Seminar Description: YOLO v1 (You Only Look Once).pptx
abhijithpramod20002
 
PDF
Digital water marking system project report
Kamal Acharya
 
PDF
Clustering Algorithms - Kmeans,Min ALgorithm
Sharmila Chidaravalli
 
PDF
Tesia Dobrydnia - An Avid Hiker And Backpacker
Tesia Dobrydnia
 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
 
PPT
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PDF
PROGRAMMING REQUESTS/RESPONSES WITH GREATFREE IN THE CLOUD ENVIRONMENT
samueljackson3773
 
PPTX
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
PPTX
Final Major project a b c d e f g h i j k l m
bharathpsnab
 
Alan Turing - life and importance for all of us now
Pedro Concejero
 
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
mbse_An_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
template.pptxr4t5y67yrttttttttttttttttttttttttttttttttttt
SithamparanaathanPir
 
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
William Stallings - Foundations of Modern Networking_ SDN, NFV, QoE, IoT, and...
lavanya896395
 
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
3rd International Conference on Machine Learning and IoT (MLIoT 2025)
ClaraZara1
 
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
darshai cross section and river section analysis
muk7971
 
Seminar Description: YOLO v1 (You Only Look Once).pptx
abhijithpramod20002
 
Digital water marking system project report
Kamal Acharya
 
Clustering Algorithms - Kmeans,Min ALgorithm
Sharmila Chidaravalli
 
Tesia Dobrydnia - An Avid Hiker And Backpacker
Tesia Dobrydnia
 
Knowledge Representation : Semantic Networks
Amity University, Patna
 
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PROGRAMMING REQUESTS/RESPONSES WITH GREATFREE IN THE CLOUD ENVIRONMENT
samueljackson3773
 
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
Final Major project a b c d e f g h i j k l m
bharathpsnab
 

Normalization in Database

  • 1. Normalization in Database Functional Dependency, DBMS Normalization, Normalization Rules By Roshni Singh 1/1/2017
  • 2. Database Normalization Database Normalization Functional Dependency Functional dependency (FD) is a set of constraints between two attributes in a relation. Functional dependency says that if two tuples have same values for attributes A1, A2,..., An, then those two tuples must have to have same values for attributes B1, B2, ..., Bn. Functional dependency is represented by an arrow sign (→) that is, X→Y, where X functionally determines Y. The left-hand side attributes determine the values of attributes on the right-hand side. Armstrong's Axioms If F is a set of functional dependencies then the closure of F, denoted as F+ , is the set of all functional dependencies logically implied by F. Armstrong's Axioms are a set of rules, that when applied repeatedly, generates a closure of functional dependencies.  Reflexive rule − If alpha is a set of attributes and beta is_subset_of alpha, then alpha holds beta.  Augmentation rule − If a → b holds and y is attribute set, then ay → by also holds. That is adding attributes in dependencies, does not change the basic dependencies.  Transitivity rule − Same as transitive rule in algebra, if a → b holds and b → c holds, then a → c also holds. a → b is called as a functionally that determines b. Trivial Functional Dependency  Trivial − If a functional dependency (FD) X → Y holds, where Y is a subset of X, then it is called a trivial FD. Trivial FDs always hold.  Non-trivial − If an FD X → Y holds, where Y is not a subset of X, then it is called a non-trivial FD.
  • 3. Database Normalization  Completely non-trivial − If an FD X → Y holds, where x intersect Y = Φ, it is said to be a completely non-trivial FD. Normalization If a database design is not perfect, it may contain anomalies, which are like a bad dream for any database administrator. Managing a database with anomalies is next to impossible.  Update anomalies − If data items are scattered and are not linked to each other properly, then it could lead to strange situations. For example, when we try to update one data item having its copies scattered over several places, a few instances get updated properly while a few others are left with old values. Such instances leave the database in an inconsistent state.  Deletion anomalies − We tried to delete a record, but parts of it was left undeleted because of unawareness, the data is also saved somewhere else.  Insert anomalies − We tried to insert data in a record that does not exist at all. Normalization is a method to remove all these anomalies and bring the database to a consistent state. Normalization Rule Normalization rule are divided into following normal form. 1. First Normal Form 2. Second Normal Form 3. Third Normal Form 4. BCNF First Normal Form First Normal Form is defined in the definition of relations (tables) itself. This rule defines that all the attributes in a relation must have atomic domains. The values in an atomic domain are indivisible units.
  • 4. Database Normalization We re-arrange the relation (table) as below, to convert it to First Normal Form. Each attribute must contain only a single value from its pre-defined domain. Second Normal Form Before we learn about the second normal form, we need to understand the following −  Prime attribute − An attribute, which is a part of the prime-key, is known as a prime attribute.  Non-prime attribute − An attribute, which is not a part of the prime-key, is said to be a non-prime attribute. If we follow second normal form, then every non-prime attribute should be fully functionally dependent on prime key attribute. That is, if X → A holds, then there should not be any proper subset Y of X, for which Y → A also holds true.
  • 5. Database Normalization We see here in Student_Project relation that the prime key attributes are Stu_ID and Proj_ID. According to the rule, non-key attributes, i.e. Stu_Name and Proj_Name must be dependent upon both and not on any of the prime key attribute individually. But we find that Stu_Name can be identified by Stu_ID and Proj_Name can be identified by Proj_ID independently. This is called partial dependency, which is not allowed in Second Normal Form. We broke the relation in two as depicted in the above picture. So there exists no partial dependency.
  • 6. Database Normalization Third Normal Form For a relation to be in Third Normal Form, it must be in Second Normal form and the following must satisfy −  No non-prime attribute is transitively dependent on prime key attribute.  For any non-trivial functional dependency, X → A, then either − o X is a superkey or o A is prime attribute. We find that in the above Student_detail relation, Stu_ID is the key and only prime key attribute. We find that City can be identified by Stu_ID as well as Zip itself. Neither Zip is a superkey nor is City a prime attribute. Additionally, Stu_ID → Zip → City, so there exists transitive dependency. To bring this relation into third normal form, we break the relation into two relations as follows −
  • 7. Database Normalization Boyce-Codd Normal Form (BCNF) Boyce-Codd Normal Form (BCNF) is an extension of Third Normal Form on strict terms. BCNF states that −  For any non-trivial functional dependency, X → A, X must be a super- key. In the above image, Stu_ID is the super-key in the relation Student_Detail and Zip is the super-key in the relation ZipCodes. So, Stu_ID → Stu_Name, Zip and Zip → City This confirms that both the relations are in BCNF.