Day 11

Quiz

1: What is wrong with the following statement?
DELETE COLLECTION;
A1: If you want to delete all records from the COLLECTION table, you must use the following syntax:
DELETE FROM COLLECTION;

Keep in mind that this statement will delete all records. You can qualify which records you want to delete by using the following syntax:

DELETE FROM COLLECTION
WHERE VALUE = 125

This statement deletes all records with a value of 125.

2: What is wrong with the following statement?
INSERT INTO COLLECTION
SELECT * FROM TABLE_2
A2: This statement was designed to insert all the records from TABLE_2 into the COLLECTION table. The main problem here is using the INTO keyword with the INSERT statement. When copying data from one table in another table, ...

Get Sams Teach Yourself SQL in 21 Days, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.