Sobes.tech
Junior — Middle

Explain what the second normal form means in the context of database normalization.

sobes.tech AI

Answer from AI

Second Normal Form (2NF) is a stage of database normalization that requires the table to be in 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 the primary key consists of multiple columns, then no column that is not part of the key should depend only on a part of that key.

This helps to avoid data redundancy and update anomalies.

Example:

A table with a composite key (StudentID, CourseID) and an attribute InstructorName, which depends only on CourseID, violates 2NF. To fix this, InstructorName should be moved to a separate table linked to CourseID.