SQL Test Data Generator — Dummy INSERT Rows for Fixtures

Generate dummy INSERT rows for fixtures and database seeds. Start from a preset, rename the columns and copy SQL for PostgreSQL, MySQL or SQLite. Emails and phone numbers come from reserved example ranges. This is not a converter, an SQL formatter, a live mock API, a fake identity pack or an online SQL sandbox.

Loading…
Notes on SQL test data
Dummy INSERT rows for fixtures and database seeds. Identifiers are quoted for the chosen dialect and values follow the column types. This is not a JSON to SQL converter, not an SQL formatter and not a fake identity pack.

How generation works

Pick a preset, a country, a quantity (1–100), an SQL table name and a dialect. CREATE TABLE IF NOT EXISTS can be added in front. Edit column names and types in the column table, or paste a header row or a simple CREATE TABLE. Each change generates new SQL. Copy all copies the SQL shown in the preview.

Options

Preset
Fills the column list. With User rows you get an ID, first and last name, email, phone and username. With Company rows you get an ID, company name and email. With Address rows you get street, city, postal code and country. Blank keeps a single ID column. A new preset replaces your columns, and the table name too if you had not changed it.
Country
Sets the names, the style of company names, the reserved phone ranges and the postal code format of each row. The default follows the page language (United States on English and Spanish pages).
Quantity (1–100)
How many rows the INSERT contains, from 1 to 100.
SQL table name
Target of INSERT INTO and CREATE TABLE. Characters other than letters, digits and underscores become underscores, then the name is quoted for the dialect.
Dialect
PostgreSQL and SQLite use double quotes and TRUE or FALSE. MySQL uses backticks and 1 or 0. Table and column names are always quoted. Date and time values are written as YYYY-MM-DD HH:MM:SS.
CREATE TABLE
When on, CREATE TABLE IF NOT EXISTS comes first, with SQL types derived from the column types. Leave it off if the table already exists. DROP TABLE IF EXISTS only appears while CREATE TABLE is on, and it is off by default.
Schema columns
Each row of the table sets a column name and a type, up to 12 columns. You can paste a header such as id,email,phone or a simple CREATE TABLE to replace the list. When the schema has name columns, the email and username of a row are built from that row’s name.

Examples

User rows, PostgreSQL

Settings

preset=user, dialect=postgres, CREATE off, count=2

Sample output

INSERT INTO "users" ("id", "first_name", …) VALUES ('…-uuid-…', 'Ada', …);

MySQL with CREATE

Settings

dialect=mysql, CREATE on

Sample output

CREATE TABLE IF NOT EXISTS `users` (`id` CHAR(36), …); INSERT INTO `users` …

Related tools

Need a JSON array instead? Use the JSON test data generator. For a spreadsheet, use the CSV test data generator. To convert JSON you already have, see JSON to SQL. To compact SQL you already have, see Minify SQL.

SQL test data FAQ

INSERT fixtures, dialects and what this tool does not do

Is this a JSON to SQL converter?

No. This page creates dummy rows as an SQL INSERT. To convert JSON you already have, use the JSON to SQL converter.

Is this an SQL formatter or an online SQL sandbox?

No. It does not reformat or minify existing SQL, and it does not run statements against a database. To compact SQL you already have, use Minify SQL.

I already have a table. Should I turn CREATE on?

Leave CREATE TABLE off. Turn it on only when you need CREATE TABLE IF NOT EXISTS before the INSERT. DROP TABLE stays off unless you tick it after turning CREATE TABLE on.

Do emails use gmail.com or real inboxes?

No. Emails use example.com, a domain reserved by IANA for examples, and phone numbers stay in reserved test ranges. Any match with a real person is a coincidence.

Dummy names, emails, phone numbers, addresses, dates, IBANs, card numbers and JSON, CSV or SQL rows for fixtures and database seeds. Everything is generated in your browser.