Use the AdventureWorks Sample Database for Your Examples

Whenever I want to explain something that requires a database, I have to spend a lot of time to create the tables and test data before I even can start with the part I want to show. The more time I spend with the setup, the less time I have to write the blog posts. However, most examples do not require handcrafted tables. They would work with any table, as long as there is just enough test data.

Microsoft created a long time ago the fictitious multinational manufacturing company called Adventure Works and shipped the AdventureWorks database as part of SQL Server. That stopped a few releases ago, but the database still does exist. With nearly 20.000 customers, over 70.000 orders and 500 products there is enough data for your examples. Thanks to the liberal license (MIT license), you are allowed to use this database for whatever you like.

You can download a backup of the database for your version of SQL Server as part of the SQL Server Samples Repository. You can choose between these editions:

  • OLTP: all you need (48 MB)
  • Lightweight (LT): with a smaller set of data (7 MB)
  • Extended data warehouse (DW_Ext): with a lot more data (883 MB)

The file size is small, but there are many tables inside this database. To navigate around you should download the AdventureWorks OLTP Database Diagram for Visio:

 

Conclusion

Instead of spending hours on creating sample databases, I will use the AdventureWorks database whenever I need just a database for my samples. Try it with your next example; it may save you a lot of time.

2 thoughts on “Use the AdventureWorks Sample Database for Your Examples”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.