Skip to content
Developer & CodeLocal · Stays on device

SQL Query Validator

Check SQL for unclosed strings, unbalanced brackets, clause order, trailing commas, = NULL, UPDATE without WHERE and dialect mistakes.

  • PostgreSQL, MySQL / MariaDB, SQLite, SQL Server
  • Free to use
  • No sign-up or watermark
sql-query-validatorOn this device
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
PostgreSQLMySQL / MariaDBSQLite
Open SQL Query Validator

Not yet professionally reviewed. This tool’s formulas and wording have not been checked by a qualified professional. Use the results as an estimate and verify anything important.

A lint for common mistakes, not a full parser for every dialect. Valid SQL can occasionally be flagged and some errors only your database will catch; test queries on a copy of the data before running them in production.

About this tool

Paste one or more SQL statements and pick a dialect. The validator tokenises the SQL the way the database would (strings, quoted identifiers, comments, PostgreSQL dollar quoting and MySQL backslash escapes) and checks each statement for problems that cause errors or bad results: unclosed strings, comments and identifiers; unbalanced parentheses; double and trailing commas; clauses in the wrong order (WHERE after GROUP BY, ORDER BY before GROUP BY); HAVING without GROUP BY; INSERT column counts that don't match the VALUES; and LIMIT on SQL Server or TOP elsewhere.

It also flags risky statements: UPDATE or DELETE without WHERE, DROP and TRUNCATE, comparisons with = NULL (which are never true) and LIKE patterns without wildcards. Each finding shows the line number. The SQL is never executed. Everything runs in your browser. What you paste is never uploaded, logged or stored.

  1. Input

    Your code or text

    PostgreSQL, MySQL / MariaDB, SQLite, SQL Server

  2. Processing

    Processed in this browser

    Instant, in-browser. Nothing is uploaded.

  3. Output

    Your result

    Ready to download or copy

Local processing pipelineInstant, in-browser

How to use it

  1. 1

    Paste your SQL.

  2. 2

    Choose the dialect.

  3. 3

    Fix the errors from the top, then re-check.

Zero-upload architecture

How to use SQL Query Validator for free, with no upload

Free, with no sign-up or watermark · Your files stay on your device

  1. 1

    Open SQL Query Validator

    Launch the app and add your file. There is nothing to install and no account to create.

  2. 2

    Work through it

    Choose the dialect.

  3. 3

    Get your result

    Fix the errors from the top, then re-check.

  • Local

    SQL Formatter

    Beautify SQL queries with consistent indentation and keyword case for 16 database dialects.

    Open tool
  • Local

    SQL Insert Generator

    Turn CSV or JSON into INSERT statements, or a CREATE TABLE with inferred column types, for PostgreSQL, MySQL, SQLite or SQL Server.

    Open tool
  • Local

    JSON Validator

    Check whether JSON is valid and see exactly where and why it fails, with fix suggestions.

    Open tool
  • Local

    YAML Validator

    Validate YAML syntax with exact line and column errors, duplicate-key detection and multi-document support.

    Open tool