Delete All Rows from a MySQL Table



We can use either TRUNCATE statement or DROP statement to delete all the rows from the table. It can also be done with the help of DELETE statement but in that case WHERE clause must identify all the rows of the table. As we know that both TRUNCATE and DELETE statement will not delete the structure of the table but still it is better to use TRUNCATE statement rather than DELETE statement. DROP statement will delete table’s structure also.

Syntax

TRUNCATE statement

TRUNCATE table table_name:

Syntax

DROP statement

DROP table table_name:
Updated on: 2019-07-30T22:30:21+05:30

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements