How to Truncate a Table in MySQL

Truncating a table is a fast way to delete all the records in the table, however it is not 100% equivalent to deleting all the records. The statement to truncate a table is:

truncate table employee;

In MySQL the differences between truncate a table and delete all rows in a table are:

  • Truncate does not fire delete triggers if they exist.
  • Truncate is more efficient in terms of response time

IN THIS PAGE