50 AI Prompts for Data Analysis
Data analysis drives better decisions, but the gap between having data and having insights is often a SQL query, a pivot table, or a visualization you cannot quite figure out. These prompts help you write complex queries, build spreadsheet models, choose the right charts, clean messy data, and — most importantly — translate numbers into stories that drive action.
SQL Queries
Write a SQL query for [database type] that [describe what you need]. Tables: [list tables with key columns]. Requirements: handle NULLs, use proper JOINs, include WHERE filters for [conditions], and add comments explaining each section. Optimize for [performance concern].
Tip: Describing your table structure upfront prevents the AI from guessing column names and relationships.
I need a SQL query to calculate [business metric: MRR/churn/cohort retention/LTV] from these tables: [describe schema]. Include: the metric formula, any assumptions, date range filtering, and segment breakdowns by [dimension]. Add a CTE for readability.
Tip: CTEs (Common Table Expressions) make complex metric queries readable and debuggable.
Debug this SQL query that returns wrong results: [paste query]. Expected: [describe expected output]. Actual: [describe actual output]. Walk through the logic, identify the error, explain why it produces wrong results, and provide the corrected query.
Tip: Most SQL bugs come from JOIN conditions (duplicating rows), GROUP BY omissions, or NULL handling.
Convert this business question into SQL: '[natural language question]'. Database schema: [describe tables]. Write the query, explain your approach, suggest an index that would improve performance, and provide a simpler alternative if the query is complex.
Tip: Asking for both the query and a simpler alternative teaches you when complexity is necessary versus habit.
Spreadsheet Formulas
Create a [Google Sheets/Excel] formula to [describe calculation]. Data is in [describe layout]. Requirements: handle blank cells, work with [data types], and be robust against data entry errors. Provide the formula, an explanation of each part, and example inputs/outputs.
Tip: Wrap formulas in IFERROR to prevent cascading #REF and #VALUE errors when data is missing.
Build a financial model in [Google Sheets/Excel] for [business type]. Include: revenue projections (3 scenarios), cost structure, cash flow, break-even analysis, and key assumptions clearly separated. Provide formulas for each cell and formatting guidance.
Tip: Separate assumptions into their own clearly labeled section so anyone can adjust scenarios without hunting through formulas.
Create a dashboard in [Google Sheets/Excel] for tracking [business metrics]. Include: KPI summary cards, trend charts, comparison tables, conditional formatting rules, and data validation dropdowns for filters. Provide the formulas and layout instructions.
Tip: A great spreadsheet dashboard fits on one screen and answers the most important questions at a glance.
Write an Apps Script / VBA macro to automate [repetitive task]. Current manual process: [describe steps]. The script should: [requirements], include error handling, add logging, and be well-commented for non-programmers to maintain.
Tip: Comment your macros as if the person maintaining them has never written code — because they probably have not.
Data Visualization
Recommend the best chart type for visualizing [data description and analysis goal]. Explain why this chart type works, what alternatives would be misleading, and provide specifications: axes, colors, annotations, and title. Include a description I can hand to a designer.
Tip: The right chart type depends on your message: comparison, composition, distribution, or relationship.
Write [Python/R/JavaScript] code to create a [chart type] visualization of [data description]. Requirements: clear title, labeled axes, legend, color scheme for [audience type], annotations for key data points, and responsive sizing. Use [library].
Tip: Always annotate the most important data point directly on the chart. Do not make the reader hunt for the insight.
I have [data description]. Create a visualization plan for an executive presentation: 5-7 charts that tell a coherent story from overview to insight. For each: chart type, data mapping, key takeaway, and transition to the next chart.
Tip: A visualization sequence should tell a story with a beginning (context), middle (analysis), and end (recommendation).
Critique this chart and suggest improvements: [describe or paste chart details]. Evaluate: chart type appropriateness, axis scaling, color accessibility, data-ink ratio, misleading elements, and whether the title communicates the insight.
Tip: Ask 'what is the one thing someone should take away from this chart?' If it is not obvious in 5 seconds, redesign.
Data Cleaning
Write a data cleaning pipeline in [Python/SQL/spreadsheet] for a dataset with these issues: [describe problems — duplicates, missing values, inconsistent formats, outliers]. For each issue: detection method, cleaning approach, validation step, and what to document.
Tip: Always document cleaning decisions. Future analysts need to know what was changed and why.
I have [X rows] of [data type] with inconsistent formatting: [describe examples]. Write a script to standardize: names, dates, addresses, phone numbers, and categories. Handle edge cases and flag records that need manual review.
Tip: Flag ambiguous records for manual review rather than making assumptions. Bad data masquerading as clean data is worse than missing data.
Create a data quality report template for [dataset]. Check: completeness (% missing by column), uniqueness (duplicate detection), consistency (cross-field validation), accuracy (range checks), and timeliness (data freshness). Provide SQL or Python for each check.
Tip: Run data quality checks before every analysis. Insights from dirty data lead to wrong decisions.
Insights and Storytelling
I have these analysis results: [paste key findings]. Write an executive summary that: leads with the most important insight, provides context, quantifies the business impact, recommends specific actions, and flags risks. Under 500 words. No jargon.
Tip: Executives want: what happened, why it matters, and what to do about it — in that order.
Translate this statistical finding into a business recommendation: [describe finding with numbers]. Explain: what the data says in plain English, the confidence level, practical significance (not just statistical), limitations, and a clear recommended action.
Tip: Statistical significance and practical significance are different things. A p-value does not tell you whether the effect matters.
Analyze this A/B test data and provide a recommendation. Control: [metrics]. Variant: [metrics]. Sample size: [N]. Duration: [days]. Calculate statistical significance, practical significance, check for novelty effects, and recommend: ship, iterate, or kill.
Tip: Always check if the test ran long enough for a full business cycle (weekly patterns, etc.) before calling a winner.
Create a data-driven quarterly business review presentation. Data: [paste key metrics]. Structure: performance vs goals, trend analysis, root cause for misses, wins to double down on, risks on the horizon, and priorities for next quarter. Each slide: one insight with supporting data.
Tip: One insight per slide with supporting data is always clearer than cramming multiple metrics onto one slide.