Thursday, 16 May 2013

drop vs delete vs truncate

Drop:


  1. Drop is DDL operation. 
  2. IN drop, a table delete all data and table itself.
  3. we can not use rollback and commit.

Delete vs Truncate:
  1. Delete is DML operation while truncate is DDL operation.
  2. IN delete, we can use where condition but not in truncate. truncate delete all rows.
  3. Delete is slower than truncate.
  4. In delete, we can rollback but not in truncate because in delete, data is not permanent delete but in truncate, data is permanent deleted.
  5. In delete we need to use commit for permanent delete.
  6. When we do delete then it make a table for rollback.

No comments:

Post a Comment