Name
DROP
Synopsis
DROP INDEXname
DROP TABLEname
DROP SEQUENCE FROMtable
Permanently remove a table, index, or sequence from the mSQL system.
Warning
DROP
is by far the most dangerous SQL statement.
If you have drop privileges, you may permanently erase a table or
even an entire database. This is done without warning or
confirmation. The only way to undo a DROP
is to
restore the table or database from backups. The lessons to be learned
here are (1) always keep backups and (2) don’t use
DROP
unless you are really sure.
Examples
# Delete the tables 'oh_no' DROP TABLE oh_no # Remove the named index 'my_index' DROP INDEX my_index # Erase the sequence defined on the table 'counter'. Another sequence can be # recreated at any time using the 'CREATE SEQUENCE' statement. DROP SEQUENCE FROM counter
Get MySQL and mSQL now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.