SlideShare a Scribd company logo
1 of 18
 It is a process of converting a complex, large and unstable
relation into a set of simple, small and stable relations.
 It is a process of efficiently organizing data in a database.
 Normalization results in a well structured relation – a relation
that contains min. redundancy and allows insert, update and
delete without errors/inconsistencies.
 Errors or inconsistencies caused by redundant data are also
called anomalies.
 There are three types of anomalies:
a) Insert Anomaly.
b) Delete Anomaly.
c) Update Anomaly.
a) Insert Anomaly.
 It occurs when extra data beyond the desired data
must be added to the database.
b) Update Anomaly.
 It occurs when it is necessary to change multiple rows
to modify only a single fact.
c) Delete Anomaly.
 It occurs when deleting a row causes some unwanted
deletions.
 Normalization is based on the analysis of Functional Dependency (FD).
 A FD is a relationship between two attributes A & B of a relation R,
such that attribute B is said to be functionally dependent on attribute
A, if A uniquely determines the values of B.(A->B)
 The attribute on the left-hand side of the arrow in a functional
dependency is called Determinant and on the right are called
Dependents.
 An attribute may be functionally dependent on more than one
attributes.
Date a Course is completed is completely determined
by the EMP_ID and Course_Title
EMP_ID Name Dept_Name Salary
EMPLOYEE1
EMPLOYEE2
EMP_ID Course_Title Name Dept_Name Salary Date_Completed
 Functional Dependencies can be thought of as an integrity
constraints that encode data semantics.
 Functional Dependencies are helpful in identifying the keys for a
given relation and to replace a relation with a collection of
smaller relations.
 An attribute or set of attributes is a key, if it can functionally
determine the other attributes of the relation.
 Example: Consider a relation R (A, B, C, D, E) with the following
FDs:
 A -> D
 D -> B
 B -> C
 E -> B
 Normalization process is built around the concept of Normal
Forms.
 A Normal Form is a state of a relation that can be determined
by applying simple rules regarding functional Dependencies.
◦ First Normal Form
◦ Second Normal Form
◦ Third Normal Form
◦ Boyce Codd Normal Form
◦ Fourth Normal Form
◦ Fifth Normal Form
Table with
Multivalued attribute
Remove multivalued attributes
Remove partial dependencies
Remove transitive dependencies
Removing remaining anomalies
Remove multivalued dependencies
Remove remaining anomalies
First Normal Form
Second Normal Form
Third Normal Form
Boyce-Codd
Normal Form
Fourth Normal Form
Fifth Normal Form
 A relation is said to be in 1NF, if it contains no Repeating Group (RG).
 A RG is a collection of multi-valued attributes OR when there is more
than one field storing the same kind of information in a single table,
there is a RG.
 To eliminate a RG, the value at the intersection of a row and column must
be atomic(having one value).
 If you developed a logical design by transforming ER diagram into
relations, there should not be any multivalued attributes remaining
 Consider the following relation:
Student (RegNo, Name, Program, C-Code, C-Title, C-Grade)
 This relation has a repeating group consisting of C-Code, C-Title, C-Grade
and therefore it has the insert, delete and update anomalies.
 Multiple values create problems in performing operations like select or
join.
 The relation Student can be converted into 1NF using either of
the following methods:
a) Change the PK of the relation and define a composite key
RegNo & C_Code. We fill the blanks by duplicating the non-
repeating data. This approach is commonly referred to as
Flattening the table.
b) Split the relation into 2 relations by placing the repeating data
along with a copy of the original key attribute(s) in a separate
relation. The new relation will always have concatenated key.
Student (RegNo, Name, Program)
Course (RegNo, C-Code, C-Title, C_Grade)
Example 2: STD(stId, stName, stAdr, prName, bkId)
 A relation is in 2NF if:
◦ It is in 1NF
◦ Every nonkey attribute is fully functionally dependent on the
primary key
 A situation of Partial Functional Dependency arises when PK
