SlideShare une entreprise Scribd logo
1  sur  15
Chapter 8: Relational Database 
Design
Combine Schemas? 
 Suppose we combine instructor and department into inst_dept 
 (No connection to relationship set inst_dept) 
 Result is possible repetition of information
Normalization 
 Database Normalisation is a technique of organizing the data in the 
database. Normalization is a systematic approach of decomposing 
tables to eliminate data redundancy and undesirable characteristics 
like Insertion, Update and Deletion Anomalies. 
 It is a multi-step process that puts data into tabular form by removing 
duplicated data from the relation tables. 
 Normalization is used for mainly two purpose, 
 Eliminating reduntant(useless) data. 
 Ensuring data dependencies make sense i.e data is logically 
stored.
Problem Without Normalization 
 Without Normalization, it becomes difficult to handle and update the 
database, without facing data loss. Insertion, Updation and Deletion 
Anomalies are very frequent if database is not Normalized. 
 To understand these anomalies let us take an example of Student 
table.
Problem Without Normalization 
 Updating Anomaly : To update address of a student who occurs 
twice or more than twice in a table, we will have to update S_Address 
column in all the rows, else data will become inconsistent. 
 Insertion Anomaly : Suppose for a new admission, we have a 
Student id(S_id), name and address of a student but if student has not 
opted for any subjects yet then we have to insert NULL there, leading 
to Insertion Anamoly. 
 Deletion Anomaly : If (S_id) 401 has only one subject and 
temporarily he drops it, when we delete that row, entire student record 
will be deleted along with it.
Normalization Techniques 
 Normalization rule are divided into following normal form. 
 First Normal Form (1NF) 
 Second Normal Form (2NF) 
 Third Normal Form (3NF) 
 BCNF 
Atomic: Domain is atomic if its elements are considered to be indivisible units 
Examples of non-atomic domains: Set of names, composite attributes 
Identification numbers like CS101 that can be broken up into parts. 
Non-atomic values complicate storage and encourage redundant (repeated) 
storage of data. Example: Set of accounts stored with each customer, and set of 
owners stored with each account
First Normal Form (Cont.) 
 A relational schema R is in first normal form if the domains of all 
attributes of R are atomic. 
 As per First Normal Form, no two Rows of data must contain repeating 
group of information i.e each set of column must have a unique value, 
such that multiple columns cannot be used to fetch the same row. 
 Each table should be organized into rows, and each row should have a 
primary key that distinguishes it as unique. 
 The Primary key is usually a single column, but sometimes more than 
one column can be combined to create a single primary key.
First Normal Form (Cont.) 
 For example consider a table which is not in First normal form. 
 In First Normal Form, any row must not have a column in which more 
than one value is saved, like separated with commas. Rather than that, 
we must separate such data into multiple rows.
First Normal Form (Cont.) 
 Using the First Normal Form, data redundancy increases, as there will 
be many columns with same data in multiple rows but each row as a 
whole will be unique.
Second 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. 
 Although there are a few complex cases in which table in Second 
Normal Form suffers Update Anomalies, and to handle those scenarios 
Third Normal Form is there. 
First 
Name 
Las t 
Name 
Address City State Zip 
Lisa Hestings Bertha 
Street 
Miami FL 33157 
Adam Gabriel Fleming 
Street 
Miami FL 33157 
Lucy Herts Bridge 
Road 
NY Sea Cliff 11579
Second Normal Form 
 A brief look at this table reveals a small amount of redundant data. 
We're storing the Sea Cliff, NY 11579 and Miami, FL 33157 
entries twice each. 
 Additionally, if the ZIP code for FL were to change, we'd need to 
make that change in many places throughout the database. 
 In a 2NF-compliant database structure, this redundant information 
is extracted and stored in a separate table. Our new table (let's call 
it ZIPs) might have the following columns- 
Zip City State 
 We’ll need to use a foreign key to tie the two tables together. 
We'll use the ZIP code (the primary key from the ZIPs table) to 
create that relationship. Here's our new Customers table: 
First Name Las t 
Name 
Address Zip
Third Normal Form 
 Third Normal form applies that every non-prime attribute of table must 
