Junior — Middle
Can you tell about the different levels of database normalization?
sobes.tech AI
Answer from AI
Database normalization is the process of organizing data to minimize redundancy and ensure integrity. The main levels of normalization:
- First Normal Form (1NF) — all fields contain atomic values, no repeating groups.
- Second Normal Form (2NF) — the table is in 1NF, and all non-key attributes 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 attributes.
- Boyce-Codd Normal Form (BCNF) — an enhancement of 3NF, where for every functional dependency, the determinant is a key.
There are more advanced forms (4NF, 5NF) that consider multivalued dependencies and joins.
Example: if you have a table with orders that stores information about the customer and the product, normalization will allow you to split data into customer, product, and order tables to avoid duplication and facilitate updates.