PrepZone Logo
PrepZone
Back to Database

Database · Easy

Difference between DELETE, TRUNCATE, and DROP. Which can be rolled back?

DatabaseSQLFresher

Answer preview

DELETE is DML that removes selected rows one at a time; TRUNCATE is DDL that discards all rows by deallocating storage; DROP is DDL that removes the table definition itself. Rollback ability depends on the engine — in PostgreSQL all three are transactional, in Oracle and MySQL TR…