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

SQL Create Database Statement

The CREATE DATABASE statement is used to create a database by specifying its name. After creation, database objects like tables and views can be added. The user must have admin privileges to create a database. The statement syntax specifies an optional collation name to set the character set, with the default used if none is provided. Examples show creating a database with the default collation or explicitly setting the "Latin General" collation.

Uploaded by

venniiii
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

SQL Create Database Statement

The CREATE DATABASE statement is used to create a database by specifying its name. After creation, database objects like tables and views can be added. The user must have admin privileges to create a database. The statement syntax specifies an optional collation name to set the character set, with the default used if none is provided. Examples show creating a database with the default collation or explicitly setting the "Latin General" collation.

Uploaded by

venniiii
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

The CREATE DATABASE Statement is used to create a database.

After creating a database, we can create several other database objects (tables, views, procedures etc.) into it. The user should have admin privileges for creating database.:

SQL CREATE DATABASE Statement:


CREATE DATABASE database_name

[COLLATE collation_name ]
In the above query, - database_name - is the name of the database to be created - collation_name - is the default collation (character set) for the database. This, collation_name, is an optional field and if not provided then Default Collation is assigned to database.

CREATE DATABASE Example:



If you want to create database MyDatabase with default collation, the statement would be like

CREATE DATABASE MyDatabase ;


If you want to create database MyOtherDatabase with collation Latin General then statement would be like

CREATE DATABASE MyOtherDatabase COLLATE Latin1_General_CP1_CI_AS;

You might also like