0% found this document useful (0 votes)
34 views17 pages

DBDD - Topic 2-3 (Normalization)

The document discusses database normalization and enhancing database design through normalization. It covers topics like functional dependencies, anomalies, splitting relations into multiple tables, and normalization steps including 1NF, 2NF, and 3NF to remove anomalies and create ideal relations.

Uploaded by

Eaindra Khin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views17 pages

DBDD - Topic 2-3 (Normalization)

The document discusses database normalization and enhancing database design through normalization. It covers topics like functional dependencies, anomalies, splitting relations into multiple tables, and normalization steps including 1NF, 2NF, and 3NF to remove anomalies and create ideal relations.

Uploaded by

Eaindra Khin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Database Design and

Development

Topic 2_Enhancing Design


(Normalization)
2

Functional Dependence
Relationship between attributes..
AB

StudentID StudentName StudentID Activity


23 Singh 21 Dancing
34 Smith 21 Swimming
56 Smith 34 Dancing
76 John 55 Fencing

StudentID  StudentName No functional


dependence.
Anomalies
What happens if we change the price of Dancing?
• Deletion Anomalies

StudentID Activity Cost


• Update Anomalies
21 Dancing $23
21 Swimming $50
• Insertion Anomalies
34 Dancing $23
55 Fencing $20

Football $30

What information do we lose if 55 stops Fencing? What happens if we add


activity football with cost $30
Splitting the Relation
StudentID Activity Cost
21 Dancing $23
21 Swimming $50
34 Dancing $23
What happens if we change
55 Fencing $20 the price of Dancing?

StudentID Activity Activity Cost


21 Dancing Dancing $23
21 Swimming Swimming $50
34 Dancing Fencing $20
55 Fencing Football $30

What information do we lose if 55 What happens if we add


stops Fencing? activity football with cost $30
Normalization
• This process of moving from data that is not in a relational form, to a relation,
and finally to a set of ideal relations is known as normalisation.
Normalization Steps
• UNF – Un-normalized Form

• 1NF - First Normal Form

• 2NF - Second Normal Form

• 3NF - Third Normal Form


Normalization Steps
UNF - un-normalized form
• Identify repeating groups

1NF - First Normal Form


• Remove repeating group information.

2NF - Second Normal Form


• Remove partial key dependencies.

3NF - Third Normal Form


• Remove non-key dependencies.
Customer Order Sheet for Art Supply Shop
Customer Order Sheet for an Art Supplier
Customer Number: 37
Customer Name: Jagpal Singh
Customer Type Code: RC
Customer Type Description: Retail Customer

Item Number Item Name Supplier ID Price Supplier Name Quantity


099 Basic Paint Set S1 £3 Smith and Co 1
0100 Sable Brush Set S2 £3.50 Acro 1
0101 Extended Colour S1 £3.75 Smith and Co 3
Set
098 Metallic Paint Set S1 £3.99 Smith and Co 1
078 Mixed Brush Set S2 £3.99 Acro 2
Un-normalized Form (UNF)
• Identify repeating groups

UNF Level
Customer Number 1
Customer Name
Customer Type Code 1
Customer Type Description 1
Item Number 1
Item Name 2
Supplier ID 2
Price
Supplier Name 2
Quantity 2
2
2
First Normal Form (1NF)
• Remove repeating group information
UNF Level 1NF

Customer Number 1 Customer Number


Customer Name 1
Customer Type Code 1 Customer Name
Customer Type Description 1 Customer Type Code
Item Number 2 Customer Type Description
Item Name 2
Supplier ID 2
Price 2
Supplier Name 2 Customer Number*
Quantity 2
Item Number
Item Name
Supplier ID
Price
Supplier Name
Quantity
Second Normal Form (2NF)
• Remove partial key dependencies
1NF 2NF
Customer Number Customer Number
Customer Name Customer Name
Customer Type Code
Customer Type Description Customer Type Code
Customer Type Description

Customer Number*
Item Number Customer Number*
Item Name Item Number*
Supplier ID Quantity
Price
Supplier Name
Quantity Item Number
Item Name
Supplier ID
Price
Supplier Name
Customer Order Sheet for Art Supply Shop
Customer Number  Item Name

Customer Order Sheet for an Art Supplier Customer Number  Supplier ID


Customer Number: 37
Customer Name: Jagpal Singh Customer Number  Price
Customer Type Code: RC Customer Number  Supplier Name
Customer Type Description: Retail Customer
Customer Number  Quantity
Item Number Item Name Supplier ID Price Supplier Name Quantity
099 Basic Paint Set S1 £3 Smith and Co 1
Item Number  Item Name
0100 Sable Brush Set S2 £3.50 Acro 1
0101 Extended Colour S1 £3.75 Smith and Co 3 Item Number  Supplier ID
Set
098 Metallic Paint Set S1 £3.99 Smith and Co 1 Item Number  Price
078 Mixed Brush Set S2 £3.99 Acro 2
Item Number  Supplier Name

Customer Number, Item Number  Quantity


Third Normal Form (3NF) 2NF 3NF
• Remove non-key dependencies Customer Number Customer Number
Customer Name Customer Name
Customer Type Code Customer Type Code*
Customer Type Description
Customer Type Code
Customer Number* Customer Type Description
Item Number*
Quantity Customer Number*
Item Number*
Item Number
Item Name Quantity
Supplier ID
Price Item Number
Supplier Name Item Name
Price
Supplier ID*

Supplier ID
Supplier Name
Third Normal Form (3NF) to Deriving Entities
3NF
Customer Number Customer
Customer Name
Customer Type Code*

Customer Type Code 1 1…*


Customer Type Description CustomerType Customer CustomerItem

Customer Number* 1…* 1…*


Item Number*
Quantity CustomerItem
Item Number 1 1
Item Name
Price CustomerType Item
Supplier ID*
Item 1…*
Supplier ID
Supplier Name
1
Supplier Supplier
The Entity Relationship Diagram

1 1...* 1...* 1
Customer CustomerItem Item
1...* 1...*

1 1

CustomerType Supplier
Extended Example
• To be used throughout the course
• Lots of different documents might be examined e.g.

• Customer records
• Sales sheets
• Receipts and invoices
THANK YOU

You might also like