Create Master-Detail Datasets


We would like to create master-detail tables (relational datasets) where the Master contains customers and the Details table contains a variable number of orders. For example: a Customers dataset would contain customer data mapped to a Orders dataset containing a variable number of orders. An example schema would look like:

Customers Dataset
Customer_ID (serves as primary key)

Orders Dataset
Order_ID (serves as primary key)
Customer_ID (serves as foreign key)

Creating the Customer dataset is pretty straight forward but I’m not clear how to use Mockaroo to create variable numbers of mock Orders, e.g., Customer “123” ordered 5 items over 3 dates, while Customer “456” ordered 2 items on a single date, and so on.

The Mockoroo Foriegn Key tutorial on YouTube ( seems to only support lookup values - not mocking up multiple/variable values tied to another dataset.

Any options/suggestions here?

I just finished making this myself

I gave each customer an id field RowNumber type - I’m using the free account so I get 1000 records.
I then saved this as a Dataset setting up a static set of data.

Then in the detail I use a formula to retrieve the Customer Number:
from_dataset("Customers", "Customer_ID", id: random(1,1000))

Still new to all this, apparently there’s a DataSet type
I’ve made an updated schema:

Details From Master Datasets

Even though I have it set to random, it seems to pull numbers sequentially. My first version seems to be more random.