SlideShare a Scribd company logo
1 of 22
Presentation topic
Normalization
Submitted to
Sir Azam Rasheed
Submitted by
Rabia Kabir (16750)
Subject:
Database Management system
Outline
• Introduction
• Purposes of normalization
• Characteristics of normalized database
• Problems without normalization
Introduction
The process of producing a simpler and more reliable database
structure is called normalization.
Purposes:
• It makes the database design efficient in performance.
• It reduce the amount of data if possible.
• It makes the database design free update, insertion and deletion
anomalies.
• It makes the design according to the rules of relational databases.
• It identified relationship between entities.
• It makes a design that allows simple retrieval of data.
• It simplifies data maintenance and reduces the need to restructure data.
Characteristics of normalized database
A normalized database should have the following characteristics:
• Each relation must have a key field.
• All fields must contain atomic data.
• There must be no repeating fields.
• Each table must contain information about a single entity.
• Each field in a relation must depend on key fields.
• All non-key fields must be mutually independent.
Problems Without Normalization
Student table:
Rollno name branch hod office_tel
401 Akon CSE Mr. X 53337
402 Bkon CSE Mr. X 53337
403 Ckon CSE Mr. X 53337
404 Dkon CSE Mr. X 53337
• repetition of data increases the size of database.
• Other issues like: insertion ,deletion , updation.
Now how can we solved these problems by normalization.
1st Normal form
The First Normal Form, it should follow the following 4 rules:
• It should only have single(atomic) valued attributes/columns.
• Values stored in a column should be of the same domain
• All the columns in a table should have unique names.
• And the order in which data is stored, does not matter.
• Example: in this the 2 students have
more than 1 subjects. And we have stored
sub name in single column because all the
column name are unique.
roll_no name subject
101 Akon OS, CN
103 Ckon Java
102 Bkon C, C++
How to solve this Problem?
roll_no name subject
101 Akon OS
101 Akon CN
103 Ckon Java
102 Bkon C
102 Bkon C++
2nd Normal Form
It should 2 rules:
• It should be in the First Normal form.
• And, it should not have Partial Dependency.
What is partial dependency?
A Composite Primary Key (a primary key that is made up of
multiple columns), and one of the non-key columns is functionally
dependent on one, but not all of the columns that make up the
Composite Primary Key.
Example:
subject_id subject_name
1 Java
2 C++
3 Php
• Let's create another table Score, to store the marks obtained by
students in the respective subjects. We will also be saving name
of the teacher who teaches that subject along with marks.
• This is Partial Dependency, where an attribute in a table
depends on only a part of the primary key and not on the whole
key.
score_id student_id subject_id marks teacher
1 10 1 70 Java Teacher
2 10 2 75 C++ Teacher
3 11 1 80 Java Teacher
subject_id subject_name teacher
1 Java Java Teacher
2 C++ C++ Teacher
3 bio bio Teacher
How to remove Partial Dependency?
There can be many different solutions for this, but out
objective is to remove teacher's name from Score table.
The simplest solution is to remove columns teacher from
Score table and add it to the Subject table. Hence, the
Subject table will become:
And our Score table is now in the second normal form,
with no partial dependency.
score_id student_id subject_id marks
1 10 1 70
2 10 2 75
3 11 1 80
3rd Normal Form
In the third normal form,
• It should be in the Second Normal form.
• And it should not have Transitive Dependency.
What is Transitive Dependency?
It is a condition in which an attributes is dependent on an attribute
that is not a part of primary key.
for example: when column C is functionally dependent on column
B, and column B is functionally dependent on column A, and
column A is the primary key.
Primary key
Total marks is no depend on the primary key it depend on
exam name and the exam name is not a primary key.
score_id student_id subject_id marks exam_name total_marks
How to remove Transitive Dependency?
The new Exam table:
Advantage of removing Transitive Dependency
The advantage of removing transitive dependency is,
• Amount of data duplication is reduced.
• Data integrity achieved.
exam_id exam_name total_marks
1 Workshop 200
2 Mains 70
3 Practicals 30
Boyce-Codd Normal Form (BCNF)
• It is also a 3.5 normal form because it is the latest version of 3rd
normal form.
Rules for BCNF:
• It should be in the Third Normal Form.
• And, for any dependency A → B, A should be a super key.
student_id subject professor
101 Java P.Java
101 C++ P.Cpp
102 Java P.Java2
103 C# P.Chash
104 Java P.Java
This table satisfies the 1st Normal form because all the
values are atomic, column names are unique and all the
values stored in a particular column are of same domain.
This table also satisfies the 2nd Normal Form as there is
no Partial Dependency . And, there is no Transitive
Dependency, hence the table also satisfies the 3rd Normal
Form . But this table is not in Boyce-Codd Normal Form.
• How to satisfy BCNF?
• Student table
• Professor table
In the table above, student_id, subject form
primary key, which means subject column is
a prime attribute.But, there is one more
dependency, professor → subject.
And while subject is a prime
attribute, professor
is a non-prime attribute, which is not
allowed by BCNF.
Why this table is
not in BCNF?
student_id p_id
101 1
101 2
and so on...
p_id professor subject
1 P.Java Java
2 P.Cpp C++
and so on...
4th Normal form
• Rules:
• It should be in the Boyce-Codd Normal Form.
• And, the table should not have any Multi-valued Dependency.
What is Multi-valued Dependency?
• For a dependency A → B, if for a single value of A, multiple
value of B exists, then the table may have multi-valued dependency.
• Also, a table should have at-least 3 columns for it to have a multi-
valued dependency.
• And for relation if there is multi-valued deoendency between,A and B,
then B and C should be independent of each other.
If all these condition are true for any relation(table), it is said to be
multi- valued dependency.
s_id course hobby
1 Science Cricket
1 Maths Hockey
1 Science Hockey
1 Maths Cricket
In the table
above, there is no
relationship
between the
columns course
and hobby.
They are
independent of
each other.
How to satisfy 4th Normal Form?
To make the above relation satisfy the
4th normal form, we can decompose the
table into 2 tables.
Course table Hobbies table
s_id course
1 Science
1 Maths
2 C#
2 Php
s_id hobby
1 Cricket
1 Hockey
2 Cricket
2 Hockey
A table can also have functional dependency along with
multi-valued dependency. In that case, the functionally
dependent columns are moved in a separate table and
the multi-valued dependent columns are moved to
separate tables.
5th Normal form
• Fifth normal form (5NF), also known as project-join normal
form (PJ/NF), is a level of database normalization designed to
reduce redundancy in relational databases recording multi-valued
facts by isolating semantically related multiple relationships.
6th Normal form
• Sixth Normal Form is the irreducible Normal Form, there
will be no further NFs after this, because the data cannot be
Normalized further. ... The definition of 6NF is: a table is in
6NF when the row contains the Primary Key, and at most
one, attribute.
Thank you
any Question?

