Skip to Content
TheCornerLabs Docs

DROP

In SQL, the DROP statement is used to remove or delete database objects, such as tables, or databases.

Here are a few common uses of the DROP statement:

  1. Drop a table

    You can delete a table in sql by using the drop command.

    DROP TABLE table_name;

    By specifying the name of table you want to delete, this command will delete the table and its associations.

  2. Drop a database

    A database can also be deleted by using the DROP command. All the table of the database will also be deleted.

    DROP DATABASE database_name;

As DROP statement result in the permanent deletion of data and database objects it’s a good practice to double-check and ensure that the object being dropped is indeed the one intended, and that any necessary backups have been made.

Last updated on