See how the AI generates SQL from natural language
-- Find all customers who made purchases over $1000 last month
SELECT c.name, SUM(o.amount) as total_spent
FROM customers c
JOIN orders o ON c.id = o.customer_id
WHERE o.date >= DATE_SUB(NOW(), INTERVAL 1 MONTH)
GROUP BY c.id
HAVING total_spent > 1000;