SlideShare a Scribd company logo
1 of 17
Normalization,1st
NF, 2nd NF, 3rd NF,
BCNF,
4th NF, 5th NF
Prepared by :
• Krunal Patel
• Vishal Panchal
• Harsh Parmar
• Dhrumil Patel
Guided BY:
Prof. Paresh Patel
1
DEFINATION
■ Database normalization or normalization : is the
process of organizing the attributes and relations of
a relational database to reduce data redundancy and
improve data redundancy.
■ Normalization is also the process of simplifying the
design of a database so that it achieves the optimal
structure composed of atomic elements.
■ It include classify like given below
■ 1st NF ,2ndNF,3rdNF, BCNF,4thNF,5thNF.
2
1st NF
■ As per First Normal Form, no two Rows of data must contain repeating group of
information i.e each set of column must have a unique value, such that multiple
columns cannot be used to fetch the same row. Each table should be organized
into rows, and each row should have a primary key that distinguishes it as unique.
■ The Primary key is usually a single column, but sometimes more than one
column can be combined to create a single primary key. For example consider a
table which is not in First normal form
■ e.g
■ StudentTable :
Student Age Subject
Adam 15 Biology, Maths
Alex 14 Maths
Stuart 17 Maths
3
1st NF
■ After 1st NF.
Student Age Subject
Adam 15 Biology
Adam 15 Maths
Alex 14 Maths
Stuart 17 Maths
1st NF
4
■ As per the Second Normal Form there must not be any partial
dependency of any column on primary key. It means that for a table that
has concatenated primary key, each column in the table that is not part
of the primary key must depend upon the entire concatenated key for its
existence. If any column depends only on one part of the concatenated
key, then the table fails Second normal form.
■ In example of First Normal Form there are two rows for Adam, to include
multiple subjects that he has opted for.While this is searchable, and
follows First normal form, it is an inefficient use of space.Also in the
aboveTable in First Normal Form, while the candidate key is
{Student, Subject}, Age of Student only depends on Student column,
which is incorrect as per Second Normal Form.To achieve second normal
form, it would be helpful to split out the subjects into an independent
table, and match them up using the student names as foreign keys.
2nd NF
5
2nd NF
■ After 2nd NF
■ New StudentTable following 2NF will be :
■ In SubjectTable the candidate key will be {Student, Subject} column.
Now, both the above tables qualifies for Second Normal Form and will
never suffer from Update Anomalies.Although there are a few complex
cases in which table in Second Normal Form suffers Update Anomalies,
and to handle those scenariosThird Normal Form is there.
Student Age
Adam 15
Alex 14
Stuart 17
Student Subject
Adam Biology
Adam Maths
Alex Maths
Stuart Maths
2nd NF
2nd NF
6
■ Third Normal form applies that every non-prime attribute of table must be
dependent on primary key, or we can say that, there should not be the case
that a non-prime attribute is determined by another non-prime attribute.
So this transitive functional dependency should be removed from the table
and also the table must be in Second Normal form. For example, consider a
table with following fields.
■ Student_DetailTable :
■ In this table Student_id is Primary key, but street, city and state depends
upon Zip.The dependency between zip and other fields is called transitive
dependency. Hence to apply 3NF, we need to move the street, city and
state to new table, with Zip as primary key.
Student_id Student_name DOB Street city State Zip
3rd NF
7
3rd NF
■ New Student_DetailTable :
■ AddressTable :
■ The advantage of removing transtive dependency is,
■ Amount of data duplication is reduced.
■ Data integrity achieved.
Student_id Student_name DOB Zip
Zip Street city state
3rd NF
8
Boyce and Codd Normal Form
(BCNF)
■ Boyce and Codd Normal Form is a higher version of theThird Normal form.
This form deals with certain type of anamoly that is not handled by 3NF. A 3NF
table which does not have multiple overlapping candidate keys is said to be in
BCNF. For a table to be in BCNF, following conditions must be satisfied:
■ R must be in 3rd Normal Form
■ and, for each functional dependency ( X ->Y ), X should be a super Key.
consider the following relationship:R(A,B,C,D)
and following dependwncies
A ->BCD
BC->AD
D ->B
above relationship is already in 3rd NF.keys are A and BC.
hence ,in functional dependency, A->BCD ,A is the super key .in second relation,
BC->AD,BC is also akey.but in,D->b,d is not a key.
Hence we can break our relation ship R into two relationship R1 and R2.
9
Boyce and Codd Normal Form
(BCNF)
R(A,B,C,D)
R1(A,D,C) R2(D,B)
10
4th NF
■ Fourth normal form (4NF) is a level of database normalization where there are
no non-trivial multivalued dependencies other than a candidate key.
■ It builds on the first three normal forms (1NF, 2NF and 3NF) and the Boyce-
Codd Normal Form (BCNF). It states that, in addition to a database meeting
the requirements of BCNF, it must not contain more than one multivalued
dependency.
■ Multivalued dependency is best illustrated using an example. In a table
containing a list of three things - college courses, the lecturer in charge of
each course and the recommended book for each course - these three
elements (course, lecturer and book) are independent of one another.
Changing the course’s recommended book, for instance, has no effect on the
course itself.This is an example of multivalued dependency: An item depends
on more than one value. In this example, the course depends on both lecturer
and book.
■ Thus, 4NF states that a table should not have more than one of these
dependencies. 4NF is rarely used outside of academic circles.
11
4th NF
■ E.g 4th NF table will be:
■ After 4th NF
Subject Lecturer books
math raj b1
math jay b2
physics kanu p1
chemestry vinod c1
Subject Lecturer
math raj
math jay
physics kanu
chemestry vinod
Subject books
math b1
math b2
physics p1
chemestry c1
12
5th NF
■ A database is said to be in 5NF, if and only if,
■ It's in 4NF
■ If we can decompose table further to eliminate redundancy and anomaly,
and when we re-join the decomposed tables by means of candidate keys,
we should not be losing the original data or any new record set should not
arise. In simple words, joining two or more decomposed table should not
lose records nor create new records.
Subject Lecturer Semester
math raj 1
math jay 2
physics kanu 1
chemestry vinod 2
chemestry divy 1
13
5th NF
 In above table, Rose takes both Mathematics and Physics class for
