SlideShare a Scribd company logo
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

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 

Recently uploaded (20)

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 

Featured

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
Pixeldarts
 
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
 
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
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
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
Neil Kimberley
 
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)
contently
 
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
Albert Qian
 
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)
 
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
Search Engine Journal
 
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
SpeakerHub
 
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
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
Tessa Mero
 
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
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
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
MindGenius
 
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...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 

Featured (20)

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...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

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.