Relational Data Generator β Multi-Table Datasets with SQL INSERT
Build 2β5 related tables with real foreign key relationships and guaranteed referential integrity. Export as SQL INSERT scripts (MySQL, PostgreSQL, SQLite, SQL Server) with bulk inserts and transaction wrapping, or as multi-file CSV/JSON/XML. Up to 5,000 records per table. Entirely browser-based β your schema never leaves your device.
Quick-start templates β or build from scratch
Field Types
Click to add to the active table tab.
Select a template above or click "+ Add Table" to start building
Choose a template or start from scratchPick from 5 pre-built templates β e-commerce, CRM/SaaS, blog/CMS, HR system, or healthcare β to get a complete multi-table schema loaded instantly with realistic column names and record counts. Or add your own tables from scratch.
2
Configure each tableClick a table tab to make it active. Add columns from the field picker. Use the Foreign Key field to link child tables to parent tables β choose which table and column to reference, and whether the distribution should be random or sequential.
3
Set record countsEach table has its own record count. Typical ratios: 100 customers β 500 orders β 2,000 order items. Up to 5,000 records per table.
4
Choose output format and SQL dialectFor SQL, select your database. The output uses correct types, quoting, and bulk INSERT syntax per dialect. MySQL gets autocommit wrapping; PostgreSQL gets BEGIN/COMMIT; SQLite wraps everything in one transaction; SQL Server caps at 1,000 rows per statement.
5
Generate and downloadClick Generate Dataset. Switch between table tabs in the output to preview each table's data. Download the complete file β one SQL script for all tables, or a ZIP for multi-file formats.
When to Use This Tool
Seeding a development or staging database that has FK constraints between tables
Generating a complete ready-to-run SQL script for a colleague or CI pipeline
Building demo environments where data relationships need to be coherent
Load testing with thousands of realistically related records across multiple tables
Creating integration test fixtures that span multiple database tables
Generating nested JSON for API mock servers that need parent-child structures
π Privacy & Security
All generation runs entirely in your browser. Your table names, column names, schema design, and all generated data stay on your device. No network requests are made at any point. This matters especially in enterprise environments where even fictional schema designs may be sensitive.
What is referential integrity and why does it matter?▼
Referential integrity means every foreign key value in a child table actually exists as a primary key in the parent table. Without it, orders can reference non-existent customers, which causes import errors when FK constraints are active in your database. This tool guarantees every FK value is a real ID from the parent table β it generates parent tables first, collects all IDs, then uses only those IDs when generating child tables.
What is the difference between Random and Sequential FK distribution?▼
Random picks any parent ID for each child record β this creates realistic clustering where some parents have many children and some have few, just like real data. Sequential distributes children evenly across all parents so each parent gets approximately the same number of child records. Use Random for realistic demos and load tests; use Sequential when you need predictable, evenly distributed data for testing specific scenarios.
How does the SQL bulk INSERT and transaction wrapping work?▼
Records are grouped into batches (default 500 rows per INSERT statement) using multi-row VALUES syntax. MySQL wraps each batch with SET autocommit=0 and COMMIT β disabling autocommit is the single largest MySQL INSERT performance lever. PostgreSQL wraps batches in BEGIN/COMMIT blocks. SQLite wraps the entire table in one BEGIN TRANSACTION/COMMIT since individual transactions are the equivalent of bulk insert. SQL Server uses BEGIN TRANSACTION/COMMIT with a hard cap of 1,000 rows per statement enforced automatically.
Can I add multiple foreign keys to one table?▼
Yes. A single table can reference multiple parent tables. For example, an order_items table might have both an order_id FK referencing the orders table and a product_id FK referencing a products table. Click the Foreign Key chip once for each FK column you want to add.
What does nested JSON output look like?▼
Nested JSON embeds child records directly inside their parent records. For example, each customer object contains an orders array, and each order object contains an order_items array. This format is useful for API mock servers, GraphQL fixtures, and any scenario where the consumer expects a hierarchical data structure rather than separate flat tables.
Does this tool send any data to a server?▼
No. All generation runs in JavaScript in your browser tab. No data is transmitted anywhere at any time. You can even use this tool while offline once the page has loaded.