SlideShare a Scribd company logo
1 of 6
Normalize the following Relationupto3rd
Normal form but stepby stpe, show
each intermediateresultant table withits data.
InvoiceID InvoiceDate CusID CusName ItemID ItemName ItemQty ItemPrice InvoiceTotal
601 11/9/18 C_101 Waqas 1 Scanner 50 10$ 2500$
601 2 Mouse 100 20$
602 11/9/18 C_101 3 Printer 40 10$ 400$
603 11/9/18 C_102 Saad 2 Mouse 50 20$ 1800$
603 4 Monitor 40 10$
603 1 Scanner 40 10$
It’s unnormalized table
In order to convert into First Normal Form(1NF)
1)Must be Atomic value in each cell
2)Identify attribute or attributes that qualifies as a
Primary Key
InvoiceID InvoiceDate CusID CusName ItemID ItemName ItemQty ItemPrice InvoiceTotal
601 11/9/18 C_101 Waqas 1 Scanner 50 10$ 2500$
601 11/9/18 C_101 Waqas 2 Mouse 100 20$ 2500$
602 11/9/18 C_101 Waqas 3 Printer 40 10$ 400$
603 11/9/18 C_102 Saad 2 Mouse 50 20$ 1800$
603 11/9/18 C_102 Saad 4 Monitor 40 10$ 1800$
603 11/9/18 C_102 Saad 1 Scanner 40 10$ 1800$
Primary Key of given table consists three attributes
(InvoiceID,CusID,ItemID)
It’s a composite key
Draw lines in these attributes
Analysis of relationship by looking its Records(Rows)
1) One invoiceID has only one same customerID ( 601 has C_101, 602 has
C_101 and 603 has C_102). It’s one to one relationship.
2) One invoiceID has many items (601 has ItemID 1 and 2). It’s one to many
relationship.
3) One customer has many items (C_101 has itemID 1,2 and 3). It’s one to
many relationship.
In order to convert into second Normal Form(2NF)
1)It’s in 1NF
2) No partial dependency
Partial Dependency: Non-key attributes depend on
a part of Primary key.
Non-Key attribute: The atttibute or set of attributes
that cannot be qualified as a Primarykey (Which can
not be used to identify a record uniquely.
Here, InvoiceID,CusID and ItemID is a part of
primary key.
List out Non-key attributes: InvoiceDate,
InvoiceTotal, CusName, ItemName, ItemQty and
ItemPrice
InvoiceDate and InvoiceTotal are depend
on a part of primary key (InvoiceID). It
must be fully dependent on InvoiceID (not
a part of primary key).
CusName is dependent on a part of primary
key (CusID). It must be fully dependent on
CusID (not a part of primary key).
ItemName, ItemQty and ItemPrice are
dependent on a part of primary key (ItemID). It
must be fully dependent on ItemID (not a part
of primary key).
InvoiceID InvoiceDate InvoiceTotal
601 11/9/18 2500$
602 11/9/18 400$
603 11/9/18 1800$
Invoice
Now InvoiceDate and InvoiceTotal are dependent onprimary key.
CusID CusName
C_101 Waqas
C_102 Saad
Customer
Now CusName is dependent on primary key.
It’s incorrect relation(Table). How??????
ItemID ItemName ItemQty ItemPrice
1 Scanner 50 10$
2 Mouse 100 20$
3 Printer 40 10$
4 Monitor 40 10$
Oh!!!!!!!! NO
Are you noticed that we have lost some data?
=>Let check it, in 1NF relation
ItemID 1 has ItemQty 50 of CusID C_101
And ItemID 1 has ItemQty 40 of CusID C_102.
In this way, we have lost record of CusID C_102 about its
itemQty 40.
ItemID ItemName ItemPrice
1 Scanner 10$
2 Mouse 20$
3 Printer 10$
4 Monitor 10$
Item
CusID ItemID ItemQty
C_101 1 50
C_101 2 100
C_101 3 40
C_102 2 50
C_102 4 40
C_102 1 40
Customer_Item
Customer_Itemis satisfied the relationship3.
InvoiceID ItemID
601 1
601 2
602 3
603 2
603 4
603 1
Invoice_Item
Invoice_Itemis satisfiedrelationship2.
We have done our relationshipsdata analysis
All relations(Tables)Customer, Item, Invoice,
Invoice_Item and Customer_Item are in 2NF.
Now, we are moving to convert into third Normal
Form(3NF).
1) It’s in 2NF
2) No transitive dependency
Transitive Dependency: Non key attributes depend on
another non-key attributes.
All these relationare in3NF.
Because there is not exist any transitive dependency.

