When you delete the database then all records of the database will be deleted.
Syntax:-
DROP DATABASE databaseName
Example:-
Suppose you have 2 databases school_management and employee_management and you want to delete database school_management then use below command
DROP DATABASE school_management
Now, you can check the remaining database list through below command
SHOW DATABASES
Output:-
employee_management
SQL Drop Database – Interview Questions
Q 1: What does DROP DATABASE do?
Ans: DROP DATABASE permanently deletes a database along with all its tables and data.
Q 2: What is the syntax for DROP DATABASE?
Ans: DROP DATABASE database_name;
Q 3: Is DROP DATABASE reversible?
Ans: No, once executed, the database cannot be recovered unless a backup exists.
Q 4: Can we drop a database conditionally?
Ans: Yes, IF EXISTS can be used to avoid errors.
Q 5: Who can drop a database?
Ans: Only users with sufficient administrative privileges can drop databases.
SQL Drop Database – Objective Questions (MCQs)
Q1. Which command is used to delete a database permanently?
Q2. What does the DROP DATABASE command do?
Q3. DROP DATABASE is an example of:
Q4. Which keyword prevents error if the database does not exist?
Q5. Can a dropped database be recovered easily?