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 | |
|---|---|---|
| 1DROP TABLE orders; | ARemoves every row from orders but keeps the empty table and its structure | |
| 2DELETE FROM orders; | BDROP TABLE cannot use a WHERE clause because it removes the whole table. To remove only some rows, use DELETE FROM students WHERE house = 'Red'; | |
| 3To remove a table that is no longer needed, including its structure and all its data, use DROP TABLE | CPermanently removes the orders table, including its structure and every record in it | |
| 4A table that other tables reference through a foreign key may need those child tables dropped first | DThe TABLE keyword is missing. The correct statement is DROP TABLE students; | |
| 5DROP TABLE students WHERE house = 'Red'; | EDROP TABLE products; | |
| 6DROP students; | FDROP TABLE orders; DROP TABLE students; |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
DROP TABLE — Permanently deletes a whole table, its structure and all its records. Unlike DELETE, which only removes rows, it cannot be undone and can fail if other tables reference it.DROP TABLE students;-- delete the subjects table completely
DROP TABLE subjects;-- orders has a FOREIGN KEY to students
DROP TABLE orders;
DROP TABLE students;DELETE FROM products WHERE stock = 0;-- removes the table and all its records
DROP TABLE products;