Data Insights Report
Analyze data and create executive-ready insights reports
Generate optimized SQL queries with explanations
Generate an optimized {{database}} query to answer: "{{question}}"
**Database Schema:**
{{schema}}
**Provide:**
1. **Main Query**
- Well-formatted SQL
- Appropriate JOINs
- Efficient WHERE clauses
2. **Query Explanation**
- Step-by-step logic
- Why this approach
3. **Performance Considerations**
- Recommended indexes
- Optimization tips
- Estimated complexity
4. **Alternative Approaches**
- CTE version if applicable
- Window function option
- Trade-offs of each
5. **Sample Output**
- Expected columns
- Example rows
Use best practices: avoid SELECT *, use explicit column names, and add comments for complex logic.
{{database}}{{schema}}{{question}}Open Playground and see results in real-time. Pick any model, paste your prompt, get instant output.