Removing Tables – DROP Command
Tables can be dropped the similar way they are created. DROP command drops the data and the structure is permanently erased from the database.
Syntax:
Drop table <tablename>;
Example:
DROP TABLE Employee;
This command displays the message “Table Dropped” and removes the structure along with the rows from the database.
Using the TRUNCATE command
A like the DROP command the TRUNCATE command deletes all the records and does not remove the structure.
Syntax:
Truncate table <tablename>;
Example:
TRUNCATE TABLE employee;
All the records in the employee table are deleted with its structure available in the database. It will display “Table Truncated”.