SQL Tools
Format, explain and build SQL in your browser, from query builders and a CSV importer to side-by-side references for MySQL, PostgreSQL, SQL Server, SQLite and Oracle. Learn more
Basic SQL Injection Pattern Tester
Educational scanner flagging classic SQLi-style text patterns
Connection String Builder
MySQL, Postgres, MSSQL, SQLite, MongoDB.
CREATE TABLE Generator
Build a table statement visually.
Cross-Database Data Type Mapping Reference
Abstract types mapped to real column types across 5 dialects
Cross-Dialect Date/Time Function Reference
Date/time syntax cheat-sheet across 5 SQL dialects
Cross-Dialect Pagination Builder
Turns a page size/number into correct LIMIT/OFFSET or FETCH syntax per dialect
CSV to SQL INSERT Generator
CSV rows into INSERT statements.
Dialect Quoting Converter
Backticks, quotes and brackets, converted.
GROUP BY/HAVING Query Builder
Visual builder for GROUP BY + aggregates + HAVING
LIKE Pattern Tester
Test % and _ wildcards against samples.
Plain-English SQL Explainer
A query, broken down clause by clause.
SELECT Query Builder
Table, columns, joins, WHERE, ORDER BY.
SQL Formatter/Beautifier
Consistent indentation and keyword case.
SQL JOIN Visualiser
Venn diagrams for every JOIN, plus anti-joins.
SQL Minifier
Strip comments and whitespace to one line.
SQL Naming Convention Linter
Check names against snake/camel/Pascal.
SQL Relationship Diagram Generator
Paste CREATE TABLEs, get a visual ER diagram with PK/FK links
SQL WHERE Clause Builder
Combine conditions with AND/OR.
UPDATE/DELETE Generator
Safe statements, WHERE clause front and centre.
SQL tools for writing, tidying and understanding queries
Whether you write SQL every day or only now and then, these tools take the fiddly parts off your hands. Paste a messy one-line query into the SQL Formatter and get clean, indented SQL back, or squash it onto one line with the SQL Minifier. Both read the SQL properly, so nothing inside your strings or comments gets changed. Handed a query you didn't write? The Plain-English SQL Explainer describes it clause by clause and warns about an UPDATE with no WHERE.
To build queries without fighting the syntax, use the SELECT Query Builder, WHERE Clause Builder and GROUP BY/HAVING Builder; they handle quoting, IN lists and BETWEEN for you. The UPDATE/DELETE Generator keeps the WHERE clause front and centre. Designing tables? The CREATE TABLE Generator writes the right types and auto-increment syntax for MySQL, PostgreSQL, SQL Server or SQLite. The CSV to SQL Generator turns a spreadsheet export into INSERT statements, and the Relationship Diagram Generator draws your tables and foreign keys as a diagram.
Moving between databases is where most SQL headaches start. The Data Type Mapping Reference and Date/Time Function Reference show the equivalent in five databases side by side. The Pagination Builder writes LIMIT/OFFSET or FETCH NEXT, and the Dialect Quoting Converter swaps backticks, double quotes and brackets. For learning, the SQL JOIN Visualiser shows which rows each join keeps, and the LIKE Pattern Tester shows exactly what % and _ match.
Questions and answers
- What's the difference between the SQL Formatter and the Plain-English SQL Explainer?
- The Formatter changes how a query looks without changing what it does. It puts each clause on its own line, indents conditions and subqueries, and can uppercase keywords, so the query is easier to read and review. The Explainer leaves the query alone and tells you what it does in words: which rows it keeps, how the joins behave, how the results are grouped and sorted. For an unfamiliar query, format it first, then explain it.
- Should I use the SELECT Query Builder or the WHERE Clause Builder?
- Use the SELECT Query Builder when you're putting together a whole query: the table, the columns, the joins, the sort order and a row limit in your database's syntax. Use the WHERE Clause Builder when the hard part is the conditions. It quotes and escapes text values, turns a comma-separated list into
IN (…), writesBETWEENcorrectly and usesIS NULLwhere= NULLwould silently match nothing. You can paste its result into the SELECT builder's WHERE box. - When would I use the CSV to SQL Generator instead of the CREATE TABLE Generator?
- They do different halves of the same job. The CREATE TABLE Generator creates an empty table, with column types, keys and auto-increment written for your database. The CSV to SQL Generator fills a table that already exists, turning each CSV row into an INSERT. It handles quoted fields with commas in them, keeps leading zeros on phone numbers and codes, and splits big imports into batches. To load a spreadsheet into a new table, run the CREATE TABLE first, then the INSERTs.
- Why does a LEFT JOIN sometimes return more rows than I expect?
- A LEFT JOIN keeps every row from the first table, but if a row matches several rows in the second table, it appears once for each match. One customer with three orders gives three rows. The JOIN Visualiser shows which rows each kind of join keeps, including the "A not in B" pattern for finding rows with no match. The Plain-English Explainer will describe what your own join does. To get one row per customer, add a GROUP BY or join to a summarised subquery instead.
- How do I move a query from MySQL to PostgreSQL or SQL Server?
- Most of it carries straight across; the differences tend to be in a few places. Swap MySQL backticks for double quotes or brackets with the Dialect Quoting Converter. Use the Pagination Builder to turn
LIMITinto SQL Server'sOFFSET … FETCH NEXT. Look up date functions such asDATE_ADDorDATEDIFFin the Date/Time Function Reference, and column types such asDATETIMEorTINYINT(1)in the Data Type Mapping Reference. Then test the converted query on a copy of your data before relying on it.