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, 99, 2, 1, '2026-03-01'); | Aorders.studentId = students.studentId | |
| 2DELETE FROM students WHERE studentId = 1; | BThe foreign key value 99 has no matching primary key in students, so the database blocks the insert. Add the student first, then the order. | |
| 3Every foreign key value must match an existing primary key value in the related table. | CThe orders would become orphan records pointing to a missing customer, so the database blocks the delete. Remove or reassign the orders first. | |
| 4An orphan record is a row whose foreign key points to a primary key that does not exist. | DAdds an order for studentId 99, who does not exist. Referential integrity makes the database reject it. | |
| 5Adding an order with studentId 99 when no student 99 exists, and expecting it to be saved | ETries to delete a student who still has orders. The database blocks it so no order is left pointing at a missing student. | |
| 6Deleting a customer who still has orders and expecting the orders to stay valid | Forders row: studentId = 99, but students has no studentId 99 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
referential integrity — Every foreign key value must match an existing primary key in the related table, so no record points to something missing. The database blocks changes that break this.FOREIGN KEY (studentId)
REFERENCES students(studentId);FOREIGN KEY (productId)
REFERENCES products(productId);INSERT INTO orders
VALUES (11, 99, 2, 1, '2026-03-01');DELETE FROM students WHERE studentId = 1;SELECT * FROM orders
WHERE studentId NOT IN
(SELECT studentId FROM students);