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 | |
|---|---|---|
| 1SELECT firstName FROM students; | AAsks the database to return the firstName of every student | |
| 2DELETE FROM students WHERE studentId = 3; | BUPDATE students SET points = 130 WHERE studentId = 1; | |
| 3SQL can add a new row of data to a table | CRemoves the student with studentId 3 from the table | |
| 4SQL can change data that is already stored, and each statement ends with a semicolon | DINSERT INTO subjects VALUES (6, 'Art', 'Ms Ray'); | |
| 5select firstName from students | ESELECT is used to ask for data, not to add it; adding a row needs INSERT | |
| 6SELECT INTO students VALUES (11, 'Sam'); | FThe statement has no semicolon at the end, and the keywords are not written in capitals as SQL style expects |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
SQL — Structured Query Language, the standard language for asking a database to return data (SELECT) or to add, change or remove it (INSERT, UPDATE, DELETE).SELECT firstName, house
FROM students;UPDATE students
SET points = 130
WHERE studentId = 1;DELETE FROM products
WHERE stock = 0;SELECT name, teacher FROM subjects;INSERT INTO subjects
VALUES (6, 'Art', 'Ms Ng');