Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > PHP / mySQL

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 06-01-2018, 10:16 AM   #1
Pavan Techn
Registered User
 
Join Date: Mar 2018
Posts: 341
What is the difference between DELETE and TRUNCATE statement in SQL?

The main differences between SQL DELETE and TRUNCATE statements are given below:

No. DELETE TRUNCATE
1) DELETE is a DML command. TRUNCATE is a DDL command.
2) We can use WHERE clause in DELETE command. We cannot use WHERE clause with TRUNCATE
3) DELETE statement is used to delete a row from a table TRUNCATE statement is used to remove all the rows from a table.
4) DELETE is slower than TRUNCATE statement. TRUNCATE statement is faster than DELETE statement.
5) You can rollback data after using DELETE statement. It is not possible to rollback after using TRUNCATE statement.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Pavan Techn is offline   Reply With Quote

Old 03-13-2021, 07:07 AM   #2
Kumkum
Registered User
 
Join Date: Dec 2017
Posts: 43
This is very helpful information, thanks for it.
I have also learn other SQL statements from here.
Kumkum is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:29 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.