SQL Query Analyzer

Analyse SQL structure: each statement's type, the referenced tables, joins, whether it filters with WHERE and how many parameters it binds, locally in your browser.

  • Runs locally in your browser
  • No upload required

Try it

Processed entirely in your browser; never uploaded.

Each dialect has its own comment, string and identifier rules.

Statements
1
Types
select
Tables
a, b
Joins
1
Has WHERE
Yes
Parameters
1
Statements: 1
Types: select
Tables: a, b
Joins: 1
Has WHERE: yes
Parameters: 1

Supported formats

Input
text/plain
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Analysed 1 statement(s); 2 table reference(s) and 1 join(s).

How it works

  • Split the script into top-level statements.
  • Classified each statement and collected FROM/JOIN/INTO/UPDATE table names.
  • Counted joins, detected WHERE and counted parameters.
  • Table names are lexical references, not resolved schema objects.

Methodology

  1. Split the script into top-level statements.
  2. For each statement, read the leading keyword to classify it and scan for FROM/JOIN/INTO/UPDATE to collect table names.
  3. Count JOIN keywords, detect a WHERE clause and count parameter tokens.

Usage

  1. Paste a SQL statement or script.
  2. Choose the dialect.
  3. Run the analyzer and read the per-statement breakdown.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

A join with a filter

jsonSelect to copy
{
  "text": "select a.id, b.name from a join b on a.id = b.id where a.id = ?;",
  "dialect": "postgresql"
}

An insert

jsonSelect to copy
{
  "text": "insert into audit_log (id, event) values ($1, $2);",
  "dialect": "postgresql"
}

Two statements

jsonSelect to copy
{
  "text": "update t set x = 1 where id = 2; delete from t where id = 3;",
  "dialect": "mysql"
}

Limitations

A quick map of a query

Before reviewing or refactoring a query it helps to know which tables it touches, whether it filters and how it joins. The analyzer reports exactly those structural facts and nothing it cannot see.

Frequently asked questions

Does it validate the query?
No. It describes the structure. Use the SQL Validator for delimiter and keyword checks.
Why does a table name look odd?
The analyzer reads the token after FROM/JOIN/INTO/UPDATE; it does not resolve schema qualifiers or aliases.
Is my query uploaded?
No. Analysis happens entirely in your browser.

Sources

  1. ISO/IEC 9075-1:2023: Information technology, Database languages SQL — ISO/IEC
  2. PostgreSQL Documentation: SQL Syntax, Lexical Structure — PostgreSQL Global Development Group
  3. MySQL 8.0 Reference Manual: String Literals — Oracle
  4. SQLite Documentation: SQL Syntax — SQLite Consortium
  5. Microsoft Learn: Transact-SQL Syntax Conventions — Microsoft