Sql Query to Truncate Table


To delete or remove all the records or data from the existing table. Then we can use a ' TRUNCATE TABLE ' statement.

This statement will work similarly to a delete statement having no conditions. The only difference is that the delete statement will not free up space while the truncate will free up space.

Enter - Select * from table_name;
SQL Query
SELECT 'Before Truncate'; SELECT * FROM regions; TRUNCATE TABLE regions; SELECT 'After Truncate'; SELECT * FROM regions;
Output