Difference between TRUNCATE,DELETE and DROP commands

By | November 8, 2013

1)DELETE-Delete command is using to remove a rows from a table.

“Where” clause is used to remove some rows.

if no “where” condition specified all rows will be removed.

After performing a DELETE operation you need to “commit” or “Rollback” the transaction to make the change permanent or undo it.

2)TRUNCATE- “truncate” removes all rows from a table

this operaion cannot be rolled back and no triggers will be fired

truncate is faster than delete and doesnt use as much undo space as delete.

3)DROP- removes a  table from the database

All the tables rows,indexes and privileges will also be removed.

this operation cannot be rolled back.