Build SELECT queries visually: pick a table, add columns, JOIN another table, set WHERE conditions and ORDER BY — then copy the formatted SQL.
Writing a SELECT query from scratch means remembering which table alias belongs to which column, whether the JOIN condition reads left-to-right or right-to-left, and whether to put the filter in WHERE or HAVING. This builder externalises all of that: type a table name, click Add Column for each expression you want, attach a JOIN, drop in a WHERE condition, and the formatted SQL updates immediately. No syntax to memorise.
The page opens pre-filled with a realistic e-commerce scenario — the orders table joined to customers, two WHERE conditions filtering by status and amount, and an ORDER BY clause — so you see the output immediately without typing anything. Every input field persists across reloads, so a query you were working on yesterday is still there when you return. Press Load Sample a second time to cycle to an analytics scenario with a GROUP BY aggregation.
The lead sample sets Table to orders, adds five SELECT columns including customers.name AS customer_name and orders.total_amount, attaches an INNER JOIN to customers on customers.id = orders.customer_id, and two WHERE conditions: orders.status = 'pending' AND orders.total_amount > 100. The ORDER BY is set to orders.created_at DESC with a LIMIT of 50. The output is a fully indented six-clause SELECT that runs directly in any SQL client. Swap INNER JOIN to LEFT JOIN with one click if you also want customers who have no orders.
FROM table. Add an alias (like o) and every subsequent field can use that short prefix instead of repeating the full table name.SELECT DISTINCTkeyword, which removes duplicate rows from the result. It runs after all JOINs and WHERE filters, so a duplicate row is one where every selected column matches exactly.orders.id), an aggregate (COUNT(*), SUM(total_amount)), a string literal ('shipped'), or an arithmetic expression (price * quantity). Leave all columns empty to generate SELECT *.IS NULL and IS NOT NULL hide the value field automatically because they take no right-hand operand. Use IN with a parenthesised list like (1, 2, 3) or IN with a subquery; both are written into the value field as-is.The builder generates syntactically correct SQL for the inputs you provide, but it does not validate semantics. A column name that does not exist in the table, a JOIN condition that references a column from the wrong alias, or a GROUP BY that omits a non-aggregate SELECT column will all produce a query that formats cleanly here but errors in the database. There is no HAVING clause builder — if you need to filter on an aggregate (e.g. HAVING COUNT(*) > 10), copy the generated SQL into the SQL Formatter tool and add the clause by hand. Subqueries, window functions and CTEs are likewise out of scope; the builder covers the 80% of SELECT queries that developers write daily.
LIMIT accepts only a positive integer; a value of 0 is silently omitted from the output because most databases treat LIMIT 0 as an empty result rather than as “no limit”. To remove a limit entirely, clear the field.
1. FROM — Main Table
2. SELECT Columns
4. WHERE Conditions (2)