GenerateRandomSearch

Relational Test Data Generator

A single table of made-up people will not tell you whether your import handles a child row pointing at a parent that was never loaded, because a single table cannot have that problem. This builds three tables that reference each other — customers, their orders, and the lines on each order, or the same shape for a blog or a school — and guarantees that every reference resolves. It will also plant a stated number of broken ones on request, so you have something to test the failure path with.

What this generator does

Fills a parent table, then a child table for each of those rows, then a third for each of those, so the result is a small database rather than a spreadsheet. Deliberate defects are counted, not sprinkled: ask for five broken references and you get five.

How to use this tool

  1. Pick which three tables you want and how many rows the first one should have.
  2. Set how many child rows each parent gets, as a range.
  3. If you are testing an importer, ask for some broken references, some repeated keys, or some blanks.
  4. Build the tables, then copy them as INSERT statements, JSON, CSV or plain columns.

Understanding the controls

Which tables
Three ready-made shapes — a shop, a blog and a school. Each is three levels deep and has at least one column that may be left blank.
Rows and child rows
The first table's row count, and the range of child rows each parent gets. A lowest of zero gives you parents with nothing underneath, which is its own useful case.
Broken references and repeated keys
Exact counts, not rates. Repeated keys are only ever placed in the last table, so that defect cannot accidentally cause the other one.
Blanks
A percentage, applied only to columns marked optional. A column that is not optional is never left empty.
Repeat word
The word these rows were built from. It goes into the address bar, so the link gives back exactly these rows — which is what a fixture needs when it has to be the same tomorrow and the same for whoever else runs the tests. Leave it empty and one is chosen for you.

Common use cases

  • Filling a development database with rows that actually join
  • Testing that an import rejects exactly the bad rows and keeps the good ones
  • Demonstrating a query or a report with data that looks plausible
  • Checking that a screen behaves when an optional field is blank
  • Producing the same fixture twice by reusing the repeat word

How this generator works

Before the rows are shown, they are read back and checked as an importer would read them: every reference is looked up in its parent table, every key is counted for repeats, every required column is checked for blanks, and every derived total is multiplied out again from the two columns it came from. The results of those checks are printed under the tables, so the promise is visible rather than claimed.

Randomness and fairness

Rows are built from a repeat word taken from your browser's secure generator unless you type one of your own, and that word goes into the address bar, so the link gives the same rows back to whoever opens it. A repeat word is there so a fixture can be reproduced, which is the opposite of being secret — it is not a cryptographic strength and nothing generated here should stand in for anything that needs one.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Three tables, one child table per parent. It does not model many-to-many joins or self-references.
  • Names, emails and addresses are invented and use example.com, so they are safe to commit but will not pass a real deliverability check.
  • Up to 60 rows in the first table and 8 children each, which is a fixture rather than a load test.
  • Asking for more defects than there are rows to hold them plants as many as will fit and tells you how many that was.

Privacy and your data

Everything is built in your browser. No settings and no generated rows are transmitted or stored.