Check out example codes for "how to drop a database in sql server when it is in use". It will help you in understanding the concepts better.

Code Example 1

BY LOVE SINGH

USE master;
GO
ALTER DATABASE OnlineRestaurant2 
SET SINGLE_USER 
WITH ROLLBACK IMMEDIATE;
GO
DROP DATABASE OnlineRestaurant2;

Code Example 2

DROP DATABASE databasename;

Learn ReactJs, React Native from akashmittal.com