AI-Powered SQL Assistant
Overview
DBWillow's AI-Powered SQL Assistant (Premium feature) helps you write SQL queries without knowing SQL syntax. Simply describe what you want in plain English, and the AI generates optimized SQL queries for you.
Getting Started
Accessing the AI Assistant
- Open DBWillow and connect to a database
- Click the "AI Assistant" button in the toolbar (or press
Ctrl+Shift+A/Cmd+Shift+A) - The AI Assistant panel will open
Your First Query
Try asking the AI:
- "Show me all users"
- "Find orders from last month"
- "Count products by category"
The AI will generate the SQL query and execute it automatically.
How It Works
Multi-Stage Reasoning
The AI uses a sophisticated multi-stage process:
- Table Selection: Identifies which tables are relevant
- Schema Analysis: Examines table structures and relationships
- Query Generation: Creates optimized SQL queries
- Execution: Runs the query and shows results
Schema Awareness
The AI understands your database structure:
- Table names and relationships
- Column names and data types
- Foreign keys and joins
- Table descriptions (if you've added them)
Best Practices
Be Specific
Good:
- "Show me customers from California who placed orders in the last 30 days"
- "Calculate total revenue by product category for 2024"
Less Effective:
- "Show customers"
- "Revenue data"
Mention Relationships
When you need data from multiple tables:
- "Show me orders with customer names and product details"
- "List users and their order counts"
Specify Format
For dashboards:
- "Show monthly sales as a line chart"
- "Display top 10 products as a bar chart"
Advanced Features
Query Refinement
After the AI generates a query:
- Review the generated SQL
- Ask for modifications: "Add a filter for active users"
- The AI will update the query
Error Handling
If a query fails:
- The AI will analyze the error
- Suggest fixes automatically
- Regenerate the corrected query
Learning Your Database
The AI learns from your database:
- Frequently used tables
- Common query patterns
- Your naming conventions
Use Cases
Data Exploration
Quickly explore your database:
- "What tables do I have?"
- "Show me sample data from the users table"
- "What's the structure of the orders table?"
Reporting
Generate reports instantly:
- "Monthly revenue by product category"
- "User signups over time"
- "Top performing products"
Data Analysis
Answer business questions:
- "Which customers haven't ordered in 90 days?"
- "What's the average order value by region?"
- "Show me products with low inventory"
Dashboard Widget Generation
The AI can also create dashboard widgets:
- Describe what you want: "Show daily sales for the last 30 days as a line chart"
- The AI generates:
- The SQL query
- The dashboard widget
- Chart configuration
- The widget appears on your dashboard automatically
Tips and Tricks
Use Table Descriptions
Add descriptions to your tables to help the AI:
- Right-click a table → "Edit Description"
- Add context about the table's purpose
- The AI uses this information for better queries
Combine with Manual Editing
- Let the AI generate the base query
- Manually refine it in the SQL editor
- Best of both worlds
Save Generated Queries
After the AI generates a query:
- Review and test it
- Save it to your favorites
- Reuse it later
Pricing & Usage Limits
AI features are available with any paid subscription tier:
- Starter ($1/month promotional): Unlimited AI during promotional period
- Professional ($4/month): 100 AI queries/month, 25 widget generations/month
- Power ($8/month): Unlimited AI queries and widget generations
Limitations
- Requires active paid subscription (Starter, Professional, or Power tier)
- Works best with well-structured databases
- May need refinement for very complex queries
- Requires internet connection for AI processing
Troubleshooting
AI Not Responding
- Check your internet connection
- Verify Premium subscription is active
- Try refreshing the AI panel
Incorrect Queries
- Be more specific in your request
- Check that table/column names are correct
- Review and refine the generated query
Slow Responses
- Complex queries may take longer
- Large databases may require more processing time
- Try breaking complex requests into smaller parts
Next Steps
- Learn about Dashboards
- Read SQL Editor guide
- Try Creating Dashboards tutorial
