SlideShare a Scribd company logo
1 of 27
Download to read offline
Prepared By:
BIPLAP BHATTARAI
 The biggest problem needed to be solved in database is data
redundancy.
 Why data redundancy is the problem? Because it causes:
Insert Anomaly
Update Anomaly
Delete Anomaly
Teacher Subject Teacher Degree Tel
Sok San Database Master's 012666777
Van Sokhen Database Bachelor's 017678678
Sok San E-Commerce Master's 012666777
Introduction To Normalization
Introduction To Normalization
 Normalization is the process of removing redundant data from your tables to improve
storage efficiency, data integrity, and scalability.
 Normalization generally involves splitting existing tables into multiple ones, which
must be re-joined or linked each time a query is issued.
 Why normalization?
1. The relation derived from the user view or data store will most likely be
unnormalized.
2. The problem usually happens when an existing system uses unstructured file, e.g. in
MS Excel.
Anomalies
A major objective of data normalization is to avoid modification anomalies.
These come in three flavours:
 An insertion anomaly is a failure to place information into all the places in
the database. In a properly normalized database, information about a
new entry needs to be inserted into only one place in the database.
 A deletion anomaly is a failure to remove information about an existing
database entry from all places. In a properly normalized database, the
entry needs to be deleted from only one.
 A update anomaly is a failure to update information about an existing
database entry from all places.
All three kinds of anomalies are highly undesirable, since their occurrence
constitutes corruption of the database.
Duplication vs Redundant Data
Duplicated Data: When an attribute has two or more identical
values
Redundant Data: If you can delete data with a loss of
information
STEPS OF NORMALIZATION
First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Boyce-Codd Normal Form (BCNF)
Fourth Normal Form (4NF)
Fifth Normal Form (5NF)
In practice, 1NF, 2NF, and 3NF are enough for database.
First Normal Form (1NF)
 The official qualifications for 1NF are:
1. Each attribute name must be unique.
2. Each attribute value must be single.
3. Each row must be unique.
4. There is no repeating groups.
 Additional:
Choose a primary key.
 Reminder:
A primary key is unique, not null, unchanged. A primary key can
be either an attribute or combined attributes.
Example of a table not in 1NF :
It violates the 1NF because:
Attribute values are not single.
Repeating groups exists.
Group Topic Student Score
Group A Intro MongoDB Sok San 18 marks
Sao Ry 17 marks
Group B Intro MySQL Chan Tina 19 marks
Tith Sophea 16 marks
After eliminating:
Group Topic Family Name Given Name Score
A Intro MongoDB Sok San 18
A Intro MongoDB Sao Ry 17
B Intro MySQL Chan Tina 19
B Intro MySQL Tith Sophea 16
Functional Dependencies:
 We say an attribute, B, has a functional dependency on another
attribute, A, if for any two records, which have the same value for A,
then the values for B in these two records must be the same. We
illustrate this as:
 A B (read as: A determines B or B depends on A)
employee name project email address
Sok San POS Mart Sys soksan@yahoo.com
Sao Ry Univ Mgt Sys sao@yahoo.com
Sok San Web Redesign soksan@yahoo.com
Chan Sokna POS Mart Sys chan@gmail.com
Sao Ry DB Design sao@yahoo.com
employee name  email address
EmpNum EmpEmail EmpFname EmpLname
123 jdoe@abc.com John Doe
456 psmith@abc.com Peter Smith
555 alee1@abc.com Alan Lee
633 pdoe@abc.com Peter Doe
787 alee2@abc.com Alan Lee
If EmpNum is the PK then the FDs:
EmpNum  EmpEmail, EmpFname, EmpLname
Must exists
Second Normal Form (2NF):
 The official qualifications for 2NF are:
