SQL TRUNCATE TABLE (original) (raw)

Last Updated : 13 Jun, 2026

The TRUNCATE TABLE statement is used to remove all records from a table while preserving its structure. It is especially useful when working with large tables.

**Example: First, we will create a demo SQL database and table, on which we will use the TRUNCATE TABLE command.

Screenshot-2026-02-06-144952

Student Table

**Query:

TRUNCATE TABLE Students;

**Output:

truncate-1

**Syntax:

TRUNCATE TABLE table_name;

Example of SQL TRUNCATE TABLE

Here we will look at different examples of the SQL TRUNCATE TABLE command. Consider the EMPLOYEE table below for the following example:

Screenshot-2026-02-06-145528

EMPLOYEE Table

**Query:

TRUNCATE TABLE EMPLOYEE;

SELECT * FROM EMPLOYEE

**Output:

empty_table

But let's now check whether the structure of the table is deleted or it has been preserved so we again use the DESC command to see the structure of the table and we will see that the structure remains as it is.

DESC-table

To better understand when to use TRUNCATE, see our detailed explanation of the differences between TRUNCATE, DELETE and DROP commands.