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. 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.

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

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1 Report Error
Which of the following is a way to avoid redundancy in a database?
A. Normalization
B. Replication
C. Indexing
D. Denormalization

Correct Answer: Option A


Explanation:
Normalization reduces redundancy by organizing data into tables with minimal duplication.

This question belongs to: Computer Database Management System (DBMS)
Question #2 Report Error
Which of the following database concepts deals with grouping a set of SQL statements into a single logical unit of execution?
A. View definition
B. Normalization
C. Transaction
D. Indexing

Correct Answer: Option C


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.

This question belongs to: Computer Database Management System (DBMS)
Question #3 Report Error
Which SQL function is used to find the maximum value in a column?
A. MAX()
B. SUM()
C. AVG()
D. MIN()

Correct Answer: Option A


Explanation:
MAX() returns the highest value in a selected column.

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