SlideShare a Scribd company logo
1 of 3
Download to read offline
Normalization
Normalization is a method for organizing data elements in a database into tables.
Normalization Avoids
 Duplication of Data – The same data is listed in multiple lines of the database
 Insert Anomaly – A record about an entity cannot be inserted into the table without first
inserting information about another entity – Cannot enter a customer without a sales
order
 Delete Anomaly – A record cannot be deleted without deleting a record about a related
entity. Cannot delete a sales order without deleting all of the customer’s information.
 Update Anomaly – Cannot update information without changing information in many
places. To update customer information, it must be updated for each sales order the
customer has placed
Normalization is a three stage process – After the first stage, the data is said to be in first normal
form, after the second, it is in second normal form, after the third, it is in third normal form
Before Normalization
1. Begin with a list of all of the fields that must appear in the database. Think of this as one big
table.
2. Do not include computed fields
3. One place to begin getting this information is from a printed document used by the system.
4. Additional attributes besides those for the entities described on the document can be added to
the database.
Before Normalization – Example
See Sales Order from below:
Sales Order
Fiction Company
202 N. Main
Mahattan, KS 66502
CustomerNumber: 1001 Sales Order Number: 405
Customer Name: ABC Company Sales Order Date: 2/1/2000
Customer Address: 100 Points Clerk Number: 210
Manhattan, KS 66502 Clerk Name: Martin Lawrence
Item Ordered Description Quantity Unit Price Total
800
801
805
widgit small
tingimajigger
thingibob
40
20
10
60.00
20.00
100.00
2,400.00
400.00
1,000.00
Order Total 3,800.00
Fields in the original data table will be as follows:
SalesOrderNo, Date, CustomerNo, CustomerName, CustomerAdd, ClerkNo, ClerkName,
ItemNo, Description, Qty, UnitPrice
Think of this as the baseline – one large table
Normalization: First Normal Form
 Separate Repeating Groups into New Tables.
 Repeating Groups Fields that may be repeated several times for one document/entity
 Create a new table containing the repeating data
 The primary key of the new table (repeating group) is always a composite key; Usually
document number and a field uniquely describing the repeating line, like an item number.
First Normal Form Example
The new table is as follows:
SalesOrderNo, ItemNo, Description, Qty, UnitPrice
The repeating fields will be removed from the original data table, leaving the following.
SalesOrderNo, Date, CustomerNo, CustomerName, CustomerAdd, ClerkNo, ClerkName
These two tables are a database in first normal form
What if we did not Normalize the Database to First Normal Form?
Repetition of Data – SO Header data repeated for every line in sales order.
Normalization: Second Normal Form
 Remove Partial Dependencies.
 Functional Dependency The value of one attribute in a table is determined entirely by
the value of another.
 Partial Dependency A type of functional dependency where an attribute is functionally
dependent on only part of the primary key (primary key must be a composite key).
 Create separate table with the functionally dependent data and the part of the key on
which it depends. Tables created at this step will usually contain descriptions of
resources.
Second Normal Form Example
The new table will contain the following fields:
ItemNo, Description
All of these fields except the primary key will be removed from the original table. The primary
key will be left in the original table to allow linking of data:
SalesOrderNo, ItemNo, Qty, UnitPrice
Never treat price as dependent on item. Price may be different for different sales orders
(discounts, special customers, etc.)
Along with the unchanged table below, these tables make up a database in second normal form:
SalesOrderNo, Date, CustomerNo, CustomerName, CustomerAdd, ClerkNo, ClerkName
What if we did not Normalize the Database to Second Normal Form?
 Repetition of Data – Description would appear every time we had an order for the item
 Delete Anomalies – All information about inventory items is stored in the
SalesOrderDetail table. Delete a sales order, delete the item.
 Insert Anomalies – To insert an inventory item, must insert sales order.
 Update Anomalies – To change the description, must change it on every SO.
Normalization: Third Normal Form
 Remove transitive dependencies.
 Transitive Dependency A type of functional dependency where an attribute is
