Which command will delete all data from a table and will not write to the rollback segment?
-
DROP
-
DELETE
-
TRUNCATE
-
REMOVE
-
NONE OF THE ABOVE
The TRUNCATE command deletes all rows from a table without generating individual row deletion logs and does not write to the rollback segment, making it much faster than DELETE. DROP removes the table structure entirely.
To answer this question, you need to understand the differences between the commands DROP, DELETE, and TRUNCATE in the context of deleting data from a table.
Option A) DROP - This option is incorrect because the DROP command is used to delete an entire table or database object, including its structure. It does not specifically delete data from a table without affecting the rollback segment.
Option B) DELETE - This option is incorrect because the DELETE command is used to delete specific rows from a table based on a condition. It does write to the rollback segment to allow for a rollback operation if needed.
Option C) TRUNCATE - This option is correct because the TRUNCATE command is used to delete all data from a table, but it does not write to the rollback segment. TRUNCATE is a DDL (Data Definition Language) command that is faster than DELETE because it deallocates the data pages and resets the highwater mark, freeing the space for reuse.
Option D) REMOVE - This option is incorrect because the REMOVE command is not a valid command in most database systems.
Option E) NONE OF THE ABOVE - This option is incorrect because option C (TRUNCATE) is the correct answer.
The correct answer is C) TRUNCATE. This option is correct because it deletes all data from a table without writing to the rollback segment.