> Database Query Generator <

> Describe what you need in natural language, get database queries instantly

Database Type:

Your Prompt

Show me all customers who made purchases over $1000 in the last 30 days

Update the price of product 'Wireless Mouse' to $29.99

Generated SQL Query

SELECT 
  c.customer_id,
  c.first_name,
  c.last_name,
  c.email,
  SUM(o.total_amount) as total_spent,
  COUNT(o.order_id) as order_count
FROM customers c
INNER JOIN orders o ON c.customer_id = o.order_id
WHERE o.order_date >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
  AND o.total_amount > 1000
GROUP BY c.customer_id, c.first_name, c.last_name, c.email
ORDER BY total_spent DESC;
UPDATE products
SET price = 29.99,
    updated_at = NOW()
WHERE product_name = 'Wireless Mouse';