Prompts for the Data Analyst
AI prompts that turn business questions into SQL queries, dashboards, and clean analyses.
A lot of analysis time disappears into the gap between a business question and the query that answers it — and into the cleanup before you can trust the answer. AI tools shorten both. Describe what a stakeholder wants in plain English and get a commented SQL query against your schema; hand over a messy file and get a Pandas cleaning script that flags the issues it found.
This collection covers the analyst's core loop end to end: SQL from a business question, advanced window-function queries with performance notes, step-by-step Pandas EDA for nulls and outliers, data-cleaning scripts with before-and-after summaries, A/B test significance with a ship-or-don't call, and dashboard planning that warns you off vanity metrics. There's even a chart-type recommender for when you know the finding but not how to show it.
The constant requirement is to keep your hands on the wheel. The model writes the query; you confirm it answers the actual question and that the numbers reconcile.
What makes a good prompt for a data analyst
Good analyst prompts hand the model your real schema — table and column names, types, relationships — so it writes SQL that runs instead of inventing fields. Then state the business question precisely, including the grain you want (per user, per day, per cohort) and how to handle nulls and duplicates, because those choices change the answer.
For statistical work, give it the real inputs and ask it to state assumptions and what it can't conclude. When asking for a chart, describe what the data represents and the comparison you want a viewer to make — that, not aesthetics, is what determines the right chart type.
Get sharper results
- 01Paste your actual table schema and a couple of sample rows before asking for SQL, so the model uses real column names and you don't burn time fixing invented ones.
- 02Specify the grain and the null-handling you expect up front — 'count distinct users per week, excluding test accounts' prevents the subtle off-by-a-cohort errors that pass review unnoticed.
- 03When checking an A/B test, give real sample sizes and conversion rates and ask the model to state both the significance result and what the data does NOT let you conclude.
- 04Always run AI-generated queries against a sample and reconcile the totals to a number you already trust before you put the result in front of a stakeholder.
Common questions
Can AI write SQL that actually runs against my database?
It can if you give it your schema. Paste the relevant table and column names, types, and a few sample rows, and it will produce a query that compiles. Without that, it guesses field names. Always run the result on a sample and check the numbers before trusting it.
How do I know the analysis is correct and not subtly wrong?
Reconcile against a number you already trust. AI errors tend to be subtle — a wrong join grain, a mishandled null, a duplicate that inflates a count. Specify grain and edge-case handling in the prompt, then validate totals against a known figure before the result reaches a decision-maker.
Will AI pick the right chart for my data?
It gives a solid recommendation if you describe what the data represents and the comparison you want viewers to make — trend over time, parts of a whole, distribution. It'll also flag common pitfalls. Treat it as a knowledgeable second opinion and overrule it when you know your audience better.
Write a SQL Query From a Business Question
Translate a business question into a clean, commented SQL query against your schema.
Analyze a Dataset With Pandas Step-by-Step
Generate step-by-step Pandas EDA code covering nulls, outliers, and a business question.
Plan a Data Dashboard Layout and Metrics
Plan a full dashboard with curated KPIs, chart types, layout, and vanity-metric warnings.
Write a Data Cleaning Script for Messy Data
Generate a step-by-step Pandas data cleaning script with issue detection and before/after summaries.
Analyze an A/B Test for Statistical Significance
Statistically analyze an A/B test result with significance testing and a ship/no-ship recommendation.
Choose the Right Chart Type for Your Data
Get a chart type recommendation with rationale, alternatives, and common pitfalls for your data.
Use SQL Window Functions for Advanced Analytics
Generate advanced SQL window function queries with explanations and performance notes.
Turn a Plain-English Question Into a SQL Query
Converts a natural-language business question into a correct, commented SQL query grounded in your real schema.
Write a Pandas Snippet for a Specific Data Transformation
Generates a vectorized, commented pandas snippet for a precise transformation on your actual DataFrame.
Choose the Right Chart Type for Your Data
Recommends the best and runner-up chart type for your message, variables, and audience with encoding guidance.
Interpret an A/B Test Result Without Overclaiming
Interprets A/B test numbers honestly, flags validity risks, and gives a ship or keep-running recommendation.
Write a Precise, Unambiguous Metric Definition
Produces a precise metric definition with formula, grain, inclusion rules, and resolved edge cases.
Build a Data-Cleaning Checklist for a New Dataset
Generates a prioritized, column-specific data-cleaning checklist tailored to your dataset and intended analysis.
Write a Dashboard Spec Before You Build It
Drafts a build-ready dashboard spec with KPIs, layout, filters, drill-downs, and out-of-scope guardrails.
Explain a Statistical Concept to Non-Technical Stakeholders
Translates a statistical concept into a plain-language explanation tied to a real decision for non-technical stakeholders.