More Related Content

Similar to normalization of database management ppt

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 in Database Management System.pptx
Normalization in Database Management System.pptxNormalization in Database Management System.pptx
Normalization in Database Management System.pptxRoshni814224
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDr. GOPINATH D
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelKunal Anand
 
Database - Normalization
Database - NormalizationDatabase - Normalization
Database - NormalizationMudasir Qazi
 
data Normalization.pdf
data Normalization.pdfdata Normalization.pdf
data Normalization.pdfBijayNag1
 
CIS 111 STUDY Achievement Education--cis111 study.com
CIS 111 STUDY Achievement Education--cis111 study.comCIS 111 STUDY Achievement Education--cis111 study.com
CIS 111 STUDY Achievement Education--cis111 study.comclaric153
 
CIS 111 STUDY Redefined Education--cis111study.com
CIS 111 STUDY Redefined Education--cis111study.comCIS 111 STUDY Redefined Education--cis111study.com
CIS 111 STUDY Redefined Education--cis111study.comclaric192
 
CIS 111 STUDY Become Exceptional--cis111study.com
CIS 111 STUDY Become Exceptional--cis111study.comCIS 111 STUDY Become Exceptional--cis111study.com
CIS 111 STUDY Become Exceptional--cis111study.comclaric102
 
CIS 111 STUDY Education Counseling--cis111study.com
 CIS 111 STUDY Education Counseling--cis111study.com CIS 111 STUDY Education Counseling--cis111study.com
CIS 111 STUDY Education Counseling--cis111study.comshanaabe12
 
Normalization.pdf
Normalization.pdfNormalization.pdf
Normalization.pdfabhijose1
 
CIS 111 STUDY Introduction Education--cis111study.com
CIS 111 STUDY Introduction Education--cis111study.comCIS 111 STUDY Introduction Education--cis111study.com
CIS 111 STUDY Introduction Education--cis111study.comclaric262
 

Similar to normalization of database management ppt (20)

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 in Database Management System.pptx
Normalization in Database Management System.pptxNormalization in Database Management System.pptx
Normalization in Database Management System.pptx
 