Semester 1, but she does not take Physics class for Semester 2. In this
case, combination of all these 3 fields is required to identify a valid data.
Imagine we want to add a new class - Semester3 but do not know which
Subject and who will be taking that subject. We would be simply inserting
a new entry with Class as Semester3 and leaving Lecturer and subject as
NULL.As we discussed above, it's not a good to have such entries.
Moreover, all the three columns together act as a primary key, we cannot
leave other two columns blank!
 Hence we have to decompose the table in such a way that it satisfies all
the rules till 4NF and when join them by using keys, it should yield correct
record. Here, we can represent each lecturer's Subject area and their
classes in a better way.We can divide above table into three - (SUBJECT,
LECTURER), (LECTURER,CLASS), (SUBJECT,CLASS)
14
5th NF
■ After 5th NF.
Subject Lecturer
math raj
math jay
physics kanu
chemestry vinod
chemestry divy
Lecturer Semester
raj 1
jay 2
kanu 1
vinod 2
divy 1
Subject Semester
math 1
math 2
physics 1
chemestry 2
chemestry 1
15
5th NF
■ Now, each of combinations is in three different tables. If we
need to identify who is teaching which subject to which
semester, we need join the keys of each table and get the
result.
■ For example, who teaches Physics to Semester 1, we would be
selecting Physics and Semester1 from table 3 above, join with
table1 using Subject to filter out the lecturer names.Then join
with table2 using Lecturer to get correct lecturer name.That is
we joined key columns of each table to get the correct data.
Hence there is no lose or new data - satisfying 5NF condition.
16
17

More Related Content

Similar to Normalization,1st NF, 2nd NF, 3rd NF, BCNF, 4th NF, 5th NF

Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
Normalization and three normal forms.pptx
Normalization and three normal forms.pptxNormalization and three normal forms.pptx
Normalization and three normal forms.pptxZoha681526
 
normalization ppt.pptx
normalization ppt.pptxnormalization ppt.pptx
normalization ppt.pptxAbdusSadik
 
Normalization
NormalizationNormalization
NormalizationRamesh 4
 
Dependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its typesDependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its typesnsrChowdary1
 
1683368767418684.pdf
1683368767418684.pdf1683368767418684.pdf
1683368767418684.pdfJanoakre
 
normalization of database management ppt
normalization of database management pptnormalization of database management ppt
normalization of database management pptRabiaKabir
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFBiplap Bhattarai
 
Normalization
NormalizationNormalization
Normalizationlingesan
 
databaess.pptx
databaess.pptxdatabaess.pptx
databaess.pptxJanoakre
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in DatabaseA. S. M. Shafi
 
Lecture 6.pptx
Lecture 6.pptxLecture 6.pptx
Lecture 6.pptxDilanAlmsa
 

Similar to Normalization,1st NF, 2nd NF, 3rd NF, BCNF, 4th NF, 5th NF (20)

Assignment#11
Assignment#11Assignment#11
Assignment#11
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
Normalization
NormalizationNormalization
Normalization
 
Normalization and three normal forms.pptx
Normalization and three normal forms.pptxNormalization and three normal forms.pptx
Normalization and three normal forms.pptx
 
normalization ppt.pptx
normalization ppt.pptxnormalization ppt.pptx
normalization ppt.pptx
 
Normalization
NormalizationNormalization
Normalization
 
Dependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its typesDependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its types
 
Research gadot
Research gadotResearch gadot
Research gadot
 
1683368767418684.pdf
1683368767418684.pdf1683368767418684.pdf
1683368767418684.pdf
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
normalization of database management ppt
normalization of database management pptnormalization of database management ppt
normalization of database management ppt
 
Data Modeling
Data ModelingData Modeling
Data Modeling
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Normalization
NormalizationNormalization
Normalization
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
 
Normalization
NormalizationNormalization
Normalization
 
databaess.pptx
databaess.pptxdatabaess.pptx
databaess.pptx
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Lecture 6.pptx
Lecture 6.pptxLecture 6.pptx
Lecture 6.pptx
 

More from Harsh Parmar

Virtual Reality (VR)
Virtual Reality (VR)Virtual Reality (VR)
Virtual Reality (VR)Harsh Parmar
 
Combinational logic With Multiplexers and Decoders
Combinational logic With Multiplexers and DecodersCombinational logic With Multiplexers and Decoders
Combinational logic With Multiplexers and DecodersHarsh Parmar
 
Organization structure
Organization structureOrganization structure
Organization structureHarsh Parmar
 
Traits of a good listener
Traits of a good listenerTraits of a good listener
Traits of a good listenerHarsh Parmar
 
Classification and Characteristics of sound
Classification and Characteristics of  soundClassification and Characteristics of  sound
Classification and Characteristics of soundHarsh Parmar
 
Introduction to engineering graphics
Introduction to engineering graphicsIntroduction to engineering graphics
Introduction to engineering graphicsHarsh Parmar
 
Taylor's and Maclaurin series
Taylor's and Maclaurin seriesTaylor's and Maclaurin series
Taylor's and Maclaurin seriesHarsh Parmar
 
Proxemics and chronemics
Proxemics and chronemicsProxemics and chronemics
Proxemics and chronemicsHarsh Parmar
 
Stair case wiring and tubelight wiring
Stair case wiring and tubelight wiring Stair case wiring and tubelight wiring
Stair case wiring and tubelight wiring Harsh Parmar
 

More from Harsh Parmar (11)

Hawk-Eye System
Hawk-Eye SystemHawk-Eye System
Hawk-Eye System
 
Virtual Reality (VR)
Virtual Reality (VR)Virtual Reality (VR)
Virtual Reality (VR)
 
Combinational logic With Multiplexers and Decoders
Combinational logic With Multiplexers and DecodersCombinational logic With Multiplexers and Decoders
Combinational logic With Multiplexers and Decoders
 
Organization structure
Organization structureOrganization structure
Organization structure
 
Traits of a good listener
Traits of a good listenerTraits of a good listener
Traits of a good listener
 
Classification and Characteristics of sound
Classification and Characteristics of  soundClassification and Characteristics of  sound
Classification and Characteristics of sound
 
Introduction to engineering graphics
Introduction to engineering graphicsIntroduction to engineering graphics
Introduction to engineering graphics
 
