Skip to content
toolgrid

No tool found. Try another word.

SQL Query Builder

Build SQL queries without typing them: pick the statement, table, columns, values and WHERE conditions, and get correctly quoted SQL for your database.

Conditions (WHERE)
SQL

        

Numbers, NULL, TRUE and FALSE are written as they are; everything else becomes a quoted string. Use parameters in real code to prevent SQL injection.

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the SQL Query Builder

  1. 1 Choose the statement type and your database.
  2. 2 Enter the table, columns, values and conditions.
  3. 3 Copy the generated SQL.

About the SQL Query Builder

The query builder writes the SQL for common statements from a few fields: which columns to select, which values to insert or update and which conditions go in the WHERE clause. It is useful when learning SQL, for quick one-off queries and for generating test data statements.

Identifiers are quoted the way your database expects: `backticks` for MySQL and MariaDB, "double quotes" for PostgreSQL and SQLite, [brackets] for SQL Server, so names with spaces or reserved words such as "order" work. Values are written as literals: numbers, NULL, TRUE and FALSE as they are, text in single quotes with any quote inside doubled.

Generated queries are meant for manual use. In application code, never build SQL by joining user input into a string; use prepared statements or your framework's query builder with parameters, which prevents SQL injection.

Frequently asked questions

Why are my column names in quotes?

Quoting makes names with spaces, capitals (in PostgreSQL) or reserved words work. Choose "no quoting" if you prefer plain names.

How do I write IN conditions?

Choose IN and enter the values separated by commas: NL, BE, DE becomes IN ('NL', 'BE', 'DE').

Does an UPDATE or DELETE without conditions affect all rows?

Yes. Without a WHERE clause every row in the table is changed or deleted, so always double-check before running it.

Is this safe against SQL injection?

Values are escaped, but the builder is for writing queries by hand. In applications, always use parameterized queries.