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 orders VALUES (11, 'Ava', 'Pencil', 'Stationery', 1.5); | AWrong: repeated (redundant) data is the cause of anomalies. It wastes space and leads to insert, update and delete anomalies. | |
| 2UPDATE orders SET price = 2 WHERE product = 'Pencil'; | BAn insert anomaly can occur here: in one big table the product details are only stored when someone orders it, so a new product can't be added without an order. | |
| 3A delete anomaly: removing the only order for a product also wipes out the product's details, so that information is lost. | CWrong type: missing a row when changing data is an update anomaly. An insert anomaly is when new data can't be added without other unrelated data. | |
| 4An update anomaly: the same fact is stored in many rows, so changing it in only some rows leaves inconsistent data. | DRisk of an update anomaly: the price is repeated on many rows, so if any row is missed the data becomes inconsistent. | |
| 5A student says: 'Repeating a customer's name in every order row is fine because it never causes any problems.' | EDELETE FROM orders WHERE orderId = 7; | |
| 6A student says: 'An insert anomaly happens when you change a price and miss a row.' | FUPDATE orders SET house = 'Blue' WHERE orderId = 3; |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
anomaly — A problem caused by repeated (redundant) data: adding, changing or deleting a record leaves data inconsistent or lost. The three types are insert, update and delete anomalies.INSERT INTO BigTable (Teacher, Room)
VALUES ('Ms Park', 'C2');
-- Cannot add Ms Park alone: insert anomalyUPDATE BigTable
SET Room = 'B7'
WHERE Teacher = 'Ms Lee';INSERT INTO BigTable (Teacher, Room)
VALUES ('Ms Park', 'C2');
-- Insert anomaly: no student to link toUPDATE BigTable SET Room = 'B7'
WHERE StudentID = 1;
-- Other rows still show B4: update anomalyDELETE FROM BigTable
WHERE StudentID = 4;
-- Mr Ford's only row goes: delete anomaly