When working on the Mastering Tabular video course, we needed a sample database with more data than what we had at our disposal in existing sample databases. We also wanted to be able to control the content so that different trends in the data present for specific countries or stores could be available, thus allowing us to recreate specific situations we wanted to demo in future articles and videos.

For these reasons, our latest investment is a tool we created that is able to generate different versions of the Contoso database used for the course.

We have now cleaned up the code and produced minimal documentation to share the tool and make it available for free in an open-source project on GitHub: Contoso Data Generator.

You can use the content available in different ways:

  • Download an existing, ready-to-use Contoso database. You get a backup that you can restore on a SQL Server or Azure SQL instance. No programming skills are required. Just download from the latest release.
  • Produce your own Contoso database. Download the executable, customize the parameters, and run the scripts to control the content of the database in terms of volume and data distribution. You must alter configuration files and the PowerShell scripts. No knowledge of SQL or C# is required.
  • Customize the C# code of the tool to implement new features. There is a Visual Studio solution with a C# project running in .NET Core 3.1. You must be a C# developer to partake in this game.

The content of the database is based on the Microsoft Contoso sample database. We added stores and customers using other files obtained by random data generation services. You can customize all these files and produce any content you want.

The transactions generated in the Sales table are not entirely random: there are parameters used to control the distribution of transactions over products, customers, stores, and time. You can spend many nights playing with these parameters, and obtain different databases that can produce trends and exceptions you can analyze for your demos.

We hope to see other contributions to this project, even just to improve the minimal documentation we have produced so far!