SlideShare a Scribd company logo
1 of 25
Database Design:
Normalization
Chapter 5, Pratt & Adamski
Functional Dependence
An attribute A is functionally dependent
on attribute(s) B if: given a value b for B
there is one and only one corresponding
value a for A (at a time).
b2
b3
a1
b1
Example: functional
dependence
All sales representatives in a given pay
class have the same commission rate.
SalesRepNumber Name PayClass Commission
Keys
Primary Key: a minimal set of attributes
that form a candidate key
Any attribute or collection of attributes that
functionally determine all attributes in a
record is a Candidate Key.
Note: since no two rows in a relational
table can be duplicates, the entire record
is always a candidate key.
Primary Key (C)
C determines all attributes
No subset of the attributes in C is a
candidate key
A key consisting of more than one attribute
is called a “composite key.”
Good Primary Keys
Do not change over the life of the
database
Are not “intelligent keys”
Are not too long
Do not consist of too many attributes (3
or fewer is good)
Foreign Keys
A value in the “child” table that matches
with the related value in the “parent”
table.
SalesRep(SalesRepNumber, Name)
[ 03 | Mary Jones ]
[ 124 | 03 ]
Customer(CustomerNumber, SalesRepNumber)
Foreign Keys
The foreign key in the child table has the
same value as the primary key in the parent.
The foreign key in a many-to-many
relationship goes in the many table.
In a many-to-many relationship, foreign keys
from both tables go into an associative entity.
In a 1-to-1 relationship the foreign key goes
into one of the tables (usually the one most
likely to change)
Normal Forms
A set of conditions on table structure that
improves maintenance. Normalization
removes processing anomalies:
Update
Inconsistent Data
Addition
Deletion
Normal Forms
All attributes depend on the key, the whole
key and nothing but the key.
1NF Keys and no repeating groups
2NF No partial dependencies
3NF All determinants are candidate keys
4NF No multivalued dependencies
1st Normal Form
Table has a primary key
Table has no repeating groups
A multivalued attribute is an attribute that
may have several values for one record
A repeating group is a set of one or more
multivalued attributes that are related
Example
Multivalued attribute:
Orders(OrderNumber, OrderDate, {PartNumber})
[ 12491 | 9/02/2001 | BT04, BZ66 ]
Repeating group:
Orders(OrderNumber, OrderDate, {PartNumber,
NumberOrdered})
[12491 | 9/02/2001 | (BT04, 1), (BZ66,
1)]
Normalization: 1NF
Every repeating group becomes a new
table with the appropriate foreign key
relationships preserved.
Remove nested repeating groups from the
outside in
Order(OrderNumber, OrderDate, {PartNumber,
{Supplier}})
Example: 1NF
Order(OrderNumber, OrderDate, {PartNumber,
{Supplier}})
Order(OrderNumber, OrderDate)
Order-Part(OrderNumber, PartNumber)
Part(PartNumber, {Supplier})
Example: 1NF (cont.)
Part(PartNumber, {Supplier})
Part( PartNumber )
Part-Supplier( PartNumber, SupplierNum)
Supplier( SupplierNum )
2nd Normal Form
No partial dependencies
No attribute depends on only some of the
attributes of a concatenated key.
Order-Part
[OrderNumber | PartNumber | PartDescription]
Create a new table with PartNumber key.
3rd Normal Form /
Boyce-Codd Normal Form
3rd Normal Form: no transitive
dependencies
Transitive dependency means that a non-
key attribute depends on another non-key
attribute(s).
This definition says nothing about
dependencies that involve the key.
3rd Normal Form /
Boyce-Codd Normal Form
BCNF: every determinant is a candidate
key.
Determinant: any attribute(s) that
functionally determine another attribute
BCNF means that there are no “transitive”
dependencies involving key or non-key
attributes.
3NF
Pratt and Adamski use the BCNF definition
as their definition of 3NF
BCNF was generated to deal with problems like:
Class(Section#, InstructorID, … ) extra key attribute
(Student, Major, Advisor) wrong key
4th Normal Form
No multivalued dependencies
A multivalued dependency of column B on
column A occurs when a table has a key
with three or more attributes, (A, B, C)
and
each value of A is associated with a collection
of values of B
this collection of values is independent of C
B is multidependent on A
B A
c1
c2
c3
a
b1
b2
b3
b4
Example: multivalued
dependence
Faculty have advisee assignments for one
major and committee assignments
[FacID | AdviseeID | FacultyComm]
[FacultyID]
[FacID | AdviseeID] [FacID | FacultyComm]
Normalization
Improves maintenance for database
changes
Tends to slow down retrieval
Better at finding problems than solving
them
Standard normalization procedures are
subtle and may introduce BCNF or 4NF
problems into tables
Normalization
1NF Keys & no repeating groups
2NF 1NF & all attributes depend on all key
components
3NF 2NF & all determinants are candidate
keys
4NF 3NF & no multivalued dependencies
Intuitive Normalization
1NF Tables represent entities
2NF Each table represents only one entity
3NF Tables do not contain attributes from
embedded entities
4NF Triple relationships should not
represent a pair of dual relationships

More Related Content

Similar to E02Normalization.ppt

Normalization of database_tables_chapter_4
Normalization of database_tables_chapter_4Normalization of database_tables_chapter_4
Normalization of database_tables_chapter_4
Farhan Chishti
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdf
Shivani139202
 

Similar to E02Normalization.ppt (20)

B & c
B & cB & c
B & c
 
Normalization
NormalizationNormalization
Normalization
 
Cis245 Midterm Review
Cis245 Midterm ReviewCis245 Midterm Review
Cis245 Midterm Review
 
Chapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdfChapter – 4 Normalization and Relational Algebra.pdf
Chapter – 4 Normalization and Relational Algebra.pdf
 
data Normalization.pdf
data Normalization.pdfdata Normalization.pdf
data Normalization.pdf
 
Research gadot
Research gadotResearch gadot
Research gadot
 
Normalization of database_tables_chapter_4
Normalization of database_tables_chapter_4Normalization of database_tables_chapter_4
Normalization of database_tables_chapter_4
 
CIS145 Final Review
CIS145 Final ReviewCIS145 Final Review
CIS145 Final Review
 
Database Normalization.docx
Database Normalization.docxDatabase Normalization.docx
Database Normalization.docx
 
Database.pptx
Database.pptxDatabase.pptx
Database.pptx
 
Cis145 Final Review
Cis145 Final ReviewCis145 Final Review
Cis145 Final Review
 
24042020_normalization 1.pdf
24042020_normalization 1.pdf24042020_normalization 1.pdf
24042020_normalization 1.pdf
 
Cis145 Final Review
Cis145 Final ReviewCis145 Final Review
Cis145 Final Review
 
Advance database system(part 5)
Advance database system(part 5)Advance database system(part 5)
Advance database system(part 5)
 
DATABASE-1.pptx
DATABASE-1.pptxDATABASE-1.pptx
DATABASE-1.pptx
 
Islamic University Previous Year Question Solution 2019 (ADBMS)
Islamic University Previous Year Question Solution 2019 (ADBMS)Islamic University Previous Year Question Solution 2019 (ADBMS)
Islamic University Previous Year Question Solution 2019 (ADBMS)
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems inc
 
Normalization
NormalizationNormalization
Normalization
 
Ism normalization pine valley 2012
Ism normalization pine valley 2012Ism normalization pine valley 2012
Ism normalization pine valley 2012
 
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLESDATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
 

More from NelsonZaidi

CSS AND LINKS TO PROGRAMMING language.pptx
CSS AND LINKS TO PROGRAMMING language.pptxCSS AND LINKS TO PROGRAMMING language.pptx
CSS AND LINKS TO PROGRAMMING language.pptx
NelsonZaidi
 
118386528-Revisiting-Approaches-and-Strategies-in-Araling-Panlipunan.pptx
118386528-Revisiting-Approaches-and-Strategies-in-Araling-Panlipunan.pptx118386528-Revisiting-Approaches-and-Strategies-in-Araling-Panlipunan.pptx
118386528-Revisiting-Approaches-and-Strategies-in-Araling-Panlipunan.pptx
NelsonZaidi
 
slidesharetopjobs-150724024626-lva1-app6891-1.pdf
slidesharetopjobs-150724024626-lva1-app6891-1.pdfslidesharetopjobs-150724024626-lva1-app6891-1.pdf
slidesharetopjobs-150724024626-lva1-app6891-1.pdf
NelsonZaidi
 

More from NelsonZaidi (7)

CSS AND LINKS TO PROGRAMMING language.pptx
CSS AND LINKS TO PROGRAMMING language.pptxCSS AND LINKS TO PROGRAMMING language.pptx
CSS AND LINKS TO PROGRAMMING language.pptx
 
118386528-Revisiting-Approaches-and-Strategies-in-Araling-Panlipunan.pptx
118386528-Revisiting-Approaches-and-Strategies-in-Araling-Panlipunan.pptx118386528-Revisiting-Approaches-and-Strategies-in-Araling-Panlipunan.pptx
118386528-Revisiting-Approaches-and-Strategies-in-Araling-Panlipunan.pptx
 
mariadb.pptx
mariadb.pptxmariadb.pptx
mariadb.pptx
 
Case Study.pptx
Case Study.pptxCase Study.pptx
Case Study.pptx
 
WORKPLAN.docx
WORKPLAN.docxWORKPLAN.docx
WORKPLAN.docx
 
slidesharetopjobs-150724024626-lva1-app6891-1.pdf
slidesharetopjobs-150724024626-lva1-app6891-1.pdfslidesharetopjobs-150724024626-lva1-app6891-1.pdf
slidesharetopjobs-150724024626-lva1-app6891-1.pdf
 
2 Exploring Art Chapter 1.ppt
2 Exploring Art Chapter 1.ppt2 Exploring Art Chapter 1.ppt
2 Exploring Art Chapter 1.ppt
 

Recently uploaded

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Recently uploaded (20)

Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
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...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
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
 

E02Normalization.ppt

  • 2. Functional Dependence An attribute A is functionally dependent on attribute(s) B if: given a value b for B there is one and only one corresponding value a for A (at a time). b2 b3 a1 b1
  • 3. Example: functional dependence All sales representatives in a given pay class have the same commission rate. SalesRepNumber Name PayClass Commission
  • 4. Keys Primary Key: a minimal set of attributes that form a candidate key Any attribute or collection of attributes that functionally determine all attributes in a record is a Candidate Key. Note: since no two rows in a relational table can be duplicates, the entire record is always a candidate key.
  • 5. Primary Key (C) C determines all attributes No subset of the attributes in C is a candidate key A key consisting of more than one attribute is called a “composite key.”
  • 6. Good Primary Keys Do not change over the life of the database Are not “intelligent keys” Are not too long Do not consist of too many attributes (3 or fewer is good)
  • 7. Foreign Keys A value in the “child” table that matches with the related value in the “parent” table. SalesRep(SalesRepNumber, Name) [ 03 | Mary Jones ] [ 124 | 03 ] Customer(CustomerNumber, SalesRepNumber)
  • 8. Foreign Keys The foreign key in the child table has the same value as the primary key in the parent. The foreign key in a many-to-many relationship goes in the many table. In a many-to-many relationship, foreign keys from both tables go into an associative entity. In a 1-to-1 relationship the foreign key goes into one of the tables (usually the one most likely to change)
  • 9. Normal Forms A set of conditions on table structure that improves maintenance. Normalization removes processing anomalies: Update Inconsistent Data Addition Deletion
  • 10. Normal Forms All attributes depend on the key, the whole key and nothing but the key. 1NF Keys and no repeating groups 2NF No partial dependencies 3NF All determinants are candidate keys 4NF No multivalued dependencies
  • 11. 1st Normal Form Table has a primary key Table has no repeating groups A multivalued attribute is an attribute that may have several values for one record A repeating group is a set of one or more multivalued attributes that are related
  • 12. Example Multivalued attribute: Orders(OrderNumber, OrderDate, {PartNumber}) [ 12491 | 9/02/2001 | BT04, BZ66 ] Repeating group: Orders(OrderNumber, OrderDate, {PartNumber, NumberOrdered}) [12491 | 9/02/2001 | (BT04, 1), (BZ66, 1)]
  • 13. Normalization: 1NF Every repeating group becomes a new table with the appropriate foreign key relationships preserved. Remove nested repeating groups from the outside in Order(OrderNumber, OrderDate, {PartNumber, {Supplier}})
  • 14. Example: 1NF Order(OrderNumber, OrderDate, {PartNumber, {Supplier}}) Order(OrderNumber, OrderDate) Order-Part(OrderNumber, PartNumber) Part(PartNumber, {Supplier})
  • 15. Example: 1NF (cont.) Part(PartNumber, {Supplier}) Part( PartNumber ) Part-Supplier( PartNumber, SupplierNum) Supplier( SupplierNum )
  • 16. 2nd Normal Form No partial dependencies No attribute depends on only some of the attributes of a concatenated key. Order-Part [OrderNumber | PartNumber | PartDescription] Create a new table with PartNumber key.
  • 17. 3rd Normal Form / Boyce-Codd Normal Form 3rd Normal Form: no transitive dependencies Transitive dependency means that a non- key attribute depends on another non-key attribute(s). This definition says nothing about dependencies that involve the key.
  • 18. 3rd Normal Form / Boyce-Codd Normal Form BCNF: every determinant is a candidate key. Determinant: any attribute(s) that functionally determine another attribute BCNF means that there are no “transitive” dependencies involving key or non-key attributes.
  • 19. 3NF Pratt and Adamski use the BCNF definition as their definition of 3NF BCNF was generated to deal with problems like: Class(Section#, InstructorID, … ) extra key attribute (Student, Major, Advisor) wrong key
  • 20. 4th Normal Form No multivalued dependencies A multivalued dependency of column B on column A occurs when a table has a key with three or more attributes, (A, B, C) and each value of A is associated with a collection of values of B this collection of values is independent of C
  • 21. B is multidependent on A B A c1 c2 c3 a b1 b2 b3 b4
  • 22. Example: multivalued dependence Faculty have advisee assignments for one major and committee assignments [FacID | AdviseeID | FacultyComm] [FacultyID] [FacID | AdviseeID] [FacID | FacultyComm]
  • 23. Normalization Improves maintenance for database changes Tends to slow down retrieval Better at finding problems than solving them Standard normalization procedures are subtle and may introduce BCNF or 4NF problems into tables
  • 24. Normalization 1NF Keys & no repeating groups 2NF 1NF & all attributes depend on all key components 3NF 2NF & all determinants are candidate keys 4NF 3NF & no multivalued dependencies
  • 25. Intuitive Normalization 1NF Tables represent entities 2NF Each table represents only one entity 3NF Tables do not contain attributes from embedded entities 4NF Triple relationships should not represent a pair of dual relationships