SQL Query Builder
Select columns, connect tables, create conditions and export readable SQL. Your schema and work stay in this browser. Back up important queries as JSON files.
Select columns
Choose what the query returns and optionally summarize values.
Join tables
Connect related data using explicit column pairs.
Filter rows
Only include records that match your conditions.
Group & summarize
Aggregate results and filter groups with HAVING.
Group by
Having
Sort & limit
Order output rows and cap the result set.
Relationships and join paths
Solid connections are explicitly confirmed; dashed suggestions come only from names and compatible types. No database was inspected.
Accessible relationship list
Select a relationship to add an actual join. A suggestion must be confirmed or explicitly acknowledged.
Edit your schema
Define table and column names exactly as they exist in your database.
Supported DDL import: simple CREATE TABLE statements with columns and single-column primary/foreign keys. Unsupported clauses cause import rejection, not silent removal. No SQL is executed. Import related tables together.
Schema JSON format: {"tables":[{"id":"users","name":"users","columns":[{"id":"id","name":"id","type":"integer"}]}]}. IDs are internal stable keys; table and column names become quoted SQL identifiers. Editing a referenced name updates generated SQL.
A query without typing SQL.
Start with a base table, pick columns on the left, and join related tables when you need columns from elsewhere. Add filters, grouping and ordering, then review the SQL preview on the right.
- Design the schema. Use the demo or import definitions from your own database.
- Select output columns. COUNT, SUM, AVG, MIN and MAX are supported for appropriate types.
- Connect tables. Set each join's left/right keys; a joined table is added only once.
- Add conditions. Values are represented as parameters by default.
- Generate & export. Copy SQL and bindings or download a project backup.
Security and limitations
Generated SQL is a SELECT statement only. This tool does not connect to a database, inspect credentials or execute SQL. Parameter placeholders must be bound in your application's database driver; never concatenate untrusted user input into executable SQL. This builder supports up to three simple WHERE groups or an optional bounded four-level AND/OR/NOT tree; subqueries, CTEs, windows, arbitrary expressions and self-joins remain unsupported.
Untrusted project and schema JSON is validated, never evaluated as JavaScript. This editor stores autosaved draft data in your browser; export a JSON backup before clearing site data.