functionally dependent on an attribute other than the primary key. Thus its value is only
indirectly determined by the primary key.
 Create a separate table containing the attribute and the fields that are functionally
dependent on it. Tables created at this step will usually contain descriptions of either
resources or agents. Keep a copy of the key attribute in the original file.
Third Normal Form Example
The new tables would be:
CustomerNo, CustomerName, CustomerAdd
ClerkNo, ClerkName
All of these fields except the primary key will be removed from the original table. The primary
key will be left in the original table to allow linking of data as follows:
SalesOrderNo, Date, CustomerNo, ClerkNo
Together with the unchanged tables below, these tables make up the database in third normal
form.
ItemNo, Description
SalesOrderNo, ItemNo, Qty, UnitPrice
What if we did not Normalize the Database to Third Normal Form?
 Repetition of Data – Detail for Cust/Clerk would appear on every SO
 Delete Anomalies – Delete a sales order, delete the customer/clerk
 Insert Anomalies – To insert a customer/clerk, must insert sales order.
 Update Anomalies – To change the name/address, etc, must change it on every SO.
Completed Tables in Third Normal Form
Customers: CustomerNo, CustomerName, CustomerAdd
Clerks: ClerkNo, ClerkName
Inventory Items: ItemNo, Description
Sales Orders: SalesOrderNo, Date, CustomerNo, ClerkNo
SalesOrderDetail: SalesOrderNo, ItemNo, Qty, UnitPrice

More Related Content

What's hot

What's hot (20)

Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a Database
 
Dbms4
Dbms4Dbms4
Dbms4
 
Data Structure (Circular Linked List)
Data Structure (Circular Linked List)Data Structure (Circular Linked List)
Data Structure (Circular Linked List)
 
linked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutoriallinked list in Data Structure, Simple and Easy Tutorial
linked list in Data Structure, Simple and Easy Tutorial
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
database Normalization
database Normalizationdatabase Normalization
database Normalization
 
Database Project of a Corporation or Firm
Database Project of a Corporation or Firm Database Project of a Corporation or Firm
Database Project of a Corporation or Firm
 
Query Worker Contracts Details Oracle Fusion Cloud
Query Worker Contracts Details Oracle Fusion CloudQuery Worker Contracts Details Oracle Fusion Cloud
Query Worker Contracts Details Oracle Fusion Cloud
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Sap isu tcodes
Sap isu tcodesSap isu tcodes
Sap isu tcodes
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
join relation.pptx
join relation.pptxjoin relation.pptx
join relation.pptx
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
JCL SORT TOOL
JCL SORT TOOLJCL SORT TOOL
JCL SORT TOOL
 
Learn Normalization in simple language
Learn Normalization in simple languageLearn Normalization in simple language
Learn Normalization in simple language
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR Schema
 
Manage users & tables in Oracle Database
Manage users & tables in Oracle DatabaseManage users & tables in Oracle Database
Manage users & tables in Oracle Database
 
Time And Labor Overview
Time And Labor OverviewTime And Labor Overview
Time And Labor Overview
 
Edit idoc , reprocess and test idoc
Edit idoc , reprocess and test idocEdit idoc , reprocess and test idoc
Edit idoc , reprocess and test idoc
 
Upgrading 11i E-business Suite to R12 E-business Suite
Upgrading 11i E-business Suite to R12 E-business SuiteUpgrading 11i E-business Suite to R12 E-business Suite
Upgrading 11i E-business Suite to R12 E-business Suite
 

Similar to Normalization

Normalization2
Normalization2Normalization2
Normalization2
rupaliz
 
Modelado Dimensional 4 Etapas
Modelado Dimensional 4 EtapasModelado Dimensional 4 Etapas
Modelado Dimensional 4 Etapas
Roberto Espinosa
 
Database Management Systems Lab manual (KR20) CSE.pdf
Database Management Systems Lab manual (KR20) CSE.pdfDatabase Management Systems Lab manual (KR20) CSE.pdf
Database Management Systems Lab manual (KR20) CSE.pdf
Anvesh71
 