1. A table is already in 1NF.
2. All nonkey attributes are fully dependent on the primary key.
3. All partial dependencies are removed to place in another table.
CourseID SemesterID Num Student Course Name
IT101 201301 25 Database
IT101 201302 25 Database
IT102 201301 30 Web Prog
IT102 201302 35 Web Prog
IT103 201401 20 Networking
Example of a table not in 2NF:
Primary Key
The Course Name depends on only CourseID, a part of the primary key
not the whole primary {CourseID, SemesterID}.It’s called partial
dependency.
Solution:
Remove CourseID and Course Name together to create a new table.
CourseID Course Name
IT101 Database
IT101 Database
IT102 Web Prog
IT102 Web Prog
IT103 Networking
Semester
Done? Oh no, it is still
not in 1NF yet.
Remove the repeating
groups too.
Finally, connect the
relationship.
CourseID Course Name
IT101 Database
IT102 Web Prog
IT103 Networking
CourseID SemesterID Num Student
IT101 201301 25
IT101 201302 25
IT102 201301 30
IT102 201302 35
IT103 201401 20
 The official qualifications for 3NF are:
1. A table is already in 2NF.
2. Nonprimary key attributes do not depend on other nonprimary key
attributes
(i.e. no transitive dependencies)
(All transitive dependencies are removed to place in another table.)
Third Normal Form (3NF):
StudyID Course Name Teacher Name Teacher Tel
1 Database Anaya Upadhay 9842855484
2 Database Sao Kanha 0977 322 111
3 Web Prog Chan Veasna 012 412 333
4 Web Prog Chan Veasna 012 412 333
5 Networking Pou Sambath 077 545 221
Example of a Table not in 3NF:
Primary Key
The Teacher Tel is a nonkey attribute, and
the Teacher Name is also a nonkey atttribute.
But Teacher Tel depends on Teacher Name.
It is called transitive dependency.
Solution:
Remove Teacher Name and Teacher Tel together
to create a new table.
Teacher Name Teacher Tel
Anaya Upadhay 9842855484
Sao Kanha 0977 322 111
Chan Veasna 012 412 333
Chan Veasna 012 412 333
Pou Sambath 077 545 221
Done?
Oh no, it is still not in 1NF yet.
Remove Repeating row.
Teacher Name Teacher Tel
Anaya Upadhay 9842855484
Sao Kanha 0977 322 111
Chan Veasna 012 412 333
Pou Sambath 077 545 221
Note about primary key:
- In theory, you can choose
Teacher Name to be a primary key.
- But in practice, you should add
Teacher ID as the primary key.
ID Teacher Name Teacher Tel
T1 Anaya Upadhay 9842855484
T2 Sao Kanha 0977 322 111
T3 Chan Veasna 012 412 333
T4 Pou Sambath 077 545 221
StudyID Course Name T.ID
1 Database T1
2 Database T2
3 Web Prog T3
4 Web Prog T3
5 Networking T4
Boyce Codd Normal Form (BCNF) – 3.5NF
 The official qualifications for BCNF are:
1. A table is already in 3NF.
2. All determinants must be superkeys.
3. All determinants that are not superkeys are removed to place in
another table.
(A superkey is a set of attributes within a table whose
values can be used to uniquely identify a tuple. A
candidate key is a minimal set of attributes necessary to
identify a tuple; this is also called a minimal superkey.)
SUPER VS CANDIDATE KEY
 Candidate key is a super key from which you cannot remove any fields.
For instance, a software release can be identified either by major/minor version, or by
the build date (we assume nightly builds).
Year Month Date Major Minor
2008 01 13 0 1
2008 04 23 0 2
2009 11 05 1 0
2010 04 05 1 1
 So (year, major, minor) or (year, month, date, major) are super keys
(since they are unique) but not candidate keys, since you can remove
year or major and the remaining set of columns will still be a super
key.
 (year, month, date) and (major, minor) are candidate keys, since you
cannot remove any of the fields from them without breaking
uniqueness.
 Example of a table not in BCNF:
 Key: {Student, Course}
 Functional Dependency:
 {Student, Course} Teacher
 Teacher  Course
 Problem: Teacher is not a superkey but determines Course.
Student Course Teacher
Sok DB John
Sao DB William
Chan E-Commerce Todd
Sok E-Commerce Todd
Chan DB William
Student Course
Sok DB
Sao DB
Chan E-Commerce
Sok E-Commerce
Chan DB
Course Teacher
DB John
DB William
E-Commerce Todd
Course
DB
E-Commerce
Solution: Decouple a table
contains Teacher and Course
from from original table (Student,
Course). Finally, connect the new
and old table to third table
contains Course.
 The official qualifications for 4NF are:
