Introduction
In this tutorial, we want to delete all rows from a table by using a SQL Statement. The table itself should remain. In order to do this, we use the TRUNCATE Statement.
We have already created the table student with the following data:
![](https://www.deeplearningnerds.com/content/images/2023/10/image-13.png)
SQL Statement
Now, let's delete all rows from the table student. We execute the following SQL statement:
TRUNCATE TABLE student;
Deleted Data
We can see that the rows have been successfully deleted. The table itself and its structure remain unchanged.
![](https://www.deeplearningnerds.com/content/images/2023/10/image-14.png)
Conclusion
Congratulations! Now you are one step closer to become an AI Expert. You have seen that it is very easy to delete all rows from a table with the TRUNCATE Statement. Try it yourself!
Also check out our Instagram page. We appreciate your like or comment. Feel free to share this post with your friends.