of a relation is composite and a non key attribute is
functionally dependent on part (but not all) of the PK.
 Referring to the Course relation:
Course (RegNo, C-Code,C-Title, C_Grade)
 The functional dependencies are:
C-Code -> C_Title (Partial FD)
RegNo,C_Code -> C_Grade (Full FD)
 Since all the non key attributes are not fully functionally
dependent on the PK or there is partial functional
dependency in the relation, therefore it is not in 2NF.
 The Anomalies associated with the course relation are:
a) Insert Anomaly:
 A course instance cant be inserted without a student (RegNo)
b) Delete Anomaly.
 Deleting a student will unnecessarily delete course data.
c) Update Anomaly.
 A course cant be updated independently.
 The process for transforming a 1NF table to 2NF is:
◦ Identify any determinants other than the composite key, and the
columns they determine.
◦ Create and name a new table for each determinant and the
unique columns it determines.
◦ Move the determined columns from the original table to the
new table. The determinate becomes the primary key of the
new table.
◦ Delete the columns you just moved from the original table
except for the determinate which will serve as a foreign key.
◦ The original table may be renamed to maintain semantic
meaning.
 The relation Course can be converted into 2NF by
decomposing it into the following relations:
Course (C-Code,C-Title)
Result (RegNo, C-Code, C_Grade)
 A relation in 1NF will be in 2NF if:
◦ The PK consists of only one attribute OR
◦ No nonkey attributes exist in the relation OR
◦ Every nonkey attribute is functionally dependent on
the full set of primary key attributes
 A relation is said to be in 3NF, if it is in 2NF and there is no
Transitive Dependency.
 A Transitive Dependency is a functional dependency between
two or more non key attributes of a relation.
 Consider the following relation:
Emp (EmpNo, EName, Job, Sal, Proj-No,Proj-Details)
 In the above relation, there is a following transitive
dependency:
Proj-No -> Proj-Details
 Due to this, project information cant be maintained
independent of a employee record and hence there are
anomalies in the relation.
 You can remove transitive dependency from a relation in the
following way:
 Create a new relation against transitively dependent
attributes and leave the PK of new relation in the old relation
to serve as a FK.
Emp (EmpNo, EName, Job, Sal, Proj-No)
Project (Proj-No, Proj-Details)
More Example:
Ex2: STD (stId, stName, stAdr, prName, prCrdts)
◦ stId -> stName, stAdr, prName, prCrdts
◦ prName -> prCrdts
 The process of transforming a table into 3NF is:
◦ Identify any determinants, other the primary key, and the
columns they determine.
◦ Create and name a new table for each determinant and the
unique columns it determines.
◦ Move the determined columns from the original table to the
new table. The determinate becomes the primary key of the
new table.
◦ Delete the columns you just moved from the original table
except for the determinate which will serve as a foreign key.
◦ The original table may be renamed to maintain semantic
meaning.
 Student Relation:
RegNo, Name, Address, Program, C-Code, C-Title, C-Grade
 Patient Relation:
PatNo, PatName, PatAge, VisitNo, VisitDate, DNo, DName, DSpeciality,
Diagnosis
 Project Relation:
PNo, PName, PBudget, EmpNo, EName, Job, ChgHour, Hours

More Related Content

What's hot

Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Eddyzulham Mahluzydde
 
Database normalization
Database normalizationDatabase normalization
Database normalizationJignesh Jain
 
Database normalization
Database normalizationDatabase normalization
Database normalizationEdward Blurock
 
Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1Eddyzulham Mahluzydde
 
Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management SystemDrishti Bhalla
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMSkoolkampus
 
Referential integrity
Referential integrityReferential integrity
Referential integrityJubin Raju
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Oum Saokosal
 
Sql ch 9 - data integrity
Sql ch 9 - data integritySql ch 9 - data integrity
Sql ch 9 - data integrityMukesh Tekwani
 
Learn Normalization in simple language
Learn Normalization in simple languageLearn Normalization in simple language
Learn Normalization in simple languageFirstWire Apps
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data ModelSmriti Jain
 
