Blog Bustle 06/03/2020
Truncate table sql query is used to empty table or delete all records from table. Remember that after running this truncate table sql query, we will not able to retrieve table data. So we should be careful.
truncate table table_name;
For example, i want to empty subject table from student database and truncate table sql query will be
truncate table subject;
We can also run " delete from subject; " query to delete records from subject table but truncate table sql query is fast process to empty table.
First we have to select database before running any query related to that database otherwise we will get 'no database selected' error.
If we think table whom we want to empty, its data can be useful for future, then we should take table backup.
Hope you like this tutorial.