SQL DROP Table
This statement is used to DROP OBJECTS in the database. It can be a whole database or just a table, index, or view.
Note: Be careful while dropping a table. Deleting a table will result in loss of all information related to it .
Syntax :
DROP OBJECT "objectName";
object can be
DROP TABLE "tableName";
DROP DATABASE "databaseName";
This statement is used to delete table or database itself..
Parameters :
tableName : Name of the table which we wish to DROP.
databaseName : Name of the database which we wish to DROP.
Examples :
We will be using the same table which we have created using the CREATE TABLE and INSERT STATEMENT.
Using Select to see all the records before drop query runs.
SELECT * FROM `employee`;
DROP TABLE `employee`;
Above query will drop all the data related to table and its structure.
Reffering to Create database statement. We will be using same database name.
DROP DATABASE `tutorialmines`;
Above query will drop the database and all related item of it.