---
sidebar_position: 1
title: Basics database operations
description: Create, list, and drop MotherDuck databases using SQL commands.
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

While embedded DuckDB uses files on your local filesystem to represent databases, MotherDuck implements SQL syntax for creating, listing and dropping databases.

## Create database

<Tabs>
<TabItem value="SQL" label="SQL">

```sql
-- [OR REPLACE] and [IF NOT EXISTS] are optional modifiers.
CREATE [OR REPLACE | IF NOT EXISTS] DATABASE <database name>;
USE <database name>;
```

</TabItem>
</Tabs>

Creating copies of databases in MotherDuck in this manner is a metadata-only operation that copies no data. Learn more in the [`CREATE DATABASE`](/sql-reference/motherduck-sql-reference/create-database/) overview documentation.

## Listing databases

<Tabs>
<TabItem value="SQL" label="SQL">

```sql
-- returns all connected local and remote databases 
SHOW DATABASES;
-- returns current database    
SELECT current_database(); 
```

</TabItem>
</Tabs>

Learn more in the [`SHOW ALL DATABASES`](/sql-reference/motherduck-sql-reference/show-databases/) overview documentation.

## Delete database

<Tabs>
<TabItem value="SQL" label="SQL">

```sql
USE <database name>;
DROP DATABASE <database name>;
```

Example usage:

```sql
> SHOW DATABASES;
test01

-- Let's put two different t1  tables into into two different databases
> CREATE TABLE dbname.t1 AS (SELECT range AS r FROM range(12));
> SELECT * FROM t1;

-- now for the other database
> CREATE DATABASE test02;
> CREATE TABLE test02.t1 AS (SELECT 'test02' AS dbname)

-- show the databases we've created
> SHOW DATABASES;
test01
test02
```

</TabItem>
</Tabs>

Learn more in the [`DROP DATABASE`](/sql-reference/motherduck-sql-reference/show-databases/) overview documentation.


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `POST https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

Payload:

```json
{
  "page_path": "/key-tasks/database-operations/basics-operations/",
  "page_title": "Basics database operations",
  "text": "<the user's feedback, max 2000 characters>",
  "source": "<optional identifier for your interface, for example 'claude.ai' or 'chatgpt'>"
}
```

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed payloads, and `429` when rate-limited.
