Key Principles
Effective data queries follow four fundamental principles that ensure you get accurate, actionable insights every time you ask a question.
Be Specific
Clearly define what metrics, time periods, and filters you want for precise results.
Include Time Context
Always specify time periods to get relevant, comparable data that drives decisions.
Use Business Language
Speak in terms your team understands, not technical database jargon.
Define Your Scope
Specify segments, channels, or categories you want to analyze.
Effective Query Structure
The What + When + Where Formula
The most effective queries follow a simple three-part structure that ensures comprehensive and actionable results:
WHAT (Metric)
WHEN (Time Period)
WHERE (Segment)
Example: "Show me revenue (WHAT) for last month (WHEN) broken down by marketing channel (WHERE)"
Complete Context
Good vs. Bad Query Examples
Understanding what makes a query effective is easier when you see examples side by side. Here are common scenarios with improvements:
Revenue Analysis
❌ Too Vague: "Show sales"
- Missing time period and context
- Which sales? When? How grouped?
✅ Clear & Specific: "Show monthly sales revenue for Q4 2024, broken down by product category"
- Clear metric, specific time period, useful segmentation
Customer Analysis
❌ Unclear Intent: "Customer data"
- What about customers? Count? Value? Behavior?
✅ Action-Oriented: "List the top 20 customers by lifetime value, showing their first purchase date and total orders"
- Specific output, clear ranking criteria, relevant context
Marketing Performance
❌ Missing Context: "How are campaigns doing?"
- Which campaigns? What metrics define "doing well"?
✅ Measurable Outcome: "Compare Google Ads vs Facebook Ads ROAS for the last 30 days, including click-through rates and conversion rates"
- Specific channels, clear metrics, defined time frame, comparative analysis
Query Templates by Use Case
Performance Analysis
Trend Analysis Template: "Show [metric] trend over the last [time period], comparing to [previous period]"
Top Performers Template: "List top [N] [items] by [metric] for [time period]"
Growth Rate Template: "Calculate [metric] growth rate from [start date] to [end date]"
Comparative Analysis
Channel Comparison Template: "Compare [metric] across [channels/segments] for [time period]"
Before vs After Template: "Compare [metric] before and after [event/date]"
Segment Performance Template: "Show [metric] breakdown by [segment] for [time period]"
Customer Insights
Customer Value Template: "Calculate average [metric] per customer for [segment] in [time period]"
Retention Analysis Template: "Show customer retention rate by [cohort/segment] over [time period]"
Acquisition Trends Template: "Analyze new customer acquisition by [source/channel] for [time period]"
Time-Based Analysis
Seasonal Patterns Template: "Show [metric] by [month/quarter] for the last [N] years"
Day-of-Week Template: "Compare [metric] by day of week for [time period]"
Hourly Patterns Template: "Show [metric] by hour of day for [specific days/period]"
Advanced Query Tips
Use Follow-up Questions
Start broad, then drill down based on initial results to uncover deeper insights and root causes.
Example Flow:
- "Show revenue by channel"
- "Why did social media revenue drop 20%?"
- "Which social campaigns underperformed?"
Include Context for Better Analysis
Mention relevant business events, campaigns, or external factors that might influence your data interpretation.
Example: "Show website traffic during our Black Friday promotion period (Nov 20-30, 2024)"
Request Specific Visualizations
Tell the AI how you want to see the results for better presentation and understanding.
Example: "Show quarterly revenue growth as a line chart with percentage change annotations"
Iterative Analysis
Common Mistakes to Avoid
Don't Do This
- Ask multiple unrelated questions in one query
- Use technical database terminology
- Forget to specify time periods
- Ask for "everything" without focus
- Use ambiguous terms like "good" or "bad"
Do This Instead
- Focus on one main question per query
- Use business language your team understands
- Always include relevant time frames
- Specify the most important 3-5 metrics
- Define success criteria with numbers
Quick Reference Checklist
Before asking your question, ensure you have:
Transform your data exploration from trial and error to precise, actionable insights by mastering the art of effective query writing.