MySQL CREATE & DROP DATABASE Statement

In order to create any database we need to use CREATE DATABASE statement.

Create Database

Syntax for Creating Database

CREATE DATABASE database_name;

Example

CREATE DATABASE payrollDB;

Drop Database

Syntax for Dropping Database

DROP DATABASE database_name;

Example

DROP DATABASE payrollDB;

Deleting a database results in dropping all the tables, triggers, stored procedures etc in that database. So always be careful while dropping a database.


Most Read