Syntax:
TRUNCATE [TABLE] tbl_name

TRUNCATE TABLE empties a table completely. Logically, this is
equivalent to a DELETE statement that deletes all rows, but there are
practical differences under some circumstances.

For InnoDB, TRUNCATE TABLE is mapped to DELETE, so there is no
difference.

For other storage engines, TRUNCATE TABLE differs from DELETE in the
following ways from MySQL 4.0 onward:

o Truncate operations drop and re-create the table, which is much
  faster than deleting rows one by one.

o Truncate operations are not transaction-safe; an error occurs when
  attempting one in the course of an active transaction or active table
  lock.

o The number of deleted rows is not returned.

o As long as the table format file tbl_name.frm is valid, the table can
  be re-created as an empty table with TRUNCATE TABLE, even if the data
  or index files have become corrupted.

o The table handler does not remember the last used AUTO_INCREMENT
  value, but starts counting from the beginning. This is true even for
  MyISAM and InnoDB, which normally do not reuse sequence values.

In MySQL 3.23, TRUNCATE TABLE is mapped to COMMIT; DELETE FROM
tbl_name, so it behaves like DELETE. See [HELP DELETE].

TRUNCATE TABLE is an Oracle SQL extension. This statement was added in
MySQL 3.23.28, although from 3.23.28 to 3.23.32, the keyword TABLE must
be omitted.
