You have decided to permanently remove all the data from the STUDENT table and you need the table structure in the future. Which single command performs this?
A: DROP TABLE student;
B: TRUNCATE TABLE student;
C: DELETE* FROM student;
D: TRUNCATE TABLE student KEEP STRUCTURE;
E: DELETE * FROM student KEEP STRUCTURE.
ANSWER: B
EXPLANATION: Answer B is correct because after truncating table you delete all data and keep table and its structure for future use. Also command TRUNCATE reset highwatermark level to zero for table.
INCORRECT ANSWERS:
A: This DDL operation will drop table and its structure without possibility to rollback this operation.
C: This operation can be used to perform question task, but it works slowly and usually used when you need to delete NOT ALL table rows. It does not reset high water mark for table.
D: Incorrect clause KEEP STRUCTURE inside TRUNCATE TABLE command.
E: Incorrect clause KEEP STRUCTURE inside DELETE command.