Lecture03 Normalization
Lecture03 Normalization
Principles of Database
Management Systems
Fall 2016
Lecture 3 –Schema Normalization
• We have 27 teams
• Functional dependencies
Conceptual SQL
Refinement Files
Modeling Tables
Conceptual Schema
name
Relational Model:
plus FD’s
(FD = functional dependency)
Normalization:
Eliminates anomalies
CSE 544 - Fall 2016 6
Entity-Relationship Diagram
name
since
dno
pno
• And more...
CSE 544 - Fall 2016 8
Subclasses to Product
Relations Name Price Category
• Functional dependencies
• Problems
– Redundant storage
– Update anomalies
– Insertion anomalies
– Deletion anomalies
• Functional dependencies
• Can we recover the FD’s on the ‘big’ table from the FD’s
on the small tables?
– Dependency-preserving decomposition
– So that we can enforce all FDs without performing joins
• Functional dependencies
R1(A1, ..., An, B1, ..., Bm) R2(A1, ..., An, C1, ..., Cp)
Repeat
choose A1, …, Am ® B1, …, Bn that violates BCNF condition
split R into
R1(A1, …, Am, B1, …, Bn) and R2(A1, …, Am, [rest])
continue with both R1 and R2
Until no more violations
Unit Product
No FDs
• Tradeoffs
– BCNF = no anomalies, but may lose some FDs
– 3NF = keeps all FDs, but may have some anomalies
• Normalization tradeoffs
– BCNF: no anomalies, but may lose some FDs
– 3NF: keeps all FDs, but may have anomalies
– Too many small tables affect performance