Normalization
Helps improve the database’s efficiency, consistency, and accuracy.
Makes it easier to manage and maintain the data and ensures that the database is adaptable to
changing business needs.
Database normalization is the process of organizing the attributes of the database to reduce
or eliminate data redundancy (having the same data but at different places).
To eliminate below anomalies
Insertion Anomalies
Deletion anomalies
Updation anomalies
In normalization, we mainly put attributes closely dependent on each other together.
Dependencies
Functional dependency: Helps define relationship between data in a table.
To make sure we don't lose information while splitting tables
Dependency Preserving decomposition
Lossless decomposition in DBMS
Features of Database Normalization
Elimination of Data Redundancy
Ensuring Data Consistency
Simplification of Data Management
Improved Database Design
Avoiding Update Anomalies
Standardization
Normal Forms in DBMS
1NF
If every attribute in that relation is Single-valued Attribute
2NF
1NF and every non-primary key attribute is fully functionally dependent on Primary key. Shouldn't
have partial dependency.
3NF
2NF, If no transitive dependency for non-prime attributes. X is Super key/ Y is a Prime attribute.
BCNF
Should be in 3NF, X should be super key for every FD in a given relation. X>Y
4NF
Should be in BCNF, Table shouldn't have any multi-valued dependency.
5NF
R should already be in 4NF, I can't have further non loss decomposed.
Advantages of Normalization
Eliminates Data Redundancy (Consistency, Accuracy)
Ensures that each table stores only relevant data. (Integrity)
Simplifies process of Updating data
Enables users to query the database using a variety of different criteria. (Data organized into
smaller, specific tables that can be joined together as needed.)
Ensure data is consistent across dif. apps that uses same DB.
Easier DB maintenance.
Disadvantages of Normalization
Increased performance overhead and potential for slower query execution times.
Loss of data context.
Requires expert knowledge of database design and normalization process.
Increase complexity of Database design.
Partial Dependency: If one attribute in a composite primary key determines a non-primary attribute.
Types of Functional Dependencies
Transitive functional Dependency: If a non-primary attribute determines another non-primary
attribute.
Trivial Functional Dependency:
A trivial functional dependency occurs when an attribute or a set of attributes functionally
determines itself or a subset of itself. This means the dependent attribute(s) are already included in
the determinant, making the dependency always true.
General Form:
If X is a set of attributes and Y is a subset of X, then:
X → Y is a trivial functional dependency
Examples:
1. {A, B} → A (Since A is already part of {A, B}, this is trivial.)
2. {Student_ID, Name} → Student_ID (Trivial because Student_ID is part of the determinant
set.)
3. {X, Y, Z} → {X, Z} (Trivial because {X, Z} is a subset of {X, Y, Z}.)
Key Points:
Trivial dependencies do not provide new information about the relationships between
attributes.
They are always true and do not impact database normalization.
In contrast, non-trivial functional dependencies occur when the dependent attribute is not
part of the determinant set (e.g., {A} → {B}, where B is not in A).
Multi-valued functional dependency