Natural Language Queries
Query your database using plain English. No SQL knowledge required.
💬 How It Works
Datix xAgents uses advanced AI to:
- Understand your natural language question
- Analyze your database schema
- Generate optimized SQL query
- Execute and return results
- Visualize data when appropriate
📊 Query Patterns
Common patterns that work great:
Simple Aggregations
How many customers do we have?
What's our total revenue for 2024?
Show me average order value by month
Time-Based Analysis
Show sales trends for the last 6 months
Compare revenue this quarter vs last quarter
What's the MoM growth rate for new customers?
Grouping & Segmentation
Top 10 customers by revenue
Sales breakdown by product category
Customer distribution by region
Filtering & Conditions
Customers who haven't ordered in 90 days
Orders over $1000 in the last month
Products with inventory below 10 units
Joins & Relationships
Show me customers with their total order value
List products that have never been sold
Which sales reps have the highest close rates?
Complex Analysis
Customer lifetime value segmentation
Cohort analysis by signup month
Product affinity analysis (what's bought together)
🎯 Best Practices
✅ Be Specific
Good: "Revenue by product for Q4 2024"
Avoid: "Show me some revenue"
✅ Use Context
Include timeframes, categories, and filters in your question
✅ Follow Up
Refine results with follow-up questions: "Now filter to USA only"
✅ Name Tables/Columns
Reference specific tables when ambiguous: "from customers table"
💡 Example Questions by Use Case
📈 Sales & Revenue
- What's our total revenue this year?
- Show me revenue by sales rep for Q3
- Which products generate the most revenue?
- What's the average deal size by region?
- Show me the sales funnel conversion rates
👥 Customer Analytics
- How many new customers did we get last month?
- What's the customer retention rate?
- Show me customer lifetime value distribution
- Which customers are at risk of churning?
- Customer segmentation by purchase frequency
📦 Product & Inventory
- Which products are selling the fastest?
- Show me slow-moving inventory
- What's the inventory turnover ratio?
- Products with the highest return rate
- Product performance by category
🎯 Marketing
- Campaign ROI by channel
- Cost per acquisition trends
- Email campaign performance metrics
- Customer acquisition source breakdown
- Marketing spend vs revenue correlation
⚙️ Operations
- Average order fulfillment time
- Show me bottlenecks in the process
- Resource utilization by department
- Cost breakdown by category
- Efficiency metrics over time
🔄 Query Refinement
Use follow-up questions to refine results:
Example Conversation:
You: Show me top customers by revenue
Agent: [Returns table with 100+ customers]
You: Limit to top 10
Agent: [Returns filtered results]
You: Now add their order count
Agent: [Adds column with order counts]
You: Sort by order count instead
Agent: [Re-sorts the data]
📊 Getting Visualizations
Request charts explicitly or let the AI suggest:
Bar Charts
Show me revenue by product as a bar chart
Compare sales across regions visually
Line Charts
Plot revenue trends over time
Show customer growth as a line chart
Pie Charts
Market share by product category as pie chart
Revenue distribution by region
🎓 Advanced Techniques
Window Functions
Show running total of revenue by month
Calculate 3-month moving average of sales
Rank customers by revenue within each region
Percentiles & Statistics
What's the 90th percentile order value?
Show me the median customer lifetime value
Standard deviation of daily sales
Date Calculations
Customers who joined in the last 30 days
Orders placed on weekends vs weekdays
Year-over-year comparison for each month
⚠️ Common Pitfalls
Avoid These Mistakes
- Vague questions: "Show me some data" → Be specific about what you want
- Missing timeframes: "Total revenue" → Specify the period
- Ambiguous terms: "active" → Define what "active" means
- Too broad: "Everything about customers" → Break into smaller questions
🚀 Tips for Better Results
1️⃣ Start Simple
Begin with basic queries, then add complexity
2️⃣ Check SQL
Review generated SQL to understand how queries work
3️⃣ Use Templates
Save common queries as templates for reuse
4️⃣ Iterate
Refine results with follow-up questions
🔍 Troubleshooting
If Results Are Wrong
- Check the generated SQL query
- Verify table/column names match your database
- Rephrase your question more specifically
- Provide additional context or constraints
- Contact support if issues persist