More Related Content

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

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...
 
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
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
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
 
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
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
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
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
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
 
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
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Normalization

  • 1. Normalize the following Relationupto3rd Normal form but stepby stpe, show each intermediateresultant table withits data. InvoiceID InvoiceDate CusID CusName ItemID ItemName ItemQty ItemPrice InvoiceTotal 601 11/9/18 C_101 Waqas 1 Scanner 50 10$ 2500$ 601 2 Mouse 100 20$ 602 11/9/18 C_101 3 Printer 40 10$ 400$ 603 11/9/18 C_102 Saad 2 Mouse 50 20$ 1800$ 603 4 Monitor 40 10$ 603 1 Scanner 40 10$ It’s unnormalized table In order to convert into First Normal Form(1NF) 1)Must be Atomic value in each cell 2)Identify attribute or attributes that qualifies as a Primary Key InvoiceID InvoiceDate CusID CusName ItemID ItemName ItemQty ItemPrice InvoiceTotal 601 11/9/18 C_101 Waqas 1 Scanner 50 10$ 2500$ 601 11/9/18 C_101 Waqas 2 Mouse 100 20$ 2500$ 602 11/9/18 C_101 Waqas 3 Printer 40 10$ 400$ 603 11/9/18 C_102 Saad 2 Mouse 50 20$ 1800$ 603 11/9/18 C_102 Saad 4 Monitor 40 10$ 1800$ 603 11/9/18 C_102 Saad 1 Scanner 40 10$ 1800$ Primary Key of given table consists three attributes (InvoiceID,CusID,ItemID) It’s a composite key Draw lines in these attributes
  • 2. Analysis of relationship by looking its Records(Rows) 1) One invoiceID has only one same customerID ( 601 has C_101, 602 has C_101 and 603 has C_102). It’s one to one relationship. 2) One invoiceID has many items (601 has ItemID 1 and 2). It’s one to many relationship. 3) One customer has many items (C_101 has itemID 1,2 and 3). It’s one to many relationship. In order to convert into second Normal Form(2NF) 1)It’s in 1NF 2) No partial dependency Partial Dependency: Non-key attributes depend on a part of Primary key. Non-Key attribute: The atttibute or set of attributes that cannot be qualified as a Primarykey (Which can not be used to identify a record uniquely. Here, InvoiceID,CusID and ItemID is a part of primary key.
  • 3. List out Non-key attributes: InvoiceDate, InvoiceTotal, CusName, ItemName, ItemQty and ItemPrice InvoiceDate and InvoiceTotal are depend on a part of primary key (InvoiceID). It must be fully dependent on InvoiceID (not a part of primary key). CusName is dependent on a part of primary key (CusID). It must be fully dependent on CusID (not a part of primary key). ItemName, ItemQty and ItemPrice are dependent on a part of primary key (ItemID). It must be fully dependent on ItemID (not a part of primary key). InvoiceID InvoiceDate InvoiceTotal 601 11/9/18 2500$ 602 11/9/18 400$ 603 11/9/18 1800$ Invoice Now InvoiceDate and InvoiceTotal are dependent onprimary key. CusID CusName C_101 Waqas C_102 Saad Customer
  • 4. Now CusName is dependent on primary key. It’s incorrect relation(Table). How?????? ItemID ItemName ItemQty ItemPrice 1 Scanner 50 10$ 2 Mouse 100 20$ 3 Printer 40 10$ 4 Monitor 40 10$ Oh!!!!!!!! NO Are you noticed that we have lost some data? =>Let check it, in 1NF relation ItemID 1 has ItemQty 50 of CusID C_101 And ItemID 1 has ItemQty 40 of CusID C_102. In this way, we have lost record of CusID C_102 about its itemQty 40. ItemID ItemName ItemPrice 1 Scanner 10$ 2 Mouse 20$ 3 Printer 10$ 4 Monitor 10$ Item CusID ItemID ItemQty C_101 1 50 C_101 2 100 C_101 3 40 C_102 2 50
  • 5. C_102 4 40 C_102 1 40 Customer_Item Customer_Itemis satisfied the relationship3. InvoiceID ItemID 601 1 601 2 602 3 603 2 603 4 603 1 Invoice_Item Invoice_Itemis satisfiedrelationship2. We have done our relationshipsdata analysis All relations(Tables)Customer, Item, Invoice, Invoice_Item and Customer_Item are in 2NF. Now, we are moving to convert into third Normal Form(3NF). 1) It’s in 2NF 2) No transitive dependency Transitive Dependency: Non key attributes depend on another non-key attributes.
  • 6. All these relationare in3NF. Because there is not exist any transitive dependency.