DBMS Normalization
DBMS Normalization
01/20/2025
01 What is Normalization
02 Why do we need Normalization?
03 Knowing Terminologies
04 Normal Forms
05 Tasks
2
01
What is Normalization?
Normalization
• Process of organizing data in a database.
• Includes creating tables and establishing relationship between those tables in a way that it reduces redundancy and inconsistent
dependency.
4
02
Why do we need Normalization?
Why do we need Normalization?
Normalization is essential for improving the structure and efficiency of a database. The main benefits include:
2. Preventing Anomalies:
The three common types of anomalies are:
a. Insert Anomaly: This occurs when certain data cannot be inserted into the database without the presence of other data.
Example: If we need to add a new department but cannot do so until an employee is hired into it, this limitation is an insertion anomaly,
as it prevents new records from being added independently.
b. Update Anomaly: This happens when data is updated in one location but not in others, leading to inconsistencies.
Example: If an employee named ‘Lee’ moves from the IT department to HR, and their department information is stored in multiple
tables (e.g., employee records and leave data), failing to update all occurrences results in conflicting information.
c. Delete Anomaly: This arises when some records are lost or deleted from the database table due to the deletion of other records.
Example: if we want to remove ‘Perry’ and ‘Steve’ as they are no longer in the organization, it also removes other attributes from the
table like address, department and other details, and their records are deleted, information about their associated departments or
addresses may also be lost, even if that data is still relevant.
6
03
Knowing Terminologies
Knowing Terminologies regarding Normalization
1. Super Key
A super key is any combination of attributes (columns) that can
uniquely identify a row in a table. It may include unnecessary
attributes in addition to the ones required for unique
identification.
2. Candidate Key
A candidate key is a minimal super key. It is the smallest set of
attributes that can uniquely identify a row in a table. A table
may have multiple candidate keys.
3. Composite Key
A composite key is a candidate key that consists of two or
more attributes combined to uniquely identify a row in a table.
Composite keys are necessary when a single attribute is not
sufficient for unique identification.
8
04
Normal Forms
Unnormalized Relation
10
Normalization – 1st Normal Form
1. 1st Normal Form
11
Normalization – 2nd Normal Form
2. 2nd Normal Form
12
Normalization – 3rd Normal Form
3. 3rd Normal Form
13
Normalization – After 3rd Normal Form
After 3rd Normal Form
[Surgeon]
[Patient]
[SurgeryDetails]
[Drug]
14
Normalization – Other Normal Forms
4. Boyce-Codd Normal Form (BCNF)
• If a functional dependency exists where 𝑋 is not a superkey, the table violates BCNF.
• A superkey is a set of one or more attributes that can uniquely identify a record in the table.
15
05
Tasks
Practicing Tasks
1. Design an example to demonstrate the process of normalizing tables from an unnormalized form to 3NF, covering all possible scenarios
discussed during the sessions.
2. List out the possible Super keys, Candidate keys and Composite Keys from your dataset.
3. Create a table definition that incorporates composite keys.
4. Implement composite keys using a combination of primary and foreign keys across tables.
5. Evaluate the enforcement of referential integrity, identifying scenarios where it can be holded and where it may be violated.
17
Thank You