SQL Drop Table

SQL DROP TABLE statement is used to delete (drop) the table. Here is the general form to use DROP TABLE statement in SQL to drop the table from the database:

DROP TABLE table_name;

SQL DROP TABLE Example

As we have already created a table named CUSTOMERS in the previous section, now let's first verify the table CUSTOMERS and then we will delete it from the database:

DESC CUSTOMERS;

It will display the following table info:

SQL drop table

This means that the table CUSTOMERS is available in the database, so let's drop the table CUSTOMERS, with this SQL statement:

DROP TABLE CUSTOMERS;

After querying the above SQL statement, will dropped the table named CUSTOMERS, and will display the result as table dropped:

SQL drop table statement

Now, if you would again try the DESC command, then you would display as follows:

DESC CUSTOMERS;

Since you have dropped the table named CUSTOMERS, so it will display the following result after querying the above SQL statement:

drop table sql

SQL Online Test


« Previous Tutorial Next Tutorial »

Like/Share Us on Facebook 😋