In the documentation it says
TRUNCATE TABLE is used to permanently delete the contents of a table without deleting the table itself.
Can anyone please give an example of it?
In the documentation it says
TRUNCATE TABLE is used to permanently delete the contents of a table without deleting the table itself.
Can anyone please give an example of it?
Unlike DROP TABLE, TRUNCATE TABLE keeps the table and deletes only all rows that are currently stored in the table. This means that you don't need to re-create the table, if you're planning to insert new rows into it once it's truncated.
This might be handy for local experiments (but not only) where you regenerate the data occasionally and run some queries over it.