what is the difference between TRUNCATE and DELETE command
in SQL




Answers were Sorted based on User's Feedback



what is the difference between TRUNCATE and DELETE command in SQL..

Answer / guest

Truncate command cannot be rolled back while Delete can be

Is This Answer Correct ?    178 Yes 18 No

what is the difference between TRUNCATE and DELETE command in SQL..

Answer / pavan_1981

truncate is ddl command.its faster than delete as it doesnt
have go through the rollbacks etc.truncate being a ddl is
auto commit.we can only truncate the whole table(cant use
where clause).once table is truncated we cant rollback the
changes.when a table is truncated the memory occupied is
released.that id the water mark is adjusted.

delete is a dml command and can be rolled back.is slower
than truncate as it is dml has to go through rollback
segments etc.we can use where clause with delete.when a
table is deleted memory occupied is not released ans also
the water mark is not adjusted.

Is This Answer Correct ?    153 Yes 11 No

what is the difference between TRUNCATE and DELETE command in SQL..

Answer / mkjmkumar

TRUNCATE

1. It is DDL.
2. Speed is faster
3. Do not Check Constraints.
4. Roll Back is not possible.
5. Can not use where clause

DELETE

1. It is not a DDL
2. Speed is slow
3. Check constraints, If Exists then shoe error.
4. We can rollback .
5. User Where Clause

Is This Answer Correct ?    78 Yes 8 No




what is the difference between TRUNCATE and DELETE command in SQL..

Answer / kotravel. b

TRUNCATE DELETE
1 cannot be 1 can ba RB
roll back


2 faster than 2 slower than truncate
delete


3 it releses the stroge 3 it does not releses the stroge
sp sp
spaces

Is This Answer Correct ?    75 Yes 8 No

what is the difference between TRUNCATE and DELETE command in SQL..

Answer / nithya

The delete statement will result in the table spaces or
memories would remain as the current size and table
structure remain in the database. Delete is not effective
when you use it to remove all data from a table, because it
takes up storage spaces due to unclear memories.

The truncate statement will result in clearing table spaces
or memories and the table structure remain in the database.
Therefore it free table storage spaces and use it only when
you need to remove all data from a table.

Is This Answer Correct ?    24 Yes 3 No

what is the difference between TRUNCATE and DELETE command in SQL..

Answer / anup.wilson

hii every one ... i want to say that delite is --dml and
truncate is ddl ..nxt thing about roll back ..through
delete we roll back untill unless we are not COMMIT IT..
IF WE COMMIT AFTER DELETE ..WE CANT ROLL BACK IT
...

Is This Answer Correct ?    15 Yes 3 No

what is the difference between TRUNCATE and DELETE command in SQL..

Answer / dheeraj

Delete is DML Command ,Whereas Trucate is DDL command

Delete can be Rolled Back,Truncate cannot be rolled back,

Truncate is much faster then Delete

Delete will not released the memory space ,Memories would
be same if we use delete command the structure of the
table is still there

Trncate can be free the space in the meomory

Delete , use check constraints if exits then show error

Truncate don't use check constraint

Is This Answer Correct ?    13 Yes 4 No

what is the difference between TRUNCATE and DELETE command in SQL..

Answer / pravesh kumar

Truncate
1.Truncate Can be DDL Command.
2.it cannot be rollback.
3.we cann't use Where clause.
4.truncate=delete+commit so we cann't rollback.
5.truncate delete all record from the table.
6.truncate is a DDL command and cannot be rollbackand all
memory space is released back to server.
7.speed faster.
8.do not chcek constraint.
Delete
1.Delete Can be DML Command.
2.it can be rollback.
3.we can use Where clause.
4.delete=delete-- so we can be rollback.
5.delete delete record from the table.
6.truncate is a DDL command and can be rollback and all
memory space is not released back to server.
7.speed slow.
8. chcek constraint.

Is This Answer Correct ?    14 Yes 7 No

what is the difference between TRUNCATE and DELETE command in SQL..

Answer / kavita sahu

1. Truncate is a DDL command and delete is a DML command
2. Truncate delete all records from table there is no
ROLLEDBACK it always Commit without giving the Commit
3. Truncate is much faster than Delete
4. Truncate you can't use where clause
DELETE you can use where clause

Is This Answer Correct ?    4 Yes 0 No

what is the difference between TRUNCATE and DELETE command in SQL..

Answer / raja lakshmi reddy v

hi friends this is raja

Truncate:
1. Truncate is used to delete all rows at a time, so the
table will become as free. The user feel the table does not
contain any rows, eventhough but internally the data exist
some memory that memory is free for our reuse.
2. Truncate is faster than delete, and where clause never
possible.
3. It is ddl command so that it will not roll back because
auto commit by default.
4. in sqlserver autoid columns will reset since from
starting seed value.
Delete:
1. Delete is used to Delete particular rows or all with
where clause or without where clause.
2. remeber if u delete rows, eventhough that memory will
never free means separate memory will allocate to our table.
3. It is slower than the truncate.
4. in sqlserver autoid values will never start from seed
intial value or default value.
5. while deleting check constrains, if any problem errow
thrown.

Is This Answer Correct ?    6 Yes 3 No

Post New Answer



More Oracle AllOther Interview Questions

8. Supporting AP, AR and GL?

0 Answers   Oracle,


How client makes connection with server in client/server architecture?

1 Answers   CA,


How would you force a log switch?

1 Answers  


what is different between inline query,subquery& corelated query?

8 Answers   Quest,


What is the sql query to find the employee who has Nth maximum salary?

2 Answers  






How can you gather statistics on a table?

3 Answers  


can we drop dual table

7 Answers   Metric Stream,


how to create an user in oracle 10g.please give me an example..

1 Answers  


Why we are using primary key and foreign key in oracle and difference between primary key and foreign key?

1 Answers  


Tell me about entire study of finacle software as soon as possible? give me the idea about questions which coulb be asked in interview of pnb it officers?

0 Answers   Punjab National Bank,


Explain the difference between a data block, an extent and a segment.

1 Answers   Accenture, IBM,


how to replace not in with not exist?

0 Answers   IBM,






Categories
  • Oracle General Interview Questions Oracle General (1658)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (188)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (509)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)