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

# Queries on Local Files

In the [chDB](https://docs.dbpilot.io/connect-chdb.md) and [DuckDB](https://docs.dbpilot.io/connect-duckdb.md) databases, you can easily query local files with SQL. You can query CSV, JSON, Parquet & [more](#learn-more).

Drag-and-drop a file into the SQL query editor, and run queries on the file right away. This is great for quick ad-hoc queries.

If you don't want to write queries by hand, consider to instead [attach the file as a source](./attach-source) (currently possible with chDB connections only). This allows you to use the [AI Assistant](https://docs.dbpilot.io/ai-assistant.md) and the [data explorer UI](https://docs.dbpilot.io/explore-data.md) for your file.

***

When you drag-and-drop a file into an empty query editor, the editor will be populated with a default query to select from your file:

<video src="https://mintcdn.com/dbpilot/UnBUT0ULD6-LsMkn/resources/drag-file-default-query.mp4?fit=max&auto=format&n=UnBUT0ULD6-LsMkn&q=85&s=ed303974151f5d3baba7395a9d3f50c7" playsInline muted controls autoPlay loop />

Alternatively, if the editor is not empty, only the file's identifier will be inserted at the cursor position:

<video src="https://mintcdn.com/dbpilot/UnBUT0ULD6-LsMkn/resources/drag-file-existing-query.mp4?fit=max&auto=format&n=UnBUT0ULD6-LsMkn&q=85&s=0177d46704ee02e7ad9cdd91efa7ee2f" playsInline muted controls autoPlay loop />

## Learn More

To learn more on how to query files with chDB/ClickHouse, or with DuckDB:

* See the [documentation of ClickHouse's `file()` function](https://clickhouse.com/docs/en/sql-reference/table-functions/file)
* Or see DuckDB's documentation: [CSV](https://duckdb.org/docs/archive/0.9.1/data/csv/overview.html), [JSON](https://duckdb.org/docs/archive/0.9.1/data/json/overview), [Parquet](https://duckdb.org/docs/archive/0.9.1/data/parquet/overview), [Excel](https://duckdb.org/docs/archive/0.9.1/guides/import/excel_import)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.