Related tables with foreign keys

3 November 2026

Generate users with their orders and order lines in one go. Child rows point to real parent ids, so the data loads into a database without broken references.

Real databases are rarely one table. RNDGen can now generate several related tables at once: users and their orders, orders and their lines, companies and their contacts.

Add a related table, set how many child rows each parent gets, and add a reference field. Every child row then points to an id that really exists in the parent table, so foreign keys hold when you import the data.

It works in every format. SQL puts the INSERT statements in dependency order, parents first, for PostgreSQL, MySQL, SQLite and SQL Server. JSON gives one object with an array per table, Excel a sheet per table, and CSV and the other formats a zip with a file per table.

Related tables need a free account: up to 3 tables per schema on Free, 20 on Pro and 50 on Team.

All updates