Understanding Normalization with SQL β 1NF, 2NF, 3NF
When working with databases, we often face redundancy, inconsistency, and anomalies. Normalization helps solve these issues by organizing data into well-structured tables.
π Base Table (Unnormalized Data)
π Anomalies Identified
Insertion: Cannot add a new course unless a student registers.
Update: Changing instructor name requires multiple updates.
Deletion: Deleting a student may remove course data too.
β
First Normal Form (1NF)
We ensure atomic values and primary keys.
β
Second Normal Form (2NF)
We remove partial dependencies by separating Students and Courses.
β
Third Normal Form (3NF)
We remove transitive dependencies by separating Instructors.
π₯ Sample Data Insertions
π Query with JOINs
π― Conclusion
By applying 1NF β 2NF β 3NF, we eliminated redundancy, prevented anomalies, and achieved a clean database design. This structured design makes querying and maintenance much easier.















Top comments (0)