1BY LOVE SINGH
2
3USE master;
4GO
5ALTER DATABASE OnlineRestaurant2
6SET SINGLE_USER
7WITH ROLLBACK IMMEDIATE;
8GO
9DROP DATABASE OnlineRestaurant2;
10
1The DROP DATABASE statement drops all tables in the database and deletes the database permanently. Therefore, you should be very careful when using this statement.
2
3The following shows the syntax of the DROP DATABASE statement:
4
5DROP DATABASE [IF EXISTS] database_name;
6
7
8
9In MySQL, the schema is the synonym for the database, therefore, you can use them interchangeably:
10
11DROP SCHEMA [IF EXISTS] database_name;
1Deletes the entire database.
2Example: Deletes a database named ‘websitesetup’.
3DROP DATABASE websitesetup;