Visual SQL Query Builder
Build a SQL SELECT statement without writing it by hand. Choose your table and columns, add WHERE conditions, joins, sorting and a row limit using simple fields, and the query updates live. String values are quoted and escaped for you so the output is ready to copy into your editor or client.
How to build a SQL query
- Enter the table name and add the columns you want, or leave it empty to select everything.
- Add WHERE conditions, joins, ORDER BY rules and a LIMIT using the fields below.
- Copy the generated SELECT statement straight into your database client.
Examples
Filter by a number
table "users", columns id and name, where age > 21
SELECT id, name FROM users WHERE age > 21
Join, filter and sort
users LEFT JOIN orders, where active is true, order by name, limit 25
SELECT u.id, u.name FROM users u LEFT JOIN orders o ON o.user_id = u.id WHERE u.active = TRUE ORDER BY u.name ASC LIMIT 25
Frequently asked questions
What does the SQL query builder do?
It turns a few form fields into a SQL SELECT statement. You pick a table and columns and add WHERE conditions, joins, ORDER BY rules and a LIMIT. The tool assembles a clean, properly spaced query, quoting and escaping string values so you can paste the result directly into your database client.
How are string values quoted and escaped?
Text values are wrapped in single quotes, and any single quote inside the text is doubled, which is the standard SQL escape. So O'Brien becomes 'O''Brien'. Numbers are left bare, booleans become TRUE or FALSE, and a null value becomes NULL without quotes.
Which operators and clauses are supported?
WHERE conditions support =, !=, >, <, >=, <=, LIKE, IN with a list of values, and IS NULL. You can chain conditions with AND or OR, add INNER, LEFT or RIGHT joins, sort with ORDER BY ascending or descending, and add LIMIT and OFFSET. It builds SELECT queries only.
Does it run my query or connect to a database?
No. The builder only generates SQL text. It never connects to a database, runs the query or validates it against a real schema. Always review the output and test it against your own database before using it in production.
Is my data private?
Yes. Everything happens in your browser. The table names, column names and values you type are never uploaded, logged or stored on a server.
Should I treat the values as safe from SQL injection?
The builder escapes single quotes in string values, which is enough to keep generated literals well formed. It is meant for composing queries by hand, not as a substitute for parameterized queries in application code. For user-supplied input in an app, always use bound parameters.
Related tools
SQL Formatter
Format and beautify SQL online. Put clauses on their own lines, indent the column list and uppercase keywords. Fast and runs in your browser.
JSON to SQL
Convert JSON to SQL INSERT statements online. Paste an array of objects, set a table name, and get ready-to-run INSERTs. Runs in your browser.
CSV to SQL
Convert CSV to SQL INSERT statements online. Set a table name, pick a delimiter, and get clean, ready to run inserts. Fast and runs in your browser.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
Aspect Ratio Calculator
Calculate aspect ratios fast. Enter a ratio like 16:9 and one dimension to get the other, or enter width and height to simplify the ratio.
Base58 Encoder
Encode and decode Base58 online with the Bitcoin alphabet. Convert text to Base58 or back, UTF-8 safe, no confusing 0 O I l. Runs in your browser.