Skip to content
← Home
🔒 Runs in your browser 🚫 No data uploaded ✓ Free, no login

SQL Query Explainer — Understand Any SQL Query

Paste any SQL query and get a plain English summary, a structured breakdown of every clause, and a complexity score — all generated instantly from the query's structure, with no AI involved. The explainer identifies tables, columns, join conditions, filters, aggregations, sorting, and limiting. It then scores the query's complexity based on the number of joins, subqueries, window functions, and other structural elements. Use it to understand inherited queries, document existing SQL, or learn how complex queries are structured.


Drop .sql or .txt file here
Supports .sql and .txt files Browse files

What This Tool Does

Analyzes a SQL query and produces a plain-English explanation of what each clause does — identifying table relationships, filters, aggregations, and subqueries — in your browser.

Who This Is For

  • SQL beginners trying to understand queries written by senior developers
  • Data analysts onboarding to a new codebase who need to quickly understand existing queries
  • Technical writers and documentation teams who need plain-English descriptions of complex SQL
  • Developers reviewing legacy code before modifying queries that haven't been touched in years

Example: Input: SELECT u.name, COUNT(o.id) FROM users u LEFT JOIN orders o ON u.id = o.user_id GROUP BY u.id HAVING COUNT(o.id) > 5 → Output: "Returns the name of each user who has placed more than 5 orders, including a count of their orders. Users with no orders are excluded by the HAVING clause."

What Does the Explainer Show?

The explainer generates three outputs from your SQL:

1. Plain English Summary — A natural-language sentence describing what the query does. For example: "This query selects customer names and order totals from the customers and orders tables, joins them on customer_id, filters to paid orders, groups results by customer, and returns the top 10 by revenue."

2. Structured Breakdown — A card-based view showing the query type, tables used, columns selected, join conditions, filters, aggregations, sorting, and limiting. Each element is displayed in its own card for quick scanning.

3. Complexity Score — A numeric score from 0 to 100 with a label (Simple, Moderate, Complex, or Advanced) and a list of reasons explaining the score. A single-table SELECT with no joins scores low. A multi-CTE query with window functions, subqueries, and HAVING clauses scores high.

How the Complexity Score Works

The scoring algorithm adds points for structural complexity:

The score caps at 100. Scores are labeled: Simple (0–25), Moderate (26–45), Complex (46–70), Advanced (71–100).

No AI — Pure Structural Analysis

This tool does not use any AI, machine learning, or external API. Every explanation is derived by parsing the SQL text and analyzing its clauses, keywords, and structure using JavaScript running in your browser. This means the explanations are deterministic: the same query always produces the same explanation, and no data is ever sent to any server.

Use Cases

🔒 Privacy & Security

Your SQL never leaves your browser. There is no server — all parsing, validation, formatting, and explanation happens in JavaScript running locally on your device. This means your table names, column names, query logic, and data patterns are never transmitted anywhere. You can disconnect from the internet after loading this page and the tool still works.

Frequently Asked Questions

Does the explainer use AI or GPT?
No. The explainer uses pure structural analysis — it parses the SQL text using JavaScript pattern matching and extracts clauses, keywords, tables, and conditions. No AI, no API calls, no data transmission.
Can it explain stored procedures?
The explainer works best with individual SQL statements (SELECT, INSERT, UPDATE, DELETE). It will analyze the first statement in a multi-statement input and extract as much structure as it can from procedural SQL, but it does not interpret flow control (IF, WHILE, CURSOR).
How accurate is the plain English summary?
The summary is generated from the parsed structure and is accurate for standard queries. Very complex or unusual syntax may produce less detailed summaries, but the structured breakdown and complexity score remain reliable.
What is a good complexity score?
There is no universal 'good' score — it depends on the problem. Simple lookups should score low (under 25). Business reports with aggregation and joins typically score 30–50. ETL queries and analytics with CTEs and window functions legitimately score 60+. If a simple lookup scores 70+, the query may be overengineered.
Can I share my explained query?
Yes. Click the Share button to copy a URL that restores the exact SQL and settings when opened.

SQL Tool Suite

Related Guides & Tutorials