The document discusses the second normal form (2NF) in database normalization. 2NF requires that the table is in 1NF and that each non-key attribute is fully dependent on the entire primary key, not a subset, if the primary key is composite. An example table with a composite primary key of student ID and subject ID is given, which could cause anomalies like needing to add a subject when adding a new teacher or changing multiple rows when changing a teacher's name.
The document discusses the second normal form (2NF) in database normalization. 2NF requires that the table is in 1NF and that each non-key attribute is fully dependent on the entire primary key, not a subset, if the primary key is composite. An example table with a composite primary key of student ID and subject ID is given, which could cause anomalies like needing to add a subject when adding a new teacher or changing multiple rows when changing a teacher's name.
The document discusses the second normal form (2NF) in database normalization. 2NF requires that the table is in 1NF and that each non-key attribute is fully dependent on the entire primary key, not a subset, if the primary key is composite. An example table with a composite primary key of student ID and subject ID is given, which could cause anomalies like needing to add a subject when adding a new teacher or changing multiple rows when changing a teacher's name.
2NF: For the second normal form, • The table must first be in 1NF. •The table is automatically in 2NF if, and only if, the PK comprises a single attribute. •If the relation has a composite PK, then each non-key attribute must be fully dependent on the entire PK and not on a subset of the PK (i.e., there must be no partial dependency). 2NF - Example 2NF - Example What will be the primary key for this table?
Student_ID + Subject_ID Can you guess the anomalies with this design?
. When adding a new
teacher we need a subject against which student was graded
. When changing teacher name we will be changing multiple rows