bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/SQL/SQL Database
SQL•SQL Database

SQL DROP DATABASE Statement

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind SQL DROP DATABASE Statement?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___ DATABASE
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The DROP DATABASE statement is used to permanently delete an existing SQL database.
DROP DATABASE Example
The SQL DROP DATABASE Statement

The SQL DROP DATABASE Statement

The DROP DATABASE statement is used to permanently delete an existing SQL database.

Note

Be careful before dropping a database! Dropping a database deletes the database and all its content (tables, views, stored procedures, and data)!

Syntax

DROP DATABASE
databasename
;

Tip

You need administrative privileges to drop a database.

DROP DATABASE Example

The following SQL statement drops an existing database named "testDB":

Example

DROP DATABASE testDB;

Tip

Once a database is dropped, you can check that it is removed from the list of databases with: SHOW DATABASES; (MySQL) or SELECT name FROM sys.databases; (SQL Server).

Previous

SQL CREATE DATABASE Statement

Next

SQL BACKUP DATABASE Statement