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 | |
|---|---|---|
| 1INSERT INTO Enrolment (CourseName, StudentID) VALUES ('Robotics', NULL); | AA dummy student ID of 0 is used just to store the course. This creates a fake record and is an insertion anomaly symptom, not a fix. | |
| 2Enrolment(StudentID, StudentName, CourseName, Teacher) | BAdds a new course to a single table by forcing a NULL into the student column because no student has enrolled yet | |
| 3A new course with no students yet cannot be recorded without adding unrelated student data | COne table mixing student and course facts, so a new course cannot be stored until a student exists | |
| 4Splitting the data into separate tables removes the insertion anomaly | DINSERT INTO Course (CourseName, Teacher) VALUES ('Cyber Security', 'Ms Lee'); | |
| 5INSERT INTO Enrolment (StudentID, CourseName) VALUES (0, 'Robotics'); | EThis is wrong because in a single combined table a course row needs student data, so it cannot be stored alone without NULLs or dummy values. | |
| 6A new course can be added to the Enrolment table at any time without students, so no insertion anomaly exists. | FINSERT INTO Enrolment VALUES (NULL, NULL, 'Cyber Security', 'Ms Lee'); |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
insertion anomaly — A problem where a new fact, like a new course, cannot be stored until unrelated data, like a student, exists, forcing null values or dummy rows in a single table.INSERT INTO enrol
VALUES (NULL, NULL, 'DS11', 'Robotics');CREATE TABLE enrol (
studentId INT NOT NULL,
courseCode TEXT);SELECT * FROM enrol
WHERE studentId IS NULL;INSERT INTO enrol (courseCode, courseName)
VALUES ('DS12', 'Databases');INSERT INTO course (courseCode, courseName)
VALUES ('DS12', 'Databases');