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 | |
|---|---|---|
| 1ALTER TABLE students ADD email TEXT; | AAdds a new column called email to the existing students table without deleting any rows. | |
| 2ALTER TABLE products DROP COLUMN stock; | BALTER TABLE subjects ADD room TEXT; | |
| 3ALTER TABLE changes the structure of a table that already exists, such as giving it an extra column. | CCOLUMN is in the wrong place. It should be DROP COLUMN stock, with COLUMN before the column name. | |
| 4After a column is added, rows that were already in the table have an empty (NULL) value in that new column. | DRemoves the stock column, and all the data in it, from the products table. | |
| 5ALTER students ADD email TEXT; | EThe TABLE keyword is missing. It must be ALTER TABLE students ADD email TEXT; | |
| 6ALTER TABLE products DROP stock COLUMN; | FALTER TABLE students ADD age INTEGER; SELECT firstName, age FROM students; |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
ALTER TABLE — Changes the structure of an existing table, such as adding a column with ADD or removing one with DROP COLUMN. Existing rows keep their data and get empty (NULL) values in a new column.ALTER TABLE students ADD email TEXT;ALTER TABLE students ADD email TEXT;ALTER TABLE students DROP COLUMN house;ALTER TABLE students ADD yearGroup INTEGER;ALTER TABLE students ADD email TEXT;
SELECT * FROM students WHERE email IS NULL;