SQL Checker: Find Syntax Errors and Dangerous Queries Before You Run Them

What is it?

The SQL Checker reads a query for the database you choose and reports syntax errors with the line and what was expected there. Before parsing, it also warns about mistakes that run but do damage or return nothing: UPDATE or DELETE without WHERE, = NULL instead of IS NULL, an extra comma before FROM or right after SELECT, unclosed quotes and brackets, and INSERT with the wrong number of values.

Who is it for?

Developers and data analysts, students in SQL courses, and anyone about to run a query on a live database who wants a safety check first.

How to use it

  1. Paste your code into the SQL to check box, or tap Try a sample to see how it works.
  2. The list of problems updates as you type: ✕ marks an error, ! a warning. The line above it sums up, for example “2 errors, 1 warning. Tap Show to jump to the line.”
  3. Choose your Database: MySQL, PostgreSQL, SQLite, SQL Server (T-SQL), MariaDB, BigQuery, Snowflake or Redshift. Your choice is remembered.
  4. Tap Show next to a problem to jump to that line, fix it, and watch the list update. Problems that are not on one line say Whole file. Clear empties the box.

Worked example

Paste SELEC * FROM t with MySQL selected. The checker reports a syntax error on line 1 at SELEC. Correct it to SELECT and the message changes to ✓. Then try DELETE FROM orders: it parses, but you get a warning that every row would be deleted.

Nothing connects to your database: only the text is read, in your browser.

Errors and how to fix them

  • “✓ No problems found: the SQL parses correctly”: the grammar is fine for that database. It does not check that tables or columns exist.
  • … Expected: …: the parser stopped at that point. Look just before it for a misspelled keyword (SELEC), a missing comma or an extra one.
  • “Extra comma right after SELECT” or “Extra comma before FROM”: remove the stray comma.
  • UPDATE or DELETE without WHERE: this changes every row. Add a WHERE, and test it first as a SELECT.
  • = NULL: NULL is never equal to anything; use IS NULL.
  • A valid query is reported: very new or rare features may be missing from the parser. If your database runs it, trust your database.

Open the tool: SQL Checker

Still stuck?

Contact support. Tell us which tool or page you were using, what you tapped, what you saw, and your phone or computer and browser (for example: Android phone, Chrome). We reply by email.

Questions, or an error not listed here?

Tell us in the comments: what you were doing, the exact message you saw, and your device and browser. We read every comment and add new fixes to this article.