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 | |
|---|---|---|
| 1UPDATE Orders SET teacher = 'Ms Lee' WHERE orderId = 5; | AUpdate anomaly: only one row is changed, so the same teacher now appears under two different names in the table | |
| 2DELETE FROM Orders WHERE orderId = 9; | BWrong: the other rows still hold the old number, so the copies disagree. This is an update anomaly. Fix by storing the phone number once in a Teachers table. | |
| 3An insertion anomaly stops you adding a new product until a customer has ordered it, because product details live in the orders table | CUPDATE Orders SET price = 5 WHERE orderId = 1; | |
| 4An update anomaly happens when a repeated value must be changed on many rows but only some rows are changed | DINSERT INTO Orders (productName, price) VALUES ('Lamp', 20); | |
| 5A table stores each teacher's phone number on every class row. The number changes, and one row is edited. The designer says: 'The data is now consistent.' | EWrong: the house details are lost too, which is a deletion anomaly. Fix by keeping houses in their own Houses table. | |
| 6A single table holds students and their house. A designer says: 'Deleting the last student in a house removes only that student.' | FDeletion anomaly: removing the only order for a product also wipes out the product's details |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
anomaly — A fault caused by redundant data: an update anomaly leaves copies that disagree, an insertion anomaly blocks adding data, and a deletion anomaly loses other data when a record is removed.UPDATE BigOrders SET teacher = 'Ms Kim'
WHERE orderId = 1;INSERT INTO BigResults
VALUES (NULL, 'Art', 'Ms Ng');DELETE FROM BigResults
WHERE studentId = 5;SELECT DISTINCT teacher FROM BigResults
WHERE subject = 'Maths';UPDATE Subjects SET teacher = 'Ms Kim'
WHERE subjectId = 1;