In writing previous blogs, I found myself having to search for old tables in which I had data to perform specific processing just to give examples and to make clear concepts.
However, the data I had available did not always match my needs, so I asked myself : how to generate fake realistic data?
I turned to Mockaroo one of the platforms for generating fake but realistic data.
![](https://nimbusintelligence.com/wp-content/uploads/2023/03/Initial_Interface-1024x611.png)
Type of data
The databases we use and would like to populate can contain data of many different types, and a strength of Mockaroo is the amount of data types it provides. There are as many as 169 of them!
Need a table that describe a person? You can find all the fields you are interested in: first name, last name, phone number, email address, gender. If the person described by this first table wanted to take a trip you can find all kinds of data to describe it :address, country, airport name, airport code and so on.
So, if you find yourself needing to populate any table you will likely find the types of data you need!
My favorite data type?
The Naughty string: «string which have high probability of causing issues when used as a user input data» (probably if your application can handle this then it can handle anything!).
![](https://nimbusintelligence.com/wp-content/uploads/2023/03/image_2023-03-23_160547605.png)
Insertion
When a new column is inserted some processing is possible.
For example, for a numeric datum you can select the range in which to generate it and the number of decimal places.
Remember: each data type has different customizable characteristics.
For each of the columns you can decide the percentage of rows containing null values.
![](https://nimbusintelligence.com/wp-content/uploads/2023/03/new_field-1024x73.png)
Very interesting feature is the Formula that provides a coding window where you can do some processing on the data generated by the platform.
Logical and mathematical operators are supported, you can create conditional statements and access some specific functions.
Exporting
After deciding on the types of columns to include in our table and before exporting it, it is necessary to set some characteristics:
- the number of rows
- the type of format in which to export it (CSV, JSON, Tab-Delimited, SQL, Cassandra CQL, Firebase, InfluxDB, Custom, Excel and XML are supported)
The format I am interested in is SQL, once selected I can choose the name of the table and also if I want the SQL statement for creating the table to be generated as well.
If I am satisfied with the preview I can proceed to download the file.
Cons
As you can see in the video the insertion of data into the table happens one row at a time so as many queries will be executed as there are rows to be inserted (+1 if there is also creation).
Another thing that is not really consonant if you want to use the product code for more demanding applications, is the absence of option to set primary key, foreign key and other details that might be formally and functionally relevant.
Additional strengths
Mockaroo offers additional possibilities:
If you have an account you can save your table templates and then use them when you need them.
It provides a Rest API that provides access to artificially constructed data in real time and without a call limit.