Data analysts
SQL drafted against your real schema and checked before you trust it, cleaning with a change log, narratives that trace every number, one metric-definitions skill, reconciliation before anything ships, a Monday KPI routine and read-only warehouse access.
For Data and business analysts, analytics engineers and BI developers
Trustworthy numbers, faster: SQL drafted for you, checked twice, explained in plain words
- SQL drafted against your real schema, with fan-out, null and row-count checks before you trust it
- One metric-definitions skill, so revenue means the same thing in every answer and every tool
- Every number reconciled to a source-of-truth total before it leaves your hands
- A Monday KPI pack drafted before you log in, with anomalies flagged for your review
- Agents that can only read the warehouse, enforced by a database role rather than a prompt
On this page
- Where AI helps in this job
- Start in 15 minutes
- The tools analysts use
- Members only: Workflow: SQL with schema context and checks
- Members only: Workflow: cleaning a messy extract
- Members only: Workflow: from results to a narrative
- Members only: Workflow: reconciliation before anything ships
- Members only: Read-only warehouse access for agents
- Members only: A skill for data analysts
- Members only: Guardrails and hooks
- Members only: Routines that run without you
- Members only: Prompt ladder for data analysts
- Members only: Measure it
- Members only: Risks and what not to automate
AI drafts SQL in seconds, and it drafts wrong SQL just as fast: a join that doubles revenue, a filter that forgets test accounts, a date boundary in the wrong time zone. The analyst's job does not shrink; it moves to definitions and checks. This page gives you prompts that build the checks in, one shared definition of each metric, and warehouse access that cannot write.
Where AI helps in this job#
| Task | What AI does well | What you still own |
|---|---|---|
| Writing SQL | Drafts queries from your schema, explains joins and grain, converts between dialects | That the query answers the actual question, and the checks |
| Cleaning data | Profiles columns, proposes cleaning rules, writes pandas or SQL with before and after counts | Which rows to drop, and what a value really means |
| Exploratory analysis | Runs many cuts quickly and points out the ones that move | Which differences matter, and correlation versus cause |
| Charts | Picks a chart type and writes the plotting code | That the axis and the scale do not mislead |
| Narratives | Turns a results table into a short, structured story | That every number in the story is in the table |
| Metric definitions | Drafts and documents definitions in one consistent format | The definition itself and who owns it |
| Reconciliation | Compares totals with source systems and lists the differences | The tolerance, and the sign-off |
| Stakeholder questions | Rewrites a vague request into a precise, answerable question | Agreeing that with the stakeholder |
| Spreadsheets | Writes formulas, pivots and lookups in Excel or Sheets | Checking the result against a known value |
AI is weakest at the parts that make numbers wrong in subtle ways. It invents columns that sound right, joins at the wrong grain so a one-to-many join silently multiplies a sum, applies filters inconsistently between two queries, and states correlations as causes. It also cannot know your business rules, such as which accounts are internal or when revenue counts as recognized, unless you write them down. That is why the metric-definitions skill below matters more than any prompt.
Start in 15 minutes#
Use a schema and a few sample rows, not a customer-level export. Remove or replace names, emails and IDs before you paste anything into a consumer chat app.
Prompt
SQL from a schema, with sanity checks
Here is the schema of the tables I can use, with three sample rows each (values are made up): [PASTE CREATE TABLE STATEMENTS OR COLUMN LISTS, PLUS SAMPLE ROWS] Write a [POSTGRES OR BIGQUERY OR SNOWFLAKE] query that answers: [QUESTION]. Then: 1. State the grain of each table and of the result. 2. Point out every join that could multiply rows, and how the query prevents it. 3. Give three sanity-check queries I should run first: row counts before and after each join, distinct counts of the key, and the null rate of each column used in a filter or a sum.
Good output names the grain of each table and flags any one-to-many join. Run the sanity checks before the main query, and compare the result with a number you already trust, such as last month's figure in the finance report.
Prompt
Cleaning plan with a change log
Here are the column names and 20 sample rows from a messy extract (personal data replaced): [PASTE] 1. List the problems you see per column: types, formats, duplicates, impossible values, inconsistent categories, missing values. 2. Propose a cleaning rule for each, and say whether it drops, changes or flags rows. 3. Write pandas code that applies the rules to the full file, never overwrites the original, and prints a change log: rule, rows affected, rows before and after.
Good output flags rather than drops whenever a value is ambiguous. When you run the code, the change log must account for every row that disappeared.
Prompt
Explain a results table in plain words
Here is a results table: [PASTE TABLE]. Write five sentences for a non-technical manager on what it shows. Use only numbers that appear in the table. Add one sentence on what the table cannot tell us.
Good output uses only the table's numbers. Tick each number in the text against the table before you send it.
The tools analysts use#
- Claude runs Python on files you upload and creates spreadsheets, charts and documents. Claude for Excel is generally available on paid plans, works inside your workbook, and cites the cells it used. Claude for Google Workspace, in public beta since October 2026, adds the same help in Sheets. Claude Code connects to warehouses over MCP and runs the checks on this page.
- Microsoft Copilot in Excel: "Edit with Copilot in Excel", formerly Agent Mode, builds and changes workbooks with tables, charts, PivotTables and formulas, and can use Python. It needs a Microsoft Copilot licence.
- Gemini in Google Sheets creates tables, formulas, analysis and charts on eligible Google Workspace and Google AI plans.
- ChatGPT analyzes files you upload with Python, and offers ChatGPT for Excel on some paid plans.
- Warehouse MCP servers let an agent read schemas and run queries. BigQuery's managed server includes a read-only SQL tool. Snowflake's managed server, generally available since November 2025, runs SQL read-only by default. Databricks' SQL server allows writes unless you disable them. DBHub covers Postgres, MySQL, SQL Server, Oracle and SQLite with a read-only mode.
- The dbt MCP server exposes Semantic Layer metrics, so an agent can query a governed metric instead of writing its own SQL. Its raw SQL tools are off by default.
Workflow: SQL with schema context and checks
Members only below this line
Get the full Data analysts playbook free
What you get on this page:
- 4 step-by-step workflows
- 11 prompts
- 1 skill
- 1 hook
- 1 routine
Also in the members part
- Workflow: cleaning a messy extract
- Workflow: from results to a narrative
- Workflow: reconciliation before anything ships
- Read-only warehouse access for agents
- A skill for data analysts
- Guardrails and hooks
- Routines that run without you
- Prompt ladder for data analysts
- Measure it
- Risks and what not to automate
Sources
Checked against these on 13 Oct 2026.
- Connect Claude Code to tools via MCP (opens in a new tab)code.claude.com
- Claude Code hooks reference (opens in a new tab)code.claude.com
- Extend Claude with skills (opens in a new tab)code.claude.com
- Automate work with routines (opens in a new tab)code.claude.com
- Schedule recurring tasks in Claude Code Desktop (opens in a new tab)code.claude.com
- DBHub TOML configuration (opens in a new tab)dbhub.ai
- DBHub execute_sql tool (opens in a new tab)dbhub.ai
- Use the BigQuery MCP server (opens in a new tab)docs.cloud.google.com
- Snowflake-managed MCP server (opens in a new tab)docs.snowflake.com
- Databricks SQL MCP server (opens in a new tab)docs.databricks.com
- dbt MCP server (opens in a new tab)github.com
- PostgreSQL predefined roles (opens in a new tab)postgresql.org
- Claude for Excel (opens in a new tab)claude.com
- Microsoft Copilot release notes (Edit with Copilot in Excel) (opens in a new tab)learn.microsoft.com
- Gemini in Google Sheets (opens in a new tab)support.google.com