Difference between DELETE and TRUNCATE.pptx

10 views 3 slides Dec 24, 2023
Slide 1
Slide 1 of 3
Slide 1
1
Slide 2
2
Slide 3
3

About This Presentation

Difference between DELETE and TRUNCATE statements in SQL


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
Tags