DROP DATABASE IF EXISTS code example
Example 1: mysql drop database if exists
DROP DATABASE IF EXISTS database_name;
Example 2: how to drop a database in sql server when it is in use
BY LOVE SINGH
USE master;
GO
ALTER DATABASE OnlineRestaurant2
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
DROP DATABASE OnlineRestaurant2;
Example 3: drop table if exists
DROP TABLE IF EXISTS dbo.Scores
Example 4: mysql drop database
DROP DATABASE ma_base
Example 5: mysql database drop
mysql -e "DROP DATABASE db_name;"