# Datalab
> Interactive data science platform for exploring and analyzing data with MotherDuck. It integrates with MotherDuck for notebooks, assistants, and AI-powered analysis workflows.
## How it works with MotherDuck

DataLab connects to MotherDuck from a workbook so SQL cells can query MotherDuck data directly.

## Prerequisites

- A DataLab workbook.
- A MotherDuck service token.
- Optional: a default MotherDuck database name for the connection.

## Setup

1. In MotherDuck, create or copy a service token.
2. In DataLab, open a workbook.
3. Select **View** > **Databases**.
4. Select the **+** icon and choose **MotherDuck**.
5. Enter a connection name, paste the service token, and optionally enter a database name.
6. Connect the data source.

![DataLab MotherDuck connection dialog with service token and optional database name fields](../img/datalab-motherduck-connection.png)

## Authentication and configuration

- The service token is required.
- The database name is optional. When set, DataLab connects to that database by default, but other accessible databases can still be queried.
- If your environment requires network allowlisting, use the DataCamp IP addresses shown in the DataLab connection dialog.

## Important notes

- Store the token only in the DataLab connection configuration.
- Use SQL cells to query the connected MotherDuck source after setup.

## Use cases

- Explore MotherDuck tables in notebook-style analysis.
- Combine SQL query results with Python or chart cells in DataLab.
- Share a workbook that uses a managed MotherDuck data connection.

## Related content

- [View the full DataLab MotherDuck setup guide](https://datalab-docs.datacamp.com/connect-to-data/motherduck)
- [MotherDuck Python overview](/integrations/language-apis-and-drivers/python/python-overview)
- [MotherDuck authentication](/key-tasks/authenticating-and-connecting-to-motherduck/authenticating-to-motherduck)


---

## 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": "/integrations/data-science-ai/datalab/",
  "page_title": "Datalab",
  "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.
