CREATE DATABASE Examples

Let’s look at examples of how to create a database in SQL and how to verify database creation by listing databases in the server.

Creating Your First SQL Database

To create a new database in SQL we use the CREATE DATABASE command and then we mention the name of the database. Note that blank spaces are not allowed in the name of the database, we can only use underscore (_). 

As an example, we will create a new database with the name “w3wiki”.

SQL Query:

CREATE DATABASE w3wiki;

Output

Creating a new database

Database Successfully Created!!

SQL CREATE DATABASE

SQL CREATE DATABASE statement creates a new database in SQL-based DBMS.

Similar Reads

CREATE DATABASE in SQL

The CREATE DATABASE query in SQL is used to create a new database in the database management system. It is also used in MySQL and other relational database management systems (RDBMS) to create databases....

Syntax

The syntax to use the CREATE DATABASE command in SQL is:...

CREATE DATABASE Examples

Let’s look at examples of how to create a database in SQL and how to verify database creation by listing databases in the server....

List Databases in SQL

Now we will verify whether the new database that we have just created has been successfully added to our system or not....

USE Database in SQL

To use a specific database in SQL, we use the USE Statement....

Important Points About SQL CREATE DATABASE

A CREATE DATABASE statement is used to create a database. A database consists of tables and inside the tables, we store the data. The database name is case-insensitive, so we need to create a unique database name. Keep the limit of database names to 128 characters....

Contact Us