SQL语法基础之DROP语句
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
一.查看DROP帮助信息
mysql> ? DROP Many help items for your request exist. To make a more specific request, please type 'help <item>', where <item> is one of the following topics: ALTER TABLE DEALLOCATE PREPARE DROP DATABASE DROP EVENT DROP FUNCTION DROP FUNCTION UDF DROP INDEX DROP PROCEDURE DROP RESOURCE GROUP DROP ROLE DROP SERVER DROP SPATIAL REFERENCE SYSTEM DROP TABLE DROP TABLESPACE DROP TRIGGER DROP USER DROP VIEW mysql> mysql>
二.DROP DATABASE
DROP DATABASE语句用来删除数据库操作,即删除了数据库也删除数据库里的所有表。
1>.查看DROP DATABASE的帮助信息
mysql> ? DROP DATABASE Name: 'DROP DATABASE' Description: Syntax: DROP {DATABASE | SCHEMA} [IF EXISTS] db_name DROP DATABASE drops all tables in the database and deletes the database. Be very careful with this statement! To use DROP DATABASE, you need the DROP privilege on the database. DROP SCHEMA is a synonym for DROP DATABASE. *Important*: When a database is dropped, privileges granted specifically for the database are not automatically dropped. They must be dropped manually. See [HELP GRANT]. IF EXISTS is used to prevent an error from occurring if the database does not exist. URL: http://dev.mysql.com/doc/refman/8.0/en/drop-database.html mysql>