DROP vs DELETE vs TRUNCATE in Oracle

Here is the difference between the commands that are used to remove the data from the database.

DROP DELETE TRUNCATE
Drop Command is a DDL Command DELETE Command is a DML Command TRUNCATE Command is a DDL Command
It removes the whole table from the database It removes all/ single/multiple rows from the table It removes all the rows exist in the table
WHERE clause cannot be used with DROP command WHERE clause can be used with DELETE command WHERE clause cannot be used with TRUNCATE command
Rollback cannot be possible Rollback can be possible Rollback cannot be possible
Commit cannot be possible Commit can be possible Commit cannot be possible
No Trigger will be fired Trigger will be fired No Trigger will be fired
Faster and Time saving Slowest and Time consuming Faster and Time saving

Syntax

DROP TABLE table_name;

Syntax

DELETE TABLE table_name;
COMMIT;

Syntax

TRUNCATE TABLE table_name;


Conclusion

All the three statements are used to remove the rows/ tables but the processing or we can say working is different as well as syntax is also different.

Ebook Download
View all
Learn
View all
F11Research & Development, LLC