What is the difference between DELETE and TRUNCATE commands?
A. DELETE can be rolled back; TRUNCATE cannot (in most DBMS)
B. TRUNCATE can have WHERE; DELETE cannot
C. DELETE removes all rows; TRUNCATE removes structure
D. No difference
Answer: Option A
Solution (By JKSSB Mock Tests)
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:
Any action that breaks referential integrity, such as inserting an orphan record, deleting a referenced record, or updating a referenced key, will violate the foreign key constraint.
No comments yet. Be the first to start the discussion!