Skip to content
Mark-t.aiMark-t.ai
Back to Browse
ChatGPTdata-analysis

SQL Query Builder

4.2(16 reviews)
356 sales

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`

sqldatabasequeries

Reviews (16)

Amanda M****
Dec 17, 2025

Nice prompt for data work. Good balance of depth and clarity.

Stephanie W****
Dec 15, 2025

Works for simple analysis. More statistical options would help.

Thomas M****
Dec 13, 2025

This data analysis prompt is exceptional! Clear insights every time.

Jessica D****
Nov 27, 2025

Great data analysis prompt with clear output. Works well overall.

Daniel A****
Nov 23, 2025

Incredible data assistant. My reports have improved significantly.

James W****
Oct 7, 2025

Reliable data tool. Helps with reports and presentations.

David G****
Jul 31, 2025

Outstanding for data work. Makes complex data accessible.

Jason A****
Jul 6, 2025

Great data analysis prompt with clear output. Works well overall.

William C****
Jun 19, 2025

This prompt delivers actionable insights. Highly recommended!

Justin B****
Jun 17, 2025

Perfect for data interpretation. The analysis quality is remarkable.

$17.99

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.