SlideShare a Scribd company logo
+
Database
Normalization
+ 7-2
Chapter Objectives
 Describe the data normalization process
 Perform the data normalization process.
 Test tables for irregularities using the data normalization
process.
+ 7-3
Logical Database Design
 The process of deciding how to arrange the attributes of the
entities in the business environment into database structures,
such as the tables of a relational database.
 The goal is to create well structured tables that properly reflect
the company’s business environment.
+ 7-4
Logical Design of Relational
Database Systems
 (1) The conversion of E-R diagrams into relational tables.
 (2) The data normalization technique.
 (3) The use of the data normalization technique to test the
tables resulting from the E-R diagram conversions.
+ 7-5
The Data Normalization Process
 A methodology for organizing attributes into tables so that
redundancy among the nonkey attributes is eliminated.
 The output of the data normalization process is a properly
structured relational database.
+ 7-6
The Data Normalization Technique
Input:
 all the attributes that must be incorporated into the
database
 a list of all the defining associations between the
attributes (i.e., the functional dependencies).
 a means of expressing that the value of one particular
attribute is associated with a single, specific value of
another attribute.
 If we know that one of these attributes has a particular
value, then the other attribute must have some other value.
7-7
General Hardware Company Database
Salesperson
Number
Salesperson
Name
Commission
Percentage Year of Hire
Office
Number
SALESPERSON
Customer
Number
Customer
Name
Salesperson
Number HQ City
CUSTOMER
Customer
Number
Employee
Number
Employee
Name Title
CUSTOMER EMPLOYEE
Product
Number
Product
Name Unit Price
PRODUCT
Salesperson
Number
Product
Number Quantity
SALES
Office
Number Telephone Size
OFFICE
+ 7-8
Functional
Dependence
 Salesperson Number is the determinant.
 The value of Salesperson Number determines the
value of Salesperson Name.
 Salesperson Name is functionally dependent on
Salesperson Number.
Salesperson Name
Salesperson Number
+
General Hardware Environment:
SALESPERSON and PRODUCT
Salesperson Number
Salesperson Name
Commission Percentage
Year of Hire
Department Number
Manager Name
Product Number
Product Name
Unit Price
Quantity
What are the
functional
dependencies?
7-9
+ 7-10
General Hardware Environment:
SALESPERSON and PRODUCT
Salesperson Number
Salesperson Name
Commission Percentage
Year of Hire
Department Number
Manager Name
Product Number
Product Name
Unit Price
Quantity
Salesperson Number Salesperson Name
Salesperson Number Commission Percentage
Salesperson Number Year of Hire
Salesperson Number Department Nu mber
Salesperson Number Manager Name
Product Number Product Name
Product Number Unit Price
Department Number Manager Name
Salesperson Number, Product Number Quantity
+Full Functional dependency:
 If A and B are attributes(columns)of a table, B is fully functionally dependent on A
if B is functionally dependent on A, but not on any proper subset of A.
SalesPerson#--SalesPersonName
Partial Functional Dependency:
 If A and B are attributes of a table, B is partially dependent on A if there is some
