What is the difference between DELETE and TRUNCATE commands? MCQ with Answer and Explanation

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.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Database Management System (DBMS) Questions

Question #1
What is a foreign key constraint violation?
A. Updating a primary key that is referenced
B. Deleting a primary key that is referenced by a foreign key
C. All of the above
D. Inserting a value in a foreign key column that does not exist in the referenced primary key

Correct Answer: Option C


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.

This question belongs to: Computer Database Management System (DBMS)
Question #2
What type of key uniquely identifies each record in a table and cannot contain NULL values?
A. Primary Key
B. Secondary Key
C. Candidate Key
D. Foreign Key

Correct Answer: Option A


Explanation:
A Primary Key is a unique identifier for each tuple in a relation. It enforces entity integrity and strictly cannot accept NULL values.

This question belongs to: Computer Database Management System (DBMS)
Question #3
What is the default sorting order when using ORDER BY without specifying ASC or DESC?
A. Descending
B. No order
C. Random
D. Ascending

Correct Answer: Option D


Explanation:
ORDER BY defaults to ascending (ASC) order.

This question belongs to: Computer Database Management System (DBMS)