data_query
Run a read-only SQL query over registered datasets to filter, group, sum, or count data. Get cited results with row counts and truncation for large outputs.
Instructions
Run one read-only SQL query (DuckDB dialect) over the registered datasets.
Allowed: SELECT / WITH / DESCRIBE / SUMMARIZE / EXPLAIN / PIVOT, one
statement; anything that writes or reads files directly is rejected.
Refer to datasets by name: SELECT region, SUM(amount) AS total FROM sales
GROUP BY region ORDER BY total DESC. Let SQL do the counting and
summing - do not add up returned rows yourself.
Returns {id, cite, columns, rows (at most limit, default 50, max 1000),
row_count (rows returned), total_rows (rows the query produced),
truncated}. Long text cells are cut at 500 characters. Call
data_describe first if you have not seen the schema.
Keywords: query the data, SQL, filter rows, group by, total of, sum of, average of, count, top 10, consultar los datos, filtrar, agrupar por, total de, suma de, media de, contar, los 10 primeros.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| limit | No |