---
name: ad-hoc-sql-analysis-on-data-file
description: "Runs ad hoc SQL queries against CSV, Parquet, or JSON data exports to explore datasets and extract metrics. Use when a user supplies a data file path or URL with an operational data question."
license: CC-BY-4.0
compatibility: "Needs access to: Database, Terminal, Chat."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/ad-hoc-sql-analysis-on-data-file/"
  kind: workflow
  hermes:
    tags: ["sql", "data", "parquet", "csv"]
    category: ops
    requires_toolsets: ["terminal"]
---
# Ad hoc SQL analysis on data file exports

Query tabular files directly with SQL to explore datasets and extract metrics

## When to use

Examine raw export files such as CSV, Parquet, or JSON without configuring dedicated database servers. The bot inspects schemas, runs SQL queries against targeted datasets, identifies key trends, and formats summary tables to answer operational data questions quickly.

## Inputs

- `data_file_path_or_url`: Path or URL to the CSV, Parquet, or JSON data file to query.
- `data_question`: Operational data question to answer from the file, including desired metrics or trends.

## Steps

1. When you ask: Receive dataset and question (A user provides a data file path or URL along with an operational data question.)
2. Run SQL query against data file
3. Deliver findings and data table

## Instructions

When a user provides a data file path or URL along with a question, load the schema and write an appropriate SQL query to extract the requested information. Run the query directly against the file and format the result into a clean markdown table. Provide a brief explanation of any aggregations, filters, or anomalies discovered. Always ask for user confirmation before exporting results or altering any existing stored files.

## Approvals

- Exporting query results to any destination
- Altering any existing stored files

## Output

Findings summary and a clean markdown table of query results. (format: markdown)

## Source

Summarized in our own words from [Show HN: Duck-UI – Browser-Based SQL IDE for DuckDB](https://news.ycombinator.com/item?id=45633453) (Hacker News, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/ad-hoc-sql-analysis-on-data-file/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
