What is difference between TRUNCATE & DELETE?

Answers were Sorted based on User's Feedback



What is difference between TRUNCATE & DELETE?..

Answer / deva

Truncate is a DDL command and hence cant be rolled back
where as delete is DML command and thus can be rolled back
if not necessary.

Is This Answer Correct ?    31 Yes 3 No

What is difference between TRUNCATE & DELETE?..

Answer / jude franco

TRuncate removes all the rows in a table in one go.
Delete deoes it for each row
Truncate does not make entries in a LOG file
Delete makes entries for each row that gets deleted

Is This Answer Correct ?    23 Yes 3 No

What is difference between TRUNCATE & DELETE?..

Answer / swapnareddy

Main Differences between Truncate and Delete:
Truncate:
1:Truncate removes all records but using this we cannot
remove a particular record.
2:Truncate is ddl command(data definiton language command)
3:Rollback cannot be done when we use this command.
4:Truncate cannot fire a trigger.
Delete:
1:delete can remove all records or a particular record.
2:delete is a dml command(data manipulation language command)
3:rollback is possible when we use this command.
4:delete can fire a trigger

Is This Answer Correct ?    19 Yes 1 No

What is difference between TRUNCATE & DELETE?..

Answer / oracle_tigress

difference between truncate and delete

1.truncate removes rows in one execution..delete removes
rows one by one so truncate is fast..

2.truncate does not creates logs and hence canot be
rolledback and hence is a DDL stmt..DELETE creates rollback
segment hence can be rolled back and hence is a DML stmt.

3.truncate doesnot allow for conditional remove of records
(all records has to remove) DELETE allows conditonal remove
of records(where cluase etc can be used.)

4.triggers are not fired on truncate stmt but trgieers are
fired on DELETE stmt..

Is This Answer Correct ?    13 Yes 2 No

What is difference between TRUNCATE & DELETE?..

Answer / suman chakraborty

Truncate can not fire a trigger while delete can fire a
trigger

Is This Answer Correct ?    11 Yes 1 No

What is difference between TRUNCATE & DELETE?..

Answer / rampratap singh

Truncate is DDL so it does not create rollback segments,

where as DELETE is DML and creates rollback segments.

Truncate removes/reset the high watermark.
Delete does not do that.

Is This Answer Correct ?    10 Yes 4 No

What is difference between TRUNCATE & DELETE?..

Answer / rao

we can utilise the space for record which is uesd to
truncate but delete we cant use same same space.

Is This Answer Correct ?    8 Yes 2 No

What is difference between TRUNCATE & DELETE?..

Answer / satya_k21

Hi,

By using truncate command we can delete all the records
in a table , but we cant delete a single record in a table.

by using delete command we can delete a entire records
or a specified record in a table..
Delete is a DML Operation but truncate is DDL Operation
let me know if it is wrong.

Regards,
Satya.k

Is This Answer Correct ?    9 Yes 3 No

What is difference between TRUNCATE & DELETE?..

Answer / pravallika

We can specify a condition while using deletecommand.But
Truncate is unconditional

Is This Answer Correct ?    4 Yes 1 No

What is difference between TRUNCATE & DELETE?..

Answer / ram kumar

1.Both are same but a little bit difference between them

2.Truncate removes all the rows in the table and it cannot
be rolledback bcoz its a DDL

3.Delete removes the particular record u want in the table
and it can be rolledback bcoz its a DML

4.Truncate is Unconditional and Delete is Conditional

Regards,
Ram Kumar...

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

What are different sql data types?

0 Answers  


what are the 'mysql' command line options? : Sql dba

0 Answers  


What is dml and ddl?

0 Answers  


i have a table emp and columns ename,empno,mgr_id,i need ename,manager name as result i.e employee respective manager.. example empno ename mgr_id 1 john 3 2 paul 3 3 smith 1 4 kevin 1 5 stewart 2 result has to look like this ename manager john smith paul smith smith john kevin john stewart paul can u plz help me out in this.....

8 Answers  


Which operator is used in query for pattern matching?

0 Answers  






how would you enter characters as hex numbers? : Sql dba

0 Answers  


What is the use of triggers?

0 Answers  


What is the difference between database trigger and stored procedure?

0 Answers  


What makes a good primary key?

0 Answers  


What is the difference between inner join and natural join?

0 Answers  


What is a sql statement?

0 Answers  


What is Difference between StoredProcedure and function?

3 Answers  


Categories