SlideShare uma empresa Scribd logo
1 de 27
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
NORMALIZATION IN DATABASES
Subhin P.V
111subru@gmail.com
www.facebook.com/111subru
twitter.com/111subru
in.linkedin.com/in/Subhin P.V
8129076036
MAIN POINTS DISCUSSED
• What normalization is and what role it plays in the
database design process
• About the normal forms 1NF, 2NF, 3NF and BCNF
• How normal forms can be transformed from lower
normal forms to higher normal forms
ABOUT NORMALIZATION
• Normalization is the process of efficiently
organizing data in a database.
• Two goals of normalization process:
 Eliminating Redundant Data
 Ensuring data dependencies
• The objective is to isolate data so that changes
of a field can be made in just one table and
then propagated through the rest of the
database using the defined relationships.
Normalization Stages
• 1NF
• 2NF
• 3NF
• Boyce-Codd Normal Form (BCNF or 3.5NF)
Normalization Stages
First Normal Form (1NF)
• The values in each column of a table are
atomic (No multi-value attributes allowed).
• Each table has a primary key: minimal set of
attributes which can uniquely identify a record
• There are no repeating groups: two columns
do not store similar information in the same
table.
Second Normal Form (2NF)
• Meet all the requirements of the first normal
form.
• Remove subsets of data that apply to multiple
rows of a table and place them in separate
tables.
• Create relationships between these new
tables and their predecessors through the use
of foreign keys.
Third Normal Form (3NF)
• Meet all the requirements of the second
normal form.
• Every non-prime attribute of R is non-
transitively dependent (i.e. directly
dependent) on every superkey of R.
• Remove columns that are
not dependent upon the primary key.
Boyce-Codd Normal Form
• Meet all the requirements of the third normal
form.
• Every determinant must be a candidate key.
• Candidate Key:
 Any attribute or a set of attributes together that
has the eligibility to become a primary key.
TRANSFORMATION FROM UNF TO HIGHER
NORMAL FORMS USING AN EXAMPLE
• Example: Institution Having Two departments
– Each Department Has 6 Different Students And Some
Courses
– Each Student in a department can study more than
one Course
– Each course has its course fee.
– Periodically, report is generated that contains
information displayed which can be represented in a
table as shown in next slide.
Un-normalized Form Example
Problems With The Table
– The table displays data redundancies.
– The table has Multivalued Attributes
– The table entries invite data inconsistencies.
– The data redundancies yield the following anomalies:
• Update anomalies.
• Addition anomalies.
• Deletion anomalies.
Conversion to 1st Normal Form
Conversion To 1st Normal Form
– ADVANTAGES
• Each table has at least one minimal set of attributes
which can uniquely identify a record
• The values in each column have Single Value
– DISADVANTAGES
• Redundant data across multiple rows of the table is still
there
• Existence of partial and transitive dependencies
The Dependency diagram
– Depicts all dependencies found within given table
structure
– Helpful in getting bird’s-eye view of all
relationships among table’s attributes
– Makes it less likely that will overlook an important
dependency
Conversion to 2nd Normal Form
{Dep No, Dep_name}
{Stud no, Stud_name, Stud_DOB, Stud_age}
{Dep No, Stud No , Course_name, Course_fee}
Department Details:
Course Details: Student Details:
Conversion to 2nd Normal Form
• Advantages
– eliminates redundant data in the table
– It includes no partial dependencies:
– Create separate tables for sets of values that apply
to multiple records
• Disadvantages
– The table contains Transitive Dependencies.
– Some records depend on attributes other than
the table's primary key
Conversion to 3rd Normal Form
Student Details:
Department Details:
Course Details:
Student course:
{Dep No, Dep_name} , {Stud no, Stud_name,Stud_DOB} , {Dep No, Stud No ,
Course name} , {Course_name, Course_fee}
Conversion to 3rd Normal Form
• Advantages:
– No non-key attribute depends transitively on a
candidate key
– All The attributes in a table Depend on a single
primary key
Conversion To BCNF
• A Case where The table is in 3NF but not in
BCNF
Example of BCNF
fd1 clientNo, interviewDate  interviewTime, staffNo, roomNo (Primary Key)
fd2 staffNo, interviewDate, interviewTime clientNo (Candidate key)
fd3 roomNo, interviewDate, interviewTime  clientNo, staffNo (Candidate key)
fd4 staffNo, interviewDate  roomNo (not a candidate key)
As a consequece the ClientInterview relation may suffer from update anomalies.
For example, two tuples have to be updated if the roomNo need be changed for staffNo
SG5 on the 13-May-02.
ClientNo interviewDate interviewTime staffNo roomNo
CR76 13-May-02 10.30 SG5 G101
CR76 13-May-02 12.00 SG5 G101
CR74 13-May-02 12.00 SG37 G102
CR56 1-Jul-02 10.30 SG5 G102
ClientInterview
Example of BCNF(2)
To transform the ClientInterview relation to BCNF, we must remove the violating
functional dependency by creating two new relations called Interview and SatffRoom as
shown below,
Interview (clientNo, interviewDate, interviewTime, staffNo)
StaffRoom(staffNo, interviewDate, roomNo)
ClientNo interviewDate interviewTime staffNo
CR76 13-May-02 10.30 SG5
CR76 13-May-02 12.00 SG5
CR74 13-May-02 12.00 SG37
CR56 1-Jul-02 10.30 SG5
staffNo interviewDate roomNo
SG5 13-May-02 G101
SG37 13-May-02 G102
SG5 1-Jul-02 G102
Interview
StaffRoom
THANKS
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us