be dependent on primary key. 
 The transitive functional dependency should be removed from the table. 
The table must be in Second Normal form. For example, consider a 
table with following fields. 
Order No Customer No Unit 
Price 
Quantity Total 
123J09 NY65031 500 $ 2 1000 $ 
120J11 ST90452 300 $ 1 300 $ 
123J09 NY65031 100 $ 4 400 $ 
 Now, are all of the columns fully dependent upon the primary key? 
 The customer number varies with the order number and it doesn't 
appear to depend upon any of the other fields. 
 It appears sometimes charge the same customer different prices. The 
quantity of items also varies from order to order. So, the unit price and 
quamtity is fully dependent upon the order number.
Third Normal Form 
 What about the total? 
 The total can be derived by multiplying the unit price by the quantity, 
therefore it's not fully dependent upon the primary key. We must 
remove it from the table to comply with the third normal form. 
Order No Customer 
No 
Price 
Price Unit Price Quantity Total
Boyce-Codd Normal Form 
Boyce and Codd Normal Form is a higher version of the 
Third Normal form. 
This form deals with certain type of anomaly that is not handled 
by 3NF. 
A 3NF table which does not have multiple overlapping candidate 
keys is said to be in BCNF.
Thank you

Contenu connexe

Tendances

Intro To DataBase
Intro To DataBaseIntro To DataBase
Intro To DataBaseDevMix
 
Introduction to Database Concepts
Introduction to Database ConceptsIntroduction to Database Concepts
Introduction to Database ConceptsRosalyn Lemieux
 
Intro databases (Table, Record, Field)
Intro databases (Table, Record, Field)Intro databases (Table, Record, Field)
Intro databases (Table, Record, Field)Maryam Fida
 
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 incMuthu Natarajan
 
Database Relationships
Database RelationshipsDatabase Relationships
Database Relationshipswmassie
 
Normalization Accepted
Normalization AcceptedNormalization Accepted
Normalization Acceptedprasaddurga
 
Normalisation - 2nd normal form
Normalisation - 2nd normal formNormalisation - 2nd normal form
Normalisation - 2nd normal formcollege
 
Week 1 Before the Advent of Database Systems & Fundamental Concepts
Week 1 Before the Advent of Database Systems & Fundamental ConceptsWeek 1 Before the Advent of Database Systems & Fundamental Concepts
Week 1 Before the Advent of Database Systems & Fundamental Conceptsoudesign
 

Tendances (19)

Database intro
Database introDatabase intro
Database intro
 
Intro To DataBase
Intro To DataBaseIntro To DataBase
Intro To DataBase
 
Dbms ppt
Dbms pptDbms ppt
Dbms ppt
 
Introduction to Database Concepts
Introduction to Database ConceptsIntroduction to Database Concepts
Introduction to Database Concepts
 
Intro databases (Table, Record, Field)
Intro databases (Table, Record, Field)Intro databases (Table, Record, Field)
Intro databases (Table, Record, Field)
 
RDBMS
RDBMSRDBMS
RDBMS
 
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
 
Database Basics Theory
Database Basics TheoryDatabase Basics Theory
Database Basics Theory
 
Research gadot
Research gadotResearch gadot
Research gadot
 
Database Relationships
Database RelationshipsDatabase Relationships
Database Relationships
 
Database Management
Database ManagementDatabase Management
Database Management
 
Normalization Accepted
Normalization AcceptedNormalization Accepted
Normalization Accepted
 
Normalisation - 2nd normal form
Normalisation - 2nd normal formNormalisation - 2nd normal form
Normalisation - 2nd normal form
 
Data Dictionary
Data DictionaryData Dictionary
Data Dictionary
 
RDBMS
RDBMSRDBMS
RDBMS
 
RDBMS concepts
RDBMS conceptsRDBMS concepts
RDBMS concepts
 
Data processing
Data processingData processing
Data processing
 
Week 1 Before the Advent of Database Systems & Fundamental Concepts
Week 1 Before the Advent of Database Systems & Fundamental ConceptsWeek 1 Before the Advent of Database Systems & Fundamental Concepts
Week 1 Before the Advent of Database Systems & Fundamental Concepts
 