Taylor's and Maclaurin series
Taylor's and Maclaurin seriesTaylor's and Maclaurin series
Taylor's and Maclaurin series
 
Proxemics and chronemics
Proxemics and chronemicsProxemics and chronemics
Proxemics and chronemics
 
Laws of motion
Laws of motionLaws of motion
Laws of motion
 
Stair case wiring and tubelight wiring
Stair case wiring and tubelight wiring Stair case wiring and tubelight wiring
Stair case wiring and tubelight wiring
 

Recently uploaded

Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 

Recently uploaded (20)

Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 

Normalization,1st NF, 2nd NF, 3rd NF, BCNF, 4th NF, 5th NF

  • 1. Normalization,1st NF, 2nd NF, 3rd NF, BCNF, 4th NF, 5th NF Prepared by : • Krunal Patel • Vishal Panchal • Harsh Parmar • Dhrumil Patel Guided BY: Prof. Paresh Patel 1
  • 2. DEFINATION ■ Database normalization or normalization : is the process of organizing the attributes and relations of a relational database to reduce data redundancy and improve data redundancy. ■ Normalization is also the process of simplifying the design of a database so that it achieves the optimal structure composed of atomic elements. ■ It include classify like given below ■ 1st NF ,2ndNF,3rdNF, BCNF,4thNF,5thNF. 2
  • 3. 1st NF ■ As per First Normal Form, no two Rows of data must contain repeating group of information i.e each set of column must have a unique value, such that multiple columns cannot be used to fetch the same row. Each table should be organized into rows, and each row should have a primary key that distinguishes it as unique. ■ The Primary key is usually a single column, but sometimes more than one column can be combined to create a single primary key. For example consider a table which is not in First normal form ■ e.g ■ StudentTable : Student Age Subject Adam 15 Biology, Maths Alex 14 Maths Stuart 17 Maths 3
  • 4. 1st NF ■ After 1st NF. Student Age Subject Adam 15 Biology Adam 15 Maths Alex 14 Maths Stuart 17 Maths 1st NF 4
  • 5. ■ As per the Second Normal Form there must not be any partial dependency of any column on primary key. It means that for a table that has concatenated primary key, each column in the table that is not part of the primary key must depend upon the entire concatenated key for its existence. If any column depends only on one part of the concatenated key, then the table fails Second normal form. ■ In example of First Normal Form there are two rows for Adam, to include multiple subjects that he has opted for.While this is searchable, and follows First normal form, it is an inefficient use of space.Also in the aboveTable in First Normal Form, while the candidate key is {Student, Subject}, Age of Student only depends on Student column, which is incorrect as per Second Normal Form.To achieve second normal form, it would be helpful to split out the subjects into an independent table, and match them up using the student names as foreign keys. 2nd NF 5
  • 6. 2nd NF ■ After 2nd NF ■ New StudentTable following 2NF will be : ■ In SubjectTable the candidate key will be {Student, Subject} column. Now, both the above tables qualifies for Second Normal Form and will never suffer from Update Anomalies.Although there are a few complex cases in which table in Second Normal Form suffers Update Anomalies, and to handle those scenariosThird Normal Form is there. Student Age Adam 15 Alex 14 Stuart 17 Student Subject Adam Biology Adam Maths Alex Maths Stuart Maths 2nd NF 2nd NF 6
  • 7. ■ Third Normal form applies that every non-prime attribute of table must be dependent on primary key, or we can say that, there should not be the case that a non-prime attribute is determined by another non-prime attribute. So this transitive functional dependency should be removed from the table and also the table must be in Second Normal form. For example, consider a table with following fields. ■ Student_DetailTable : ■ In this table Student_id is Primary key, but street, city and state depends upon Zip.The dependency between zip and other fields is called transitive dependency. Hence to apply 3NF, we need to move the street, city and state to new table, with Zip as primary key. Student_id Student_name DOB Street city State Zip 3rd NF 7
  • 8. 3rd NF ■ New Student_DetailTable : ■ AddressTable : ■ The advantage of removing transtive dependency is, ■ Amount of data duplication is reduced. ■ Data integrity achieved. Student_id Student_name DOB Zip Zip Street city state 3rd NF 8
  • 9. Boyce and Codd Normal Form (BCNF) ■ Boyce and Codd Normal Form is a higher version of theThird Normal form. This form deals with certain type of anamoly that is not handled by 3NF. A 3NF table which does not have multiple overlapping candidate keys is said to be in BCNF. For a table to be in BCNF, following conditions must be satisfied: ■ R must be in 3rd Normal Form ■ and, for each functional dependency ( X ->Y ), X should be a super Key. consider the following relationship:R(A,B,C,D) and following dependwncies A ->BCD BC->AD D ->B above relationship is already in 3rd NF.keys are A and BC. hence ,in functional dependency, A->BCD ,A is the super key .in second relation, BC->AD,BC is also akey.but in,D->b,d is not a key. Hence we can break our relation ship R into two relationship R1 and R2. 9
  • 10. Boyce and Codd Normal Form (BCNF) R(A,B,C,D) R1(A,D,C) R2(D,B) 10
  • 11. 4th NF ■ Fourth normal form (4NF) is a level of database normalization where there are no non-trivial multivalued dependencies other than a candidate key. ■ It builds on the first three normal forms (1NF, 2NF and 3NF) and the Boyce- Codd Normal Form (BCNF). It states that, in addition to a database meeting the requirements of BCNF, it must not contain more than one multivalued dependency. ■ Multivalued dependency is best illustrated using an example. In a table containing a list of three things - college courses, the lecturer in charge of each course and the recommended book for each course - these three elements (course, lecturer and book) are independent of one another. Changing the course’s recommended book, for instance, has no effect on the course itself.This is an example of multivalued dependency: An item depends on more than one value. In this example, the course depends on both lecturer and book. ■ Thus, 4NF states that a table should not have more than one of these dependencies. 4NF is rarely used outside of academic circles. 11
  • 12. 4th NF ■ E.g 4th NF table will be: ■ After 4th NF Subject Lecturer books math raj b1 math jay b2 physics kanu p1 chemestry vinod c1 Subject Lecturer math raj math jay physics kanu chemestry vinod Subject books math b1 math b2 physics p1 chemestry c1 12
  • 13. 5th NF ■ A database is said to be in 5NF, if and only if, ■ It's in 4NF ■ If we can decompose table further to eliminate redundancy and anomaly, and when we re-join the decomposed tables by means of candidate keys, we should not be losing the original data or any new record set should not arise. In simple words, joining two or more decomposed table should not lose records nor create new records. Subject Lecturer Semester math raj 1 math jay 2 physics kanu 1 chemestry vinod 2 chemestry divy 1 13
  • 14. 5th NF  In above table, Rose takes both Mathematics and Physics class for Semester 1, but she does not take Physics class for Semester 2. In this case, combination of all these 3 fields is required to identify a valid data. Imagine we want to add a new class - Semester3 but do not know which Subject and who will be taking that subject. We would be simply inserting a new entry with Class as Semester3 and leaving Lecturer and subject as NULL.As we discussed above, it's not a good to have such entries. Moreover, all the three columns together act as a primary key, we cannot leave other two columns blank!  Hence we have to decompose the table in such a way that it satisfies all the rules till 4NF and when join them by using keys, it should yield correct record. Here, we can represent each lecturer's Subject area and their classes in a better way.We can divide above table into three - (SUBJECT, LECTURER), (LECTURER,CLASS), (SUBJECT,CLASS) 14
  • 15. 5th NF ■ After 5th NF. Subject Lecturer math raj math jay physics kanu chemestry vinod chemestry divy Lecturer Semester raj 1 jay 2 kanu 1 vinod 2 divy 1 Subject Semester math 1 math 2 physics 1 chemestry 2 chemestry 1 15
  • 16. 5th NF ■ Now, each of combinations is in three different tables. If we need to identify who is teaching which subject to which semester, we need join the keys of each table and get the result. ■ For example, who teaches Physics to Semester 1, we would be selecting Physics and Semester1 from table 3 above, join with table1 using Subject to filter out the lecturer names.Then join with table2 using Lecturer to get correct lecturer name.That is we joined key columns of each table to get the correct data. Hence there is no lose or new data - satisfying 5NF condition. 16
  • 17. 17