Sunday, March 31, 2019

DROP | DDL Commands | Drop Command In SQL

DROP Command

SQL Drop command used to remove a table definition and all the data, indexes, triggers, constraints and permission specifications for that table.

Drop command is used to delete table structure as well as all of table data.

If you may use SQL DROP command, You should be very careful. Because, once a table is deleted then all the information available in that table will also be lost forever. In other words we can say that we didn't rollback this data.

In short, DDL commands are auto-committed that means it permanently save all the changes in the database.

We didn't drop entire row. Because, this command is used only for drop whole table (table data and table structure )  or database.

Syntax :

DROP TABLE table_name ;

In DROP command there is one parameter :

1) table_name -This parameter specifies the name of table.

Drop Table SQL

Example :

// Drop Customer01 table

DROP TABLE Customer01;

Above example, may Drop Table SQL Server

SQL DROP All Tables

If we want to delete or drop all tables from database, we can delete whole database from SQL Server.

Syntax : 

DROP DATABASE database_name;

Example :

// Drop Student database


* * * * * * * * * * * * * * * * *

In Easy Language (Simplify)

DROP command used to remove table definition and table data.

Previous Post
Next Post

post written by: