Wednesday , 20 January 2021
Stackode
Home > MySql > Create Database – SQL

Create Database – SQL

Create Database – SQL statement is used to create new SQL database.

Syntax:

Basic syntax of CREATE DATABASE statement is as follows:

CREATE DATABASE DatabaseName;

Always database name should be unique within the RDBMS.

Example:

If you want to create new database <testDB>, then CREATE DATABASE statement would be as follows:

SQL> CREATE DATABASE testDB;

Make sure you have admin privilege before creating any database. Once a database is created, you can check it in the list of databases as follows:

SQL> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| AMROOD             |
| TUTORIALSPOINT     |
| mysql              |
| orig               |
| test               |
| testDB             |
+--------------------+
7 rows in set (0.00 sec)

About Whendy

Whendy Blog mengumpulkan beberapa Tutorial Website, PHP, AngularJS, JQuery, Laravel, Codeigniter dan lain-lain. ( jika sempat ) :)

Check Also

Operators – SQL

What is an Operator in SQL? Operators – SQL is a reserved word or a ...

Leave a Reply

Your email address will not be published. Required fields are marked *