# CSV
> CSV is a simple text format for tabular data. DuckDB can read CSV files from local paths, HTTPS URLs, and supported cloud storage locations, then load the results into MotherDuck tables.
## How it works with MotherDuck

1. Connect to MotherDuck from the DuckDB CLI, Python, or another DuckDB client.
2. Use DuckDB's CSV reader to inspect local files, HTTPS URLs, or cloud storage paths.
3. Create a MotherDuck table from the file when you want durable storage, sharing, or repeated queries.

## Example

```sql
CREATE TABLE my_table AS
SELECT *
FROM read_csv('data.csv');
```

## Remote CSV files

CSV files available over HTTPS or cloud storage can be queried server side in MotherDuck:

```sql
CREATE OR REPLACE TABLE my_database.main.remote_csv AS
SELECT *
FROM read_csv(
    'https://example.com/path/to/file.csv',
    MD_RUN = REMOTE
);
```

For non-local `https://`, `s3://`, `gcs://`, `r2://`, and Azure URLs, MotherDuck uses remote execution by default. `MD_RUN = REMOTE` makes that explicit. See the [MD_RUN parameter](/sql-reference/motherduck-sql-reference/md-run-parameter/) for details.

## Google Sheets CSV exports

Public Google Sheets can be queried as CSV by using the `/export?format=csv` URL:

```sql
SELECT *
FROM read_csv(
    'https://docs.google.com/spreadsheets/d/<sheet_id>/export?format=csv&gid=<tab_id>',
    MD_RUN = REMOTE
);
```

For private sheets, configure HTTP authentication with a DuckDB `HTTP` secret. See the [Google Sheets integration](/integrations/file-formats/google-sheets/) for the full workflow.

## Related content

- [DuckDB CSV documentation](https://duckdb.org/docs/current/data/csv/overview.html)
- [Loading data into MotherDuck](/key-tasks/loading-data-into-motherduck/)
- [MotherDuck cloud storage integrations](/integrations/cloud-storage/)
- [Google Sheets integration](/integrations/file-formats/google-sheets/)


---

## 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/file-formats/csv/",
  "page_title": "CSV",
  "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.
