MySQL Query Generator

SQL Tools

Build MySQL SELECT, INSERT, UPDATE, DELETE and DDL from a form.

Runs entirely in your browser โ€” nothing is uploaded

What people do next

Features

  • SELECT, INSERT, UPDATE, DELETE and CREATE TABLE from one form.
  • Warns when an UPDATE or DELETE has no WHERE clause.
  • Joins, grouping, ordering and limits without remembering the clause order.
  • Backtick-quoted identifiers, so reserved words and spaces are safe.
  • Built in your browser โ€” schema names are never uploaded.

How to use the MySQL Query Generator

  1. 1Pick the statement type.
  2. 2Fill in the table, columns and conditions.
  3. 3Copy the generated query.

Frequently asked questions

Does this work with MariaDB?

Yes. MariaDB began as a fork of MySQL and the statement syntax this generates โ€” SELECT, INSERT, UPDATE, DELETE and basic CREATE TABLE โ€” is identical between them. The dialects diverge on newer and more specialised features, none of which this form produces.

Why does it warn about a missing WHERE clause?

Because UPDATE and DELETE without one apply to every row in the table, and that is almost never what someone building a query by hand intends. It is a warning rather than a block, since occasionally you do mean it โ€” but it should be a deliberate decision rather than an omission.

Why are the identifiers wrapped in backticks?

So that a column named `order` or a table with a space in its name still works. MySQL reserves a long list of words, and a query that runs fine today can break when a column is renamed into one of them. Backticks cost nothing and remove the whole class of problem.

Can it generate joins?

Yes, for SELECT. Add the joined table and the join condition, and the clause is placed in the right position โ€” after FROM and before WHERE, which is the ordering people most often get wrong when writing by hand.

Should I use this instead of an ORM?

For application code, no โ€” parameterised queries or an ORM protect you against SQL injection in a way a generated string does not. This is for the one-off query at a console, the migration you are drafting, and learning what the clause order actually is.