Kumar lav
Kumar lavKumar lav
Kumar lav
 
Normalization in databases
Normalization in databasesNormalization in databases
Normalization in databases
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEM
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data Model
 
Database - Normalization
Database - NormalizationDatabase - Normalization
Database - Normalization
 
DBMS
DBMSDBMS
DBMS
 
Db lec 06_new
Db lec 06_newDb lec 06_new
Db lec 06_new
 
data Normalization.pdf
data Normalization.pdfdata Normalization.pdf
data Normalization.pdf
 
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
 
CIS 111 STUDY Achievement Education--cis111 study.com
CIS 111 STUDY Achievement Education--cis111 study.comCIS 111 STUDY Achievement Education--cis111 study.com
CIS 111 STUDY Achievement Education--cis111 study.com
 
CIS 111 STUDY Redefined Education--cis111study.com
CIS 111 STUDY Redefined Education--cis111study.comCIS 111 STUDY Redefined Education--cis111study.com
CIS 111 STUDY Redefined Education--cis111study.com
 
CIS 111 STUDY Become Exceptional--cis111study.com
CIS 111 STUDY Become Exceptional--cis111study.comCIS 111 STUDY Become Exceptional--cis111study.com
CIS 111 STUDY Become Exceptional--cis111study.com
 
Normalisation and anomalies
Normalisation and anomaliesNormalisation and anomalies
Normalisation and anomalies
 
CIS 111 STUDY Education Counseling--cis111study.com
 CIS 111 STUDY Education Counseling--cis111study.com CIS 111 STUDY Education Counseling--cis111study.com
CIS 111 STUDY Education Counseling--cis111study.com
 
Normalization.pdf
Normalization.pdfNormalization.pdf
Normalization.pdf
 
CIS 111 STUDY Introduction Education--cis111study.com
CIS 111 STUDY Introduction Education--cis111study.comCIS 111 STUDY Introduction Education--cis111study.com
CIS 111 STUDY Introduction Education--cis111study.com
 
Chapter5.pptx
Chapter5.pptxChapter5.pptx
Chapter5.pptx
 
Exception & Database
Exception & DatabaseException & Database
Exception & Database
 

