Business question into a checked SQL answer
The agent finds the right tables, writes a query, runs it read-only and sanity-checks the result. It returns the answer with the query, row counts and assumptions. You review it before sharing.
What the agent does
- 1
Read the question.
- 2
Find the tables.
- 3
Write the query.
- 4
Run it read-only.
- 5
Sanity-check the result.
- 6
Explain it with assumptions. → analyst reviews before sharing
Enough to decide?
Similar setup documented- Required input
- No example input written yet
- Example output
- No example output written yet
- Stop condition
- wrong join; show query and row counts
- Reviewer
- Reviewer to be named · About this entry
- Last run
- Not run by us yet
What it costs to run
A rough range per run, from the cheapest to the dearest of the paid models we checked. Your real cost depends on how much text you send.
Checked 2026-11-25 source
$0.002 to $0.48 per run · $0.025 per run with a mid-priced model
- Small, cheap model
- $0.002 per runPer 100 runs: $0.17
- Typical
- $0.025 per runPer 100 runs: $2.52
- Large model
- $0.48 per runPer 100 runs: $48.00
Free tiers and local models can bring this to zero while you test.
How we worked this out
- 6 model calls, one per step (at least 2)
- 4,000 input tokens per call (it reads documents or data)
- 800 output tokens per call
- each call re-reads the earlier outputs
- no retries, no loops, no cached-input discount
- Longer inputs cost more; agents that retry or loop use more calls.
- Free tiers may cover small volumes: see free AI tokens.
- Local models have no per-token price but need your own hardware.
Works with
Tags
Before you start
- Access the agent needs
- database, spreadsheet
- Who approves
- analyst reviews before sharing
- What to log
- every action it proposes and the decision taken
- When to stop
- wrong join; show query and row counts
Why it is worth it
Quick questions from colleagues take an analyst an hour each. A checked first answer, with the query shown, takes minutes to review.
Start this week
- Give the agent read-only access and a short guide to your main tables.
- Ask it the next business question you get, and request the query, row counts and assumptions.
- Check the joins before you share the answer.
Watch out for
A wrong join gives a confident wrong number. Always look at the query.
Measure this
Time from question to answer.
About this entry
Similar setup documented Checked 2026-11-27 Next check 2026-12-25 v2026-11-27.1
What we checked
| Item | Result | Date | By | Source and note |
|---|---|---|---|---|
| Text and steps | Checked | 2026-11-25 | — | — |
| Human checkpoint and risks | Checked | 2026-11-25 | Reviewer to be named | — |
| Workflow run | Not checked yet | — | — | — |
| Cost estimate | Checked | 2026-11-25 | — | source · mid-priced model assumed |
| Tool links | Not checked yet | — | — | — |
| Outside evidence | Checked, with limits | 2026-11-27 | — | — |
Limitations
- An organisation has published a related setup, not this exact workflow. What differs is shown with the evidence.
- Results reported by a vendor or customer are their claims, not our measurements.
- Not checked yet: workflow run, tool links.
Change history
- Evidence label changed: Proposed pattern to Similar setup documented spec v2026-11-27.1
- Long text added: why it is worth it, how to start, what to watch out for, how to measure it spec v2026-11-26.1
- Added to the catalogue spec v2026-11-25.1
Evidence
- Uber · Adjacent pattern Close: an agent picks the relevant tables, writes the SQL and explains it. Differs: the post does not say the query is run read-only and sanity-checked by the agent; users confirm the table list and a validation agent was still planned. No execution or result checking is described as a production step (a validation agent was still planned and hallucination was 'not completely solved'). Limited release. Company's own estimates and survey. · source · 2026-11-27
- LinkedIn · Adjacent pattern Close: SQL Bot finds the right tables, writes the query and self-corrects errors. Differs: the check is a database EXPLAIN, a dry run that plans the query without running it, so there are no row counts. No analyst review step before sharing is described. The check is a dry run (EXPLAIN), not a real run with row counts; no analyst review before results are shared is described. The accuracy figure is from a user survey, not a measurement. Company's own figures. · source · 2026-11-27
Spec versions
- v2026-11-27.1 · Evidence label changed: Proposed pattern to Similar setup documented
- v2026-11-26.1 · Long text added: why it is worth it, how to start, what to watch out for, how to measure it
- v2026-11-25.1 · Added to the catalogue
Run it with AI
Pick the AI you already use.
You are helping data analyst. Goal: Business question into a checked SQL answer. The agent finds the right tables, writes a query, runs it read-only and sanity-checks the result. It returns the answer with the query, row counts and assumptions. You review it before sharing. Work through these steps and show your result for each: 1. Read the question. 2. Find the tables. 3. Write the query. 4. Run it read-only. 5. Sanity-check the result. 6. Explain it with assumptions. Tools or data I can give you: database, spreadsheet. Ask me for anything missing before you start. Do not take any action yourself; stop for my decision where: analyst reviews before sharing. Watch for: wrong join; show query and row counts.
Opens the tool with your prompt already filled in. Review it there before you send.
Copies the prompt, then opens the tool. Paste it in to start.
Nothing happened? The Claude Desktop app (Mac, Windows, or Linux, where it is still in beta) may not be installed. Use the copy button instead.
ROLE: Assistant for data analyst. TASK: Business question into a checked SQL answer. SUMMARY: The agent finds the right tables, writes a query, runs it read-only and sanity-checks the result. It returns the answer with the query, row counts and assumptions. You review it before sharing. PROCEDURE: 1. Read the question. 2. Find the tables. 3. Write the query. 4. Run it read-only. 5. Sanity-check the result. 6. Explain it with assumptions. HUMAN CHECKPOINT: analyst reviews before sharing GUARDRAILS: wrong join; show query and row counts RULES: ask when inputs are missing; never invent facts; cite where each fact came from.
Copies the prompt, then opens the tool. Paste it in to start.
{
"name": "ad-hoc-question-answerer-0038",
"goal": "Business question into a checked SQL answer",
"persona": [
"data-analyst"
],
"autonomy": "supervised",
"tools": [
"database",
"spreadsheet"
],
"plan": [
"Read the question.",
"Find the tables.",
"Write the query.",
"Run it read-only.",
"Sanity-check the result.",
"Explain it with assumptions."
],
"human_in_the_loop": "analyst reviews before sharing",
"guardrails": "wrong join; show query and row counts",
"output": "a draft for human review"
}Copies the prompt, then opens the tool. Paste it in to start.
{
"trigger": "On demand (manual start)",
"steps": [
{
"n": 1,
"do": "Read the question."
},
{
"n": 2,
"do": "Find the tables."
},
{
"n": 3,
"do": "Write the query."
},
{
"n": 4,
"do": "Run it read-only."
},
{
"n": 5,
"do": "Sanity-check the result."
},
{
"n": 6,
"do": "Explain it with assumptions."
}
],
"connects": [
"database",
"spreadsheet"
],
"approval": "analyst reviews before sharing",
"stop_on": "wrong join; show query and row counts"
}Copies the prompt, then opens the tool. Paste it in to start.
{
"name": "ad-hoc-question-answerer-0038",
"goal": "Business question into a checked SQL answer",
"persona": [
"data-analyst"
],
"autonomy": "supervised",
"tools": [
"database",
"spreadsheet"
],
"plan": [
"Read the question.",
"Find the tables.",
"Write the query.",
"Run it read-only.",
"Sanity-check the result.",
"Explain it with assumptions."
],
"human_in_the_loop": "analyst reviews before sharing",
"guardrails": "wrong join; show query and row counts",
"output": "a draft for human review"
}Opens the tool with your prompt already filled in. Review it there before you send.
Copies the prompt, then opens the tool. Paste it in to start.
You are helping data analyst. Goal: Business question into a checked SQL answer. The agent finds the right tables, writes a query, runs it read-only and sanity-checks the result. It returns the answer with the query, row counts and assumptions. You review it before sharing. Work through these steps and show your result for each: 1. Read the question. 2. Find the tables. 3. Write the query. 4. Run it read-only. 5. Sanity-check the result. 6. Explain it with assumptions. Tools or data I can give you: database, spreadsheet. Ask me for anything missing before you start. Do not take any action yourself; stop for my decision where: analyst reviews before sharing. Watch for: wrong join; show query and row counts.
Copies the prompt, then opens the tool. Paste it in to start.
You are helping data analyst. Goal: Business question into a checked SQL answer. The agent finds the right tables, writes a query, runs it read-only and sanity-checks the result. It returns the answer with the query, row counts and assumptions. You review it before sharing. Work through these steps and show your result for each: 1. Read the question. 2. Find the tables. 3. Write the query. 4. Run it read-only. 5. Sanity-check the result. 6. Explain it with assumptions. Tools or data I can give you: database, spreadsheet. Ask me for anything missing before you start. Do not take any action yourself; stop for my decision where: analyst reviews before sharing. Watch for: wrong join; show query and row counts.
Copies the prompt, then opens the tool. Paste it in to start.
{
"name": "ad-hoc-question-answerer-0038",
"goal": "Business question into a checked SQL answer",
"persona": [
"data-analyst"
],
"autonomy": "supervised",
"tools": [
"database",
"spreadsheet"
],
"plan": [
"Read the question.",
"Find the tables.",
"Write the query.",
"Run it read-only.",
"Sanity-check the result.",
"Explain it with assumptions."
],
"human_in_the_loop": "analyst reviews before sharing",
"guardrails": "wrong join; show query and row counts",
"output": "a draft for human review"
}Copies the prompt, then opens the tool. Paste it in to start.
{
"name": "ad-hoc-question-answerer-0038",
"goal": "Business question into a checked SQL answer",
"persona": [
"data-analyst"
],
"autonomy": "supervised",
"tools": [
"database",
"spreadsheet"
],
"plan": [
"Read the question.",
"Find the tables.",
"Write the query.",
"Run it read-only.",
"Sanity-check the result.",
"Explain it with assumptions."
],
"human_in_the_loop": "analyst reviews before sharing",
"guardrails": "wrong join; show query and row counts",
"output": "a draft for human review"
}Copies the prompt, then opens the tool. Paste it in to start.
At a glance
- For
- data analyst
- Industry
- analytics
- Autonomy
- supervised
- Difficulty
- Works with
- Steps
- 6 · 1 human checkpoint
- Runs as
- on demand
- Data touched
- read-only
- Needs approval
- analyst reviews before sharing
- What it costs to run
- $0.025 per run with a mid-priced model
- Evidence
- ID
UC-0038
Compare routes for this job
Share this comparison| For this job | Claude | ChatGPT | CrewAI |
|---|---|---|---|
| What you do by hand | Paste or attach the input each time, check the answer, and carry the result to where it goes yourself. | Set up the assistant once with your instructions and files. Then paste or attach each new input, check the answer and carry the result on. | Build and test the agent once. Then do the human checkpoint this use case names (approve, edit or decide) and check its work regularly. |
| Human checkpoint | analyst reviews before sharing | ||
| Typical API cost (same for every route) | $0.025 per run with a mid-priced model checked 2026-11-25 · pricing source | ||
| Learning curve | Point and click | Point and click | Code |
| Price model | free tier | free tier | free |
| Where your data goes | What you type and upload goes to Anthropic's servers and is handled under its terms. Check its data settings before you use real work data. | What you type and upload goes to OpenAI's servers and is handled under its terms. Check its data settings before you use real work data. | Your code decides: your data goes to the models and services you connect, so a local model keeps it on your machine. It may also send anonymous usage data to its makers by default; check its docs to turn that off. |
| Before you start | An account on the website. The free plan is enough to try it. | An account on the website. The free plan is enough to try it. | Python on your computer, basic coding, and access to a model (an API key or a local model). |
| Evidence for this route | Proposed pattern | Proposed pattern | Proposed pattern |
| Open | Open in run panel Tool page | Open in run panel Tool page | Open in run panel Tool page |
Where to go from here
All data analyst use casesSimilar work
These use cases do the same kinds of work as this one. Each card shows what they have in common.
Likely impact of a feature on metrics
The agent finds similar past launches, estimates the likely effect as a range, lists its assumptions and drafts a sizing note. You challenge it.
Comparable sales and a pricing opinion
The agent searches recent sales data, picks comparable properties, adjusts for differences and drafts a pricing report that shows the data and dates. You set the price.
Neighbourhood market report
The agent fetches public sales and rent data for an area, computes trends and drafts a report with charts. A map confirms the area boundary. You edit it before sending.
Same kinds of tools, a different job
These use cases connect to the same kinds of tools as this one, so part of your setup carries over.
Messy spreadsheet into clean tables
The agent infers a schema from a spreadsheet, cleans the values, loads them into staging and validates them. It reports rejected rows with counts so no data is lost silently. You approve the load.
Monthly forecast refresh with backtest
Each month the agent refits forecast models on new data, backtests them and picks the best, publishing it with error statistics. A backtest threshold guards against drift. You approve any model change.
Themes in open comments
The agent clusters open comments from reviews, tickets and surveys, labels the themes, counts them by period and quotes examples. You validate the themes.