Can you explain the different forms of database normalization?
sobes.tech AI
Answer from AI
Database normalization is the process of organizing data to reduce redundancy and improve integrity. The main normal forms are:
-
First Normal Form (1NF) — all fields contain atomic values, with no repeating groups or arrays.
-
Second Normal Form (2NF) — the table is in 1NF, and all non-key fields depend fully on the entire composite key (if the key is composite).
-
Third Normal Form (3NF) — the table is in 2NF, and there are no transitive dependencies between non-key fields (i.e., non-key fields do not depend on each other).
-
Boyce-Codd Normal Form (BCNF) — a strengthening of 3NF, where for every functional dependency, the determining attribute is a key.
Example: if there is a table with order data, which also stores customer information, normalization involves splitting into an orders table and a customers table to avoid duplicating customer data in each order.