---
sidebar_position: 5
title: Writing Data to Amazon S3
description: Export data from MotherDuck to Amazon S3 or transform S3 files in place.
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

You can use MotherDuck to transform files on Amazon S3 or export data from MotherDuck to Amazon S3.

:::note
MotherDuck supports several cloud storage providers, including [Azure](/integrations/cloud-storage/azure-blob-storage.mdx), [Google Cloud](/integrations/cloud-storage/google-cloud-storage.mdx) and [Cloudflare R2](/integrations/cloud-storage/cloudflare-r2).
:::

MotherDuck supports the [DuckDB dialect](https://duckdb.org/docs/guides/import/s3_export) to write data to Amazon S3. The examples here write data in Parquet format, for more options refer to the [documentation for DuckDB's COPY command](https://duckdb.org/docs/stable/sql/statements/copy.html).

## Syntax

```sql
COPY <table name> TO 's3://<bucket>/[<path>]/<file name>';
```

## Example usage

```sql
-- write entire ducks_table table to parquet file in S3
COPY ducks_table to 's3://ducks_bucket/ducks.parquet';

-- writing the output of a query will also work
COPY (SELECT * FROM ducks_table LIMIT 100) to 's3://ducks_bucket/ducks_head.parquet';
```
