SQL DROP TABLE Statement

In this post, you will get a drop table and truncate table SQL commands.

The SQL DROP TABLE Statement

The DROP TABLE statement is used to drop an existing table in a database.

Syntax

DROP TABLE table_name;

SQL DROP TABLE Example

The following SQL statement drops the existing table "users":

Example

DROP TABLE users;

SQL TRUNCATE TABLE

The TRUNCATE TABLE statement is used to delete the data inside a table, but not the table itself.

Syntax

TRUNCATE TABLE table_name;

Example

TRUNCATE TABLE users;



Comments