The MySQL TRUNCATE TABLE statement is used to remove all records from database table. The truncate table statement is similar to delete statement without a WHERE clause. MySQL truncate table statement is more powerful compare to delete statement.
To remove all records from existing table, use the following syntax:
Parameters:
tablename: The table name from which you want to remove all records.
Note:
In the above example, we have deleted the record for customer "Sunil Shetty".
You can use MySQL Command Line Client to remove all records from "tblCustomer" table. It will look like this:
You can use MySQL Command Line Client to check the deleted data in table. It will look like this: