Normalization in Database
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity by breaking down large tables into smaller ,more manageable tables.
Types of normalization:
1. 1NF
Each column must contain atomic values, example:student information table with columns for name,address and phone_number.
2. 2NF
No partial dependencies,all non-key columns depend on the entire primary key.
example:student and course information table linked by student ID.
3. 3NF
No transitive dependencies,non-key colums do not depend on other non-key columns,example:course information and instructor information liked by course ID.
4.BCNF
it stands for Boyce-codd Normal form. it requires that every non-trivial functional dependency in the relation is a dependency on a superkey. in this process eliminates redundancy and anomalies in the data.
example:Consider table with columns for student ID,name,course,instructor name. In BCNF,the table would be split into two tables, one for student information and one for course information ,linked bt student ID.
5.Fourth Normal Form (4NF)
requires that there are no multi-valued dependencies. it eliminates redundancy and annomalies in multi-valed relationships.
example:Consider a table with columns for student ID,name,course and instructor name.In 4NF,the table would be split into three tables,one for student information,one for course information and one for instructor information,liked by studentID and course.
6.Fifth Normal Form
requires that there are no join dependencies. it eliminates redundancy and anomalies in join relationships.
example:Consider a table with columns for student ID,name,course and instructor name.In 5NF,the table would be split into multiple tables,each representing a single relationship between entities,such as student-course and course-instructor.