TRUNCATE TABLE

SQL TRUNCATE TABLE Keyword

The TRUNCATE TABLE command is used to delete all data inside a table without deleting the table structure itself. It is faster than DELETE FROM table_name because it does not log individual row deletions.

Important: The table structure (columns, indexes, constraints) remains intact after TRUNCATE TABLE.

Tutorials dojo strip

SQL TRUNCATE TABLE Syntax

SQL

SQL TRUNCATE TABLE Example

SQL

Note: This syntax does not work in TechKubo playground. SQLite (and therefore TechKubo) does not support the TRUNCATE TABLE command.

SQL DELETE Equivalent Example

In SQLite (TechKubo Playground), you can achieve the same result using:

SQL

SQL TRUNCATE TABLE Labs

Tutorials dojo strip