Delete an entire schema and all objects inside it.

Section: constraints and keys

Drop a database

sql
sql
DROP DATABASE IF EXISTS sandbox_db;
Explanation

This is intentionally destructive and should be reserved for controlled environments.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing constraints and keys
Add a unique key
Prevent duplicate values for a column or column pair.
OpenIn sheetsqlsame section
Create a table with a foreign key
Reference a parent table and enforce relational integrity.
OpenIn sheetsqlsame section
Drop a foreign key
Remove a foreign key constraint from a table.
OpenIn sheetsqlsame section
Create a table with a composite primary key
Use multiple columns as the logical primary key.
OpenIn sheetsqlsame section
Drop a table if it exists
Delete a table definition and all rows.
OpenIn sheetsql1 tag match
Create a database
Create a schema if it does not already exist.