SQL CREATE DATABASE Statement

The CREATE DATABASE command in SQL is used to create a new, empty database. This is a fundamental step in setting up a database system.



CREATE DATABASE: Definition and Usage

Before you can start creating tables and storing data, you need to create a database to hold that data. The CREATE DATABASE command is how you do this. You will need administrator or equivalent privileges to create a database.

Syntax

Syntax

CREATE DATABASE database_name;
      

Example

Creating a Database

This example creates a database named "testDB".

Syntax

CREATE DATABASE testDB;
      
Output

A new, empty database named "testDB" is created. You can verify this by using the command SHOW DATABASES; (in MySQL) or a similar command for your specific database system to list all existing databases.


**Important Note:** You need appropriate database administration privileges to create a new database. The exact syntax and commands for managing databases might vary slightly depending on your specific database system (MySQL, PostgreSQL, SQL Server, etc.). Always consult your database system's documentation.