W3Schools Learner's Blog

w3Schools programming knowledge summary website

div

1/03/2018

SQL Drop DataBase

SQL Drop DataBase

The DROP DATABASE Statement is used to drop or delete a database. Dropping of the database will drop all database objects (tables, views, procedures etc.) inside it. The user should have admin privileges for deleting a database.
The DROP statement cannot be rollback.

Syntax for the DROP DATABASE Statement is:

DROP DATABASE database_name;
In the above query,
database_name - is the name of the database to be dropped

DROP DATABASE Example:

  • If you want to drop database MyDatabase, the statement would be like
  • DROP DATABASE MyDatabase ;

DROP STATEMENT CAUTION

DROP is a powerful statement. A backup of data for a database to be deleted or drop is a the best quick cheap recovery solution. So be smart with this statement!
To use DROP DATABASE, one needs to have the DROP privilege on the database.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.