Database 4
Database 4
Normalization
Agenda
1 Title Slide
2 Introduction to Relational Database Modeling
3 Components of a Relational Model
4 Entity-Relationship (ER) Diagram
5 Database Normalization
6 The Normalization Process
7 Example: Normalizing a Construction Project Database
8 Importance of Normalization in the Construction Industry
9 Trade-offs of Normalization
10 Summary
11 Questions and Discussion
12 Conclusion
Relational Database Modeling and Normalization
10
Step 1: First Normal Form (1NF)
In 1NF, we eliminate repeating groups and ensure that each field contains atomic (indivisible) values.
•The table is already in 1NF because there are no repeating groups, and each field contains atomic values.
11
Step 2: Second Normal Form (2NF)
In 2NF, we remove partial dependencies. A partial dependency occurs when a non-primary key attribute
depends on only part of the composite primary key.
The primary key in this table would be the combination of Project ID and Task Name, but we have non-key
attributes that depend on only Project ID (e.g., Contractor Name and Contractor Phone). We need to separate
these into their own tables.
New Tables for 2NF:
1.Projects Table :
Project ID Project Name
101 Mall Expansion
102 Residential Complex
2. Contractors Table:
Contractor Name Contractor Phone
ABC Construction Co. 123-456-7890
BuildFast Solutions 987-654-3210
Elite Builders Inc. 555-987-6543
12
Step 2: Second Normal Form (2NF)
In 2NF, we remove partial dependencies. A partial dependency occurs when a non-primary key attribute
depends on only part of the composite primary key.
The primary key in this table would be the combination of Project ID and Task Name, but we have non-key
attributes that depend on only Project ID (e.g., Contractor Name and Contractor Phone). We need to separate
these into their own tables.
3. Materials Table:
13
Step 2: Second Normal Form (2NF)
In 2NF, we remove partial dependencies. A partial dependency occurs when a non-primary key attribute
depends on only part of the composite primary key.
The primary key in this table would be the combination of Project ID and Task Name, but we have non-key
attributes that depend on only Project ID (e.g., Contractor Name and Contractor Phone). We need to separate
these into their own tables.
4. Tasks Table:
14
Step 3: Third Normal Form (3NF)
In 3NF, we eliminate transitive dependencies. A transitive dependency exists when a non-key attribute depends
on another non-key attribute.
•The Contractor Phone depends on the Contractor Name, not the Project ID, so it is already separated into its
own table in 2NF.
•The Material Supplier and Material Cost depend on Material Used, not on the Project ID or Task Name.
Since the non-key attributes are properly placed in their own tables, the database is now in 3NF.
15
Final Tables:
Projects Table:
1 0 /8 /2 4 S A M P L E F O O T E R T E X T 16
Final Tables:
Contractors Table:
Contractor Name Contractor Phone
ABC Construction Co. 123-456-7890
BuildFast Solutions 987-654-3210
Elite Builders Inc. 555-987-6543
Materials Table:
1 0 /8 /2 4 S A M P L E F O O T E R T E X T 17
Final Tables:
Tasks Table:
Project ID Task Name Task Deadline
101 Foundation Work May 15, 2024
101 Structural Framing August 1, 2024
102 Groundwork June 1, 2024
102 Electrical Installation November 15, 2024
1 0 /8 /2 4 S A M P L E F O O T E R T E X T 18
Final Tables:
Project-Material Relationship Table:
Project ID Material Used
101 Concrete
101 Steel Beams
102 Cement Blocks
102 Roofing Sheets
Importance of Normalization in the Construction
Industry
• Consistency and Accuracy: In construction, maintaining accurate
project data is critical, as it influences decision-making across various
stakeholders; normalization aids in ensuring this consistency.