MySQL CREATE DATABASE Statement

Table of Contents

CREATE DATABASE Example

The following SQL statement creates a database called "pttc_testDB":

Example 1

CREATE DATABASE pttc_testDB;

Tip: Make sure you have admin privilege before creating any database. Once a database is created, you can check it in the list of databases with the following SQL command: SHOW DATABASES;

SHOW DATABASES;

DROP DATABASE Example

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

The following SQL statement drops the existing database "pttc_testDB":

Example 1

DROP DATABASE pttc_testDB;

Document

Document in project

You can Download PDF file.

Refference