ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Databases  >>  SQL PLSQL
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
What is the difference between DELETE and TRUNCATE?
 Question Submitted By :: Srikanth
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is the difference between DELETE and TRUNCATE?
Answer
# 1
Whenever we delete records then they are stored in data 
dictionary and can be retrieved later ie by roll back.
but when we truncate then the memory used by the records 
which is to be truncated is released and it cannot be 
rolled back.
 
Is This Answer Correct ?    2 Yes 0 No
Protyusha Banerjee Dawn
 
  Re: What is the difference between DELETE and TRUNCATE?
Answer
# 2
when truncate command is issued, all the rows from the 
table are deleted and the memory space occupied by the 
table in the tablespace is also released whereas when 
delete command is issued, only all the rows are deleted 
fronm the table
 
Is This Answer Correct ?    1 Yes 0 No
Babloo
 
 
 
  Re: What is the difference between DELETE and TRUNCATE?
Answer
# 3
Truncate will remove the watermark from the table, but the 
delete will not.
 
Is This Answer Correct ?    0 Yes 0 No
Gourvendra Singh
 
  Re: What is the difference between DELETE and TRUNCATE?
Answer
# 4
Delete command will remove the data values ( all the 
records of table) and space and table structure will be 
ramain. We cannot free the space and remove the table 
structure using Delete command.
Truncate command will free the memory and removes table 
structure from data dictionary.

ramumcato@yahoo.com
 
Is This Answer Correct ?    0 Yes 0 No
Raam
 
  Re: What is the difference between DELETE and TRUNCATE?
Answer
# 5
we can go upto some number of records through delete while
in truncate we have to unoccupied all records.
 
Is This Answer Correct ?    0 Yes 0 No
Sanjay Keserwani
 
  Re: What is the difference between DELETE and TRUNCATE?
Answer
# 6
Deletes perform normal DML. That is, they take locks on 
rows, they generate redo  and they require segments in the 
UNDO tablespace. Deletes clear records out of blocks 
carefully. If a mistake is made a rollback can be issued to 
restore the records prior to a commit. 
   Truncates are DDL and truncate moves the High Water Mark 
of the table back to zero. No row-level locks are taken, no 
redo or rollback is generated.so they have the same effect 
as a delete, but without all the overhead. Just one slight 
problem: a truncate is a DDL command, so you can't roll it 
back if you decide you made a mistake. (It's also true that 
you can't selectively truncate -no "WHERE" clause is 
permitted, unlike with deletes, of course).
 
Is This Answer Correct ?    0 Yes 0 No
Brajendra Arzare
 
  Re: What is the difference between DELETE and TRUNCATE?
Answer
# 7
You cannot TRUNCATE a table that has any foreign key
constraints.  You will have to remove the contraints,
TRUNCATE the table, and reapply the contraints.

You can DELETE any row that will not violate a constraint,
while leaving the foreign key or any other contraint in place.
 
Is This Answer Correct ?    0 Yes 0 No
Manivasan.s
 
  Re: What is the difference between DELETE and TRUNCATE?
Answer
# 8
DELETE: DML, Manual Commit, Till not committed can be 
rollback, can be applied for both row level as well as 
table level, can be used in trigger, doesn't release memory.

TRUNCATE: DDL, auto commit, cann't rollback, applied table 
level, cann't be used in trigger, releases memory.

In both cases structure remains.
 
Is This Answer Correct ?    0 Yes 0 No
Satyajit Patel
 
  Re: What is the difference between DELETE and TRUNCATE?
Answer
# 9
the delete command log all the stmts in the transaction log 
and the truncate command dont log the stmts.
 
Is This Answer Correct ?    1 Yes 0 No
Althaf
 
  Re: What is the difference between DELETE and TRUNCATE?
Answer
# 10
Delete is associated with rollback segments like U can undo 
it before committing and U have a choice of deleting a 
specific row or rows where as

Truncate is not associated with rollback segments ie U cant 
undo it and U cant delete a row/rows of ur choice
 
Is This Answer Correct ?    0 Yes 0 No
Kalyana Chakravarthy
 

 
 
 
Other SQL PLSQL Interview Questions
 
  Question Asked @ Answers
 
Can we relate two different tables from two different users in ORACLE,PL/SQL?  4
Can we use SQL%ISOPEN in implicit cursors? Does this attribute works properly in Implicit Curosors?  2
If an unique key constraint on DATE column is created, will it validate the rows that are inserted with SYSDATE?  2
Is it possible to access the current value in a session before accessing next value?  1
What is difference between Procedures and Functions ? Hi-Caliber-IT3
i don't want the message as 14 rows updated just it should update what it will do  2
What is NOCOPY? DELL5
what is global variable in pl/sql  1
Write the order of precedence for validation of a column in a table ?  1
In testing where do we use sql language and how it helps in testing?  2
Types of joins ? TCS6
Types of joins ? Digital-GlobalSoft3
diff b/w sub query and co-relater query? iFlex3
Do view contain data? Ramco2
how can we find the select statement is indexed or not? CTS2
What are the pre requisites?  1
How to perform a loop through all tables in pl/sql? MBT3
Explain UNION,MINUS,UNION ALL, INTERSECT?  1
What is a cursor ? Why Cursor is required ?  2
what is definer rights invoke rights?  1
 
For more SQL PLSQL Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com