Tag Archives: truncate statement

Difference between truncate and delete statements

Difference between truncate and delete statements

Truncate
Truncate is DDL command. It is completely remove the data from the table.
It is fast because does not generate the redo entries and cannot be rollback.
It also reset the high-water mark value for the table.

Example of Truncate table

truncate table employees;

Delete Query
Delete query is used to delete data from the tables. You can use the where clause with it for removing specific or condition based data. Delete statement generate the redo logs.

Delete from table_name [where]

Example of Delete statement

Delete from employees;
delete from employees where id = 100;

Note: Delete without where clause delete all data from the specified table.