By using the DROP statement, you can easily delete indexes, tables, and databases.
SQL DROP INDEX Statement
We can use the DROP Index command to delete the index in the table.
Syntax for Microsoft Sqljet (and Microsoft Access):
DROP INDEX index_name on table_name
Syntax for MS SQL Server:
DROP INDEX Table_name.index_name
For IBM DB2 and Oracle syntax:
DROP INDEX index_name
Syntax for MySQL:
ALTER TABLE table_name DROP INDEX index_name
SQL DROP TABLE Statement
The DROP TABLE statement is used to delete tables (the structure, properties, and indexes of the table are also deleted):
DROP Table Name
SQL DROP DATABASE Statement
The DROP DATABASE statement is used to delete databases:
DROP database name
SQL TRUNCATE TABLE Statement
If we just need to get rid of the data in the table, but not delete the table itself, what should we do?
Please use the TRUNCATE Table command (delete only the data in the table):
TRUNCATE Table Name
The drop statement for SQL