Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1PRIMARY KEY (orderId, productId) | AorderItems(orderId, productId, quantity) | |
| 2productId → productName | BThe key is a single field, so there is no partial dependency. Depending on the whole key is fine, and 2NF is not broken. | |
| 3To remove a partial dependency, split the dependent field into a new table keyed by the part of the key it depends on. | Cproducts(productId, productName) | |
| 4After splitting to reach 2NF, the original table keeps the full composite key and only the fields that depend on all of it. | DA partial dependency when the key is (orderId, productId): productName depends on only part of the key. | |
| 5orderItems(orderId, productId, productName, quantity) is in 2NF | EproductName depends only on productId, which is part of the composite key, so this is a partial dependency and the table is not in 2NF. | |
| 6students(studentId, firstName, house) is not in 2NF because firstName depends on studentId | FA composite key. 2NF checks every non-key field against both parts of this key, not just one part. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
2NF — A table in 1NF where no non-key field depends on only part of a composite key. Remove any partial dependency by splitting those fields into a new table.Key: StudentID, SubjectID
SubjectID -> SubjectName
This is a partial dependencyCREATE TABLE Subject (
SubjectID INT PRIMARY KEY,
SubjectName VARCHAR(30));CREATE TABLE Enrolment (
StudentID INT, SubjectID INT, Mark INT,
PRIMARY KEY (StudentID, SubjectID));2NF needs the table to be in 1NF first
and have no partial dependencies Mark INT,
FOREIGN KEY (SubjectID)
REFERENCES Subject(SubjectID));