SQL Create Database – SQL TUTORIAL | Software Testing Material

SQL Create Database:

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

Syntax:

1
CREATE DATABASE databasename;

Note: Always database name should be unique within the RDBMS.

Also Read:  SQL Create Table

Example:

I am creating a Database say TestDB

Note: Make sure you have admin privilege before creating any database.

1
CREATE DATABASE TestDB

To see the list of databases, use the following syntax. We see list of Select Queries in other post in detail.

1
SELECT NAME FROM MASTER.DBO.SYSDATABASES;

We have created a Database named ‘TestDB’. In the below image, we could find the list of Databases based on the above query. In the list of Databases, we could find the database ‘TestDB’ which we have created.

In the next tutorial, we will see How To Create A Table In SQL

Check out the complete SQL Tutorial by clicking on below link:

SQL Tutorial – Complete