As its name suggests, it is used to delete all records from a MySQL table.
Truncate table table_name;
mysql> Truncate table student; Query OK, 0 rows affected (0.18 sec)
The above query deletes all records from the ‘Student’ table. We can observe that MySQL returned the empty set after running the following query:
mysql> select * from student; Empty set (0.00 sec)
The above is the detailed content of What is the MySQL TRUNCATE command used for?. For more information, please follow other related articles on the PHP Chinese website!