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 | |
|---|---|---|
| 1DELETE FROM Enrolment WHERE StudentID = 7; | AThis describes an insertion anomaly, not a deletion anomaly. A deletion anomaly happens when deleting a row loses a separate fact. | |
| 2deletion anomaly | BCourse(CourseID, CourseName, Teacher) Enrolment(StudentID, CourseID) | |
| 3Course details (CourseName, Teacher) are stored in the same table as student enrolments, so they are only kept while a student is enrolled. | CDeleting a row also wipes out a separate fact that was stored only in that row. | |
| 4Normalising fixes the deletion anomaly by moving course details into their own table, so deleting an enrolment keeps the course. | DIn a single unnormalised table the Robotics details exist only in that student's row, so deleting the row also erases the course name and teacher. | |
| 5Deleting the last student in Robotics is safe because the Robotics course details will stay in the table. | EEnrolment(StudentID, StudentName, CourseID, CourseName, Teacher) | |
| 6A deletion anomaly happens when you add a new course and it cannot be saved until a student enrols. | FRemoves the row for student 7. If that was the only row holding a course's details, those details are lost too (a deletion anomaly). |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
deletion anomaly — Deleting a row also wipes out a separate fact stored only in that row, e.g. deleting the last student enrolled in a course also erases the course details.DELETE FROM Enrolment WHERE studentId = 7;DELETE FROM Enrolment WHERE studentId = 7;DELETE FROM Enrolment WHERE studentId = 7;
SELECT courseName FROM Enrolment
WHERE courseCode = 'IT101';DELETE FROM Enrolment WHERE studentId = 7;-- Course details are in their own table
DELETE FROM Enrolment WHERE studentId = 7;
SELECT * FROM Course;