Recently uploaded

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Recently uploaded (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 

normalization of database management ppt

  • 1. Presentation topic Normalization Submitted to Sir Azam Rasheed Submitted by Rabia Kabir (16750) Subject: Database Management system
  • 2. Outline • Introduction • Purposes of normalization • Characteristics of normalized database • Problems without normalization
  • 3. Introduction The process of producing a simpler and more reliable database structure is called normalization. Purposes: • It makes the database design efficient in performance. • It reduce the amount of data if possible. • It makes the database design free update, insertion and deletion anomalies. • It makes the design according to the rules of relational databases. • It identified relationship between entities. • It makes a design that allows simple retrieval of data. • It simplifies data maintenance and reduces the need to restructure data.
  • 4. Characteristics of normalized database A normalized database should have the following characteristics: • Each relation must have a key field. • All fields must contain atomic data. • There must be no repeating fields. • Each table must contain information about a single entity. • Each field in a relation must depend on key fields. • All non-key fields must be mutually independent.
  • 5. Problems Without Normalization Student table: Rollno name branch hod office_tel 401 Akon CSE Mr. X 53337 402 Bkon CSE Mr. X 53337 403 Ckon CSE Mr. X 53337 404 Dkon CSE Mr. X 53337 • repetition of data increases the size of database. • Other issues like: insertion ,deletion , updation. Now how can we solved these problems by normalization.
  • 6. 1st Normal form The First Normal Form, it should follow the following 4 rules: • It should only have single(atomic) valued attributes/columns. • Values stored in a column should be of the same domain • All the columns in a table should have unique names. • And the order in which data is stored, does not matter. • Example: in this the 2 students have more than 1 subjects. And we have stored sub name in single column because all the column name are unique. roll_no name subject 101 Akon OS, CN 103 Ckon Java 102 Bkon C, C++
  • 7. How to solve this Problem? roll_no name subject 101 Akon OS 101 Akon CN 103 Ckon Java 102 Bkon C 102 Bkon C++
  • 8. 2nd Normal Form It should 2 rules: • It should be in the First Normal form. • And, it should not have Partial Dependency. What is partial dependency? A Composite Primary Key (a primary key that is made up of multiple columns), and one of the non-key columns is functionally dependent on one, but not all of the columns that make up the Composite Primary Key. Example: subject_id subject_name 1 Java 2 C++ 3 Php
  • 9. • Let's create another table Score, to store the marks obtained by students in the respective subjects. We will also be saving name of the teacher who teaches that subject along with marks. • This is Partial Dependency, where an attribute in a table depends on only a part of the primary key and not on the whole key. score_id student_id subject_id marks teacher 1 10 1 70 Java Teacher 2 10 2 75 C++ Teacher 3 11 1 80 Java Teacher
  • 10. subject_id subject_name teacher 1 Java Java Teacher 2 C++ C++ Teacher 3 bio bio Teacher How to remove Partial Dependency? There can be many different solutions for this, but out objective is to remove teacher's name from Score table. The simplest solution is to remove columns teacher from Score table and add it to the Subject table. Hence, the Subject table will become:
  • 11. And our Score table is now in the second normal form, with no partial dependency. score_id student_id subject_id marks 1 10 1 70 2 10 2 75 3 11 1 80
  • 12. 3rd Normal Form In the third normal form, • It should be in the Second Normal form. • And it should not have Transitive Dependency. What is Transitive Dependency? It is a condition in which an attributes is dependent on an attribute that is not a part of primary key. for example: when column C is functionally dependent on column B, and column B is functionally dependent on column A, and column A is the primary key.
  • 13. Primary key Total marks is no depend on the primary key it depend on exam name and the exam name is not a primary key. score_id student_id subject_id marks exam_name total_marks
  • 14. How to remove Transitive Dependency? The new Exam table: Advantage of removing Transitive Dependency The advantage of removing transitive dependency is, • Amount of data duplication is reduced. • Data integrity achieved. exam_id exam_name total_marks 1 Workshop 200 2 Mains 70 3 Practicals 30
  • 15. Boyce-Codd Normal Form (BCNF) • It is also a 3.5 normal form because it is the latest version of 3rd normal form. Rules for BCNF: • It should be in the Third Normal Form. • And, for any dependency A → B, A should be a super key. student_id subject professor 101 Java P.Java 101 C++ P.Cpp 102 Java P.Java2 103 C# P.Chash 104 Java P.Java
  • 16. This table satisfies the 1st Normal form because all the values are atomic, column names are unique and all the values stored in a particular column are of same domain. This table also satisfies the 2nd Normal Form as there is no Partial Dependency . And, there is no Transitive Dependency, hence the table also satisfies the 3rd Normal Form . But this table is not in Boyce-Codd Normal Form.
  • 17. • How to satisfy BCNF? • Student table • Professor table In the table above, student_id, subject form primary key, which means subject column is a prime attribute.But, there is one more dependency, professor → subject. And while subject is a prime attribute, professor is a non-prime attribute, which is not allowed by BCNF. Why this table is not in BCNF? student_id p_id 101 1 101 2 and so on... p_id professor subject 1 P.Java Java 2 P.Cpp C++ and so on...
  • 18. 4th Normal form • Rules: • It should be in the Boyce-Codd Normal Form. • And, the table should not have any Multi-valued Dependency. What is Multi-valued Dependency? • For a dependency A → B, if for a single value of A, multiple value of B exists, then the table may have multi-valued dependency. • Also, a table should have at-least 3 columns for it to have a multi- valued dependency. • And for relation if there is multi-valued deoendency between,A and B, then B and C should be independent of each other. If all these condition are true for any relation(table), it is said to be multi- valued dependency.
  • 19. s_id course hobby 1 Science Cricket 1 Maths Hockey 1 Science Hockey 1 Maths Cricket In the table above, there is no relationship between the columns course and hobby. They are independent of each other. How to satisfy 4th Normal Form? To make the above relation satisfy the 4th normal form, we can decompose the table into 2 tables.
  • 20. Course table Hobbies table s_id course 1 Science 1 Maths 2 C# 2 Php s_id hobby 1 Cricket 1 Hockey 2 Cricket 2 Hockey A table can also have functional dependency along with multi-valued dependency. In that case, the functionally dependent columns are moved in a separate table and the multi-valued dependent columns are moved to separate tables.
  • 21. 5th Normal form • Fifth normal form (5NF), also known as project-join normal form (PJ/NF), is a level of database normalization designed to reduce redundancy in relational databases recording multi-valued facts by isolating semantically related multiple relationships. 6th Normal form • Sixth Normal Form is the irreducible Normal Form, there will be no further NFs after this, because the data cannot be Normalized further. ... The definition of 6NF is: a table is in 6NF when the row contains the Primary Key, and at most one, attribute.