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

TRUNCATE TABLE table_name;

SQL TRUNCATE TABLE Example

TRUNCATE TABLE Patients;

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:

DELETE FROM Patients;

SQL TRUNCATE TABLE Labs

Tutorials dojo strip
Scroll to Top