Data Analysis Prompts for Business Intelligence Teams
Data analysis prompt templates for SQL, exploration, insight extraction and reporting, with a worked example on a small synthetic dataset, checked arithmetic and privacy limits.
AI assistants can speed up parts of data work: drafting SQL, suggesting exploration steps, and turning a finished analysis into a readable summary. They are also capable of getting arithmetic wrong, inventing columns that are not in your schema, and stating weak patterns with too much confidence. This guide gives reusable prompt templates and a worked example that shows what a useful answer looks like and how to check it.
Why Data Analysis Prompts Matter
The right prompt turns vague requests like "analyze this data" into precise, actionable outputs. Knowing how to write better AI prompts makes all the difference. Good data prompts:
- Specify the data structure you're working with
- Define the question you're trying to answer
- Indicate the output format needed
- Set context for business relevance
Worked Example: From a Small CSV to a Checked Analysis
The dataset below is synthetic. It was written for this article and does not describe any real business. It is deliberately small so you can verify every number by hand.
order_id,order_date,region,channel,units,unit_price,returned
1001,2026-02-03,North,web,2,40.00,no
1002,2026-02-07,South,web,1,40.00,no
1003,2026-02-11,North,retail,3,25.00,no
1004,2026-02-15,West,web,1,120.00,yes
1005,2026-02-19,South,retail,4,25.00,no
1006,2026-02-24,West,web,2,40.00,no
1007,2026-03-02,North,web,3,40.00,no
1008,2026-03-06,South,web,2,40.00,yes
1009,2026-03-10,North,retail,2,25.00,no
1010,2026-03-14,West,web,2,120.00,no
1011,2026-03-18,South,retail,1,25.00,no
1012,2026-03-23,West,web,1,40.00,yes
1013,2026-03-27,North,web,1,120.00,no
1014,2026-03-30,South,web,3,40.00,no
The prompt
You are helping me analyze a small order export. The CSV is below.
Definitions:
- Gross revenue = units * unit_price
- Net revenue = gross revenue minus the gross revenue of returned orders
- Return rate = returned orders / all orders
Question: How did revenue change from February to March 2026,
which regions and channels drove the change, and should the
return rate worry us?
Rules:
- Show the calculation for every number you report.
- Only use columns that exist in the CSV. Do not assume costs or margins.
- If the sample is too small to support a conclusion, say so.
- End with the 2-3 follow-up questions you would need answered
before making a decision.
[PASTE CSV]
The prompt defines the metrics up front. Without definitions, "revenue" and "return rate" can be calculated several reasonable ways, and two runs of the same prompt may silently use different ones.
What a useful answer should contain
The figures below were calculated directly from the sample data, not taken from a model's output. Use them to check whatever answer your assistant gives you.
| Metric | February 2026 | March 2026 | Change |
|---|---|---|---|
| Orders | 6 | 8 | +2 |
| Units | 13 | 15 | +2 |
| Gross revenue | $495.00 | $795.00 | +$300.00 (+60.6%) |
| Returned orders | 1 | 2 | +1 |
| Return rate (orders) | 16.7% (1/6) | 25.0% (2/8) | +8.3 points |
| Gross revenue of returned orders | $120.00 | $120.00 | $0.00 |
| Net revenue | $375.00 | $675.00 | +$300.00 (+80.0%) |
| Average order value (gross) | $82.50 | $99.38 | +$16.88 |
| Breakdown (gross) | February | March | Change |
|---|---|---|---|
| North | $155.00 | $290.00 | +$135.00 (+87.1%) |
| South | $140.00 | $225.00 | +$85.00 (+60.7%) |
| West | $200.00 | $280.00 | +$80.00 (+40.0%) |
| Web channel | $320.00 | $720.00 | +$400.00 (+125.0%) |
| Retail channel | $175.00 | $75.00 | -$100.00 (-57.1%) |
A good answer then interprets the numbers carefully:
- Drivers: North contributed $135 of the $300 increase (45%). By channel, web grew by $400 while retail fell by $100. Three of the four $120 units sold in the two months were sold in March (orders 1010 and 1013), so a shift toward the higher-priced item explains much of the web increase.
- Returns: the return rate by order count rose from 16.7% to 25.0%, but returned revenue was $120 in both months, so returns fell as a share of gross revenue (24.2% to 15.1%). An answer that only says "returns went up" is incomplete.
- Limits: six and eight orders are far too few to call a trend or test significance. A responsible answer says this plainly instead of recommending a strategy change.
- Follow-up questions: Is the retail decline a data gap (for example, a store export missing) or real? Is the $120 item seasonal? What was the return reason for orders 1004, 1008 and 1012?
Check the answer yourself
Do not accept the model's arithmetic without checking it. Recompute the headline figures with a query you control:
SELECT
strftime('%Y-%m', order_date) AS month,
COUNT(*) AS orders,
SUM(units * unit_price) AS gross_revenue,
SUM(CASE WHEN returned = 'yes' THEN 1 ELSE 0 END) AS returned_orders,
SUM(CASE WHEN returned = 'yes' THEN 0
ELSE units * unit_price END) AS net_revenue
FROM orders
GROUP BY month
ORDER BY month;
This uses SQLite's strftime. In PostgreSQL, use to_char(order_date, 'YYYY-MM') or date_trunc('month', order_date). If the model's totals and your query's totals differ, trust the query and ask the model where its calculation went wrong.
If your assistant can execute code in a sandbox, ask it to compute the figures with code and show the code. You still need to read that code, because a correct calculation on a wrongly filtered dataset still gives the wrong answer.
Privacy and Data Handling Limits
Before pasting data into any AI tool:
- Do not paste personal data or confidential records (names, emails, account IDs, health or payment data, unreleased financials) unless your organization has explicitly approved that tool for that data.
- Check your organization's policy on which AI tools are approved, and read the provider's current data-usage and retention controls for the plan you are on. Consumer and business plans often differ, so do not assume.
- Prefer structure over records. For SQL help, the schema plus a few synthetic rows is usually enough. Replace real identifiers with placeholders and round or perturb sensitive values.
- Aggregate first. If you need help interpreting results, paste aggregated tables (like the ones above) rather than row-level exports.
- Keep the source of truth outside the chat. Final numbers in reports should come from your warehouse or BI tool, not from a model's restatement of them.
SQL Query Prompts
Basic Query Generation
Write a SQL query to [GOAL].
Database: [PostgreSQL / MySQL / SQLite / etc.]
Schema:
[TABLE DEFINITIONS WITH COLUMNS AND TYPES]
Requirements:
- [Performance considerations]
- [Any constraints]
Include comments explaining complex parts.
Complex Multi-Table Query
I need a query that [BUSINESS QUESTION].
Tables involved:
- [table1]: [columns, relationships]
- [table2]: [columns, relationships]
- [table3]: [columns, relationships]
Expected output columns:
- [column1]: [description]
- [column2]: [description]
Filters:
- [Filter conditions]
Aggregations needed:
- [Any GROUP BY, SUM, AVG, etc.]
Optimize for [large dataset / real-time / one-time report].
Query Optimization
Optimize this SQL query for performance:
[QUERY]
Table statistics:
- [table1]: ~[N] rows
- [table2]: ~[N] rows
Current execution time: [TIME]
Target: [TARGET TIME]
Existing indexes:
[INDEX LIST]
Suggest:
1. Query rewrites
2. Index recommendations
3. Explain the optimization reasoning
Debugging SQL
This query returns wrong results:
[QUERY]
Expected: [DESCRIBE EXPECTED OUTPUT]
Actual: [DESCRIBE ACTUAL OUTPUT]
Schema:
[RELEVANT SCHEMA]
Sample data:
[SAMPLE DATA IF HELPFUL]
Find the bug and fix it.
Window Functions
I need to calculate [METRIC] using window functions.
Use case: [DESCRIBE WHAT YOU'RE TRYING TO DO]
For example: "Running total" or "Rank within group" or "Moving average"
Table:
[SCHEMA]
Show the query with explanation of each window function component.
For a fill-in template, see the SQL query writer and the SQL query optimizer and explainer.
Data Exploration Prompts
Initial Data Assessment
I have a new dataset. Help me explore it:
Columns:
[LIST COLUMNS WITH TYPES]
Sample rows:
[PASTE A FEW ROWS]
For each column, suggest:
1. Data quality checks to run
2. Summary statistics to calculate
3. Visualizations to create
4. Potential relationships to explore
Finding Patterns
Analyze this data for patterns:
[DATA SAMPLE OR DESCRIPTION]
Look for:
- Trends over time
- Correlations between variables
- Anomalies or outliers
- Seasonal patterns
- Group differences
Present findings as [bullet points / narrative / structured report].
Cohort Analysis Setup
Help me set up a cohort analysis:
Business: [DESCRIPTION]
Cohort definition: [How to group users - signup date, first purchase, etc.]
Metric to track: [Retention, revenue, engagement, etc.]
Time periods: [Week / month / quarter]
Data available:
[TABLE AND COLUMN DESCRIPTIONS]
Provide:
1. SQL query to generate the cohort table
2. How to visualize the results
3. What to look for in the analysis
Funnel Analysis
Create a funnel analysis query:
Funnel steps:
1. [Step 1 - e.g., page view]
2. [Step 2 - e.g., add to cart]
3. [Step 3 - e.g., checkout started]
4. [Step 4 - e.g., purchase completed]
Events table schema:
[SCHEMA]
Calculate:
- Absolute numbers at each step
- Conversion rates between steps
- Overall funnel conversion
- Drop-off points
Insight Extraction Prompts
Business Insights from Data
I have this analysis result:
[DATA OR SUMMARY]
Business context: [WHAT THE BUSINESS DOES, GOALS]
Extract:
1. 3-5 key insights
2. For each insight:
- What the data shows
- Why it matters for the business
- Recommended action
3. Questions this raises for further analysis
Comparing Periods
Compare these two periods:
Period 1 ([DATE RANGE]):
[METRICS]
Period 2 ([DATE RANGE]):
[METRICS]
For each metric:
1. Calculate the change (absolute and percentage)
2. Assess if change is significant
3. Suggest possible causes
4. Recommend next steps
Anomaly Explanation
I found an anomaly in our data:
What I observed: [DESCRIBE THE ANOMALY]
Normal range: [WHAT'S TYPICAL]
When it occurred: [DATE/TIME]
Business context: [RELEVANT BUSINESS INFO]
Recent changes: [ANY KNOWN CHANGES]
Help me:
1. List possible causes (ranked by likelihood)
2. Suggest data to examine to confirm each cause
3. Recommend immediate actions
Root Cause Analysis
Our [METRIC] dropped by [X%] on [DATE].
Available data:
- [Data source 1]
- [Data source 2]
Segmentations available:
- [Dimension 1]
- [Dimension 2]
Guide me through root cause analysis:
1. What segments to check first
2. Queries to run for each hypothesis
3. How to validate the root cause
Reporting Prompts
Executive Summary
Create an executive summary from this analysis:
[DETAILED ANALYSIS OR DATA]
Audience: [C-level / department heads / board]
Key business question: [WHAT THEY WANT TO KNOW]
Format:
- Headline (1 sentence takeaway)
- 3-4 bullet points with key findings
- Recommendation for action
- Risk or caveat if applicable
Length: Under 200 words
Avoid jargon—explain data implications in business terms.
Weekly Metrics Report
Generate our weekly metrics report narrative:
This week's numbers:
[METRICS WITH VALUES]
Last week:
[LAST WEEK'S VALUES]
MTD target:
[TARGETS]
Write a brief report that:
- Opens with the headline (best or worst news)
- Compares to last week
- Notes progress toward targets
- Highlights 1-2 items needing attention
- Ends with next week's focus
Tone: [Professional / casual / urgent]
Dashboard Description
Write descriptions for a dashboard I'm building:
Dashboard purpose: [WHO USES IT, FOR WHAT]
Metrics to describe:
1. [Metric name]: [Definition, why it matters]
2. [Metric name]: [Definition, why it matters]
3. [Metric name]: [Definition, why it matters]
For each metric, write:
- Short definition (1 sentence)
- How to interpret it (what's good/bad)
- How it's calculated
Stakeholder Presentation
Help me structure a presentation of this analysis:
Findings:
[YOUR KEY FINDINGS]
Audience: [WHO'S WATCHING]
Time available: [MINUTES]
Goal: [INFORM / PERSUADE / DECIDE]
Create:
1. Slide outline with key message per slide
2. Suggested visualizations
3. Talking points for each slide
4. Anticipated questions and answers
Visualization Prompts
Chart Selection
I want to visualize [DATA DESCRIPTION].
Goal: Show [RELATIONSHIP / TREND / COMPARISON / DISTRIBUTION]
Audience: [WHO WILL SEE THIS]
Suggest:
1. Best chart type and why
2. Alternative options
3. Axis labels and title
4. Color recommendations
5. Common mistakes to avoid
Chart Critique
Critique this visualization approach:
Data: [WHAT DATA]
Current chart: [CHART TYPE]
Goal: [WHAT IT'S TRYING TO SHOW]
Identify:
- What works well
- Potential misinterpretation risks
- Improvements to suggest
- Alternative approaches
Python Visualization Code
Generate Python code to create a [CHART TYPE]:
Data structure:
[DESCRIBE YOUR DATAFRAME]
Libraries: [matplotlib / seaborn / plotly]
Requirements:
- [Size specifications]
- [Color scheme]
- [Labels and titles]
- [Any annotations]
Include comments explaining customization options.
Data Cleaning Prompts
Data Quality Assessment
Review this data sample for quality issues:
[DATA SAMPLE]
Check for:
- Missing values patterns
- Inconsistent formats
- Duplicates
- Outliers
- Invalid values
- Referential integrity issues
Provide remediation suggestions for each issue found.
Cleaning Script Generation
Write a [Python / SQL] script to clean this data:
Current issues:
- [Issue 1]
- [Issue 2]
- [Issue 3]
Raw data format:
[SAMPLE]
Desired clean format:
[EXPECTED OUTPUT]
Include logging for tracking what was cleaned.
Standardization Rules
Create standardization rules for [FIELD TYPE]:
Examples of current messy data:
[SAMPLE DATA]
Business requirements:
[WHAT THE CLEAN DATA SHOULD LOOK LIKE]
Generate:
1. Mapping rules
2. Regex patterns if applicable
3. Edge case handling
4. Validation checks
A/B Testing Prompts
Experiment Design
Help me design an A/B test:
Goal: [WHAT WE WANT TO LEARN]
Primary metric: [KEY METRIC]
Baseline: [CURRENT VALUE]
Minimum detectable effect: [% CHANGE WE CARE ABOUT]
Traffic available: [USERS/DAY]
Determine:
1. Required sample size
2. Expected duration
3. Segmentation strategy
4. Guardrail metrics to track
5. Potential confounds to control
Results Analysis
Analyze these A/B test results:
Control: [N] users, [METRIC VALUE]
Treatment: [N] users, [METRIC VALUE]
Test duration: [TIME]
Expected effect: [WHAT WE HOPED FOR]
Provide:
1. Statistical significance (include method used)
2. Confidence interval
3. Practical significance assessment
4. Recommendation (ship / iterate / abandon)
5. Caveats or concerns
Frequently Asked Questions
How detailed should I be about my schema?
Include all tables and columns relevant to your question. More context = better queries. But you don't need the entire database—just what's needed.
Can AI write production-ready SQL?
Treat AI-generated SQL as a solid first draft. Always:
- Review the logic
- Test on sample data
- Check performance on large datasets
- Validate results against known values
What about sensitive data?
Do not paste personal or confidential data unless your organization has approved the tool for it. Use synthetic or anonymized samples, or describe the structure without real values. See Privacy and Data Handling Limits above.
Which AI is best for data work?
There is no single answer, and capabilities change often. What matters more for analysis is whether the tool can run code (so arithmetic is computed rather than predicted) and whether it is approved for your data. Whichever tool you use, validate results independently before they reach a report.
How do I get better at data prompts?
Study how senior analysts ask questions. The prompt structure mirrors how you'd brief a human analyst. Be specific about the business context—our business strategy prompts guide has templates tailored to strategic decisions.
For more starting points, browse the data prompt templates, including pandas data manipulation and dashboard metric definitions.
Related Articles
AGENTS.md vs CLAUDE.md: Which AI Coding Tools Read Which Instruction File
A cross-tool guide to AGENTS.md: how Cursor, Claude Code, Gemini CLI, Kiro, Devin Desktop (Windsurf), GitHub Copilot and Antigravity read it, how it relates to CLAUDE.md, GEMINI.md and tool-specific rules, and a shared-file pattern with caveats.
How to Create Claude Code Skills: A SKILL.md Guide with a Worked Example
Create an Agent Skill for Claude Code: directory layout, SKILL.md frontmatter rules, supporting files and scripts, where Claude Code discovers skills, how they are invoked, failure handling, and how skills differ from MCP servers.
How to Evaluate AI Prompts: A Repeatable Regression Workflow
A step-by-step method for evaluating AI prompts: build a test set, write a rubric, combine deterministic and model-graded checks, record model settings, read failures and iterate without regressions.