SQL Linter
Free online SQL linter — paste any query and get instant feedback on anti-patterns and style issues: SELECT *, UPDATE/DELETE without WHERE, implicit comma JOINs, trailing commas, leading-wildcard LIKE, double-quoted strings, keyword casing, and possible N+1 query loops. Every finding shows a severity, line number, and a concrete fix. 100% client-side — your SQL never leaves your browser.
Lint your SQL
Try a worked example:
Rules checked
Eleven heuristic rules across four severity levels. String literals and comments are masked before analysis, so a SELECT * inside a string is never flagged.
| Rule | Severity | What it detects |
|---|---|---|
select-star | Warning | SELECT * or t.* in the select list (COUNT(*) and arithmetic * are ignored) |
missing-where | Danger | UPDATE or DELETE with no WHERE — rewrites every row |
where-tautology | Warning | WHERE 1=1 — a filter that filters nothing |
trailing-comma | Error | Comma before FROM, ) or ; — a real syntax error |
implicit-join | Warning | FROM a, b comma join — use explicit JOIN … ON |
join-without-on | Warning | JOIN with no ON/USING — accidental cartesian product |
like-leading-wildcard | Warning | LIKE '%…' — B-tree indexes cannot be used |
string-style | Info | Double-quoted string literal — standard SQL reserves "…" for identifiers |
keyword-case | Info | Inconsistent or all-lowercase keyword casing |
missing-semicolon | Info | Statement not terminated with ; |
n-plus-one | Info | 3+ structurally identical SELECTs — probable query-in-a-loop |
Honest framing: this is heuristic linting, not a full SQL parser. It catches the most common and costly mistakes instantly, in your browser, with zero setup. For dialect-exact parsing (e.g. in CI), pair it with a real parser such as sqlfluff.
How the SQL linter works
- Mask. String literals (
'…',"…"), quoted identifiers, and--//*…*/comments are blanked out first — preserving positions — so rules never fire on text inside them. - Split. The masked SQL is split into statements on top-level semicolons (a
;inside a string is ignored thanks to masking). - Scan. Each of the 11 checks runs over the masked statements: star detection walks the select list at paren-depth 0, write statements are tested for
WHERE, JOINs are tested forON/USING, and SELECT fingerprints are compared to spot N+1 loops. - Score. Findings are sorted by position and rolled into a 0–100 lint score (danger −25, error −15, warning −10, info −3), with per-severity counts and line:col locations.
Frequently asked questions
What does this SQL linter check?
Is this a real SQL parser like sqlfluff?
Does the linter execute my SQL?
Which SQL dialects are supported?
Is SELECT * always bad?
What do the severity levels mean?
Can it catch every syntax error?
Is my SQL sent to any server?
Free tool by NRTechStudio