Developer Utilities

SQL Query Builder

All tools

Fill in a form and get a parameterized SELECT, or paste SQL to load it back into the form.

How it works

Four simple steps

1

Define tables & columns

Add joins, filters, order, and limit visually.

2

Pick a dialect

Toggle Postgres vs MySQL parameter style.

3

Generate SQL

Copy parameterized SELECT statements instantly.

4

Paste to reverse

Best-effort parse of SELECT…FROM…WHERE back into the form.

SQL Query Builder

About SQL Query Builder

A support engineer needs paid orders from the last month joined to customers, newest first, 50 per page, and does not write SQL every day. Rather than stitching it together from old snippets, they fill in the table, join and filters here and copy a query that uses placeholders instead of pasted values.

The form covers a base table and alias, a column list, any number of joins (inner, left, right, full outer or cross) with ON conditions, and WHERE rows linked by AND or OR. Operators include the usual comparisons, LIKE, ILIKE, IN, NOT IN, IS NULL and BETWEEN. GROUP BY, HAVING, a single ORDER BY column, LIMIT, OFFSET and DISTINCT round it out. With parameter mode on, values become

,
placeholders for PostgreSQL or ? for MySQL, and the value list appears in its own box ready for your driver. Identifiers are quoted for the chosen dialect, while expressions such as count(*) pass through untouched.

The reverse direction is best-effort: paste a single SELECT and the parser fills the form, though CTEs, UNIONs and nested parenthesised conditions only come back partially. A lint panel warns about SELECT *, a missing WHERE or LIMIT, joins without ON, and deep OFFSET paging. For document databases the MongoDB aggregation builder plays the same role, and the SQL beautifier helps when you need to read a long query before loading it.

The builder only writes text. It never connects to a database or asks for credentials, and the query stays in your browser tab.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

Use parameters for anything that ends up in application code. A bound value is always treated as data, so it cannot change the shape of the statement, and the database can reuse the prepared plan. Inline mode is handy for a one-off query in a console.

Choose BETWEEN as the operator and put both bounds in the value box separated by a comma. They become two bound parameters, for example BETWEEN

AND
in PostgreSQL.

The parser handles one SELECT with joins, a flat WHERE, grouping, ordering and paging. CTEs, UNION queries, window functions and nested parenthesised conditions do not map onto the form fields, so those parts are only partly recovered. Compare the regenerated SQL with your original before relying on it.

View more FAQs

Related tools

View all

Cron Calendar

Explain cron expressions and preview the next run times in any timezone.

Open

CSV to SQL

Infer column types and generate CREATE TABLE + INSERT statements from CSV.

Open

Log Pattern Miner

Cluster log lines into templates, surface anomalies, and mask PII locally.

Open

MongoDB Query Builder

Build find/aggregate pipelines visually and export mongosh snippets.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools