AI summary
Seven AI prompts for the analyst’s actual week: plain-English to SQL, query performance review, stakeholder-question translation, result-to-narrative drafting, cohort analysis design, dashboard triage, and A/B test reading. Built to protect the rigor of the analysis, not just speed it up.
Analysts spend half their time writing SQL and the other half translating vague stakeholder questions into specific ones, then defending the answer when the answer is complicated. The seven prompts below take the parts of analyst work that compress well with AI (the SQL drafting, the cohort design, the narrative around a finding) and structure them so the rigor stays intact. This is the analyst slice of the AI Prompt Library, paired with a connector callout for the Snowflake, Supabase, and Notion connectors that make analyst work easier.
Why do most AI SQL and analytics workflows produce queries no one trusts and dashboards no one opens?
Most AI-for-analytics tooling fails in one of two ways. Either it generates queries against a schema it does not actually know (and the SQL references columns that do not exist), or it produces a narrative that overstates the certainty of the finding. Either way the analyst ends up doing more cleanup work than if they had written the query themselves.
The seven prompts below all share one pattern: they require you to paste in the schema, the actual numbers, the stakeholder context. The AI is asked to do the structural work (translation, cohort design, narrative framing) inside the constraints you provided. Your analyst judgment stays the source of truth. If you do let AI draft any analysis narrative, run it through How to Edit AI Out of Your Writing so it does not read like a chatbot summary. When a prompt becomes weekly, graduate it using the Prompt-to-Workflow Ladder.
What are the seven for data analysts prompts?
Prompt 1
Plain-English to SQL
You know what question you want answered. Writing the SQL takes 20 minutes. This prompt gets you to the right query in under 2.
I want to answer this business question: [STATE THE QUESTION IN PLAIN ENGLISH]. Here is the relevant schema (table names, key columns, what each represents): [PASTE SCHEMA OR TABLE DEFINITIONS] The data warehouse / database is: [SNOWFLAKE / BIGQUERY / POSTGRES / DUCKDB / etc.] Write the SQL with: 1. The query, formatted readably (CTEs over nested subqueries when it helps). 2. Comments above each CTE or major step explaining what it does in one sentence. 3. A note about any assumptions you made (date ranges, NULL handling, what counts as "active"). 4. A note about anything in the schema that surprised you or that I should double-check. Do not invent column names. If something is unclear in my schema, ask before writing the query.
When to use: Any time you have a question that needs an answer in under 30 minutes. · Best model: Claude with the Snowflake or Supabase connector is strongest. Without a connector, paste schema directly.
Prompt 2
Query Performance Review
Your query works but takes 4 minutes to run. This prompt finds the bottleneck.
Here is a SQL query that takes too long to run: ```sql [PASTE QUERY] ``` The warehouse: [SNOWFLAKE / BIGQUERY / POSTGRES / etc.] Approximate row counts of the main tables: [TABLE 1: N rows, TABLE 2: N rows, etc.] Available indexes (if Postgres) or clustering keys (if Snowflake / BigQuery): [LIST OR "NONE KNOWN"] Current runtime: [SECONDS / MINUTES] Target runtime: [SECONDS] Analyze: 1. The likely bottleneck and why. 2. The change with the highest expected impact (rewrite a join, add a clustering key, push down a filter, etc.). 3. The change with the second-highest impact. 4. Anything in the query that is dead code or redundant. 5. The rewritten query, ordered by expected impact. Be direct. If the query has a fundamental design issue, name it rather than tuning around it.
When to use: When a query has been running for over 30 seconds and that is not OK. · Best model: Claude (most disciplined about not over-promising performance gains).
Prompt 3
Stakeholder-Question Translator
An exec asks you “what is going on with retention?” and you have to translate that into the 3 actual analyses they care about. This prompt does the translation.
A stakeholder asked me this question: "[PASTE EXACT QUESTION]" The stakeholder's role: [TITLE] The likely underlying decision they are about to make: [YOUR BEST GUESS] What I already know about this topic from past work: [BRIEF CONTEXT] Translate the question: 1. The 2-3 specific, answerable questions hiding inside the vague one. 2. Which one is most likely the actual decision input they need. 3. The metric(s) that would answer it. 4. The cuts (by segment, by time, by cohort) most likely to be useful. 5. The one follow-up question I should ask the stakeholder before I start building. 6. A 90-second response I could send them right now if I cannot start the actual analysis yet. Do not assume the stakeholder asked the right question. Most of the time they asked an adjacent one.
When to use: Within an hour of receiving a vague ask. · Best model: Claude (best at distinguishing real questions from adjacent ones).
Prompt 4
Result-to-Narrative Drafter
You have a chart and a finding. Now you have to write the story that goes around it. This prompt produces a narrative that holds up to executive scrutiny.
Here is the analytical finding I want to communicate: [PASTE THE KEY METRIC / CHART DESCRIPTION / RESULT] My audience is: [ROLE OR FUNCTION OF READERS] The decision they are using this to make: [SPECIFIC DECISION OR DIRECTION] My confidence level in this finding: [HIGH / MEDIUM / LOW, WITH ONE-LINE REASON] What I do NOT know: [LIST CAVEATS] Draft a narrative with: 1. THE HEADLINE in one sentence. 2. THE NUMBER, stated cleanly with the comparison that makes it meaningful (year-over-year, vs target, vs cohort, etc.). 3. THE WHY: 2-3 sentences on what we think is driving this, anchored in evidence. 4. THE CAVEAT: what we do not yet know and how it would change the picture. 5. THE SO-WHAT: what this means for the decision the audience is making. 6. ONE FOLLOW-UP ANALYSIS that would resolve the remaining uncertainty. Do not over-claim. If the finding is correlational not causal, say so directly. Do not bury the caveat.
When to use: Any time you are about to present a finding to a stakeholder. · Best model: Claude. It is more disciplined about confidence calibration than other models.
Prompt 5
Cohort-Analysis Designer
Most cohort analyses get the cohort definition wrong, then everything downstream is wrong. This prompt designs the cohort cuts before you write the SQL.
I want to do a cohort analysis to understand [QUESTION OR HYPOTHESIS]. The entity being analyzed: [USERS / ACCOUNTS / ORDERS / EVENTS / etc.] Available signup or first-event timestamp: [WHAT YOU HAVE] Relevant dimensions I have: [LIST: e.g., signup source, plan tier, geography, customer size] Time window I care about: [e.g., 6 months post-signup] Design the analysis: 1. THE COHORT DEFINITION: how to define a cohort for this question (signup month, signup source, first product touched). Justify the choice. 2. THE METRIC TO TRACK: what we measure across cohorts and at what cadence. 3. THE 2-3 CUTS WORTH SEPARATING: which dimensions to cross-cut by (and which to ignore as noise). 4. THE CONFOUNDS: what could make this analysis misleading. 5. THE SQL SKELETON: pseudo-SQL or CTE structure for what the query would look like. 6. THE FIRST CHART: what visualization would answer the question fastest. Do not skip the confounds. They are the difference between a useful and a misleading cohort analysis.
When to use: Before you write a single line of cohort SQL. · Best model: Claude is well-suited because it will actually name the confounds rather than skip them.
Prompt 6
Dashboard Triage
Your team has 47 dashboards. 5 of them are actually used. This prompt helps you decide what to keep, kill, or merge.
Here is an inventory of our team's dashboards: [FOR EACH: name, purpose in one sentence, owner, rough viewer count over past 30 days if known, last meaningfully edited date] Produce a triage: 1. KEEP: the dashboards that are clearly earning their maintenance cost. Note why. 2. MERGE: pairs or groups of dashboards that overlap and should be combined. 3. KILL: dashboards no one is using, with the reason they probably stopped being relevant. 4. ORPHANED: dashboards with no clear owner, who they should be reassigned to. 5. MISSING: based on the topics covered, what dashboards SHOULD exist that do not. If the inventory is incomplete (low usage signal, no last-edit date), say so and ask for the missing info rather than guess.
When to use: Quarterly. Or any time you find yourself spending more time maintaining dashboards than answering questions. · Best model: Claude or Grok (both willingly recommend killing things).
Prompt 7
A/B Test Reading
Your experiment ended. The headline result looks good. This prompt forces you to check whether the result actually holds up before you ship the change.
Here are the results of an A/B test I just ran: Treatment vs Control on metric: [METRIC NAME] Control: [VALUE, SAMPLE SIZE] Treatment: [VALUE, SAMPLE SIZE] Test duration: [DAYS] P-value or confidence interval: [IF AVAILABLE] Guardrail metrics: [LIST WITH VALUES FOR EACH ARM] The change being tested: [DESCRIBE] Read the result: 1. STATISTICAL READ: do the numbers actually support the conclusion the team wants to draw. 2. PRACTICAL READ: is the effect size large enough to justify shipping the change. 3. GUARDRAIL CHECK: did anything bad happen on the secondary metrics, even if non-significant. 4. NOVELTY EFFECTS: is the test long enough to rule out novelty or weekday effects. 5. SEGMENT CHECK: should we look at the effect by segment before concluding (suggest 2-3 segments to check). 6. SHIP OR HOLD: your recommendation, with the one reason that drove it. Be direct. If the team is over-reading the data, say so.
When to use: Within 24 hours of the test reaching the planned sample size. · Best model: Claude. It pushes back on over-claiming more reliably than ChatGPT.
These work across Claude, ChatGPT, Gemini, and Grok. Claude has the longest context window for paid users which matters when you are pasting in large schemas. ChatGPT is widely tested for SQL generation. Gemini integrates with BigQuery if you live in Google Cloud. Grok is sharpest for the A/B test reading because it does not over-soft the “we should not ship this” call. The model matters less than the prompt structure and the schema you give it.
What is the worst thing you can do with AI for data analysts?
Three failure modes will undermine an analyst’s credibility faster than anything else.
- Running an AI-generated query against production without reading the SQL first. AI confidently writes queries against fictional columns. Always read the SQL, run it on a small slice or sample first, and verify the output before scaling up.
- Letting AI write the narrative around a finding and skipping the caveats. The temptation is to take the AI’s polished paragraph and ship it. The caveats are exactly what protects you when the stakeholder asks the follow-up question three weeks later. Never cut the caveat line.
- Trusting AI to interpret statistical results without your own check. AI can read a confidence interval and write a sentence about it, but it cannot tell you that your test population was contaminated, that the metric was redefined mid-experiment, or that the seasonal effect was not controlled for. Those are analyst judgment calls.
What if you want to take this further?
Each prompt above takes inputs (schemas, queries, results, stakeholder questions) you have to paste in. The next step is connecting AI to the data warehouse so the schema is read directly.
Connectors are now standard
Claude, ChatGPT, and Grok all support connectors that let your AI read live data from your work tools (Gmail, Notion, GitHub, Asana, HubSpot, Stripe, and many more) instead of relying on you to paste context. For analysts this means the AI can query Snowflake directly with the schema visible, read Supabase Postgres tables, pull dashboards from Notion, or fetch the relevant Slack thread where the stakeholder originally asked the question.
For data analysts, the connectors worth pairing with these prompts:
- Snowflake connector — reads your warehouse schema and query history, drafts queries against real columns, surfaces slow queries.
- Supabase connector — reads your Postgres schema and can suggest indexes, RLS policies, and slow-query optimizations.
- Notion connector — if your team documents dashboards or analyses in Notion, AI reads prior work for the dashboard-triage prompt.
- Slack connector — pulls the original thread where a stakeholder asked their vague question, giving the stakeholder-translation prompt actual context.
- GitHub connector — if your dbt models or analyst SQL live in GitHub, AI reads the codebase for query review and refactor work.
What are common questions about AI for data analysts?
Should I trust AI-generated SQL against production?
Trust the structure, verify the details. The AI is good at expressing your intent in SQL grammar. It is not reliable about which columns exist, which JOINs are correct, or which date logic matches your warehouse’s conventions. Always read the SQL, run on a small sample first, and check the output against your intuition before sending the results to anyone.
Will AI replace data analysts?
AI will replace analysts who do not move up the stack. The work that compresses (writing SQL from clear specs, drafting narratives, designing one-off dashboards) gets faster. The work that does not compress (understanding the business, designing the experiment, defending the analysis to a hostile stakeholder, knowing when the data is wrong) is still yours. The analysts who pair AI with judgment will be more productive and more valuable, not less.
Which AI tool is best for SQL?
Claude is well-tested on Snowflake and Postgres dialects. ChatGPT is broad and handles most warehouses competently. Gemini is strongest if you live in BigQuery / Google Cloud. For long schemas or large query history, the model with the longest context window (Claude on paid tiers, Gemini Pro) wins. Test the same query request on two and see which produces fewer fictional column references.
Can AI help with dbt models?
Yes for drafting model SQL, suggesting tests, and writing documentation. Less reliable for refactoring complex chains of models because the AI does not see the full DAG. Use AI for individual model work; use a human review for cross-model architecture.
Is it safe to give AI my company’s data?
Paid Claude and ChatGPT plans do not train on inputs and do not retain after the session. For sensitive data (PII, financial detail, health data), check your data governance policies before pasting. For schema-only work (no actual rows), the risk is lower. For row-level data, use a no-retention paid tier or self-hosted model.
How do I get AI to stop hallucinating column names?
Always paste the schema explicitly with the prompt. Use the SQL-generation prompt above which forces the AI to ask before assuming. If the AI references a column you did not provide, push back and have it correct. Over a few cycles, the AI learns your schema for that conversation.
How long does it take to build the analyst-AI loop?
Three weeks. Start with the SQL prompt and the stakeholder-translator. By week three, two more (query performance review and A/B test reading) should be in your weekly rotation. Most analysts end up using 4-5 of the seven regularly; the others come out for specific situations like cohort design or dashboard triage.
The AI Prompt Library · $39
Data analyst workflows, prompt-paved.
Soon to be 1000+ prompts in Notion organized by use case. The full analyst section includes everything above plus prompts for executive QBR prep, ad hoc requests triage, instrumentation requests, and quarterly metric reviews. Plus prompts for every other field. Lifetime access.
Get Smarter About AI Every Morning
Free daily newsletter. Built for people who want to use AI well, not chase every model.
Free forever. Unsubscribe anytime.
Sources to read next?
- Anthropic prompt engineering documentation · official prompt design guide
- OpenAI prompt engineering guide · ChatGPT-specific prompting reference
- Snowflake documentation · for warehouse-specific SQL and performance tuning
- Anthropic: Introducing Connectors · context for the Snowflake, Supabase, Notion callout
- Locally Optimistic: analytics engineering community · evidence-based writing on analytics craft and team practice
You might also like
- AI Prompt Library · the full library this post pulls from
- Claude for Data Analysis · the broader Claude-for-analysts playbook
- How to Edit AI Out of Your Writing · the cleanup pass before any narrative goes to execs
- Prompt to Workflow: The AI Ladder · graduate prompts into saved workflows
- Best AI Prompts for Marketing · the marketing-side companion when analysts work with the marketing function
- Best AI Prompts for Managers · for analyst leads
- Best Claude Prompts: 50 Examples · the broader prompt collection
Two ways to go further
The AI Prompt Library
1,000+ ready-to-use prompts for Claude, ChatGPT, and Gemini. Stop staring at a blank box.
Get it for $39 →2-Hour Live AI Crash Course
A private, beginner-friendly session across Claude, ChatGPT, Gemini, and the wider landscape.
Book for $125 →