Which command will delete all data from a table and will not write to the rollback segment?

  1. DROP

  2. DELETE

  3. CASCADE

  4. TRUNCATE


Correct Option: D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) DROP - This option is incorrect because the DROP command is used to delete an entire table, including its structure, from the database. It does not delete data from a table without writing to 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 not delete all data from a table without writing to the rollback segment.

Option C) CASCADE - This option is incorrect because the CASCADE keyword is used in conjunction with the DROP command to delete dependent objects along with the table. It does not delete all data from a table without writing to the rollback segment.

Option D) TRUNCATE - This option is correct because the TRUNCATE command is used to delete all data from a table without writing to the rollback segment. It is a faster operation than DELETE as it does not generate undo logs for each deleted row.

The correct answer is D) TRUNCATE. This option is correct because it deletes all data from a table without writing to the rollback segment.

Find more quizzes: