Prem Tiwari - - MySQL Tutorial
In MySQL, the truncate statement removes the all data from database table, but it’s not removes the table’s structure.
You can use the truncate statement when you want to delete the complete data from the table without deleting table structure. See the below truncate statement syntax:
1 2 3 | TRUNCATE TABLE table_name; |
Here is the example of MySQL truncate statement:
1 2 3 | TRUNCATE TABLE tbl_employee; |
The above MySQL query will delete the complete data from “tbl_employee” table. Now execute the below MySQL query to see the data from “tbl_employee” table:
1 2 3 | select * from tbl_employee; |