Part 2Supplier Database (MS Access)As you recall, data is a.docx
Part 2Supplier Database (MS Access)As you recall, data is a.docxPart 2Supplier Database (MS Access)As you recall, data is a.docx
Part 2Supplier Database (MS Access)As you recall, data is a.docx
odiliagilby
 
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
arjunstores123
 
Part 2Provider Database (Open Office Database)Use the project.docx
Part 2Provider Database (Open Office Database)Use the project.docxPart 2Provider Database (Open Office Database)Use the project.docx
Part 2Provider Database (Open Office Database)Use the project.docx
dewhirstichabod
 
Part 2Provider Database (Open Office Database)Use the project des.docx
Part 2Provider Database (Open Office Database)Use the project des.docxPart 2Provider Database (Open Office Database)Use the project des.docx
Part 2Provider Database (Open Office Database)Use the project des.docx
danhaley45372
 
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docx
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docxPart 1 - Microsoft AccessView GlossaryUse Access to create a.docx
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docx
honey690131
 
Part 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docxPart 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docx
danhaley45372
 
Part 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docxPart 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docx
herbertwilson5999
 
Lamar University - MISY 3310 Access ProjectPremiere Products.docx
Lamar University - MISY 3310 Access ProjectPremiere Products.docxLamar University - MISY 3310 Access ProjectPremiere Products.docx
Lamar University - MISY 3310 Access ProjectPremiere Products.docx
DIPESH30
 
Part 2Provider Database (MS Access)Use the project descriptio.docx
Part 2Provider Database (MS Access)Use the project descriptio.docxPart 2Provider Database (MS Access)Use the project descriptio.docx
Part 2Provider Database (MS Access)Use the project descriptio.docx
dunnramage
 
Advanced excel unit 01
Advanced excel unit 01Advanced excel unit 01
Advanced excel unit 01
Prashanth Shivakumar
 
Computer Assignment #2 Company Database GuideCustomer Table Da.docx
Computer Assignment #2 Company Database GuideCustomer Table Da.docxComputer Assignment #2 Company Database GuideCustomer Table Da.docx
Computer Assignment #2 Company Database GuideCustomer Table Da.docx
zollyjenkins
 

Similar to Normalization (20)

Normalization2
Normalization2Normalization2
Normalization2
 
Normalization.ppt
Normalization.pptNormalization.ppt
Normalization.ppt
 
Database design
Database designDatabase design
Database design
 
Modelado Dimensional 4 Etapas
Modelado Dimensional 4 EtapasModelado Dimensional 4 Etapas
Modelado Dimensional 4 Etapas
 
Modelado Dimensional 4 etapas.ppt
Modelado Dimensional 4 etapas.pptModelado Dimensional 4 etapas.ppt
Modelado Dimensional 4 etapas.ppt
 
Database Management Systems Lab manual (KR20) CSE.pdf
Database Management Systems Lab manual (KR20) CSE.pdfDatabase Management Systems Lab manual (KR20) CSE.pdf
Database Management Systems Lab manual (KR20) CSE.pdf
 
Normalization
NormalizationNormalization
Normalization
 
Part 2Supplier Database (MS Access)As you recall, data is a.docx
Part 2Supplier Database (MS Access)As you recall, data is a.docxPart 2Supplier Database (MS Access)As you recall, data is a.docx
Part 2Supplier Database (MS Access)As you recall, data is a.docx
 
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
 
Part 2Provider Database (Open Office Database)Use the project.docx
Part 2Provider Database (Open Office Database)Use the project.docxPart 2Provider Database (Open Office Database)Use the project.docx
Part 2Provider Database (Open Office Database)Use the project.docx
 
12045217.ppt
12045217.ppt12045217.ppt
12045217.ppt
 
Part 2Provider Database (Open Office Database)Use the project des.docx
Part 2Provider Database (Open Office Database)Use the project des.docxPart 2Provider Database (Open Office Database)Use the project des.docx
Part 2Provider Database (Open Office Database)Use the project des.docx
 
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docx
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docxPart 1 - Microsoft AccessView GlossaryUse Access to create a.docx
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docx
 
