0% found this document useful (0 votes)
118 views

SQL5

The SQL CREATE DATABASE statement is used to create a new SQL database. It has a basic syntax of CREATE DATABASE DatabaseName; with the database name needing to be unique. An example shows creating a database called testDB using CREATE DATABASE testDB; and then checking it exists in the list of databases shown using SHOW DATABASES.

Uploaded by

jeffa123
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views

SQL5

The SQL CREATE DATABASE statement is used to create a new SQL database. It has a basic syntax of CREATE DATABASE DatabaseName; with the database name needing to be unique. An example shows creating a database called testDB using CREATE DATABASE testDB; and then checking it exists in the list of databases shown using SHOW DATABASES.

Uploaded by

jeffa123
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

The SQL 

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

Syntax
The basic syntax of this CREATE DATABASE statement is as follows −
CREATE DATABASE DatabaseName;
Always the database name should be unique within the RDBMS.

Example
If you want to create a new database <testDB>, then the CREATE DATABASE statement
would be as shown below −
SQL> CREATE DATABASE testDB;

Make sure you have the 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)
 Previous Page  Print Page
Next Page  
Advertisements
The SQL CREATE DATABASE statement is used to create a new SQL database.

Syntax
The basic syntax of this CREATE DATABASE statement is as follows −
CREATE DATABASE DatabaseName;
Always the database name should be unique within the RDBMS.

Example
If you want to create a new database <testDB>, then the CREATE DATABASE statement
would be as shown below −
SQL> CREATE DATABASE testDB;

Make sure you have the 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)
 Previous Page  Print Page
Next Page  
Advertisements

You might also like