MySQL – Delete All Rows from Table

To delete all rows from a table in MySQL, use SQL DELETE statement.

The following is a simple syntax of DELETE statement to delete all the rows from a given table.

DELETE FROM table_name;

where

ADVERTISEMENT
  • table_name is the name of table from which we would like to delete all the rows.

Example

In the following example, we will consider a table students and remove all the rows from the table.

“students” table before DELETE

name	rollno
Arjun	14
Manish	15
Vina	16

SQL Query

DELETE FROM students;

Response

3 row(s) affected

“students” table after DELETE

name	rollno