# CREATE DATABASE

## Syntax <a href="#synopsis" id="synopsis"></a>

```sql
CREATE DATABASE database_name;
```

## Description <a href="#description" id="description"></a>

Similar to other relational databases, a [database](https://docs.deltastream.io/overview/core-concepts/databases) is a logical grouping of [schemas](https://docs.deltastream.io/overview/core-concepts/databases#_schema) in DeltaStream. Databases are the foundation for organizing data in DeltaStream and provide the building block of its namespacing model.

You can create databases for logical groupings for different teams or projects. For instance, you can create one database for a logging project and another for an ads team.

### Arguments

#### database\_name

Name of the database to create. When a database is created, it automatically includes a `public` schema in the database. If the new database is the only database in the organization, it's set as default automatically. If the name is case sensitive, you must wrap it in double quotes; otherwise the system uses the lowercase name.

{% hint style="warning" %}
**Important** `virtual` is a reserved database name. You cannot create it with this command.
{% endhint %}

## Examples

#### Create a new database

The following shows how to create a new database. As this is the first database you're creating, DeltaStream automatically sets it as the default for the current organization and uses it for the remainder of the session:

```sh
<no-db>/<no-store># CREATE DATABASE demodb;
+------------+---------------+------------+------------------------------------------+
|  Type      |  Name         |  Command   |  Summary                                 |
+============+===============+============+==========================================+
| database   | demodb        | CREATE     | database "demodb" was successfully       |
|            |               |            | created                                  |
+------------+---------------+------------+------------------------------------------+
| schema     | demodb.public | CREATE     | schema "demodb.public" was successfully  |
|            |               |            | created                                  |
+------------+---------------+------------+------------------------------------------+
demodb.public/<no-store># LIST DATABASES;
+-------------+-------------+------------+-------------------------------+
|  Name       |  Is Default |  Owner     |  Created At                   |
+=============+=============+============+===============================+
| demodeb     | true        | sysadmin   | 2024-07-02 21:41:40 +0000 UTC |
+-------------+-------------+------------+-------------------------------+
```

#### Create a new case-sensitive database

The following shows how to create a new database. As this is the first database you're creating, DeltaStream automatically sets it as the default for the user account:

```sh
<no-db>/<no-store># CREATE DATABASE "DemoDB!";
+------------+----------------+------------+------------------------------------------+
|  Type      |  Name          |  Command   |  Summary                                 |
+============+================+============+==========================================+
| database   | DemoDB!        | CREATE     | database "DemoDB!" was successfully      |
|            |                |            | created                                  |
+------------+----------------+------------+------------------------------------------+
| schema     | DemoDB!.public | CREATE     | schema "DemoDB!.public" was              |
|            |                |            | successfully created                     |
+------------+----------------+------------+------------------------------------------+
DemoDB!.public/<no-store># LIST DATABASES;
+------------+-------------+------------+-------------------------------+
|  Name      |  Is Default |  Owner     |  Created At                   |
+============+=============+============+===============================+
+------------+-------------+------------+-------------------------------+
| DemoDB!    | true        | sysadmin   | 2024-07-02 16:24:11 +0000 UTC |
+------------+-------------+------------+-------------------------------+
```
