9314JIUsi
Developer tools · syntax-level checking, no database

SQL Inspection Desk: Screen Your DDL Before It Ships

Write a CREATE TABLE, run it directly, and the error message is something only the database itself understands. Paste it here for a screening pass first: columns parse one by one into a structure table (type/NOT NULL/primary key/unique/default/foreign key), missing commas, absent types and duplicate column names all come back with an exact line and column, MySQL/PostgreSQL/SQLite types get classification hints, and INSERT column-count mismatches are flagged on the spot.

SQL under inspection CREATE TABLE / INSERT; multiple statements allowed

SQL you paste is checked in this page's memory only - no database connection, no execution, no uploads, works offline. The dialect option lives in this device's browser and is lost when you switch devices or clear site data. To remove it, use "Clear my data" in the footer.

How to use it

  1. Paste a CREATE TABLE (or a whole DDL block with INSERTs) into the input and hit "Run check".
  2. Findings sort by severity: red must be fixed (missing commas, absent types, duplicate columns, unbalanced parentheses), yellow deserves a look (unknown types, INSERT column mismatches), green info notes carry type classification hints.
  3. Valid DDL expands into a structured table below: column names, types, nullability, defaults and constraints at a glance, copyable as TSV for documents.

What gets checked

Column-by-column CREATE TABLE parsing: names, types with length/precision (VARCHAR(50), DECIMAL(10,2)), constraints (NOT NULL / PRIMARY KEY / UNIQUE / DEFAULT / AUTO_INCREMENT / CHECK / FOREIGN KEY ... REFERENCES ...). Table-level constraints (PRIMARY KEY (a, b), UNIQUE (c), FOREIGN KEY ...) parse too.

Errors located at line:column: missing commas, absent column types, duplicate column names, unbalanced parentheses, REFERENCES without a target table - all reported as "line L, column C". Counts and constraint ownership are per statement; multiple statements check independently.

INSERT column-count validation: INSERT INTO t (a, b, c) VALUES (1, 2) has 3 columns but 2 values - a yellow warning; INSERTs without a column list are not checked (counts depend on the real table).

When it earns its keep

The worst moment in shipping a migration is a mid-script failure and rollback: run a few hundred lines of DDL through this syntax screen first and the low-level mistakes - a missing comma, say - surface instantly instead of blowing up on the third table.

Reviewing someone else's DDL pull request gets easier too: paste it in, get the structure table, and scan in one pass who forgot NOT NULL and who skipped a default.

InputCREATE TABLE / INSERT statements (multiple statements separated by semicolons, comments allowed); ≤1MB
OutputSeverely-graded findings (error/warning/info, errors carry line:column) + a structured column table (copyable as TSV)
Key parametersDialect hints default to MySQL (mysql/postgres/sqlite); ?dialect=postgres deep-links
ProcessingBrowser-local syntax-level checking - no database, no execution, no uploads; dialect option in localStorage
Limits1MB per run
Known limitsSyntax-level checking; no database, no semantics: does not verify that tables or columns exist, foreign-key targets, or CHECK conditions; unknown types warn yellow instead of erroring; CREATE INDEX/VIEW/TRIGGER and stored procedures are skipped with a notice

FAQ

Does this validator connect to a database? Can it check whether a table exists?

No connection. This is syntax-level checking: column definition structure, constraint spelling, type names, and INSERT column-to-value counts, all done in the browser and working offline. Whether a table exists, whether a foreign key's target has been created, whether column names match business semantics - those semantic checks need a real database connection and are out of scope.

How do I use the line and column numbers in errors?

Just count along: lines start at 1 counted by newlines, columns start at 1 counted by characters, pointing at the offending position. For example "3:15 missing column type" means the column definition near line 3, column 15 lacks its type name. Fix it, press check again, and a green list appears once everything passes.

Which SQL dialects are supported? How does type checking work?

The CREATE TABLE / INSERT grammar skeleton parses as generic SQL, while the common types of MySQL, PostgreSQL and SQLite are all catalogued (int/bigint/varchar/text/timestamp/jsonb and so on). A mistyped name like varchr gets a "closest correct type" suggestion. Unknown types raise a yellow warning rather than a red error - every dialect has too many extensions to declare them dead.

If the check passes, will the table definitely create successfully?

Not guaranteed. Passing the syntax screen only means no obvious structural errors; a real run can still hit an existing table, a foreign key referencing a missing table, an unsupported charset, or insufficient privileges. Treat it as the first sieve before submitting, and give the constraint logic one more human pass before running.

Is my DDL uploaded anywhere?

No. Parsing and checking run entirely in this device's browser - there is no upload endpoint. Only the dialect option lives in this browser's localStorage; Clear my data in the footer removes it.

Which tool should I use for formatting?

Typesetting belongs to the site's SQL formatter (sql-formatter) - that one handles looks, not correctness; this one handles correctness, not looks. Use them together: format first to see the structure, then validate to catch the errors.

Related tools