English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Usage and Examples of SQL DROP TABLE and TRUNCATE TABLE Keywords

SQL Keyword Reference

DROP TABLE (Delete Table)

The DROP TABLE command will delete the table from the database.

The following SQL statement deletes the table "Shippers":

  DROP TABLE Shippers;

Note:Be careful before deleting a table. Deleting a table will result in the loss of all information stored in the table!

TRUNCATE TABLE (Clear Table)

The TRUNCATE TABLE command will delete the data in the table but will not delete the table itself.

The following SQL statement clears the table "Categories": 

  TRUNCATE TABLE Categories;

SQL Keyword Reference