Description
Convert natural language questions into optimized SQL queries. Supports complex joins, subqueries, window functions, and CTEs with performance optimization suggestions.
Preview
Example Input
Tables: orders(id, customer_id, total, created_at), customers(id, name, email). Need: Top 10 customers by total spend in last 90 days with their order count.
Example Output
## SQL Query\n\n```sql\nSELECT \n c.id,\n c.name,\n c.email,\n COUNT(o.id) AS order_count,\n SUM(o.total) AS total_spend\nFROM customers c\nINNER JOIN orders o ON c.id = o.customer_id\nWHERE o.created_at >= DATEADD(day, -90, GETDATE())\nGROUP BY c.id, c.name, c.email\nORDER BY total_spend DESC\nLIMIT 10;\n```\n\n**Query Explanation:**\n- INNER JOIN connects customers to their orders\n- WHERE filters to last 90 days\n- GROUP BY aggregates per customer\n- ORDER BY + LIMIT gets top 10\n\n**Performance Tips:**\n- Add index on orders(customer_id, created_at)\n- Consider partitioning orders table by date\n\n**PostgreSQL variant:**\nReplace `DATEADD(day, -90, GETDATE())` with `CURRENT_DATE - INTERVAL 90 days`
Reviews (16)
Nice prompt for data work. Good balance of depth and clarity.
Works for simple analysis. More statistical options would help.
This data analysis prompt is exceptional! Clear insights every time.
Great data analysis prompt with clear output. Works well overall.
Incredible data assistant. My reports have improved significantly.
Reliable data tool. Helps with reports and presentations.
Outstanding for data work. Makes complex data accessible.
Great data analysis prompt with clear output. Works well overall.
This prompt delivers actionable insights. Highly recommended!
Perfect for data interpretation. The analysis quality is remarkable.
FREE with subscription
Learn More →- Instant download after purchase
- Lifetime access
- 30-day money-back guarantee
About the Seller
Mark-T AI
Member since Feb 15, 2025
Official Mark-T marketplace prompts. Curated collection of high-quality AI prompts for ChatGPT, Claude, Midjourney, DALL-E, Stable Diffusion, and Sora. Trusted by thousands of creators and professionals.