Author: Shameer
•10:22 AM
DELETE

1. DELETE is a DML statement.
2. DELETE removes some rows if WHERE clause is used
3. Can be rolled back
4. Can be used with or without WHERE clause
5. Does not reset identity of the table
6. Triggers will be fired.
7. When DELETE operation is performed, all the data get copied into Rollback Tablespace first,
and then delete operation get performed. Hence we can get back the data by ROLLBACK command.

SYNTAX:

To delete a particular row

DELETE FROM table_name
WHERE column_name = column_value

To delete all rows

DELETE FROM table_name
Or
DELETE * FROM table_name

DROP

1. DROP is a DDL statement.
2. Removes a table from the database. Table structures, indexes, privileges, constraints will
also be removed.
3. Cannot be rolled back
4. No Triggers will be fired.

SYNTAX:

DROP TABLE table_name


TRUNCATE

1. TRUNCATE is a DDL Statement.
2. Removes all rows from a table, but the table structures and its columns, constraints, indexes
remains.
3. Cannot be rolled back
4. Resets the identity of the table
5. Truncate is faster and uses fewer system and transaction log than delete.
6. Cannot use TRUNCATE on a table referenced by a FOREIGN KEY constraint.
7. No Triggers will be fired.
8. Cannot use WHERE conditions

SYNTAX:

TRUNCATE TABLE table_name
This entry was posted on 10:22 AM and is filed under , . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

16 comments:

On September 7, 2012 at 8:59 PM , Anonymous said...

it's very clear and useful

 
On March 6, 2013 at 10:42 PM , Anonymous said...

very useful...Thanks...

 
On April 5, 2013 at 10:24 PM , Anonymous said...

I really like your blog.. very nice colors & theme. Did you create this website yourself
or did you hire someone to do it for you? Plz answer back as I'm looking to construct my own blog and would like to find out where u got this from. cheers

Feel free to surf to my web-site - mouse click the following webpage

 
On April 16, 2013 at 9:11 AM , Anonymous said...

Or maybe you look at it from a monetary standpoint and decide that Guy
Ritchie and Madonna divorce was worse because they were married
so long and have children and there is a lot of money involved.
Aamir Khan and Amitabh Bachchan had a rough battle, when
the movies related to them were released at the same time.
However, today, the wedding photographers capture photographs of moments that
are precious and that you would cherish all your life; and, when you least expects the wedding photographer to capture
you.

Check out my web page; watchmygames.com

 
On April 29, 2013 at 2:01 PM , Anonymous said...

You will find the most updated news being uploaded or published in blogs and
celeb news sites. Stay connected with for the latest
tit-bits of pick me up news and cool celebrity pictures.
Celebritynewsapp has developed a celebrity app which is getting popular day by day.


Feel free to visit my web-site: profitbusinessathome.net

 
On May 8, 2013 at 1:16 AM , Anonymous said...

I think it is best answer comparing to all other on internet...

 
On May 11, 2013 at 6:02 AM , Anonymous said...

You have made some decent points there. I checked on the net to learn more about the issue and
found most individuals will go along with your views on this site.


My site ... http://ip-50-62-224-156.ip.secureserver.net

 
On May 15, 2013 at 2:42 AM , Anonymous said...

I used to be able to find good info from your articles.


Review my weblog :: www.50.co.za

 
On July 30, 2013 at 10:12 PM , Anonymous said...

Great tutorial. One more difference between truncate and delete is that truncate is DDL.

 
On August 25, 2013 at 7:12 PM , james said...

Oh my God this site is really good

 
On August 25, 2013 at 7:40 PM , Martin said...

thanks alot for nice post

 
On July 7, 2014 at 1:55 AM , john said...

Thanks

 
On September 15, 2014 at 2:31 PM , Anonymous said...

thanks

 
On October 7, 2014 at 11:40 AM , Gorakhnathmehta Mehta said...

good with thanks

 
On October 9, 2014 at 5:52 AM , Anonymous said...

3

 
On December 7, 2014 at 5:25 AM , Rajan Kumar said...

Good ...........Keep on.........Very helpful