Remove a table and all its data.
Permanently removes a table and all its data, triggering any associated triggers and constraints. Irreversible. Use CASCADE with caution -- it drops dependent objects too. Prefer soft deletes (is_deleted flag) if you need auditability.
| Database System | Support Status | Since Version | Notes |
|---|---|---|---|
| MySQL | ✓ Supported | all | CASCADE available |
| PostgreSQL | ✓ Supported | all | CASCADE / RESTRICT |
| SQL Server | ✓ Supported | all | IF EXISTS in 2016+ |
| Oracle | ✓ Supported | all | PURGE option |
| SQLite | ✓ Supported | all | IF EXISTS |
DDL to remove a table.
CASCADE available
CASCADE / RESTRICT
IF EXISTS in 2016+
PURGE option
IF EXISTS