What is DROP Command in SQL?
DROP is a Data Definition Language (DDL) command which removes the named elements of the schema like relations, domains, or constraints and you can also remove an entire schema using the DROP command.
Syntax
DROP SCHEMA schema_name RESTRICT;
DROP Table table_name CASCADE;
Example:
DROP TABLE Customer;
DROP DATABASE
Drop Database is used to remove the existing SQL Database from the Server.
Syntax
DROP DATABASE NAME_OF_DATABASE;
DROP COLUMN
The Drop Column is used to remove the existing SQL column from the database.
Syntax
ALTER TABLE table_nameDrop COLUMN column_name;
DROP INDEX
Drop Index is used to remove the index in a table.
Syntax
DROP INDEX IF EXISTS index_name
ON table_name;
Difference between DELETE and DROP in SQL
Delete and Drop commands both are used to remove the data from the database but the Delete command is used to remove some or all the tuples from a relation and the Drop command is used to remove the named elements of the schema like relations, domains and it also removes entire data from the database. Let’s start with DELETE Command first.