SQL -Truncate Table Statement
SQL TRUNCATE TABLE statement is used to delete all records from a table.
- It is same function as a DELETE statement without a WHERE clause.
TRUNCATE TABLE table_name;
Below is the Student Table.
Executing Truncate Command
mysql> TRUNCATE Student;
Query OK, 0 rows affected (2.56 sec)
Student Table is truncated and below is the output of SELECT query
mysql> Select * from Student;
Empty set (0.00 sec)