In SQL Sometimes we want to get rid of all the data in a table then One way of doing this is with DROP TABLE. If we want to simply get rid of the data but not the table itself then For this purpose, we can use the TRUNCATE TABLE command.
The syntax for "TRUNCATE TABLE" is:-
TRUNCATE TABLE "table_name"
For example, if we wanted to truncate the table called customer then in SQL, we simply type the following table:-
TRUNCATE TABLE customer
This query get rid all of the data but not table itself.
The syntax for "TRUNCATE TABLE" is:-
TRUNCATE TABLE "table_name"
For example, if we wanted to truncate the table called customer then in SQL, we simply type the following table:-
TRUNCATE TABLE customer
This query get rid all of the data but not table itself.