QuestionQ18Verified/Manipulating DataCopy linkReport a problemAsk AstroTutorSave questionWhich statement about TRUNCATE and DELETE is true?AFor tables with multiple indexes and triggers DELETE is faster than TRUNCATE.BFor large tables TRUNCATE is faster than DELETE.CYou can never TRUNCATE a table if foreign key constraints will be violated.DYou can never DELETE rows from a table if foreign key constraints will be violated.Show AnswerAnswerExplanationFor large tables, TRUNCATE is generally faster than DELETE because it empties the table without individually processing every row. MySQL documents that TRUNCATE drops and re-creates the table, making it much faster than deleting rows one by one, particularly for large tables.Learn moreMySQL 8.0 Reference Manual — TRUNCATE TABLE StatementShow comments1Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion