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 VARCHAR(50); | ADROP on its own is not enough here. Removing a column needs DROP COLUMN followed by the column name. | |
| 2ALTER TABLE students DROP COLUMN house; | BThe TABLE keyword is missing. The command must start with ALTER TABLE before the table name. | |
| 3Link an existing orders table to the students table by adding a foreign key on studentId. | CALTER TABLE products ADD discount INT; | |
| 4Change the structure of the products table by adding a whole number column called discount. | DRemoves the house column, and all the values stored in it, from the students table. | |
| 5ALTER students ADD email VARCHAR(50); | EALTER TABLE orders ADD FOREIGN KEY (studentId) REFERENCES students(studentId); | |
| 6ALTER TABLE students DROP house; | FAdds a new column called email to the existing students table without deleting the table or its rows. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
ALTER TABLE — An SQL command that changes the structure of an existing table, such as adding a column with ADD, removing one with DROP COLUMN, or adding a FOREIGN KEY, without deleting the table.ALTER TABLE students ADD email VARCHAR(50);ALTER TABLE students ADD email VARCHAR(50);ALTER TABLE products DROP COLUMN stock;ALTER TABLE orders
ADD FOREIGN KEY (productId)
REFERENCES products(productId);ALTER TABLE results
ADD FOREIGN KEY (subjectId)
REFERENCES subjects(subjectId);