Title: Normalization
1Normalization
2Purpose of Normalization
- Remove data redundancies
- Eliminate inconsistent data dependencies
- Remove any anomalies
- Break raw data into more logical units, or tables
3Considerations
- Needs of the end user
- What data is needed?
- How will users access it?
- How should data be grouped?
- What data is most commonly accessed?
- How is data related?
- What measures are needed to ensure accuracy?
4Benefits to Normalization
- Greater organization
- Reduction of redundant data
- Data consistency
- More flexible design
- Better security
5Drawbacks to Normalization
- Reduced database performance
- CPU usage
- Memory usage
- Input/Output
6Denormalizing a Database
- Modify a normalized database
- Modify tables to allow controlled redundancies
- Recombine tables to eliminate certain joins
7Further Considerations
- Decisions should be made during design
- Some normalization is necessary
- Performance vs quality and integrity
- Trade-off decisions get you the big bucks
8Levels of Normalization
- First Normal Form (1NF)
- Second Normal Form (2NF)
- Third Normal Form (3NF)
- Others
91NF
- Divide data into logical entities or tables
- Eliminate repeating groups
- Identify Primary Keys to make every row (record)
in a table unique
102NF
- Ensure 1NF
- Remove data that is only partly related to the
Primary Key to a new table - Create new tables from those in the 1NF
113NF
- Ensure 1NF
- Ensure 2NF
- Remove data that is not dependent on the Primary
Key to a new table
12Making it work!Referential Integrity
- Assurance of consistent and accurate data
- Values of one column in a table depend upon the
values of a column in another table - Controlled through the use of Primary and Foreign
Keys
13Example1NF
Employees EmpID EmpName Address City State Zip Pho
ne Position Department Salary HireDate
Customers CustID CustName Address City State Zip P
hone Fax Contact
14Example2NF
Employees EmpID EmpName Address City State Zip Pho
ne Position Department Salary HireDate
Customers CustID CustName Address City State Zip P
hone Fax Contact
Emplyees EmpID Address City State Zip Phone
EmployeePay EmpID Position Department Salary HireD
ate
15Example3NF
Employees EmpID EmpName Address City State Zip Pho
ne Position Department Salary HireDate
Customers CustID CustName Address City State Zip P
hone Fax Contact
Emplyees EmpID Address City State Zip Phone
ZipCodes ZipCode City State
EmployeePay EmpID PositionID DeptID Salary HireDat
e
Positions PositionID Position
Departments DeptID Department