Oracle Database SQL — Question 22
Which statement is true about TRUNCATE and DELETE?
Answer options
- A. For tables with multiple indexes and triggers, DELETE is faster than TRUNCATE.
- B. You can never TRUNCATE a table if foreign key constraints would be violated.
- C. You can DELETE rows from a table with referential integrity constraints.
- D. For large tables, DELETE is faster than TRUNCATE.
Correct answer: B
Explanation
The correct answer is B because TRUNCATE cannot be executed when foreign key constraints are in place, ensuring data integrity. Option A is incorrect since DELETE is generally slower than TRUNCATE with multiple indexes and triggers. Option C is true, but it does not address the relationship between TRUNCATE and DELETE. Option D is also false as TRUNCATE is typically faster than DELETE for large tables.