DROP TABLE Command

<< Click to Display Table of Contents >>

Navigation:  SQL Reference > SQL Commands >

DROP TABLE Command

Previous pageReturn to chapter overviewNext page

 

DROP TABLE allows you to remove an existing table.

Syntax

DROP TABLE [ IF EXISTS ] [ MEMORY ] table_name

Description

DROP TABLE removes a table. All table data and the table definition are removed, so be careful with this command!

DROP TABLE will not return an error or raise exception if the table doesn't exist.

 

IF EXISTS

Regardless of this keyword specification, the table will not be dropped, if the table doesn't exist and an exception will not be raised.

 

MEMORY

If MEMORY keyword is specified before the table_name then an in-memory table will be removed, not a disk one.

 

table_name

The name of the table to be removed.

 

Example:

DROP TABLE developers;

__________________________
Absolute SQL Reference - 06 February 2021, Niels Knabe