ClickHouse/docs/en/sql-reference/statements/create/database.md
Ivan Blinkov 258d2fd499
[docs] split various kinds of CREATE queries into separate articles (#12328)
* normalize

* split & adjust links

* re-normalize

* adjust ru links

* adjust ja/tr links

* partially apply e0d19d2aea

* reset contribs
2020-07-09 18:10:35 +03:00

996 B
Raw Blame History

toc_priority toc_title
1 DATABASE

CREATE DATABASE

Creates a new database.

CREATE DATABASE [IF NOT EXISTS] db_name [ON CLUSTER cluster] [ENGINE = engine(...)]

Clauses

IF NOT EXISTS

If the db_name database already exists, then ClickHouse doesnt create a new database and:

  • Doesnt throw an exception if clause is specified.
  • Throws an exception if clause isnt specified.

ON CLUSTER

ClickHouse creates the db_name database on all the servers of a specified cluster. More details in a Distributed DDL article.

ENGINE

MySQL allows you to retrieve data from the remote MySQL server. By default, ClickHouse uses its own database engine. Theres also a lazy engine.