Database Normalisation
Database NormalisationDatabase Normalisation
Database NormalisationAmin Omi
 
Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Prosanta Ghosh
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraintsmadhav bansal
 

What's hot (20)

Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3Chapter 2 Relational Data Model-part 3
Chapter 2 Relational Data Model-part 3
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Normal forms
Normal formsNormal forms
Normal forms
 
09.01 normalization
09.01 normalization09.01 normalization
09.01 normalization
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1Chapter 2 Relational Data Model-part1
Chapter 2 Relational Data Model-part1
 
Dbms relational data model and sql queries
Dbms relational data model and sql queries Dbms relational data model and sql queries
Dbms relational data model and sql queries
 
Fd & Normalization - Database Management System
Fd & Normalization - Database Management SystemFd & Normalization - Database Management System
Fd & Normalization - Database Management System
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMS
 
Referential integrity
Referential integrityReferential integrity
Referential integrity
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Sql ch 9 - data integrity
Sql ch 9 - data integritySql ch 9 - data integrity
Sql ch 9 - data integrity
 
Learn Normalization in simple language
Learn Normalization in simple languageLearn Normalization in simple language
Learn Normalization in simple language
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
 
Database Normalisation
Database NormalisationDatabase Normalisation
Database Normalisation
 
Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 

Viewers also liked (13)

Vaisakhppt
VaisakhpptVaisakhppt
Vaisakhppt
 
Habilidades tecnicas
Habilidades tecnicasHabilidades tecnicas
Habilidades tecnicas
 
BIOLOGI
BIOLOGIBIOLOGI
BIOLOGI
 
Erin crawford design portfolio
Erin crawford design portfolioErin crawford design portfolio
Erin crawford design portfolio
 
Habilidades Administrativas
Habilidades AdministrativasHabilidades Administrativas
Habilidades Administrativas
 
Innovative work
Innovative workInnovative work
Innovative work
 
Administrative skill
Administrative skillAdministrative skill
Administrative skill
 
Ipay presentation
Ipay presentationIpay presentation
Ipay presentation
 
financial options
financial optionsfinancial options
financial options
 
ga Hà Nội.
ga Hà Nội.ga Hà Nội.
ga Hà Nội.
 
Audio script - Electromagnetic induction
Audio script - Electromagnetic inductionAudio script - Electromagnetic induction
Audio script - Electromagnetic induction
 
Presentasi Destilasi
Presentasi DestilasiPresentasi Destilasi
Presentasi Destilasi
 
Makalah destilasi kelompok 3
Makalah destilasi kelompok 3Makalah destilasi kelompok 3
Makalah destilasi kelompok 3
 

Similar to Database Normalization Explained

DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.pptKalpanaThakre2
 
chapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdfchapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdfMisganawAbeje1
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.pptDeependra35
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdfShivani139202
 
MODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptMODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptBelkinAntony1
 
Chapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdfChapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdfTamiratDejene1
 
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.pptMODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.pptHemaSenthil5
 
Penormalan/Normalization
Penormalan/NormalizationPenormalan/Normalization
Penormalan/NormalizationJoan Ador
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-NormalisationAjit Nayak
 
Design dbms
Design dbmsDesign dbms
Design dbmsIIITA
 
Ibps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloudIbps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloudaffairs cloud
 
Ibps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloudIbps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloudaffairs cloud
 
MODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in designMODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in designHemaSenthil5
 

Similar to Database Normalization Explained (20)

Chapter 3 ( PART 2 ).pptx
Chapter 3 ( PART 2 ).pptxChapter 3 ( PART 2 ).pptx
Chapter 3 ( PART 2 ).pptx
 
DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.ppt
 
chapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdfchapter 4-Functional Dependency and Normilization.pdf
chapter 4-Functional Dependency and Normilization.pdf
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.ppt
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdf
 
Normalization
NormalizationNormalization
Normalization
 
Rdbms
RdbmsRdbms
Rdbms
 
MODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptMODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.ppt
 
Chapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdfChapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdf
 
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.pptMODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
 
DBMS.pdf
DBMS.pdfDBMS.pdf
DBMS.pdf
 
Penormalan/Normalization
Penormalan/NormalizationPenormalan/Normalization
Penormalan/Normalization
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-Normalisation
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Design dbms
Design dbmsDesign dbms
Design dbms
 
Ibps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloudIbps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloud
 
Ibps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloudIbps it officer exam capsule by affairs cloud
Ibps it officer exam capsule by affairs cloud
 
MODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in designMODULE 3 -Normalization_1.ppt moduled in design
MODULE 3 -Normalization_1.ppt moduled in design
 
UNIT 2 -PPT.pptx
UNIT 2 -PPT.pptxUNIT 2 -PPT.pptx
UNIT 2 -PPT.pptx
 
DATABASE DESIGN.pptx
DATABASE DESIGN.pptxDATABASE DESIGN.pptx
DATABASE DESIGN.pptx
 

Recently uploaded

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 

Database Normalization Explained

  • 1.
  • 2.  It is a process of converting a complex, large and unstable relation into a set of simple, small and stable relations.  It is a process of efficiently organizing data in a database.  Normalization results in a well structured relation – a relation that contains min. redundancy and allows insert, update and delete without errors/inconsistencies.  Errors or inconsistencies caused by redundant data are also called anomalies.  There are three types of anomalies: a) Insert Anomaly. b) Delete Anomaly. c) Update Anomaly.
  • 3. a) Insert Anomaly.  It occurs when extra data beyond the desired data must be added to the database. b) Update Anomaly.  It occurs when it is necessary to change multiple rows to modify only a single fact. c) Delete Anomaly.  It occurs when deleting a row causes some unwanted deletions.
  • 4.  Normalization is based on the analysis of Functional Dependency (FD).  A FD is a relationship between two attributes A & B of a relation R, such that attribute B is said to be functionally dependent on attribute A, if A uniquely determines the values of B.(A->B)  The attribute on the left-hand side of the arrow in a functional dependency is called Determinant and on the right are called Dependents.  An attribute may be functionally dependent on more than one attributes.
  • 5. Date a Course is completed is completely determined by the EMP_ID and Course_Title EMP_ID Name Dept_Name Salary EMPLOYEE1 EMPLOYEE2 EMP_ID Course_Title Name Dept_Name Salary Date_Completed
  • 6.  Functional Dependencies can be thought of as an integrity constraints that encode data semantics.  Functional Dependencies are helpful in identifying the keys for a given relation and to replace a relation with a collection of smaller relations.  An attribute or set of attributes is a key, if it can functionally determine the other attributes of the relation.  Example: Consider a relation R (A, B, C, D, E) with the following FDs:  A -> D  D -> B  B -> C  E -> B
  • 7.  Normalization process is built around the concept of Normal Forms.  A Normal Form is a state of a relation that can be determined by applying simple rules regarding functional Dependencies. ◦ First Normal Form ◦ Second Normal Form ◦ Third Normal Form ◦ Boyce Codd Normal Form ◦ Fourth Normal Form ◦ Fifth Normal Form
  • 8. Table with Multivalued attribute Remove multivalued attributes Remove partial dependencies Remove transitive dependencies Removing remaining anomalies Remove multivalued dependencies Remove remaining anomalies First Normal Form Second Normal Form Third Normal Form Boyce-Codd Normal Form Fourth Normal Form Fifth Normal Form
  • 9.  A relation is said to be in 1NF, if it contains no Repeating Group (RG).  A RG is a collection of multi-valued attributes OR when there is more than one field storing the same kind of information in a single table, there is a RG.  To eliminate a RG, the value at the intersection of a row and column must be atomic(having one value).  If you developed a logical design by transforming ER diagram into relations, there should not be any multivalued attributes remaining  Consider the following relation: Student (RegNo, Name, Program, C-Code, C-Title, C-Grade)  This relation has a repeating group consisting of C-Code, C-Title, C-Grade and therefore it has the insert, delete and update anomalies.  Multiple values create problems in performing operations like select or join.
  • 10.  The relation Student can be converted into 1NF using either of the following methods: a) Change the PK of the relation and define a composite key RegNo & C_Code. We fill the blanks by duplicating the non- repeating data. This approach is commonly referred to as Flattening the table. b) Split the relation into 2 relations by placing the repeating data along with a copy of the original key attribute(s) in a separate relation. The new relation will always have concatenated key. Student (RegNo, Name, Program) Course (RegNo, C-Code, C-Title, C_Grade) Example 2: STD(stId, stName, stAdr, prName, bkId)
  • 11.  A relation is in 2NF if: ◦ It is in 1NF ◦ Every nonkey attribute is fully functionally dependent on the primary key  A situation of Partial Functional Dependency arises when PK of a relation is composite and a non key attribute is functionally dependent on part (but not all) of the PK.  Referring to the Course relation: Course (RegNo, C-Code,C-Title, C_Grade)  The functional dependencies are: C-Code -> C_Title (Partial FD) RegNo,C_Code -> C_Grade (Full FD)
  • 12.  Since all the non key attributes are not fully functionally dependent on the PK or there is partial functional dependency in the relation, therefore it is not in 2NF.  The Anomalies associated with the course relation are: a) Insert Anomaly:  A course instance cant be inserted without a student (RegNo) b) Delete Anomaly.  Deleting a student will unnecessarily delete course data. c) Update Anomaly.  A course cant be updated independently.
  • 13.  The process for transforming a 1NF table to 2NF is: ◦ Identify any determinants other than the composite key, and the columns they determine. ◦ Create and name a new table for each determinant and the unique columns it determines. ◦ Move the determined columns from the original table to the new table. The determinate becomes the primary key of the new table. ◦ Delete the columns you just moved from the original table except for the determinate which will serve as a foreign key. ◦ The original table may be renamed to maintain semantic meaning.
  • 14.  The relation Course can be converted into 2NF by decomposing it into the following relations: Course (C-Code,C-Title) Result (RegNo, C-Code, C_Grade)  A relation in 1NF will be in 2NF if: ◦ The PK consists of only one attribute OR ◦ No nonkey attributes exist in the relation OR ◦ Every nonkey attribute is functionally dependent on the full set of primary key attributes
  • 15.  A relation is said to be in 3NF, if it is in 2NF and there is no Transitive Dependency.  A Transitive Dependency is a functional dependency between two or more non key attributes of a relation.  Consider the following relation: Emp (EmpNo, EName, Job, Sal, Proj-No,Proj-Details)  In the above relation, there is a following transitive dependency: Proj-No -> Proj-Details  Due to this, project information cant be maintained independent of a employee record and hence there are anomalies in the relation.
  • 16.  You can remove transitive dependency from a relation in the following way:  Create a new relation against transitively dependent attributes and leave the PK of new relation in the old relation to serve as a FK. Emp (EmpNo, EName, Job, Sal, Proj-No) Project (Proj-No, Proj-Details) More Example: Ex2: STD (stId, stName, stAdr, prName, prCrdts) ◦ stId -> stName, stAdr, prName, prCrdts ◦ prName -> prCrdts
  • 17.  The process of transforming a table into 3NF is: ◦ Identify any determinants, other the primary key, and the columns they determine. ◦ Create and name a new table for each determinant and the unique columns it determines. ◦ Move the determined columns from the original table to the new table. The determinate becomes the primary key of the new table. ◦ Delete the columns you just moved from the original table except for the determinate which will serve as a foreign key. ◦ The original table may be renamed to maintain semantic meaning.
  • 18.  Student Relation: RegNo, Name, Address, Program, C-Code, C-Title, C-Grade  Patient Relation: PatNo, PatName, PatAge, VisitNo, VisitDate, DNo, DName, DSpeciality, Diagnosis  Project Relation: PNo, PName, PBudget, EmpNo, EName, Job, ChgHour, Hours