Difference between DELETE and TRUNCATE statements in SQL
Size: 61.49 KB
Language: en
Added: Dec 24, 2023
Slides: 3 pages
Slide Content
Difference between DELETE and TRUNCATE By Mohanabalasankari R
DELETE TRUNCATE DDL (Data Definition Language) command DML (Data Manipulation Language) command Removes a single, multiple or all records from the table Removes all the records from the table Records removed c an be rolled back Cannot be rolled back and changes are permanent Can specify a condition using WHERE clause Not possible to use where clause Slower compared to truncate Faster compared to delete DIFFERENCE
SYNTAX FOR DELETE SYNTAX FOR TRUNCATE TO DELETE ONE RECORD: Delete from table_name where column_name = some value TO DELETE ALL RECORDS: Delete from table_name TO TRUNCATE TABLE: Truncate table table_name