1. A table is already in BCNF.
2. A table contains no multi-valued dependencies.
(2,3,BCNF are concerned with functional dependencies)
 Multi-valued dependency: MVDs occur when two or more
independent multi valued facts about the same attribute occur within
the same table.
 A  B (B multi-valued depends on A)
Forth Normal Form (4NF):
 Example of a table not in 4NF:
 Key: {Student, Major, Hobby}
 MVD: Student  Major, Hobby
Student Major Hobby
Sok IT Football
Sok IT Volleyball
Sao IT Football
Sao Med Football
Chan IT NULL
Puth NULL Football
Tith NULL NULL
Student Major
Sok IT
Sao IT
Sao Med
Chan IT
Puth NULL
Tith NULL
Student Hobby
Sok Football
Sok Volleyball
Sao Football
Chan NULL
Puth Football
Tith NULL
Student
Sok
Sao
Chan
Puth
Tith
Solution: Decouple to each
table contains MVD. Finally,
connect each to a third table
contains Student.
Other one:
Restaurant
Al Pizza
Al Pizza
Al Pizza
At Pizza
Al Pizza
Al Pizza
Elite Pizza
Elite Pizza
Vincenzo's Pizza
Vincenzo's Pizza
Vincenzo's Pizza
Vincenzo's Pizza
Pizza Variety
Thick Crust
Thick Crust
Thick Crust
Stuffed Crust
Stuffed Crust
Stuffed Crust
Thin Crust
Stuffed Crust
Thick Crust
Thick Crust
Thin Crust
Thin Crust
Delivery Area
Springfield
Shelbyville
Capital City
Springfield
Shelbyville
Capital City
Capital City
Capital City
Springfield
Shelbyville
Springfield
Shelbyville
Varieties By Restaurant
Restaurant
At Pizza
Al Pizza
Elite Pizza
Elite Pizza
Vincenzo's Pizza
Vincenzo's Pizza
Pizza Variety
Thick Crust
Stuffed Crust
Thin Crust
Stuffed Crust
Thick Crust
Thin Crust
Delivery Areas By Restaurant
DeliveryArea
Springfield
Shelbyville
Capital City
Capital City
Springfield
Shelbyville
Restaurant
A1 Pizza
A1 Pizza
A1 Pizza
Elite Pizza
Vincenzo's Pizza
Vincenzo's Pizza
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF

More Related Content

What's hot (20)

Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Normalization
NormalizationNormalization
Normalization
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
database Normalization
database Normalizationdatabase Normalization
database Normalization
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management System
 
Dbms normalization
Dbms normalizationDbms normalization
Dbms normalization
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) ModelingEnhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
 
Relational model
Relational modelRelational model
Relational model
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Normalization
NormalizationNormalization
Normalization
 
Bcnf
BcnfBcnf
Bcnf
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
Normalization
NormalizationNormalization
Normalization
 
Normalization 1 nf,2nf,3nf,bcnf
Normalization 1 nf,2nf,3nf,bcnf Normalization 1 nf,2nf,3nf,bcnf
Normalization 1 nf,2nf,3nf,bcnf
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
Learn Normalization in simple language
Learn Normalization in simple languageLearn Normalization in simple language
Learn Normalization in simple language
 
Entity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalizationEntity relationship diagram - Concept on normalization
Entity relationship diagram - Concept on normalization
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 

Similar to Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF

Normalization in Database Management System.pptx
Normalization in Database Management System.pptxNormalization in Database Management System.pptx
Normalization in Database Management System.pptxRoshni814224
 
Presentation on Normalization.pptx
Presentation on Normalization.pptxPresentation on Normalization.pptx
Presentation on Normalization.pptxkshipra sony
 
Normalization and three normal forms.pptx
Normalization and three normal forms.pptxNormalization and three normal forms.pptx
Normalization and three normal forms.pptxZoha681526
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.pptDeependra35
 
data Normalization.pdf
data Normalization.pdfdata Normalization.pdf
data Normalization.pdfBijayNag1
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in DatabaseA. S. M. Shafi
 
