Skip to content
CodeKruPro

DELETE, TRUNCATE and DROP: the details

QuizMedium-HardAsked in: Accenture

Pick every true statement about DELETE, TRUNCATE and DROP. A trigger is code that the database runs automatically when rows change. A commit saves changes for good; a rollback undoes changes that are not yet committed.

  • DELETE can take a WHERE clause and fires ON DELETE triggers
  • In MySQL, TRUNCATE causes an implicit commit, so it cannot be rolled back
  • In MySQL, TRUNCATE resets the AUTO_INCREMENT counter to its start value
  • TRUNCATE can never be rolled back in any database
  • DROP TABLE removes the rows but keeps the empty table

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in