TRUNCATE TABLE in MySQL

TRUNCATE TABLE

In MySQL, the TRUNCATE TABLE statement is used to truncate or remove table records but not the structure.
Syntax:
TRUNCATE TABLE table_name
Example:
TRUNCATE TABLE items;
Output:
Query OK, 0 rows affected <0.07 sec>
Explanation: The “items” is an already existing table that is truncated thus deleting all the data. Verify the result using the below query. SELECT* FROM items;

Output:

Empty set <0.00 sec>
Please follow and like us:
Content Protection by DMCA.com