Part 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docxPart 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docx
 
Part 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docxPart 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docx
 
Lamar University - MISY 3310 Access ProjectPremiere Products.docx
Lamar University - MISY 3310 Access ProjectPremiere Products.docxLamar University - MISY 3310 Access ProjectPremiere Products.docx
Lamar University - MISY 3310 Access ProjectPremiere Products.docx
 
(Lecture 4)Slowly Changing Dimensions.pdf
(Lecture 4)Slowly Changing Dimensions.pdf(Lecture 4)Slowly Changing Dimensions.pdf
(Lecture 4)Slowly Changing Dimensions.pdf
 
Part 2Provider Database (MS Access)Use the project descriptio.docx
Part 2Provider Database (MS Access)Use the project descriptio.docxPart 2Provider Database (MS Access)Use the project descriptio.docx
Part 2Provider Database (MS Access)Use the project descriptio.docx
 
Advanced excel unit 01
Advanced excel unit 01Advanced excel unit 01
Advanced excel unit 01
 
Computer Assignment #2 Company Database GuideCustomer Table Da.docx
Computer Assignment #2 Company Database GuideCustomer Table Da.docxComputer Assignment #2 Company Database GuideCustomer Table Da.docx
Computer Assignment #2 Company Database GuideCustomer Table Da.docx
 

More from Samir Sabry (16)

Mapping rules
Mapping rulesMapping rules
Mapping rules
 
Mapping example
Mapping exampleMapping example
Mapping example
 
Mapping example
Mapping exampleMapping example
Mapping example
 
Keyboard symbols
Keyboard symbolsKeyboard symbols
Keyboard symbols
 
Xhtml
XhtmlXhtml
Xhtml
 
Normlaization
NormlaizationNormlaization
Normlaization
 
Mapping
MappingMapping
Mapping
 
Data mining
Data miningData mining
Data mining
 
Data warehouse
Data warehouseData warehouse
Data warehouse
 
2010 Calendriersexy
2010 Calendriersexy2010 Calendriersexy
2010 Calendriersexy
 
Sample Test Word Intermediate Mulitple Choice
Sample Test Word Intermediate Mulitple ChoiceSample Test Word Intermediate Mulitple Choice
Sample Test Word Intermediate Mulitple Choice
 
Computer Fundamentals Test
Computer Fundamentals TestComputer Fundamentals Test
Computer Fundamentals Test
 
Database Management System And Design Questions
Database Management System And Design QuestionsDatabase Management System And Design Questions
Database Management System And Design Questions
 
Test In Word
Test In WordTest In Word
Test In Word
 