Mais conteúdo relacionado

Mais procurados

Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
emailharmeet
 
Database Relationships
Database RelationshipsDatabase Relationships
Database Relationships
wmassie
 

Mais procurados (20)

Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
 
Normalization
NormalizationNormalization
Normalization
 
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
 
normaliztion
normaliztionnormaliztion
normaliztion
 
Normal forms
Normal formsNormal forms
Normal forms
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Dbms Interview Question And Answer
Dbms Interview Question And AnswerDbms Interview Question And Answer
Dbms Interview Question And Answer
 
Normalization
NormalizationNormalization
Normalization
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
Database Relationships
Database RelationshipsDatabase Relationships
Database Relationships
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
 
Integrity constraints in dbms
Integrity constraints in dbmsIntegrity constraints in dbms
Integrity constraints in dbms
 
Types of keys in dbms
Types of keys in dbmsTypes of keys in dbms
Types of keys in dbms
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Normalization in RDBMS
Normalization in RDBMSNormalization in RDBMS
Normalization in RDBMS
 
Database language
Database languageDatabase language
Database language
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Validation based protocol
Validation based protocolValidation based protocol
Validation based protocol
 

Destaque

Normalization
NormalizationNormalization
Normalization
lingesan
 
Normalisation lesson plan
Normalisation   lesson planNormalisation   lesson plan
Normalisation lesson plan
Mohamed Maguid
 
Normalisation student summary
Normalisation student summaryNormalisation student summary
Normalisation student summary
mary_ramsay
 
Normalisation - 2nd normal form
Normalisation - 2nd normal formNormalisation - 2nd normal form
Normalisation - 2nd normal form
college
 

Destaque (20)

DBMS - Normalization
DBMS - NormalizationDBMS - Normalization
DBMS - Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
functional dependencies with example
functional dependencies with examplefunctional dependencies with example
functional dependencies with example
 
Normalization
NormalizationNormalization
Normalization
 
Database management system
Database management systemDatabase management system
Database management system
 
Normalisation lesson plan
Normalisation   lesson planNormalisation   lesson plan
Normalisation lesson plan
 
TIMEN: An Open Temporal Expression Normalisation Resource
TIMEN: An Open Temporal Expression Normalisation ResourceTIMEN: An Open Temporal Expression Normalisation Resource
TIMEN: An Open Temporal Expression Normalisation Resource
 
Normalisation
NormalisationNormalisation
Normalisation
 
Database Normalisation
Database NormalisationDatabase Normalisation
Database Normalisation
 
Normalisation student summary
Normalisation student summaryNormalisation student summary
Normalisation student summary
 
Bcnf
BcnfBcnf
Bcnf
 
Normalisation and anomalies
Normalisation and anomaliesNormalisation and anomalies
Normalisation and anomalies
 
Normalisation
NormalisationNormalisation
Normalisation
 
NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I NORMALIZATION - BIS 1204: Data and Information Management I
NORMALIZATION - BIS 1204: Data and Information Management I
 
Dbms and sqlpptx
Dbms and sqlpptxDbms and sqlpptx
Dbms and sqlpptx
 
Decision tree
Decision treeDecision tree
Decision tree
 
Normalisation - 2nd normal form
Normalisation - 2nd normal formNormalisation - 2nd normal form
Normalisation - 2nd normal form
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 

Semelhante a Normalization in databases

Dependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its typesDependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its types
nsrChowdary1
 
