Build SELECT queries with filters, joins and sorting, or CREATE TABLE statements — with identifiers and values safely escaped.
How to use this tool
SELECT query builder, or CREATE TABLE.
Leave columns blank for *. Column and table names must be valid identifiers.
e.g. age > 18 or city IN NYC, LA. Sorting and LIMIT are optional.
The SQL is shown with string values safely quoted (single quotes doubled).
Formula & worked example
Table users, columns id, name, filter age > 18, order name DESC, limit 10 gives: SELECT id, name FROM users WHERE age > 18 ORDER BY name DESC LIMIT 10;
Limitations — read this before you rely on it
This builds standard SQL for common cases. It does not support subqueries, window functions, GROUP BY/HAVING, or dialect-specific syntax beyond the generic form — and it cannot check your query against a real database schema. Always review generated SQL before running it, especially against production data.
Frequently asked questions
Strings are wrapped in single quotes and any single quote inside is doubled (O'Brien → 'O''Brien'), which is the SQL standard. Numbers, TRUE/FALSE and NULL are emitted bare.
To prevent injection through names: only letters, digits and underscores (optionally schema.table) are accepted, so a name cannot smuggle in extra SQL.
This tool builds queries and table definitions. The INSERT Generator turns rows of data into INSERT statements — a different job.
Yes — INNER, LEFT, RIGHT and FULL joins with a single ON equality condition each, via the builder's join options in code; the page form covers the common single-table case.
No — this page has no database. Copy the SQL into your database client.