Data Warehouse
Data WarehouseData Warehouse
Data Warehouse
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
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
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
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...
 
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
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
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 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
 
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
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
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
 
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...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
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...
 
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
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Normalization

  • 1. Normalization Normalization is a method for organizing data elements in a database into tables. Normalization Avoids  Duplication of Data – The same data is listed in multiple lines of the database  Insert Anomaly – A record about an entity cannot be inserted into the table without first inserting information about another entity – Cannot enter a customer without a sales order  Delete Anomaly – A record cannot be deleted without deleting a record about a related entity. Cannot delete a sales order without deleting all of the customer’s information.  Update Anomaly – Cannot update information without changing information in many places. To update customer information, it must be updated for each sales order the customer has placed Normalization is a three stage process – After the first stage, the data is said to be in first normal form, after the second, it is in second normal form, after the third, it is in third normal form Before Normalization 1. Begin with a list of all of the fields that must appear in the database. Think of this as one big table. 2. Do not include computed fields 3. One place to begin getting this information is from a printed document used by the system. 4. Additional attributes besides those for the entities described on the document can be added to the database. Before Normalization – Example See Sales Order from below: Sales Order Fiction Company 202 N. Main Mahattan, KS 66502 CustomerNumber: 1001 Sales Order Number: 405 Customer Name: ABC Company Sales Order Date: 2/1/2000 Customer Address: 100 Points Clerk Number: 210 Manhattan, KS 66502 Clerk Name: Martin Lawrence Item Ordered Description Quantity Unit Price Total 800 801 805 widgit small tingimajigger thingibob 40 20 10 60.00 20.00 100.00 2,400.00 400.00 1,000.00 Order Total 3,800.00
  • 2. Fields in the original data table will be as follows: SalesOrderNo, Date, CustomerNo, CustomerName, CustomerAdd, ClerkNo, ClerkName, ItemNo, Description, Qty, UnitPrice Think of this as the baseline – one large table Normalization: First Normal Form  Separate Repeating Groups into New Tables.  Repeating Groups Fields that may be repeated several times for one document/entity  Create a new table containing the repeating data  The primary key of the new table (repeating group) is always a composite key; Usually document number and a field uniquely describing the repeating line, like an item number. First Normal Form Example The new table is as follows: SalesOrderNo, ItemNo, Description, Qty, UnitPrice The repeating fields will be removed from the original data table, leaving the following. SalesOrderNo, Date, CustomerNo, CustomerName, CustomerAdd, ClerkNo, ClerkName These two tables are a database in first normal form What if we did not Normalize the Database to First Normal Form? Repetition of Data – SO Header data repeated for every line in sales order. Normalization: Second Normal Form  Remove Partial Dependencies.  Functional Dependency The value of one attribute in a table is determined entirely by the value of another.  Partial Dependency A type of functional dependency where an attribute is functionally dependent on only part of the primary key (primary key must be a composite key).  Create separate table with the functionally dependent data and the part of the key on which it depends. Tables created at this step will usually contain descriptions of resources. Second Normal Form Example The new table will contain the following fields: ItemNo, Description All of these fields except the primary key will be removed from the original table. The primary key will be left in the original table to allow linking of data: SalesOrderNo, ItemNo, Qty, UnitPrice Never treat price as dependent on item. Price may be different for different sales orders (discounts, special customers, etc.) Along with the unchanged table below, these tables make up a database in second normal form: SalesOrderNo, Date, CustomerNo, CustomerName, CustomerAdd, ClerkNo, ClerkName What if we did not Normalize the Database to Second Normal Form?  Repetition of Data – Description would appear every time we had an order for the item  Delete Anomalies – All information about inventory items is stored in the SalesOrderDetail table. Delete a sales order, delete the item.
  • 3.  Insert Anomalies – To insert an inventory item, must insert sales order.  Update Anomalies – To change the description, must change it on every SO. Normalization: Third Normal Form  Remove transitive dependencies.  Transitive Dependency A type of functional dependency where an attribute is functionally dependent on an attribute other than the primary key. Thus its value is only indirectly determined by the primary key.  Create a separate table containing the attribute and the fields that are functionally dependent on it. Tables created at this step will usually contain descriptions of either resources or agents. Keep a copy of the key attribute in the original file. Third Normal Form Example The new tables would be: CustomerNo, CustomerName, CustomerAdd ClerkNo, ClerkName All of these fields except the primary key will be removed from the original table. The primary key will be left in the original table to allow linking of data as follows: SalesOrderNo, Date, CustomerNo, ClerkNo Together with the unchanged tables below, these tables make up the database in third normal form. ItemNo, Description SalesOrderNo, ItemNo, Qty, UnitPrice What if we did not Normalize the Database to Third Normal Form?  Repetition of Data – Detail for Cust/Clerk would appear on every SO  Delete Anomalies – Delete a sales order, delete the customer/clerk  Insert Anomalies – To insert a customer/clerk, must insert sales order.  Update Anomalies – To change the name/address, etc, must change it on every SO. Completed Tables in Third Normal Form Customers: CustomerNo, CustomerName, CustomerAdd Clerks: ClerkNo, ClerkName Inventory Items: ItemNo, Description Sales Orders: SalesOrderNo, Date, CustomerNo, ClerkNo SalesOrderDetail: SalesOrderNo, ItemNo, Qty, UnitPrice