Sample data: O

Previous  Top  Next


Orders & order-lines

Customer orders with several order lines are a typical case for databases. The example can be expanded to "shopping cart with several items" and many other types of data. Below is a way to generate data for such a case. The Sample Video has a


Generating these is a two-step process:

1.generate the orders
2.for each order, generate at least 1 order line (with a product)


Orders table

Generate fixed number or random numbers of rows, eg: 2500.



Sequential number, starting at 1, increase by 1


Referential Link to Customers table


Random date


Value based on "order date", but increased with a few hours


Random paragraph, mostly empty


ORDERS table example


Order Lines table

Generate between 1 and 20 rows "for each in" the orders table. Select the OrderLines table and for Rows, select For each in... - then select the "master item" from the list: Orders. Enter values for "between 1 and 20" rows.


When generating data for the OrderLines table, you can select values from the "master" item, if required.



A link to the Orders table, here generated as a "master value"


A sequential number, starting at 1, unique for each "master" record


Referential link to the Products table, or a "lookup value" if the "product_price" should be correct.


Either a sample random value or a "lookup value" if it needs to be the same as in the Products table for the given ProductID.


Random number for the ordered quantity.


ORDERLINES table example