📊 Data & Analytics
AI2sql SQL Model — Query Generator
Example outputs
Here is what ChatGPT, Claude, and Gemini typically return for this prompt:
SELECT customers.customer_id, customers.name, SUM(orders.total_amount) AS total_spent FROM customers INNER JOIN orders ON customers.customer_id = orders.customer_id WHERE orders.order_date >= '2024-01-01' GROUP BY customers.customer_id, customers.name ORDER BY total_spent DESC LIMIT 10;
SELECT c.customer_id, c.customer_name, COUNT(o.order_id) AS order_count, SUM(o.order_total) AS revenue FROM customers c LEFT JOIN orders o ON c.customer_id = o.customer_id WHERE o.order_date BETWEEN '2023-01-01' AND '2023-12-31' GROUP BY c.customer_id, c.customer_name HAVING COUNT(o.order_id) > 5 ORDER BY revenue DESC;
SELECT p.product_name, p.category, SUM(oi.quantity) AS units_sold, SUM(oi.quantity * oi.unit_price) AS total_revenue FROM products p INNER JOIN order_items oi ON p.product_id = oi.product_id GROUP BY p.product_id, p.product_name, p.category ORDER BY total_revenue DESC LIMIT 20;
How to use this prompt
Copy the prompt above or click an "Open in" button to launch it directly in your preferred AI. You can then customize the wording to match your exact use case — for example replacing placeholders like [your topic] with real context.
Which AI model works best
ChatGPT, Claude, and Gemini all produce useful results for this type of prompt. Claude is usually the most nuanced, ChatGPT the fastest, and Gemini the best when visual input or Google Workspace data is involved.
How to customize this prompt
Adapt the prompt to your specific use case. Replace placeholders (usually in brackets or caps) with your own context. The more detail you provide, the more precise the response.
Common use cases
- Use directly in ChatGPT, Claude, or Gemini
- Adapt to your specific project or industry
- Use as a starting point for your own custom prompt
- Compare across models to find the best fit for your case
- Share with your team as a standard workflow
Variations
Adapt the tone (more casual, more technical), change the output format (bullet points vs. paragraphs), or add constraints (word limits, target audience).