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 Students SET year = 10 WHERE id = 7; | AUPDATE Students SET email = 'sam@school.edu' WHERE id = 12; | |
| 2DELETE FROM Students WHERE id = 7; | BDELETE FROM Students; | |
| 3Change a student's email address, but only for the student with id 12 | CFROM is missing. The correct syntax is DELETE FROM Students WHERE id = 7; | |
| 4Danger: leaving out WHERE deletes every record in the table | DChanges the year field to 10 for only the student whose id is 7 | |
| 5UPDATE Students SET year = 10; | ERemoves only the record for the student whose id is 7 | |
| 6DELETE Students WHERE id = 7; | FWHERE is missing, so every student's year is changed to 10. Add WHERE id = 7; to change just one record. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
UPDATE table SET field = value WHERE condition; — UPDATE changes field values and DELETE FROM removes records. Always add WHERE so only the chosen records change. Without it, every record in the table is changed or deleted.UPDATE students SET year = 10 WHERE id = 3;UPDATE students SET year = 10 WHERE id = 3;DELETE FROM students WHERE id = 7;DELETE FROM students WHERE id = 7;UPDATE students SET year = 10
WHERE id = 3;