Drop Table in SQL

Drop-Table  In SQL:- The DROP TABLE statement is used to delete a table definition and all the data from a table.
This statement is also used to remove all the constraints, permissions, indexes, and triggers for that table.
In this DROP TABLE statement once a table is deleted all the information available in the table is lost forever.

Syntax:-

DROP TABLE table_name;

Example:-

Let us take an example:-
First, we will verify the "student" table and then we would delete it from the database.




This means that the table "student" is available in the database. Now let's DROP the table by using the following command:-
Example:-

DROP TABLE student;

Now the table has been dropped from the database. If we want to open that table it will show the error.

"The object 'student' does not exist in database 'test' or is invalid for this operation."

Here TEST is our database which we are using to demonstrate the DROP TABLE Command.



Comments

Popular posts from this blog

ASP.NET Overview

SQL AND ,OR, NOT Operators

SQL Joins