1-161103092724.pzxsdfdsdrgdrgdfgdfgdfgdfgptx
1-161103092724.pzxsdfdsdrgdrgdfgdfgdfgdfgptx1-161103092724.pzxsdfdsdrgdrgdfgdfgdfgdfgptx
1-161103092724.pzxsdfdsdrgdrgdfgdfgdfgdfgptxwrushabhsirsat
 
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
 
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
 

Similar to Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF (20)

Normalization in Database Management System.pptx
Normalization in Database Management System.pptxNormalization in Database Management System.pptx
Normalization in Database Management System.pptx
 
Chapter5.pptx
Chapter5.pptxChapter5.pptx
Chapter5.pptx
 
Normalization
NormalizationNormalization
Normalization
 
Presentation on Normalization.pptx
Presentation on Normalization.pptxPresentation on Normalization.pptx
Presentation on Normalization.pptx
 
Normalization and three normal forms.pptx
Normalization and three normal forms.pptxNormalization and three normal forms.pptx
Normalization and three normal forms.pptx
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
Normmmalizzarion.ppt
Normmmalizzarion.pptNormmmalizzarion.ppt
Normmmalizzarion.ppt
 
data Normalization.pdf
data Normalization.pdfdata Normalization.pdf
data Normalization.pdf
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Data Modeling
Data ModelingData Modeling
Data Modeling
 
Normalization
NormalizationNormalization
Normalization
 
1-161103092724.pzxsdfdsdrgdrgdfgdfgdfgdfgptx
1-161103092724.pzxsdfdsdrgdrgdfgdfgdfgdfgptx1-161103092724.pzxsdfdsdrgdrgdfgdfgdfgdfgptx
1-161103092724.pzxsdfdsdrgdrgdfgdfgdfgdfgptx
 
Research gadot
Research gadotResearch gadot
Research gadot
 
1683368767418684.pdf
1683368767418684.pdf1683368767418684.pdf
1683368767418684.pdf
 
Database Normalization.docx
Database Normalization.docxDatabase Normalization.docx
Database Normalization.docx
 
Assignment#11
Assignment#11Assignment#11
Assignment#11
 
normalization of database management ppt
normalization of database management pptnormalization of database management ppt
normalization of database management ppt
 
Year 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st TermYear 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st Term
 
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
 

Recently uploaded

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingThe Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingSelcen Ozturkcan
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central BankingThe Evolution of Money: Digital Transformation and CBDCs in Central Banking
The Evolution of Money: Digital Transformation and CBDCs in Central Banking
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF

  • 2.  The biggest problem needed to be solved in database is data redundancy.  Why data redundancy is the problem? Because it causes: Insert Anomaly Update Anomaly Delete Anomaly Teacher Subject Teacher Degree Tel Sok San Database Master's 012666777 Van Sokhen Database Bachelor's 017678678 Sok San E-Commerce Master's 012666777 Introduction To Normalization
  • 3. Introduction To Normalization  Normalization is the process of removing redundant data from your tables to improve storage efficiency, data integrity, and scalability.  Normalization generally involves splitting existing tables into multiple ones, which must be re-joined or linked each time a query is issued.  Why normalization? 1. The relation derived from the user view or data store will most likely be unnormalized. 2. The problem usually happens when an existing system uses unstructured file, e.g. in MS Excel.
  • 4. Anomalies A major objective of data normalization is to avoid modification anomalies. These come in three flavours:  An insertion anomaly is a failure to place information into all the places in the database. In a properly normalized database, information about a new entry needs to be inserted into only one place in the database.  A deletion anomaly is a failure to remove information about an existing database entry from all places. In a properly normalized database, the entry needs to be deleted from only one.  A update anomaly is a failure to update information about an existing database entry from all places. All three kinds of anomalies are highly undesirable, since their occurrence constitutes corruption of the database.
  • 5. Duplication vs Redundant Data Duplicated Data: When an attribute has two or more identical values Redundant Data: If you can delete data with a loss of information
  • 6. STEPS OF NORMALIZATION First Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF) Boyce-Codd Normal Form (BCNF) Fourth Normal Form (4NF) Fifth Normal Form (5NF) In practice, 1NF, 2NF, and 3NF are enough for database.
  • 7. First Normal Form (1NF)  The official qualifications for 1NF are: 1. Each attribute name must be unique. 2. Each attribute value must be single. 3. Each row must be unique. 4. There is no repeating groups.  Additional: Choose a primary key.  Reminder: A primary key is unique, not null, unchanged. A primary key can be either an attribute or combined attributes.
  • 8. Example of a table not in 1NF : It violates the 1NF because: Attribute values are not single. Repeating groups exists. Group Topic Student Score Group A Intro MongoDB Sok San 18 marks Sao Ry 17 marks Group B Intro MySQL Chan Tina 19 marks Tith Sophea 16 marks
  • 9. After eliminating: Group Topic Family Name Given Name Score A Intro MongoDB Sok San 18 A Intro MongoDB Sao Ry 17 B Intro MySQL Chan Tina 19 B Intro MySQL Tith Sophea 16
  • 10. Functional Dependencies:  We say an attribute, B, has a functional dependency on another attribute, A, if for any two records, which have the same value for A, then the values for B in these two records must be the same. We illustrate this as:  A B (read as: A determines B or B depends on A) employee name project email address Sok San POS Mart Sys soksan@yahoo.com Sao Ry Univ Mgt Sys sao@yahoo.com Sok San Web Redesign soksan@yahoo.com Chan Sokna POS Mart Sys chan@gmail.com Sao Ry DB Design sao@yahoo.com employee name  email address
  • 11. EmpNum EmpEmail EmpFname EmpLname 123 jdoe@abc.com John Doe 456 psmith@abc.com Peter Smith 555 alee1@abc.com Alan Lee 633 pdoe@abc.com Peter Doe 787 alee2@abc.com Alan Lee If EmpNum is the PK then the FDs: EmpNum  EmpEmail, EmpFname, EmpLname Must exists
  • 12. Second Normal Form (2NF):  The official qualifications for 2NF are: 1. A table is already in 1NF. 2. All nonkey attributes are fully dependent on the primary key. 3. All partial dependencies are removed to place in another table.
  • 13. CourseID SemesterID Num Student Course Name IT101 201301 25 Database IT101 201302 25 Database IT102 201301 30 Web Prog IT102 201302 35 Web Prog IT103 201401 20 Networking Example of a table not in 2NF: Primary Key The Course Name depends on only CourseID, a part of the primary key not the whole primary {CourseID, SemesterID}.It’s called partial dependency. Solution: Remove CourseID and Course Name together to create a new table.
  • 14. CourseID Course Name IT101 Database IT101 Database IT102 Web Prog IT102 Web Prog IT103 Networking Semester Done? Oh no, it is still not in 1NF yet. Remove the repeating groups too. Finally, connect the relationship. CourseID Course Name IT101 Database IT102 Web Prog IT103 Networking CourseID SemesterID Num Student IT101 201301 25 IT101 201302 25 IT102 201301 30 IT102 201302 35 IT103 201401 20
  • 15.  The official qualifications for 3NF are: 1. A table is already in 2NF. 2. Nonprimary key attributes do not depend on other nonprimary key attributes (i.e. no transitive dependencies) (All transitive dependencies are removed to place in another table.) Third Normal Form (3NF):
  • 16. StudyID Course Name Teacher Name Teacher Tel 1 Database Anaya Upadhay 9842855484 2 Database Sao Kanha 0977 322 111 3 Web Prog Chan Veasna 012 412 333 4 Web Prog Chan Veasna 012 412 333 5 Networking Pou Sambath 077 545 221 Example of a Table not in 3NF: Primary Key The Teacher Tel is a nonkey attribute, and the Teacher Name is also a nonkey atttribute. But Teacher Tel depends on Teacher Name. It is called transitive dependency. Solution: Remove Teacher Name and Teacher Tel together to create a new table.
  • 17. Teacher Name Teacher Tel Anaya Upadhay 9842855484 Sao Kanha 0977 322 111 Chan Veasna 012 412 333 Chan Veasna 012 412 333 Pou Sambath 077 545 221 Done? Oh no, it is still not in 1NF yet. Remove Repeating row. Teacher Name Teacher Tel Anaya Upadhay 9842855484 Sao Kanha 0977 322 111 Chan Veasna 012 412 333 Pou Sambath 077 545 221 Note about primary key: - In theory, you can choose Teacher Name to be a primary key. - But in practice, you should add Teacher ID as the primary key. ID Teacher Name Teacher Tel T1 Anaya Upadhay 9842855484 T2 Sao Kanha 0977 322 111 T3 Chan Veasna 012 412 333 T4 Pou Sambath 077 545 221 StudyID Course Name T.ID 1 Database T1 2 Database T2 3 Web Prog T3 4 Web Prog T3 5 Networking T4
  • 18. Boyce Codd Normal Form (BCNF) – 3.5NF  The official qualifications for BCNF are: 1. A table is already in 3NF. 2. All determinants must be superkeys. 3. All determinants that are not superkeys are removed to place in another table. (A superkey is a set of attributes within a table whose values can be used to uniquely identify a tuple. A candidate key is a minimal set of attributes necessary to identify a tuple; this is also called a minimal superkey.)
  • 19. SUPER VS CANDIDATE KEY  Candidate key is a super key from which you cannot remove any fields. For instance, a software release can be identified either by major/minor version, or by the build date (we assume nightly builds). Year Month Date Major Minor 2008 01 13 0 1 2008 04 23 0 2 2009 11 05 1 0 2010 04 05 1 1  So (year, major, minor) or (year, month, date, major) are super keys (since they are unique) but not candidate keys, since you can remove year or major and the remaining set of columns will still be a super key.  (year, month, date) and (major, minor) are candidate keys, since you cannot remove any of the fields from them without breaking uniqueness.
  • 20.  Example of a table not in BCNF:  Key: {Student, Course}  Functional Dependency:  {Student, Course} Teacher  Teacher  Course  Problem: Teacher is not a superkey but determines Course. Student Course Teacher Sok DB John Sao DB William Chan E-Commerce Todd Sok E-Commerce Todd Chan DB William
  • 21. Student Course Sok DB Sao DB Chan E-Commerce Sok E-Commerce Chan DB Course Teacher DB John DB William E-Commerce Todd Course DB E-Commerce Solution: Decouple a table contains Teacher and Course from from original table (Student, Course). Finally, connect the new and old table to third table contains Course.
  • 22.  The official qualifications for 4NF are: 1. A table is already in BCNF. 2. A table contains no multi-valued dependencies. (2,3,BCNF are concerned with functional dependencies)  Multi-valued dependency: MVDs occur when two or more independent multi valued facts about the same attribute occur within the same table.  A  B (B multi-valued depends on A) Forth Normal Form (4NF):
  • 23.  Example of a table not in 4NF:  Key: {Student, Major, Hobby}  MVD: Student  Major, Hobby Student Major Hobby Sok IT Football Sok IT Volleyball Sao IT Football Sao Med Football Chan IT NULL Puth NULL Football Tith NULL NULL
  • 24. Student Major Sok IT Sao IT Sao Med Chan IT Puth NULL Tith NULL Student Hobby Sok Football Sok Volleyball Sao Football Chan NULL Puth Football Tith NULL Student Sok Sao Chan Puth Tith Solution: Decouple to each table contains MVD. Finally, connect each to a third table contains Student.
  • 25. Other one: Restaurant Al Pizza Al Pizza Al Pizza At Pizza Al Pizza Al Pizza Elite Pizza Elite Pizza Vincenzo's Pizza Vincenzo's Pizza Vincenzo's Pizza Vincenzo's Pizza Pizza Variety Thick Crust Thick Crust Thick Crust Stuffed Crust Stuffed Crust Stuffed Crust Thin Crust Stuffed Crust Thick Crust Thick Crust Thin Crust Thin Crust Delivery Area Springfield Shelbyville Capital City Springfield Shelbyville Capital City Capital City Capital City Springfield Shelbyville Springfield Shelbyville
  • 26. Varieties By Restaurant Restaurant At Pizza Al Pizza Elite Pizza Elite Pizza Vincenzo's Pizza Vincenzo's Pizza Pizza Variety Thick Crust Stuffed Crust Thin Crust Stuffed Crust Thick Crust Thin Crust Delivery Areas By Restaurant DeliveryArea Springfield Shelbyville Capital City Capital City Springfield Shelbyville Restaurant A1 Pizza A1 Pizza A1 Pizza Elite Pizza Vincenzo's Pizza Vincenzo's Pizza