SQL CREATE DATABASE

SQL CREATE DATABASE

The CREATE DATABASE statement is used to create a new SQL database.

Note: You need the appropriate administrative rights to execute this command.


Syntax

The basic syntax is straightforward:

CREATE DATABASE database_name;

Example

The following SQL statement creates a new database called "TestDB":

CREATE DATABASE TestDB;

Once the database is created, you can see it in the list of databases on your database server. Your next step would be to select it with the USE TestDB; command (in systems like MySQL or SQL Server) and start creating tables inside it.