12 SQL
12 SQL12 SQL
12 SQL
 

En vedette

En vedette (10)

Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Arrays in CPP
Arrays in CPPArrays in CPP
Arrays in CPP
 
Computer processing
Computer processingComputer processing
Computer processing
 
String operation
String operationString operation
String operation
 
Arrays
ArraysArrays
Arrays
 
Merge sort and quick sort
Merge sort and quick sortMerge sort and quick sort
Merge sort and quick sort
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 
SQL : introduction
SQL : introductionSQL : introduction
SQL : introduction
 
Erd examples
Erd examplesErd examples
Erd examples
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 

Similaire à Normalization

Similaire à Normalization (20)

What is Database NormalizationExplain the guidelines for ensuring t.pdf
What is Database NormalizationExplain the guidelines for ensuring t.pdfWhat is Database NormalizationExplain the guidelines for ensuring t.pdf
What is Database NormalizationExplain the guidelines for ensuring t.pdf
 
Normalization
NormalizationNormalization
Normalization
 
Assignment#11
Assignment#11Assignment#11
Assignment#11
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
Lecture 6.pptx
Lecture 6.pptxLecture 6.pptx
Lecture 6.pptx
 
Normalization.ppt
Normalization.pptNormalization.ppt
Normalization.ppt
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Database design normalization note and exercise
Database design normalization note and exerciseDatabase design normalization note and exercise
Database design normalization note and exercise
 
normaliztion
normaliztionnormaliztion
normaliztion
 
Year 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st TermYear 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st Term
 
DBMS (UNIT 2)
DBMS (UNIT 2)DBMS (UNIT 2)
DBMS (UNIT 2)
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Data normailazation
Data normailazationData normailazation
Data normailazation
 
Data tidying with tidyr meetup
Data tidying with tidyr  meetupData tidying with tidyr  meetup
Data tidying with tidyr meetup
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Normal forms
Normal formsNormal forms
Normal forms
 
Database Normalization.docx
Database Normalization.docxDatabase Normalization.docx
Database Normalization.docx
 
Jai dbms
Jai dbmsJai dbms
Jai dbms
 
DBMS (1).pptx
DBMS (1).pptxDBMS (1).pptx
DBMS (1).pptx
 

Plus de Shakila Mahjabin

Plus de Shakila Mahjabin (7)

CSC 433 Sample normalization SQL Question
CSC 433 Sample normalization SQL QuestionCSC 433 Sample normalization SQL Question
CSC 433 Sample normalization SQL Question
 
Solution of Erds
Solution of ErdsSolution of Erds
Solution of Erds
 
Stack and queue
Stack and queueStack and queue
Stack and queue
 
Algo analysis
Algo analysisAlgo analysis
Algo analysis
 
Codes on structures
Codes on structuresCodes on structures
Codes on structures
 
array, function, pointer, pattern matching
array, function, pointer, pattern matchingarray, function, pointer, pattern matching
array, function, pointer, pattern matching
 
Data Structure Basics
Data Structure BasicsData Structure Basics
Data Structure Basics
 

Dernier

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
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.pdfAdmir Softic
 
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
 
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 ImpactPECB
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
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
 
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 pdfAyushMahapatra5
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
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 ...EduSkills OECD
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 

Dernier (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
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
 
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...
 
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
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
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
 
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
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
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 ...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

Normalization

  • 1. Chapter 8: Relational Database Design
  • 2. Combine Schemas? Suppose we combine instructor and department into inst_dept (No connection to relationship set inst_dept) Result is possible repetition of information
  • 3. Normalization Database Normalisation is a technique of organizing the data in the database. Normalization is a systematic approach of decomposing tables to eliminate data redundancy and undesirable characteristics like Insertion, Update and Deletion Anomalies. It is a multi-step process that puts data into tabular form by removing duplicated data from the relation tables. Normalization is used for mainly two purpose, Eliminating reduntant(useless) data. Ensuring data dependencies make sense i.e data is logically stored.
  • 4. Problem Without Normalization Without Normalization, it becomes difficult to handle and update the database, without facing data loss. Insertion, Updation and Deletion Anomalies are very frequent if database is not Normalized. To understand these anomalies let us take an example of Student table.
  • 5. Problem Without Normalization Updating Anomaly : To update address of a student who occurs twice or more than twice in a table, we will have to update S_Address column in all the rows, else data will become inconsistent. Insertion Anomaly : Suppose for a new admission, we have a Student id(S_id), name and address of a student but if student has not opted for any subjects yet then we have to insert NULL there, leading to Insertion Anamoly. Deletion Anomaly : If (S_id) 401 has only one subject and temporarily he drops it, when we delete that row, entire student record will be deleted along with it.
  • 6. Normalization Techniques Normalization rule are divided into following normal form. First Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF) BCNF Atomic: Domain is atomic if its elements are considered to be indivisible units Examples of non-atomic domains: Set of names, composite attributes Identification numbers like CS101 that can be broken up into parts. Non-atomic values complicate storage and encourage redundant (repeated) storage of data. Example: Set of accounts stored with each customer, and set of owners stored with each account
  • 7. First Normal Form (Cont.) A relational schema R is in first normal form if the domains of all attributes of R are atomic. As per First Normal Form, no two Rows of data must contain repeating group of information i.e each set of column must have a unique value, such that multiple columns cannot be used to fetch the same row. Each table should be organized into rows, and each row should have a primary key that distinguishes it as unique. The Primary key is usually a single column, but sometimes more than one column can be combined to create a single primary key.
  • 8. First Normal Form (Cont.) For example consider a table which is not in First normal form. In First Normal Form, any row must not have a column in which more than one value is saved, like separated with commas. Rather than that, we must separate such data into multiple rows.
  • 9. First Normal Form (Cont.) Using the First Normal Form, data redundancy increases, as there will be many columns with same data in multiple rows but each row as a whole will be unique.
  • 10. Second 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. Although there are a few complex cases in which table in Second Normal Form suffers Update Anomalies, and to handle those scenarios Third Normal Form is there. First Name Las t Name Address City State Zip Lisa Hestings Bertha Street Miami FL 33157 Adam Gabriel Fleming Street Miami FL 33157 Lucy Herts Bridge Road NY Sea Cliff 11579
  • 11. Second Normal Form A brief look at this table reveals a small amount of redundant data. We're storing the Sea Cliff, NY 11579 and Miami, FL 33157 entries twice each. Additionally, if the ZIP code for FL were to change, we'd need to make that change in many places throughout the database. In a 2NF-compliant database structure, this redundant information is extracted and stored in a separate table. Our new table (let's call it ZIPs) might have the following columns- Zip City State We’ll need to use a foreign key to tie the two tables together. We'll use the ZIP code (the primary key from the ZIPs table) to create that relationship. Here's our new Customers table: First Name Las t Name Address Zip
  • 12. Third Normal Form Third Normal form applies that every non-prime attribute of table must be dependent on primary key. The transitive functional dependency should be removed from the table. The table must be in Second Normal form. For example, consider a table with following fields. Order No Customer No Unit Price Quantity Total 123J09 NY65031 500 $ 2 1000 $ 120J11 ST90452 300 $ 1 300 $ 123J09 NY65031 100 $ 4 400 $ Now, are all of the columns fully dependent upon the primary key? The customer number varies with the order number and it doesn't appear to depend upon any of the other fields. It appears sometimes charge the same customer different prices. The quantity of items also varies from order to order. So, the unit price and quamtity is fully dependent upon the order number.
  • 13. Third Normal Form What about the total? The total can be derived by multiplying the unit price by the quantity, therefore it's not fully dependent upon the primary key. We must remove it from the table to comply with the third normal form. Order No Customer No Price Price Unit Price Quantity Total
  • 14. Boyce-Codd Normal Form Boyce and Codd Normal Form is a higher version of the Third Normal form. This form deals with certain type of anomaly that is not handled by 3NF. A 3NF table which does not have multiple overlapping candidate keys is said to be in BCNF.