SQL DROP command is used to delete database objects, such as tables, views, indexes, constraints or procedures. The syntax is: DROP [object type] object name. Where the object type can be DATABASE, VIEW, INDEX, CONSTRAINT, PROCEDURE, or FUNCTION, and the object name is the name of the object to be deleted. This command permanently deletes the object, so use it with caution.
DROP command in SQL
Purpose:Delete database objects, such as tables and views , index, constraint or procedure.
Syntax:
<code class="sql">DROP [DATABASE | VIEW | INDEX | CONSTRAINT | PROCEDURE | FUNCTION] object_name;</code>
Parameters:
Usage:
The DROP command is used to permanently delete database objects. Use this command with caution because once deleted, it cannot be restored.
Example:
DROP TABLE table_name;
DROP VIEW view_name;
DROP INDEX index_name;
DROP CONSTRAINT constraint_name;
DROP PROCEDURE procedure_name;
Note:
The above is the detailed content of How to use drop in sql. For more information, please follow other related articles on the PHP Chinese website!