What is Difference Between delete and Truncate?
Answers were Sorted based on User's Feedback
Answer / muralipitti
Delete - temparaly delete the table we can undo it using
rollback where as
truncate= delete+commit we can't rollback it .
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / udhayakumar
delete is used to delete one or more rows from the table
where as truncate to delete all the rows without its
structure from the table
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / nandini sett
Both delete and Trunate are DML or Data Manupilating
Language.
Both statements --- Delete table_name and Truncate table
table_name --- deletes all rows.
Truncate Table works faster than delete.
Truncate table does not support where clause and truncate
doe not fire a trigger. When truncate is used the deleted
rows are not entered in transaction log.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / rajesh
Delete is DML statement which can delete data from table
which needs to be commited afterwards. But it doesn't free
memory area occupied by the data in the table.Where clause
can be used.
Truncate is DDL statement which is auto commit. It not only
deletes all data from table, but it also frees the memory
area occupied the data in the table. where clause is not
permitted. Works faster than delete statement
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / shivaindu
Differentiate between TRUNCATE and DELETE:
-----------------------------------------
TRUNCATE deletes much faster than DELETE
TRUNCATE HAS NO CONDITION CLAUSE. WHERE AS DELETE HAS CONDITION.
Delete
~~~~~~
1> Executes triggers
2> DML statement
3> Roll back possible
4> Flash query can get the data
5> cannot free the table free space
Truncate
~~~~~~~~
1>No trigger Execution
2>DDL statement
3>No roll back possible
4>can’t get data from flash queries
5>Option to free table space
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / chandrakala
also delete is a DML statement where as truncate is a DDL
statement.
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / shankar
DELETE and TRUNCATE both delete table from database, but
DELETE - temperorily deletes the table so we can undo the
table.
TRUNCATE - Perminently delete the table from database so we
cant undo it.
| Is This Answer Correct ? | 4 Yes | 7 No |
Answer / kiran.
Delete(DML) : All records not possible to Delete at a time,
Where clause is allowed.
structure of the table is available.
Roll Back is possible.
Truncate(DDL): All records possible to Delete at a time,
Where clause is not allowed.
structure of the table is not available.
Roll Back is possible.
>Truncate Table<tablename>;
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / joe
Delete is DML and truncate is DDl;
both or used to delete the records from the table.
We can rollback the deleted records but we cant when we used truncate.
Delete is faster than truncate
| Is This Answer Correct ? | 0 Yes | 7 No |
What is query optimization in sql?
How many joins in sql?
What is sql not null constraint?
1 SELECT a.field1, b.field2, c.field3, d.field4 2 FROM atable a, atable b, ctable c, dtable d 3 ? 4 ORDER BY 1 What is the minimum number of joins that must be specified on line 3 in the sample code above to properly link the tables? Notice that the table "atable" is aliased twice: once as "a" and once as "b." 1. One join 2. Two joins 3. Three joins 4. Four joins 5. Five joins
in table there r so many rows write a query which two rows r updated last two day befor?
Is postgresql a server?
How to change the order of columns in Oracle SQL Plus ?
Where the sql database files are stored?
Why partition by is used in sql?
What is trigger and stored procedure in sql?
What is left join in postgresql?
How did you export data from database to excel file.
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)