Skip to content
Laviyx Learn

Try

SQL Query Explainer

Paste a query to see what each part does, in plain English, in the order the database actually runs it.

Try:

How it works

The explainer reads the structure of your query: its clauses, joins, conditions, groups and columns. It then describes each part in the database's logical order of execution:

FROM and JOINs → WHERE → GROUP BY → HAVING → SELECT → DISTINCT → ORDER BY → LIMIT

That order explains many common surprises, such as why a column alias works in ORDER BY but not in WHERE.

What it supports

  • SELECT queries with joins, subqueries, CTEs (WITH), aggregates, window functions, UNION, INTERSECT and EXCEPT.
  • INSERT, UPDATE, DELETE, CREATE TABLE, ALTER, DROP and TRUNCATE, including warnings for changes without a WHERE clause.

Limitations

The explainer does not connect to a database, so it cannot see your data, check that tables or columns exist, or guarantee that a query will run without errors. Very unusual or vendor-specific syntax may be described only in general terms. Nothing you paste leaves your browser.

To learn the concepts behind each step, start with SELECT, then JOINs and GROUP BY.