What is the difference between DELETE and TRUNCATE commands?
A. DELETE can be rolled back; TRUNCATE cannot (in most DBMS)
B. No difference
C. TRUNCATE can have WHERE; DELETE cannot
D. DELETE removes all rows; TRUNCATE removes structure
Answer: Option A
Solution (By JKExamLibrary)
DELETE is a DML command that can be rolled back and can use WHERE; TRUNCATE is a DDL command that removes all rows and cannot be rolled back (in some DBMS) and resets auto-increment counters.
Explanation:
A Transaction is a sequence of one or more SQL operations treated as a single, indivisible unit of work that must either succeed completely or fail completely.
No comments yet. Be the first to start the discussion!