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 | |
|---|---|---|
| 1Passport(passportId PK, personId FK UNIQUE) | AstudentId should be a foreign key, and the table is missing a subjectId foreign key to the Subject table | |
| 2Enrolment(studentId FK, subjectId FK) | BStudent >o---o< Subject | |
| 3A student can take many subjects and a subject has many students, so this is a many-to-many relationship | CA junction table that links students and subjects by holding two foreign keys | |
| 4A many-to-many relationship is split into two one-to-many links by adding a junction table between the entities | DA one-to-one relationship: each person has at most one passport and each passport belongs to one person | |
| 5Student(studentId PK, subjectId FK) | EA single subjectId foreign key in Student lets each student have only one subject, so it cannot show a many-to-many relationship | |
| 6Enrolment(enrolId PK, studentId PK) | FStudent ||--o< Enrolment >o--|| Subject |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
junction table — A table that splits a many-to-many relationship into two one-to-many links by holding two foreign keys, such as Enrolment with studentId and subjectId.CREATE TABLE Enrolment (
studentId INT,
subjectId INTFOREIGN KEY (subjectId)
REFERENCES Subject(subjectId)FROM Student JOIN Enrolment
ON Student.studentId = Enrolment.studentIdCREATE TABLE Passport (
personId INT UNIQUE,
passportNo INTINSERT INTO Enrolment
VALUES (1, 2),
(1, 3);