titlesidebar_labeldescription
TRUNCATE TABLE keyword
TRUNCATE TABLE
TRUNCATE SQL keyword reference documentation.

TRUNCATE TABLE is used to permanently delete the contents of a table without deleting the table itself.

:::caution

This command irremediably deletes the data in the target table. In doubt, make sure you have created backups of your data.

:::

Syntax

  1. TRUNCATE TABLE 'table_name';

Examples

  1. TRUNCATE TABLE ratings;

:::note

To delete both the data and the table structure, use DROP.

:::