SQLFormatter
FormatterConvertPricingDocsGet Pro
AI Tool · Explain

Explain a SQL query in plain English

Paste an unfamiliar, inherited or ORM-generated query and get a clear, step-by-step description of what it actually does — joins, filters, aggregates and edge cases — without reverse-engineering it yourself.

1Paste your SQL into the formatter.
2Click Explain.
3Read a plain-English breakdown of the query.
Explain a query

Free account, 3 free AI credits. Formatting stays free without signing in.

SQL
SELECT u.email, COUNT(o.id) AS orders, SUM(o.total) AS spent
FROM users u
LEFT JOIN orders o ON o.user_id = u.id AND o.status = 'paid'
WHERE u.created_at > now() - INTERVAL '90 days'
GROUP BY u.email
HAVING SUM(o.total) > 500
ORDER BY spent DESC;
What this query does
  • Lists every user created in the last 90 days alongside how many paid orders they have and how much they spent.
  • The LEFT JOIN keeps users with zero paid orders (they still appear, with 0), because the paid-status filter sits in the ON clause, not WHERE.
  • HAVING SUM(o.total) > 500 keeps only users whose paid spend tops $500, and the result is sorted from highest spender down.

Why explain SQL with AI?

The hardest SQL to work with is the SQL you didn’t write: a report someone left behind, a query an ORM generated, a stored procedure with five nested subqueries. A formatter makes it readable; an explanation tells you what it means — which tables drive the result, where the filters bite, and where a LEFT JOIN or HAVING clause changes the row set in a way that’s easy to miss.

Explanations run against the exact SQL you paste, in the dialect you choose, so the description matches your query rather than a generic template.

More SQL tools

Optimize a SQL queryConvert between dialectsSQL minifierSQL validator