> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mage.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# DuckDB

> Execute SQL commands in DuckDB.

![](https://miro.medium.com/v2/resize:fit:1400/format:webp/0*Qcgc4cmJk5lFGBwi.png)

## Credentials

Open the file named `io_config.yaml` at the root of your Mage project and enter DuckDB database name:

```yaml theme={"system"}
version: 0.1.1
default:
  DUCKDB_DATABASE: database
  DUCKDB_SCHEMA: main
```

## How to use

1. Create a new pipeline or edit an existing pipeline.

2. Add a data loader or transformer SQL block.

3. In the block’s header, click the dropdown menu labeled <b>Connection</b> and select the option
   labeled <b>DuckDB</b>.

4. In the block’s header, click the dropdown menu labeled <b>Profile</b> and select the option
   labeled <b>default</b>.

   <Note>
     If the name of your profile in the `io_config.yaml` file is different,
     then select the profile name that matches your settings.
   </Note>

5. You can optionally check the box labeled <b>Use raw SQL</b>.
   If you do, read more about [how to use SQL blocks with raw SQL](/guides/blocks/sql-blocks#using-raw-sql).

6. Write your SQL statements in the SQL block.

7. Once you’re finished writing your SQL statements,
   click the play button in the top right corner of the block to execute the SQL block and preview
   the results.