Normalization ppt for RDBMS PPT FOR BCA and for computer science student..pptx
Normalization ppt for RDBMS PPT FOR BCA and for computer science student..pptxNormalization ppt for RDBMS PPT FOR BCA and for computer science student..pptx
Normalization ppt for RDBMS PPT FOR BCA and for computer science student..pptx
SIR RIP .NET
 
Meet 6_sssssssssssssssssssssssssssssssssssss.pdf
Meet 6_sssssssssssssssssssssssssssssssssssss.pdfMeet 6_sssssssssssssssssssssssssssssssssssss.pdf
Meet 6_sssssssssssssssssssssssssssssssssssss.pdf
SarahHarahap4
 
Database Normalization - First, second and Third Normal Forms with an example
Database Normalization - First, second and Third Normal Forms with an exampleDatabase Normalization - First, second and Third Normal Forms with an example
Database Normalization - First, second and Third Normal Forms with an example
SABITHARASSISTANTPRO
 

Semelhante a Normalization in databases (20)

Database normalisation by D.Lukachuk
Database normalisation by D.LukachukDatabase normalisation by D.Lukachuk
Database normalisation by D.Lukachuk
 
data Normalization.pdf
data Normalization.pdfdata Normalization.pdf
data Normalization.pdf
 
normalization of database management ppt
normalization of database management pptnormalization of database management ppt
normalization of database management ppt
 
Database - Normalization
Database - NormalizationDatabase - Normalization
Database - Normalization
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
Data Modeling
Data ModelingData Modeling
Data Modeling
 
Normalization and three normal forms.pptx
Normalization and three normal forms.pptxNormalization and three normal forms.pptx
Normalization and three normal forms.pptx
 
Normalization,ddl,dml,dcl
Normalization,ddl,dml,dclNormalization,ddl,dml,dcl
Normalization,ddl,dml,dcl
 
Exception & Database
Exception & DatabaseException & Database
Exception & Database
 
Normalization,ddl,dml,dcl
Normalization,ddl,dml,dclNormalization,ddl,dml,dcl
Normalization,ddl,dml,dcl
 
Normalization
NormalizationNormalization
Normalization
 
Normalization of database tables
Normalization of database tablesNormalization of database tables
Normalization of database tables
 
Dependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its typesDependencies in various topics like normalisation and its types
Dependencies in various topics like normalisation and its types
 
Normalization
NormalizationNormalization
Normalization
 
Database Normalization.docx
Database Normalization.docxDatabase Normalization.docx
Database Normalization.docx
 
Normalization ppt for RDBMS PPT FOR BCA and for computer science student..pptx
Normalization ppt for RDBMS PPT FOR BCA and for computer science student..pptxNormalization ppt for RDBMS PPT FOR BCA and for computer science student..pptx
Normalization ppt for RDBMS PPT FOR BCA and for computer science student..pptx
 
Normalization in relational database management systems
Normalization in relational database management systemsNormalization in relational database management systems
Normalization in relational database management systems
 
Meet 6_sssssssssssssssssssssssssssssssssssss.pdf
Meet 6_sssssssssssssssssssssssssssssssssssss.pdfMeet 6_sssssssssssssssssssssssssssssssssssss.pdf
Meet 6_sssssssssssssssssssssssssssssssssssss.pdf
 
Database Normalization - First, second and Third Normal Forms with an example
Database Normalization - First, second and Third Normal Forms with an exampleDatabase Normalization - First, second and Third Normal Forms with an example
Database Normalization - First, second and Third Normal Forms with an example
 
Relational database design
Relational database designRelational database design
Relational database design
 

Mais de baabtra.com - No. 1 supplier of quality freshers

Mais de baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Último

Último (20)

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

