i2tutorials

MySQL – TRUNCATE Table

MySQL – TRUNCATE Table

 

MySQL - TRUNCATE Table

TRUNCATE removes the entire data without affecting its structure. Typically, it is part of a DDL (data definition language) command. Generally, we use this command to delete entire data from a table without removing the table structure.

Syntax:

TRUNCATE TABLE table_name; 

TABLE is actually an optional keyword:

TRUNCATE table_name;

When using the TRUNCATE command, it is important to consider the following points:

Example:

TRUNCATE employees;

Exit mobile version