- Delete:-
Delete is a DML statement and We can use where clause with DELETE to filter & delete specific records.
It maintain transaction log that’s why Delete command slower than Truncate.
Delete command can be rolled back.
Syntax: DELETE FROM table_name WHERE column_name = column_value;
- Truncate:-
Truncate is a DDL statement.
Truncate command is used to remove all the rows from a table but its structures, constraints, and indexes will remain as it is in database.
We can’t use Where clause with TRUNCATE.
Truncate command can’t be rollback.
Syntax: TRUNCATE TABLE table_name;
Drop:-
Drop is a DDL statement.
Drop operation can’t be rolled back.
Drop command remove entire table and all its constraints and privileges from the database.
DROP and TRUNCATE are DDL commands, whereas DELETE is a DML command.
Syntax: DROP TABLE table_name;