What is the difference between DELETE and TRUNCATE commands?

Question

Try to be specific

in progress 1
Dhruv2301 4 years 2 Answers 888 views Great Grand Master 0

Answers ( 2 )

  1. 1) Delete
    – Delete is Data Manipulation Language command
    -You can specify the tuple that you want to delete.
    -DELETE command can have WHERE clause.
    – DELETE command eliminate the tuples one-by-one.
    – DELETE command acts slower as compared to TRUNCATE.
    – DELETE command can be followed either by COMMIT or ROLLBACK.

    2) Truncate
    – Truncate is a Data Definition Language Command
    – It deletes all the tuples from a relation.
    – TRUNCATE command do not have WHERE clause.
    – TRUNCATE delete the entire data page containing the tuples.
    – TRUNCATE is faster as compared to DELETE.
    – TRUNCATE command can’t be ROLL BACKED.

  2. -Delete
    It removes data Plus Table definition or table structure

    -Truncate
    It only removes data from table

Leave an answer

Browse
Browse