Create a SQL database

SQL CREATE DATABASE statement is a DDL  SQL statement , CREATE DATABASE statement to create a database. After creating the database, we can create several other database objects (tables, views, procedures, etc.) in them. Users should have created a database administrator privileges.

SQL CREATE DATABASE syntax

CREATE DATABASE database_name [COLLATE collation_name ] 
SQL

In the above query,

  • Database_name- name of the database is to be created
  • collation_name- is the default database collation (character set). collation_name This is an optional field, if not provided, the collation of the database will be assigned to the default.

SQL CREATE DATABASE example

If you want to create a database geekdocscom default collation, the statement would be similar

CREATE DATABASE geekdocscom; 
SQL

If you want to use collation  Latin General create the database MyOtherDatabase, the statement is:

CREATE DATABASE MyOtherDatabase COLLATE Latin1_General_CP1_CI_AS; 
SQL

To delete a database can read Geeks tutorial of SQL database deleted .

Guess you like

Origin www.cnblogs.com/numpycomcn/p/11790239.html