Normalization in databases

  • 1.
  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 3. NORMALIZATION IN DATABASES Subhin P.V 111subru@gmail.com www.facebook.com/111subru twitter.com/111subru in.linkedin.com/in/Subhin P.V 8129076036
  • 4. MAIN POINTS DISCUSSED • What normalization is and what role it plays in the database design process • About the normal forms 1NF, 2NF, 3NF and BCNF • How normal forms can be transformed from lower normal forms to higher normal forms
  • 5. ABOUT NORMALIZATION • Normalization is the process of efficiently organizing data in a database. • Two goals of normalization process:  Eliminating Redundant Data  Ensuring data dependencies • The objective is to isolate data so that changes of a field can be made in just one table and then propagated through the rest of the database using the defined relationships.
  • 6. Normalization Stages • 1NF • 2NF • 3NF • Boyce-Codd Normal Form (BCNF or 3.5NF)
  • 8. First Normal Form (1NF) • The values in each column of a table are atomic (No multi-value attributes allowed). • Each table has a primary key: minimal set of attributes which can uniquely identify a record • There are no repeating groups: two columns do not store similar information in the same table.
  • 9. Second Normal Form (2NF) • Meet all the requirements of the first normal form. • Remove subsets of data that apply to multiple rows of a table and place them in separate tables. • Create relationships between these new tables and their predecessors through the use of foreign keys.
  • 10. Third Normal Form (3NF) • Meet all the requirements of the second normal form. • Every non-prime attribute of R is non- transitively dependent (i.e. directly dependent) on every superkey of R. • Remove columns that are not dependent upon the primary key.
  • 11. Boyce-Codd Normal Form • Meet all the requirements of the third normal form. • Every determinant must be a candidate key. • Candidate Key:  Any attribute or a set of attributes together that has the eligibility to become a primary key.
  • 12. TRANSFORMATION FROM UNF TO HIGHER NORMAL FORMS USING AN EXAMPLE • Example: Institution Having Two departments – Each Department Has 6 Different Students And Some Courses – Each Student in a department can study more than one Course – Each course has its course fee. – Periodically, report is generated that contains information displayed which can be represented in a table as shown in next slide.
  • 14. Problems With The Table – The table displays data redundancies. – The table has Multivalued Attributes – The table entries invite data inconsistencies. – The data redundancies yield the following anomalies: • Update anomalies. • Addition anomalies. • Deletion anomalies.
  • 15. Conversion to 1st Normal Form
  • 16. Conversion To 1st Normal Form – ADVANTAGES • Each table has at least one minimal set of attributes which can uniquely identify a record • The values in each column have Single Value – DISADVANTAGES • Redundant data across multiple rows of the table is still there • Existence of partial and transitive dependencies
  • 17. The Dependency diagram – Depicts all dependencies found within given table structure – Helpful in getting bird’s-eye view of all relationships among table’s attributes – Makes it less likely that will overlook an important dependency
  • 18. Conversion to 2nd Normal Form {Dep No, Dep_name} {Stud no, Stud_name, Stud_DOB, Stud_age} {Dep No, Stud No , Course_name, Course_fee} Department Details: Course Details: Student Details:
  • 19. Conversion to 2nd Normal Form • Advantages – eliminates redundant data in the table – It includes no partial dependencies: – Create separate tables for sets of values that apply to multiple records • Disadvantages – The table contains Transitive Dependencies. – Some records depend on attributes other than the table's primary key
  • 20. Conversion to 3rd Normal Form Student Details: Department Details: Course Details: Student course: {Dep No, Dep_name} , {Stud no, Stud_name,Stud_DOB} , {Dep No, Stud No , Course name} , {Course_name, Course_fee}
  • 21. Conversion to 3rd Normal Form • Advantages: – No non-key attribute depends transitively on a candidate key – All The attributes in a table Depend on a single primary key
  • 22. Conversion To BCNF • A Case where The table is in 3NF but not in BCNF
  • 23. Example of BCNF fd1 clientNo, interviewDate  interviewTime, staffNo, roomNo (Primary Key) fd2 staffNo, interviewDate, interviewTime clientNo (Candidate key) fd3 roomNo, interviewDate, interviewTime  clientNo, staffNo (Candidate key) fd4 staffNo, interviewDate  roomNo (not a candidate key) As a consequece the ClientInterview relation may suffer from update anomalies. For example, two tuples have to be updated if the roomNo need be changed for staffNo SG5 on the 13-May-02. ClientNo interviewDate interviewTime staffNo roomNo CR76 13-May-02 10.30 SG5 G101 CR76 13-May-02 12.00 SG5 G101 CR74 13-May-02 12.00 SG37 G102 CR56 1-Jul-02 10.30 SG5 G102 ClientInterview
  • 24. Example of BCNF(2) To transform the ClientInterview relation to BCNF, we must remove the violating functional dependency by creating two new relations called Interview and SatffRoom as shown below, Interview (clientNo, interviewDate, interviewTime, staffNo) StaffRoom(staffNo, interviewDate, roomNo) ClientNo interviewDate interviewTime staffNo CR76 13-May-02 10.30 SG5 CR76 13-May-02 12.00 SG5 CR74 13-May-02 12.00 SG37 CR56 1-Jul-02 10.30 SG5 staffNo interviewDate roomNo SG5 13-May-02 G101 SG37 13-May-02 G102 SG5 1-Jul-02 G102 Interview StaffRoom
  • 26. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com