Role playbook

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.

Checked 13 Oct 202618 min read14 prompts1 skill1 hook1 routine

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
Works withClaudeClaude CodeMicrosoft Copilot in ExcelGemini in Google SheetsChatGPTdbt MCP serverBigQuery MCP serverSnowflake MCP serverDBHub
On this page
  1. Where AI helps in this job
  2. Start in 15 minutes
  3. The tools analysts use
  4. Members only: Workflow: SQL with schema context and checks
  5. Members only: Workflow: cleaning a messy extract
  6. Members only: Workflow: from results to a narrative
  7. Members only: Workflow: reconciliation before anything ships
  8. Members only: Read-only warehouse access for agents
  9. Members only: A skill for data analysts
  10. Members only: Guardrails and hooks
  11. Members only: Routines that run without you
  12. Members only: Prompt ladder for data analysts
  13. Members only: Measure it
  14. 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#

TaskWhat AI does wellWhat you still own
Writing SQLDrafts queries from your schema, explains joins and grain, converts between dialectsThat the query answers the actual question, and the checks
Cleaning dataProfiles columns, proposes cleaning rules, writes pandas or SQL with before and after countsWhich rows to drop, and what a value really means
Exploratory analysisRuns many cuts quickly and points out the ones that moveWhich differences matter, and correlation versus cause
ChartsPicks a chart type and writes the plotting codeThat the axis and the scale do not mislead
NarrativesTurns a results table into a short, structured storyThat every number in the story is in the table
Metric definitionsDrafts and documents definitions in one consistent formatThe definition itself and who owns it
ReconciliationCompares totals with source systems and lists the differencesThe tolerance, and the sign-off
Stakeholder questionsRewrites a vague request into a precise, answerable questionAgreeing that with the stakeholder
SpreadsheetsWrites formulas, pivots and lookups in Excel or SheetsChecking 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

Level 2Any assistant
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

Level 2Any assistant
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

Level 1Any assistant
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

Every query the agent writes should arrive with proof that it counted the right rows. Run this for any question that will end up in a deck, a dashboard or a decision. 1. Connect read-only. Set up the warehouse connection from the read-only access section ...

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

Free. You also get Stratiflux Weekly: one email a week, unsubscribe anytime.

Also in the members part

  1. Workflow: cleaning a messy extract
  2. Workflow: from results to a narrative
  3. Workflow: reconciliation before anything ships
  4. Read-only warehouse access for agents
  5. A skill for data analysts
  6. Guardrails and hooks
  7. Routines that run without you
  8. Prompt ladder for data analysts
  9. Measure it
  10. Risks and what not to automate

Sources

Checked against these on 13 Oct 2026.

  1. Connect Claude Code to tools via MCP (opens in a new tab)code.claude.com
  2. Claude Code hooks reference (opens in a new tab)code.claude.com
  3. Extend Claude with skills (opens in a new tab)code.claude.com
  4. Automate work with routines (opens in a new tab)code.claude.com
  5. Schedule recurring tasks in Claude Code Desktop (opens in a new tab)code.claude.com
  6. DBHub TOML configuration (opens in a new tab)dbhub.ai
  7. DBHub execute_sql tool (opens in a new tab)dbhub.ai
  8. Use the BigQuery MCP server (opens in a new tab)docs.cloud.google.com
  9. Snowflake-managed MCP server (opens in a new tab)docs.snowflake.com
  10. Databricks SQL MCP server (opens in a new tab)docs.databricks.com
  11. dbt MCP server (opens in a new tab)github.com
  12. PostgreSQL predefined roles (opens in a new tab)postgresql.org
  13. Claude for Excel (opens in a new tab)claude.com
  14. Microsoft Copilot release notes (Edit with Copilot in Excel) (opens in a new tab)learn.microsoft.com
  15. Gemini in Google Sheets (opens in a new tab)support.google.com