# MotherDuck

## Copy your MotherDuck service token

Follow the steps in [this section ](https://motherduck.com/docs/authenticating-to-motherduck#fetching-the-service-token)of the MotherDuck documentation.

## Set up a MotherDuck connection

When inside a workbook, click **View** > **Databases**, then click the **+** icon and follow the on-screen instructions.

<figure><img src="/files/UfqSyYPkFl11ezsB0ycw" alt=""><figcaption></figcaption></figure>

The "Database Name" configuration is optional. If you configure it, the connection will by default connect to that database, but other databases are still accessible.

## Query the database

You can now query your MotherDuck database with a [SQL cell](/work/sql-cell.md). Select it in the **Select source** dropdown in the top left corner of a SQL cell.

<figure><img src="/files/mg3AVyXiBC17Yzq4DLUz" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://datalab-docs.datacamp.com/connect-to-data/motherduck.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
