Junior — Middle
Can you explain what the second normal form means in the context of database normalization?
sobes.tech AI
Answer from AI
The Second Normal Form (2NF) is a stage of database normalization that requires the table to be in the First Normal Form (1NF) and that all non-key attributes are fully dependent on the entire composite key, not just part of it.
In simpler terms, if a table has a composite primary key, then no column that is not part of the key should depend only on a part of that key.
For example, if a table contains order data with a key (OrderID, ProductID), then attributes that depend only on OrderID (such as order date) should be moved to a separate table to avoid redundancy and update anomalies.