attribute that can be removed from A and yet the dependency still holds.
SP#, SPName -------> Comm%
Comm% is functionally dependent on a subset of A (SP#, SPName),
namely SP#.
Transitive Functional Dependency:
 A , B and C are attributes of a table. If A is functionally dependent on B, and B is
functionally dependent on C, then C is Transitively dependent on A via B.
SP#---->SPName, Comm%, YearOfHire, Office#
Office#---Telephone#
SP# attribute functionally determines Telephone# via Office# attribute.
8/11/2022
+ 7-12
Steps in the Data Normalization Process
+ 7-13
The Data Normalization Process
 Once the attributes are arranged in third normal form, the
group of tables that they comprise is a well-structured
relational database with no data redundancy.
 Subsequently R.Boyce and E.F.Codd introduced a stronger
definition of 3NF called Boyce-Codd Normal Form(BCNF).
 With the exception of 1NF, all these normal forms are based on
Functional dependencies among the attributes of a table. Higher
normal forms that go beyond BCNF were introduced later such as
Fourth Normal Form (4NF) and Fifth Normal Form (5NF). However
these later normal forms deal with situations that are very rare.
 A group of tables is said to be in a particular normal form
if every table in the group is in that normal form.
 The data normalization process is progressive.
 For example, if a group of tables is in second normal form, it is
also in first normal form.
+ 7-14
General Hardware Company:
Unnormalized Data
Sales-person
Number Product
Number
Sales-person
Name Commission
Percentage
Year
of
Hire
Depart-ment
Number Manager
Name
Product
Name
Unit
Price Quantity
137 19440
24013
26722
Baker 10 1995 73 Scott Hammer
Saw
Pliers
17.50
26.25
11.50
473
170
688
186 16386
19440
21765
24013
Adams 15 2001 59 Lopez Wrench
Hammer
Drill
Saw
12.95
17.50
32.99
26.25
1745
2529
1962
3071
204 21765
26722
Dickens 10 1998 73 Scott Drill
Pliers
32.99
11.50
809
734
361 16386
21765
26722
Carlyle 20 2001 73 Scott Wrench
Drill
Pliers
12.95
32.99
11.50
3729
3110
2738
SALESPERSON/PRODUCT Table
 Records contain multivalued attributes.
7-15
General Hardware Company: First
Normal Form
 The only thing that is required for a table to be in 1NF is to
contain only atomic values (intersection of each row and
column should contain one and only one value). This is
sometimes referred to as: Eliminate Repeating groups.
 The attributes under consideration have been listed in one
table, and a primary key has been established.
 The number of records has been increased so that every
attribute of every record has just one value.
 The multivalued attributes have been eliminated.
Sales-person
Number
Product
Number
Sales-person
Name
Commission
Percentage
Year
of
Hire
Depart-ment
Number
Manager
Name
Product
Name
Unit
Price
Quantity
SALESPERSON/PRODUCT Table
+ 7-16
General Hardware Company: First
Normal Form
Sales-person
Number Product
Number
Sales-person
Name Commission
Percentage
Year
of
Hire
Depart-ment
Number Manager
Name
Product
Name
Unit
Price Quantity
137 19440 Baker 10 1995 73 Scott Hammer 17.50 473
137 24013 Baker 10 1995 73 Scott Saw 26.25 170
137 26722 Baker 10 1995 73 Scott Pliers 11.50 688
186 16386 Adams 15 2001 59 Lopez Wrench 12.95 1745
186 19440 Adams 15 2001 59 Lopez Hammer 17.50 2529
186 21765 Adams 15 2001 59 Lopez Drill 32.99 1962
186 24013 Adams 15 2001 59 Lopez Saw 26.25 3071
204 21765 Dickens 10 1998 73 Scott Drill 32.99 809
204 26722 Dickens 10 1998 73 Scott Pliers 11.50 734
361 16386 Carlyle 20 2001 73 Scott Wrench 12.95 3729
361 21765 Carlyle 20 2001 73 Scott Drill 32.99 3110
361 26722 Carlyle 20 2001 73 Scott Pliers 11.50 2738
SALESPERSON/PRODUCT Table
+ 7-17
General Hardware Company: First
Normal Form
First normal form is merely a starting point in
the normalization process.
First normal form contains a great deal of
data redundancy.
 Three records involve salesperson 137, so there
are three places in which his name is listed as
Baker, his commission percentage is listed as 10,
and so on.
 Two records involve product 19440 and this
product’s name is listed twice as Hammer and its
unit price is listed twice as 17.50.
+ 7-18
Second Normal Form
 A Table is said to be in 2NF if it is in 1NF and there are no
partial dependencies
 No Partial Functional Dependencies
 Every non primary key attribute of the table must be fully functionally
dependent on the entire primary key of that table.
 A non-key attribute cannot depend on only part of the key.
7-19
General Hardware Company: Second
Normal Form
Salesperson
Number
Product
Number
Quantity
QUANTITY Table
Salesperson
Number
Salesperson
Name
Commission
Percentage
Year
of
Hire
Department
Number
Manager
Name
SALESPERSON Table
 In SALESPERSON, Salesperson Number is the sole primary
key attribute. Every nonkey attribute of the table is fully defined
just by Salesperson Number.
 Similar logic for PRODUCT and QUANTITY tables.
Product
Number
Product
Name
Unit
Price
PRODUCT Table
7-20
General Hardware Company: Second
Normal Form
Product
Number
Product
Name
Unit
Price
16386 Wrench 12.95
19440 Hammer 17.50
21765 Drill 32.99
24013 Saw 26.25
26722 Pliers 11.50
PRODUCT Table
Salesperson
Number
Product
Number Quantity
137 19440 473
137 24013 170
137 26722 688
186 16386 1745
186 19440 2529
186 21765 1962
186 24013 3071
204 21765 809
204 26722 734
361 16386 3729
361 21765 3110
361 26722 2738
QUANTITY Table
Salesperson
Number
Salesperson
Name
Commission
Percentage
Year
of
Hire
Department
Number
Manager
Name
137 Baker 10 1995 73 Scott
186 Adams 15 2001 59 Lopez
204 Dickens 10 1998 73 Scott
361 Carlyle 20 2001 73 Scott
SALESPERSON Table
+ 7-21
Third Normal Form
 A Table that is in 1NF and 2NF and in which no non primary
key attribute is transitively dependent on the primary key.
 Does not allow transitive dependencies in which one nonkey
attribute is functionally dependent on another.
 Nonkey attributes are not allowed to define other nonkey
attributes.
 "Each attribute must be a fact about the key, the whole key, and
nothing but the key."
7-22
General Hardware Company: Third
Normal Form
Salesperson
Number
Salesperson
Name
Commission
Percentage
Year of
Hire
Department
Number
SALESPERSON Table
Department
Number
Manager
Name
DEPARTMENT Table
Product
Number
Product
Name
Unit
Price
PRODUCT Table
Salesperson
Number
Product
Number
Quantity
QUANTITY Table
7-23
General Hardware Company: Third
Normal Form
Salesperson
Number
Salesperson
Name
Commission
Percentage
Year of
Hire
Department
Number
137 Baker 10 1995 73
186 Adams 15 2001 59
204 Dickens 10 1998 73
361 Carlyle 20 2001 73
SALESPERSON Table
Department
Number
Manager
Name
59 Lopez
73 Scott
DEPARTMENT Table
Product
Number
Product
Name
Unit
Price
16386 Wrench 12.95
19440 Hammer 17.50
21765 Drill 32.99
24013 Saw 26.25
26722 Pliers 11.50
PRODUCT Table
Salesperson
Number
Product
Number Quantity
137 19440 473
137 24013 170
137 26722 688
186 16386 1745
186 19440 2529
186 21765 1962
186 24013 3071
204 21765 809
204 26722 734
361 16386 3729
361 21765 3110
361 26722 2738
QUANTITY Table
+ 7-24
General Hardware Company: Third
Normal Form
Important points about the third normal form
structure are:
 It is completely free of data redundancy.
 All foreign keys appear where needed to logically
tie together related tables.
 It is the same structure that would have been
derived from a properly drawn entity-relationship
diagram of the same business environment.
+
Recap + clarification
 0NF:
 Unstructured data, can have multi-valued attributes
 1NF:
 Atomic values (one per column of the record)
 No duplicate rows (implies there is a key)
 As we move forward need to consider functional dependencies
and determine candidate keys
 Note: earlier slides simplified this slightly by saying choose a
primary key, but normalization is actually about candidate keys
 For the higher forms of normalization, we need to consider the
case where there is not a single option for the primary key
8/11/2022
+
Definitions
 Superkey: a combination of attributes that can be used to
uniquely identify a row in a database. The trivial superkey is all
attributes.
 Candidate key: a minimal superkey – all attributes are
necessary to uniquely identify the record
 Primary key: one candidate key, arbitrarily chosen
 Prime attribute: an attribute that occurs in some candidate key
 Non prime attribute: an attribute that does not occur in any
candidate key
8/11/2022
+
2NF (revisited)
 A Table is said to be in 2NF if it is in 1NF and there are no
partial dependencies
 No Partial Functional Dependencies
 Every non primary key attribute of the table must be fully functionally
dependent on the entire primary key of that table.
 A non-key attribute cannot depend on only part of the key.
 No Partial Functional Dependences
 Every non prime key attribute of the table must be fully functionally
dependent on the entire key of one of the candidate keys in the
table.
 An non-prime attribute cannot depend on only part of one of the
candidate keys.
8/11/2022
+
3NF revisited
 A Table that is in 1NF and 2NF and in which no non primary
key attribute is transitively dependent on the primary key.
 Old:
 Does not allow transitive dependencies in which one non-key
attribute is functionally dependent on another.
 Nonkey attributes are not allowed to define other nonkey attributes.
 New:
 Every non-prime attribute is non-transitively dependent on every
candidate key in the table.
 The attributes that do not directly contribute to the description of the
candidate keys are removed from the table. In other words, no
transitive dependency is allowed.
8/11/2022
+
"Each non-key attribute must
provide a fact about the key, the
whole key, and nothing but the key.”
 The key: 1NF – we have a table of related items, with each row
unique, with atomic values
 The whole key: 2NF – no partial dependences on the candidate
keys
 Nothing but the key: 3NF – no transitive dependencies
8/11/2022
+ 7-30
Boyce-codd Normal Form (BCNF)
 A Table is in BCNF if and only if every determinant (i.e., the
attribute or a group of attributes on which some other
attribute is fully functionally dependent) is a candidate key.
BCNF is a stronger form of 3NF.
 The difference between 3NF and BCNF is that for a
Functional dependency A--->B, 3NF allows this
dependency in a table if attribute B is a primary key
attribute and attribute A is not a candidate key, where as
BCNF insists that for this dependency to remain in a table,
attribute A must be a candidate key.
 Only in rare cases does a 3NF table not meet the
requirements of BCNF. A 3NF table which does not have
multiple overlapping candidate keys is guaranteed to be in
BCNF. Depending on what its functional dependencies are,
a 3NF table with two or more overlapping candidate keys
may or may not be in BCNF
+ Example of 3NF table not in BCNF
 Today's Court
Bookings
 Each row in the table represents a court booking at a tennis club that
has one hard court (Court 1) and one grass court (Court 2). A booking is
defined by its Court and the period for which the Court is reserved
Additionally, each booking has a Rate Type associated with it. There
are four distinct rate types:
 SAVER, for Court 1 bookings made by members
 STANDARD, for Court 1 bookings made by non-members
 PREMIUM-A, for Court 2 bookings made by members
 PREMIUM-B, for Court 2 bookings made by non-members
 http://en.wikipedia.org/wiki/Boyce%E2%80%93Codd_normal_form 8/11/2022
Court StartTime EndTime RateType
1 09:30 10:30 SAVER
1 11:00 12:00 SAVER
1 14:00 15:30 STANDARD
2 10:00 11:30 PREMIUM-B
2 11:30 13:30 PREMIUM-B
2 15:00 16:30 PREMIUM-A
+
What is the problem?
 Identify the functional dependencies
 Identify the table’s super keys
 Determine the candidate keys
 Why isn’t the table in BCNF?
 A Table is in BCNF if and only if every determinant is a candidate
key.
 For all functional dependencies A -> B, is A a candidate key?
8/11/2022
+
Fourth Normal Form (4NF)
 4NF is a stronger normal form than 3NF/BCNF as it prevents
Tables from containing nontrivial Multi-Valued Dependencies
(MVDs) and hence data redundancy.
 The Normalization of BCNF Tables to 4NF involves the removal
of MVDs from the Table by placing the attribute(s) in a new
Table along with the copy of the determinant(s).
 http://en.wikipedia.org/wiki/Fourth_normal_form
8/11/2022
+
Pizza Delivery Example – not in 4NF
Restaurant Pizza Variety Delivery Area
A1 Pizza Thick Crust Springfield
A1 Pizza Thick Crust Shelbyville
A1 Pizza Thick Crust Capital City
A1 Pizza Stuffed Crust Springfield
A1 Pizza Stuffed Crust Shelbyville
A1 Pizza Stuffed Crust Capital City
Elite Pizza Thin Crust Capital City
Elite Pizza Stuffed Crust Capital City
Vincenzo's Pizza Thick Crust Springfield
Vincenzo's Pizza Thick Crust Shelbyville
Vincenzo's Pizza Thin Crust Springfield
Vincenzo's Pizza Thin Crust Shelbyville
8/11/2022
+
Fifth Normal Form (5NF)
 Also known as project-join normal form (PJ/NF)
 Designed to reduce redundancy in relational databases
recording multi-valued facts by isolating semantically related
multiple relationships.
 A table is said to be in the 5NF if and only if every join
dependency in it is implied by the candidate keys.
 http://en.wikipedia.org/wiki/Fifth_normal_form
8/11/2022
+
Traveling Salesman Product Availability By Brand
Traveling Salesman Brand Product Type
Jack Schneider Acme Vacuum Cleaner
Jack Schneider Acme Breadbox
Willy Loman Robusto Pruning Shears
Willy Loman Robusto Vacuum Cleaner
Willy Loman Robusto Breadbox
Willy Loman Robusto Umbrella Stand
Louis Ferguson Robusto Vacuum Cleaner
Louis Ferguson Robusto Telescope
Louis Ferguson Acme Vacuum Cleaner
Louis Ferguson Acme Lava Lamp
Louis Ferguson Nimbus Tie Rack
8/11/2022
Not in 5NF if the Salesman must offer only products of Type
P made by Brand B if that product type and brand is in his
repetoire
+ 7-37
Steps in the Data Normalization Process
+
Other good resources:
 http://www.informationqualitysolutions.com/FreeStuff/rettigNor
malizationPoster.pdf
 Today’s handout includes the explanations of each
normalization step for the example highlighted in the poster
8/11/2022
7-39
General Hardware Company:
Functional Dependencies
Salesperson Number Salesperson Name
Salesperson Number Commission Percentage
Salesperson Number Year of Hire
Salesperson Number Department Nu mber
Salesperson Number Manager Name
Customer Number Customer Name
Customer Number Salesperson Number
Customer Number HQ City
Customer Number, Employee Number Employee Name
Customer Number, Employee Number Title
Product Number Product Name
Product Number Unit Price
Department Number Manager Name
Salesperson Number, Product Number Quantity
Office Number Telephone
Office Number Salesperson Number
Office Number Size
7-40
General Hardware Company: First
Normal Form
Salesperson
Number
Customer
Number
Employee
Number
Product
Number
Office
Number
Salesperson
Name
Commission
Percentage
Year
of
Hire
Department
Number
Manager
Name
Customer
Name HQ
City
Employee
Name Title
Product
Name
Unit
Price Quantity Telephone Size
+ 7-41
World Music Association: Functional
Dependencies
Orchestra Name City
Orchestra Name Country
Orchestra Name Music Director
Musician Number Musician Name
Musician Number Instrument
Musician Number Annual Salary
Musician Number Orchestra Name
Musician Number, Degree Univeristy
Musician Number, Degree Year
Composer Name Country
Composer Name Date of Birth
Composition Name, Composer Name Year
Orchestra Name, Composition Name, Composer Name Year
Orchestra Name, Composition Name, Composer Name Price
+ 7-42
Lucky Rent-A-Car:
Functional Dependencies
Manufacturer Name Manufacturer Country
Manufacturer Name Sales Rep Na me
Manufacturer Name Sales Rep Te lephone
Car Serial Number Model
Car Serial Number Year
Car Serial Number Class
Car Serial Number Manufacturer Na me
Repair Number Car Serial Number
Repair Number Date
Repair Number Procedure
Repair Number Mileage
Repair Number Repair Time
Customer Number Customer Name
Customer Number Customer Address
Customer Number Customer Telephone
Car Serial Number, Customer Number, Rental Date Return Date
Car Serial Number, Customer Number, Rental Date Total Cost

More Related Content

Similar to 2020.11.10 SISTEM BASIS DATA PERTEMUAN 12 - Normalization_new.pptx

functional Design DFD and data flow diagram.ppt
functional Design DFD and data flow diagram.pptfunctional Design DFD and data flow diagram.ppt
functional Design DFD and data flow diagram.ppt
jayantp524
 
Cis336 i lab 1 of 7
Cis336 i lab 1 of 7Cis336 i lab 1 of 7
Cis336 i lab 1 of 7helpido9
 
Intro to tsql unit 4
Intro to tsql   unit 4Intro to tsql   unit 4
Intro to tsql unit 4Syed Asrarali
 
Intro To TSQL - Unit 4
Intro To TSQL - Unit 4Intro To TSQL - Unit 4
Intro To TSQL - Unit 4
iccma
 
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
 
45 Essential SQL Interview Questions
45 Essential SQL Interview Questions45 Essential SQL Interview Questions
45 Essential SQL Interview Questions
Best SEO Tampa
 
Database management system
Database management systemDatabase management system
Database management system
Tushar Desarda
 
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
 
Prague data management meetup 2016-11-22
Prague data management meetup 2016-11-22Prague data management meetup 2016-11-22
Prague data management meetup 2016-11-22
Martin Bém
 
Normalization by Ashwin and Tanmay
Normalization by Ashwin and TanmayNormalization by Ashwin and Tanmay
Normalization by Ashwin and TanmayAshwin Dinoriya
 
Sql Server 2000
Sql Server 2000Sql Server 2000
Sql Server 2000
Om Vikram Thapa
 
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 2Provider Database (MS Access)For a review of the complete r.docx
Part 2Provider Database (MS Access)For a review of the complete r.docxPart 2Provider Database (MS Access)For a review of the complete r.docx
Part 2Provider Database (MS Access)For a review of the complete r.docx
herbertwilson5999
 
Visual Approach to Essbase Calcs: 2018
Visual Approach to Essbase Calcs: 2018Visual Approach to Essbase Calcs: 2018
Visual Approach to Essbase Calcs: 2018
Joseph Alaimo Jr
 
Illustrated Access 2013 Unit A SAM Project 1aIllustrated .docx
Illustrated Access 2013  Unit A SAM Project 1aIllustrated .docxIllustrated Access 2013  Unit A SAM Project 1aIllustrated .docx
Illustrated Access 2013 Unit A SAM Project 1aIllustrated .docx
wilcockiris
 
Sql for biggner
Sql for biggnerSql for biggner
Sql for biggner
Arvind Kumar
 
122 sql for-beginners
122 sql for-beginners122 sql for-beginners
122 sql for-beginners
suzzanj1990
 
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
 

Similar to 2020.11.10 SISTEM BASIS DATA PERTEMUAN 12 - Normalization_new.pptx (20)

functional Design DFD and data flow diagram.ppt
functional Design DFD and data flow diagram.pptfunctional Design DFD and data flow diagram.ppt
functional Design DFD and data flow diagram.ppt
 
Cis336 i lab 1 of 7
Cis336 i lab 1 of 7Cis336 i lab 1 of 7
Cis336 i lab 1 of 7
 
Intro to tsql unit 4
Intro to tsql   unit 4Intro to tsql   unit 4
Intro to tsql unit 4
 
Intro To TSQL - Unit 4
Intro To TSQL - Unit 4Intro To TSQL - Unit 4
Intro To TSQL - Unit 4
 
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
 
45 Essential SQL Interview Questions
45 Essential SQL Interview Questions45 Essential SQL Interview Questions
45 Essential SQL Interview Questions
 
Database management system
Database management systemDatabase management system
Database management system
 
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
 
Prague data management meetup 2016-11-22
Prague data management meetup 2016-11-22Prague data management meetup 2016-11-22
Prague data management meetup 2016-11-22
 
Normalization by Ashwin and Tanmay
Normalization by Ashwin and TanmayNormalization by Ashwin and Tanmay
Normalization by Ashwin and Tanmay
 
Sql Server 2000
Sql Server 2000Sql Server 2000
Sql Server 2000
 
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
 
Part 2Provider Database (MS Access)For a review of the complete r.docx
Part 2Provider Database (MS Access)For a review of the complete r.docxPart 2Provider Database (MS Access)For a review of the complete r.docx
Part 2Provider Database (MS Access)For a review of the complete r.docx
 
Visual Approach to Essbase Calcs: 2018
Visual Approach to Essbase Calcs: 2018Visual Approach to Essbase Calcs: 2018
Visual Approach to Essbase Calcs: 2018
 
07.05 division
07.05 division07.05 division
07.05 division
 
Getting power bi
Getting power biGetting power bi
Getting power bi
 
Illustrated Access 2013 Unit A SAM Project 1aIllustrated .docx
Illustrated Access 2013  Unit A SAM Project 1aIllustrated .docxIllustrated Access 2013  Unit A SAM Project 1aIllustrated .docx
Illustrated Access 2013 Unit A SAM Project 1aIllustrated .docx
 
Sql for biggner
Sql for biggnerSql for biggner
Sql for biggner
 
122 sql for-beginners
122 sql for-beginners122 sql for-beginners
122 sql for-beginners
 
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
 

Recently uploaded

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
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
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 

Recently uploaded (20)

Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
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
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 

2020.11.10 SISTEM BASIS DATA PERTEMUAN 12 - Normalization_new.pptx

  • 2. + 7-2 Chapter Objectives  Describe the data normalization process  Perform the data normalization process.  Test tables for irregularities using the data normalization process.
  • 3. + 7-3 Logical Database Design  The process of deciding how to arrange the attributes of the entities in the business environment into database structures, such as the tables of a relational database.  The goal is to create well structured tables that properly reflect the company’s business environment.
  • 4. + 7-4 Logical Design of Relational Database Systems  (1) The conversion of E-R diagrams into relational tables.  (2) The data normalization technique.  (3) The use of the data normalization technique to test the tables resulting from the E-R diagram conversions.
  • 5. + 7-5 The Data Normalization Process  A methodology for organizing attributes into tables so that redundancy among the nonkey attributes is eliminated.  The output of the data normalization process is a properly structured relational database.
  • 6. + 7-6 The Data Normalization Technique Input:  all the attributes that must be incorporated into the database  a list of all the defining associations between the attributes (i.e., the functional dependencies).  a means of expressing that the value of one particular attribute is associated with a single, specific value of another attribute.  If we know that one of these attributes has a particular value, then the other attribute must have some other value.
  • 7. 7-7 General Hardware Company Database Salesperson Number Salesperson Name Commission Percentage Year of Hire Office Number SALESPERSON Customer Number Customer Name Salesperson Number HQ City CUSTOMER Customer Number Employee Number Employee Name Title CUSTOMER EMPLOYEE Product Number Product Name Unit Price PRODUCT Salesperson Number Product Number Quantity SALES Office Number Telephone Size OFFICE
  • 8. + 7-8 Functional Dependence  Salesperson Number is the determinant.  The value of Salesperson Number determines the value of Salesperson Name.  Salesperson Name is functionally dependent on Salesperson Number. Salesperson Name Salesperson Number
  • 9. + General Hardware Environment: SALESPERSON and PRODUCT Salesperson Number Salesperson Name Commission Percentage Year of Hire Department Number Manager Name Product Number Product Name Unit Price Quantity What are the functional dependencies? 7-9
  • 10. + 7-10 General Hardware Environment: SALESPERSON and PRODUCT Salesperson Number Salesperson Name Commission Percentage Year of Hire Department Number Manager Name Product Number Product Name Unit Price Quantity Salesperson Number Salesperson Name Salesperson Number Commission Percentage Salesperson Number Year of Hire Salesperson Number Department Nu mber Salesperson Number Manager Name Product Number Product Name Product Number Unit Price Department Number Manager Name Salesperson Number, Product Number Quantity
  • 11. +Full Functional dependency:  If A and B are attributes(columns)of a table, B is fully functionally dependent on A if B is functionally dependent on A, but not on any proper subset of A. SalesPerson#--SalesPersonName Partial Functional Dependency:  If A and B are attributes of a table, B is partially dependent on A if there is some attribute that can be removed from A and yet the dependency still holds. SP#, SPName -------> Comm% Comm% is functionally dependent on a subset of A (SP#, SPName), namely SP#. Transitive Functional Dependency:  A , B and C are attributes of a table. If A is functionally dependent on B, and B is functionally dependent on C, then C is Transitively dependent on A via B. SP#---->SPName, Comm%, YearOfHire, Office# Office#---Telephone# SP# attribute functionally determines Telephone# via Office# attribute. 8/11/2022
  • 12. + 7-12 Steps in the Data Normalization Process
  • 13. + 7-13 The Data Normalization Process  Once the attributes are arranged in third normal form, the group of tables that they comprise is a well-structured relational database with no data redundancy.  Subsequently R.Boyce and E.F.Codd introduced a stronger definition of 3NF called Boyce-Codd Normal Form(BCNF).  With the exception of 1NF, all these normal forms are based on Functional dependencies among the attributes of a table. Higher normal forms that go beyond BCNF were introduced later such as Fourth Normal Form (4NF) and Fifth Normal Form (5NF). However these later normal forms deal with situations that are very rare.  A group of tables is said to be in a particular normal form if every table in the group is in that normal form.  The data normalization process is progressive.  For example, if a group of tables is in second normal form, it is also in first normal form.
  • 14. + 7-14 General Hardware Company: Unnormalized Data Sales-person Number Product Number Sales-person Name Commission Percentage Year of Hire Depart-ment Number Manager Name Product Name Unit Price Quantity 137 19440 24013 26722 Baker 10 1995 73 Scott Hammer Saw Pliers 17.50 26.25 11.50 473 170 688 186 16386 19440 21765 24013 Adams 15 2001 59 Lopez Wrench Hammer Drill Saw 12.95 17.50 32.99 26.25 1745 2529 1962 3071 204 21765 26722 Dickens 10 1998 73 Scott Drill Pliers 32.99 11.50 809 734 361 16386 21765 26722 Carlyle 20 2001 73 Scott Wrench Drill Pliers 12.95 32.99 11.50 3729 3110 2738 SALESPERSON/PRODUCT Table  Records contain multivalued attributes.
  • 15. 7-15 General Hardware Company: First Normal Form  The only thing that is required for a table to be in 1NF is to contain only atomic values (intersection of each row and column should contain one and only one value). This is sometimes referred to as: Eliminate Repeating groups.  The attributes under consideration have been listed in one table, and a primary key has been established.  The number of records has been increased so that every attribute of every record has just one value.  The multivalued attributes have been eliminated. Sales-person Number Product Number Sales-person Name Commission Percentage Year of Hire Depart-ment Number Manager Name Product Name Unit Price Quantity SALESPERSON/PRODUCT Table
  • 16. + 7-16 General Hardware Company: First Normal Form Sales-person Number Product Number Sales-person Name Commission Percentage Year of Hire Depart-ment Number Manager Name Product Name Unit Price Quantity 137 19440 Baker 10 1995 73 Scott Hammer 17.50 473 137 24013 Baker 10 1995 73 Scott Saw 26.25 170 137 26722 Baker 10 1995 73 Scott Pliers 11.50 688 186 16386 Adams 15 2001 59 Lopez Wrench 12.95 1745 186 19440 Adams 15 2001 59 Lopez Hammer 17.50 2529 186 21765 Adams 15 2001 59 Lopez Drill 32.99 1962 186 24013 Adams 15 2001 59 Lopez Saw 26.25 3071 204 21765 Dickens 10 1998 73 Scott Drill 32.99 809 204 26722 Dickens 10 1998 73 Scott Pliers 11.50 734 361 16386 Carlyle 20 2001 73 Scott Wrench 12.95 3729 361 21765 Carlyle 20 2001 73 Scott Drill 32.99 3110 361 26722 Carlyle 20 2001 73 Scott Pliers 11.50 2738 SALESPERSON/PRODUCT Table
  • 17. + 7-17 General Hardware Company: First Normal Form First normal form is merely a starting point in the normalization process. First normal form contains a great deal of data redundancy.  Three records involve salesperson 137, so there are three places in which his name is listed as Baker, his commission percentage is listed as 10, and so on.  Two records involve product 19440 and this product’s name is listed twice as Hammer and its unit price is listed twice as 17.50.
  • 18. + 7-18 Second Normal Form  A Table is said to be in 2NF if it is in 1NF and there are no partial dependencies  No Partial Functional Dependencies  Every non primary key attribute of the table must be fully functionally dependent on the entire primary key of that table.  A non-key attribute cannot depend on only part of the key.
  • 19. 7-19 General Hardware Company: Second Normal Form Salesperson Number Product Number Quantity QUANTITY Table Salesperson Number Salesperson Name Commission Percentage Year of Hire Department Number Manager Name SALESPERSON Table  In SALESPERSON, Salesperson Number is the sole primary key attribute. Every nonkey attribute of the table is fully defined just by Salesperson Number.  Similar logic for PRODUCT and QUANTITY tables. Product Number Product Name Unit Price PRODUCT Table
  • 20. 7-20 General Hardware Company: Second Normal Form Product Number Product Name Unit Price 16386 Wrench 12.95 19440 Hammer 17.50 21765 Drill 32.99 24013 Saw 26.25 26722 Pliers 11.50 PRODUCT Table Salesperson Number Product Number Quantity 137 19440 473 137 24013 170 137 26722 688 186 16386 1745 186 19440 2529 186 21765 1962 186 24013 3071 204 21765 809 204 26722 734 361 16386 3729 361 21765 3110 361 26722 2738 QUANTITY Table Salesperson Number Salesperson Name Commission Percentage Year of Hire Department Number Manager Name 137 Baker 10 1995 73 Scott 186 Adams 15 2001 59 Lopez 204 Dickens 10 1998 73 Scott 361 Carlyle 20 2001 73 Scott SALESPERSON Table
  • 21. + 7-21 Third Normal Form  A Table that is in 1NF and 2NF and in which no non primary key attribute is transitively dependent on the primary key.  Does not allow transitive dependencies in which one nonkey attribute is functionally dependent on another.  Nonkey attributes are not allowed to define other nonkey attributes.  "Each attribute must be a fact about the key, the whole key, and nothing but the key."
  • 22. 7-22 General Hardware Company: Third Normal Form Salesperson Number Salesperson Name Commission Percentage Year of Hire Department Number SALESPERSON Table Department Number Manager Name DEPARTMENT Table Product Number Product Name Unit Price PRODUCT Table Salesperson Number Product Number Quantity QUANTITY Table
  • 23. 7-23 General Hardware Company: Third Normal Form Salesperson Number Salesperson Name Commission Percentage Year of Hire Department Number 137 Baker 10 1995 73 186 Adams 15 2001 59 204 Dickens 10 1998 73 361 Carlyle 20 2001 73 SALESPERSON Table Department Number Manager Name 59 Lopez 73 Scott DEPARTMENT Table Product Number Product Name Unit Price 16386 Wrench 12.95 19440 Hammer 17.50 21765 Drill 32.99 24013 Saw 26.25 26722 Pliers 11.50 PRODUCT Table Salesperson Number Product Number Quantity 137 19440 473 137 24013 170 137 26722 688 186 16386 1745 186 19440 2529 186 21765 1962 186 24013 3071 204 21765 809 204 26722 734 361 16386 3729 361 21765 3110 361 26722 2738 QUANTITY Table
  • 24. + 7-24 General Hardware Company: Third Normal Form Important points about the third normal form structure are:  It is completely free of data redundancy.  All foreign keys appear where needed to logically tie together related tables.  It is the same structure that would have been derived from a properly drawn entity-relationship diagram of the same business environment.
  • 25. + Recap + clarification  0NF:  Unstructured data, can have multi-valued attributes  1NF:  Atomic values (one per column of the record)  No duplicate rows (implies there is a key)  As we move forward need to consider functional dependencies and determine candidate keys  Note: earlier slides simplified this slightly by saying choose a primary key, but normalization is actually about candidate keys  For the higher forms of normalization, we need to consider the case where there is not a single option for the primary key 8/11/2022
  • 26. + Definitions  Superkey: a combination of attributes that can be used to uniquely identify a row in a database. The trivial superkey is all attributes.  Candidate key: a minimal superkey – all attributes are necessary to uniquely identify the record  Primary key: one candidate key, arbitrarily chosen  Prime attribute: an attribute that occurs in some candidate key  Non prime attribute: an attribute that does not occur in any candidate key 8/11/2022
  • 27. + 2NF (revisited)  A Table is said to be in 2NF if it is in 1NF and there are no partial dependencies  No Partial Functional Dependencies  Every non primary key attribute of the table must be fully functionally dependent on the entire primary key of that table.  A non-key attribute cannot depend on only part of the key.  No Partial Functional Dependences  Every non prime key attribute of the table must be fully functionally dependent on the entire key of one of the candidate keys in the table.  An non-prime attribute cannot depend on only part of one of the candidate keys. 8/11/2022
  • 28. + 3NF revisited  A Table that is in 1NF and 2NF and in which no non primary key attribute is transitively dependent on the primary key.  Old:  Does not allow transitive dependencies in which one non-key attribute is functionally dependent on another.  Nonkey attributes are not allowed to define other nonkey attributes.  New:  Every non-prime attribute is non-transitively dependent on every candidate key in the table.  The attributes that do not directly contribute to the description of the candidate keys are removed from the table. In other words, no transitive dependency is allowed. 8/11/2022
  • 29. + "Each non-key attribute must provide a fact about the key, the whole key, and nothing but the key.”  The key: 1NF – we have a table of related items, with each row unique, with atomic values  The whole key: 2NF – no partial dependences on the candidate keys  Nothing but the key: 3NF – no transitive dependencies 8/11/2022
  • 30. + 7-30 Boyce-codd Normal Form (BCNF)  A Table is in BCNF if and only if every determinant (i.e., the attribute or a group of attributes on which some other attribute is fully functionally dependent) is a candidate key. BCNF is a stronger form of 3NF.  The difference between 3NF and BCNF is that for a Functional dependency A--->B, 3NF allows this dependency in a table if attribute B is a primary key attribute and attribute A is not a candidate key, where as BCNF insists that for this dependency to remain in a table, attribute A must be a candidate key.  Only in rare cases does a 3NF table not meet the requirements of BCNF. A 3NF table which does not have multiple overlapping candidate keys is guaranteed to be in BCNF. Depending on what its functional dependencies are, a 3NF table with two or more overlapping candidate keys may or may not be in BCNF
  • 31. + Example of 3NF table not in BCNF  Today's Court Bookings  Each row in the table represents a court booking at a tennis club that has one hard court (Court 1) and one grass court (Court 2). A booking is defined by its Court and the period for which the Court is reserved Additionally, each booking has a Rate Type associated with it. There are four distinct rate types:  SAVER, for Court 1 bookings made by members  STANDARD, for Court 1 bookings made by non-members  PREMIUM-A, for Court 2 bookings made by members  PREMIUM-B, for Court 2 bookings made by non-members  http://en.wikipedia.org/wiki/Boyce%E2%80%93Codd_normal_form 8/11/2022 Court StartTime EndTime RateType 1 09:30 10:30 SAVER 1 11:00 12:00 SAVER 1 14:00 15:30 STANDARD 2 10:00 11:30 PREMIUM-B 2 11:30 13:30 PREMIUM-B 2 15:00 16:30 PREMIUM-A
  • 32. + What is the problem?  Identify the functional dependencies  Identify the table’s super keys  Determine the candidate keys  Why isn’t the table in BCNF?  A Table is in BCNF if and only if every determinant is a candidate key.  For all functional dependencies A -> B, is A a candidate key? 8/11/2022
  • 33. + Fourth Normal Form (4NF)  4NF is a stronger normal form than 3NF/BCNF as it prevents Tables from containing nontrivial Multi-Valued Dependencies (MVDs) and hence data redundancy.  The Normalization of BCNF Tables to 4NF involves the removal of MVDs from the Table by placing the attribute(s) in a new Table along with the copy of the determinant(s).  http://en.wikipedia.org/wiki/Fourth_normal_form 8/11/2022
  • 34. + Pizza Delivery Example – not in 4NF Restaurant Pizza Variety Delivery Area A1 Pizza Thick Crust Springfield A1 Pizza Thick Crust Shelbyville A1 Pizza Thick Crust Capital City A1 Pizza Stuffed Crust Springfield A1 Pizza Stuffed Crust Shelbyville A1 Pizza Stuffed Crust Capital City Elite Pizza Thin Crust Capital City Elite Pizza Stuffed Crust Capital City Vincenzo's Pizza Thick Crust Springfield Vincenzo's Pizza Thick Crust Shelbyville Vincenzo's Pizza Thin Crust Springfield Vincenzo's Pizza Thin Crust Shelbyville 8/11/2022
  • 35. + Fifth Normal Form (5NF)  Also known as project-join normal form (PJ/NF)  Designed to reduce redundancy in relational databases recording multi-valued facts by isolating semantically related multiple relationships.  A table is said to be in the 5NF if and only if every join dependency in it is implied by the candidate keys.  http://en.wikipedia.org/wiki/Fifth_normal_form 8/11/2022
  • 36. + Traveling Salesman Product Availability By Brand Traveling Salesman Brand Product Type Jack Schneider Acme Vacuum Cleaner Jack Schneider Acme Breadbox Willy Loman Robusto Pruning Shears Willy Loman Robusto Vacuum Cleaner Willy Loman Robusto Breadbox Willy Loman Robusto Umbrella Stand Louis Ferguson Robusto Vacuum Cleaner Louis Ferguson Robusto Telescope Louis Ferguson Acme Vacuum Cleaner Louis Ferguson Acme Lava Lamp Louis Ferguson Nimbus Tie Rack 8/11/2022 Not in 5NF if the Salesman must offer only products of Type P made by Brand B if that product type and brand is in his repetoire
  • 37. + 7-37 Steps in the Data Normalization Process
  • 38. + Other good resources:  http://www.informationqualitysolutions.com/FreeStuff/rettigNor malizationPoster.pdf  Today’s handout includes the explanations of each normalization step for the example highlighted in the poster 8/11/2022
  • 39. 7-39 General Hardware Company: Functional Dependencies Salesperson Number Salesperson Name Salesperson Number Commission Percentage Salesperson Number Year of Hire Salesperson Number Department Nu mber Salesperson Number Manager Name Customer Number Customer Name Customer Number Salesperson Number Customer Number HQ City Customer Number, Employee Number Employee Name Customer Number, Employee Number Title Product Number Product Name Product Number Unit Price Department Number Manager Name Salesperson Number, Product Number Quantity Office Number Telephone Office Number Salesperson Number Office Number Size
  • 40. 7-40 General Hardware Company: First Normal Form Salesperson Number Customer Number Employee Number Product Number Office Number Salesperson Name Commission Percentage Year of Hire Department Number Manager Name Customer Name HQ City Employee Name Title Product Name Unit Price Quantity Telephone Size
  • 41. + 7-41 World Music Association: Functional Dependencies Orchestra Name City Orchestra Name Country Orchestra Name Music Director Musician Number Musician Name Musician Number Instrument Musician Number Annual Salary Musician Number Orchestra Name Musician Number, Degree Univeristy Musician Number, Degree Year Composer Name Country Composer Name Date of Birth Composition Name, Composer Name Year Orchestra Name, Composition Name, Composer Name Year Orchestra Name, Composition Name, Composer Name Price
  • 42. + 7-42 Lucky Rent-A-Car: Functional Dependencies Manufacturer Name Manufacturer Country Manufacturer Name Sales Rep Na me Manufacturer Name Sales Rep Te lephone Car Serial Number Model Car Serial Number Year Car Serial Number Class Car Serial Number Manufacturer Na me Repair Number Car Serial Number Repair Number Date Repair Number Procedure Repair Number Mileage Repair Number Repair Time Customer Number Customer Name Customer Number Customer Address Customer Number Customer Telephone Car Serial Number, Customer Number, Rental Date Return Date Car Serial Number, Customer Number, Rental Date Total Cost