Canonical: https://toolipedia.app/sql-statement-builder-for-ddl-and-dml

# SQL Statement Builder for DDL and DML

Fill in a table and its columns, or pick ALTER, index, view, foreign key, trigger, grant, INSERT, UPDATE or DELETE, and get the SQL for MySQL, PostgreSQL, SQL Server, SQLite or Oracle.

Breadcrumbs: Toolipedia > Developer tools > Code and developer utilities > SQL Statement Builder for DDL and DML

## About SQL Statement Builder for DDL and DML

Fill in a short form and get correct SQL for the database you use. Choose CREATE TABLE and list the columns as lines such as 'id int pk auto' and 'email varchar(255) not null unique', or pick ALTER TABLE (add, drop or change a column), CREATE INDEX, CREATE VIEW, ADD FOREIGN KEY, CREATE TRIGGER, GRANT, INSERT, UPDATE or DELETE. Auto numbering, quoting and types are written the way MySQL, PostgreSQL, SQL Server, SQLite or Oracle expects, for example AUTO_INCREMENT in MySQL and IDENTITY(1,1) in SQL Server.

## How to use SQL Statement Builder for DDL and DML
1. Choose the database and the kind of statement, then type the table name.
2. Fill in the fields that appear for that statement: columns with flags, index columns, values to insert, changes to make or a WHERE condition.
3. Copy the SQL. Read the notes under the result, for example when an UPDATE or DELETE has no WHERE condition.

## Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.

## Also known as
- sql statement builder for ddl and dml
- create table
- alter
- index
- sql insert builder
- sql update builder
- sql delete builder
- add column builder
- create index builder

## Frequently asked questions

### What flags can I use on a column line?

pk, auto, not null, unique, default value and references table(column), after the name and the type. Portable types such as bool, datetime, uuid and json are translated for the chosen database.

### Are the values I type protected against SQL injection?

Text values are quoted and their quotes doubled, but this tool is for building statements by hand. In application code always pass values as query parameters.

### Why does SQLite show a comment instead of a statement for GRANT?

SQLite has no users or GRANT statement. Access is controlled by the permissions of the database file, so the tool says so instead of writing SQL that would fail.

### Is SQL Statement Builder for DDL and DML free?

Yes. SQL Statement Builder for DDL and DML on Toolipedia is free to use, with no sign-up and no watermark.

### Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

### Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

### Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

## Related tools

More free tools that go well with SQL Statement Builder for DDL and DML:
- [CSV to SQL](https://toolipedia.app/csv-to-sql)
- [SQL Schema Diff](https://toolipedia.app/sql-schema-diff)
- [SQL Query Builder](https://toolipedia.app/sql-query-builder)
- [SQL Reserved Word Checker](https://toolipedia.app/sql-reserved-word-checker)
- [SQL formatter](https://toolipedia.app/sql-formatter)
