Ask questions in plain English, get SQL answers.

Write SQL queries in seconds with AI assistance.
Try it now
Generate database queries from natural language
1. Add your database
2. Generate queries
Use natural language to describe what you want to query. We'll generate SQL using a fine-tuned model.
3. Share with colleagues

Spend more time on data, less time on SQL

Complete your everyday analytics using natural language
"What are the top 10 products by total revenue, broken down by month for the past year?"
SELECT
  p.name,
  SUM(o.total_price) AS total_revenue,
  MONTH(o.timestamp) AS month,
  YEAR(o.timestamp) AS year
FROM products p
JOIN orders o
ON p.product_id = o.product_id
WHERE o.timestamp >= DATEADD(year, -1, GETDATE())
GROUP BY p.name, month, year
ORDER BY total_revenue DESC
LIMIT 10
Answer specific, complex questions
"Which products have a revenue growth rate of at least 50% compared to the previous month, broken down by product category?"
WITH monthly_revenue AS (
  SELECT
    p.product_id,
    p.name,
    p.category,
    SUM(o.total_price) AS total_revenue,
    MONTH(o.timestamp) AS month,
    YEAR(o.timestamp) AS year
  FROM products p
  JOIN orders o
  ON p.product_id = o.product_id
  GROUP BY p.product_id, p.name, p.category, month, year
)

SELECT mr.name, mr.category,
  (mr.total_revenue - LAG(mr.total_revenue) OVER (PARTITION BY mr.category ORDER BY mr.year, mr.month))
  / LAG(mr.total_revenue) OVER (PARTITION BY mr.category ORDER BY mr.year, mr.month) AS revenue_growth_rate
FROM monthly_revenue mr
HAVING revenue_growth_rate >= 0.5
Write some queries now
No login required

Works with your database

SQL
PostgreSQL
MySQL
SQLite
Microsoft SQL Server
Google BigQuery
Snowflake
Redshift
Mongodb

Learn more

How does it work?

We use a fine-tuned model to generate SQL queries from plain English. These queries are tailored to your database based on computed embeddings from user-provided descriptions of the database structure. Post-processing checks for correctness and flags possible issues.

How is my data used?

By default, we do not store any of your data. Your database structure is fed to the model in order to generate query output.

Database information is stored in your browser and is not saved on our server, unless you explicitly save it using the Save or Share functionality. You can delete your information at any time.

How well does it work?

The best way to find out is to try it yourself. We're constantly improving things, so results will get better over time. You'll also become more productive with this tool as you adopt the best practices and get used to its quirks.

QueryMuse is an assistant. You should always proofread and understand any a generated query before running it.

How can I improve my results?

The more information you provide about your database, the better the results will be. You can fill out information about your database on the Databases page. Use the column details field to provide as much context on each column as possible.

Try it now
No login required