you are at Encyclopedia of SQL >> TRUNCATE
TRUNCATE
To erase whole data from table without deleting table from database there is used TRUNCATE.Syntax
TRUNCATE TABLE `table_name`
To gain this same result there can be used DELETE.
To delete whole table with its data use DROP
Example
Delete whole data from `people` table
name | surname | age |
---|---|---|
Paweł | Kowalski | 3 |
Piotr | Janik | 7 |
Michał | Nowak | 13 |
query
TRUNCATE TABLE `people`
result
name | surname | age |
---|