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
Explanation:

To solve this question, the user needs to know the basic SQL commands for deleting data from a table.

Option A: DROP is used to delete an entire table, not just its data. This option is incorrect.

Option B: DELETE is used to delete data from a table. However, it writes the deleted data to the rollback segment in case it needs to be recovered later. This option is incorrect.

Option C: CASCADE is an option used with the DROP command to delete all objects that depend on the specified object before dropping that object. This option is incorrect.

Option D: TRUNCATE is used to delete all data from a table without logging the individual row deletions. It does not write the deleted data to the rollback segment, making it a faster operation compared to DELETE. This option is correct.

Therefore, the answer is: D. TRUNCATE.

Find more quizzes: