AdventureWorks Sample Database

What is the AdventureWorks sample database?

Microsoft has made available an example database called AdventureWorks that is intended for testing and demonstrating different Microsoft SQL Server functionalities. It is often used in learning and training environments so that students may learn and put their SQL queries and data manipulation skills to practice.

AdventureWorks download

You can download the sample from Microsoft’s website or Github. Installation instructions are described on the download pages.

AdventureWorks ER Diagram

In this article you will learn how to easily create an ER diagram of the AdventureWorks sample database. The following screenshot shows the ER diagram for the Person schema.

AdventureWorks sample database - ER Diagram

How to create the ER diagram in Luna Modeler

This section assumes that you have the AdventureWorks database installed.

Step 1: Run Luna Modeler and create a new SQL Server connection

On page Connections, click the Create New Connection button. New modal form opens. Specify the connection name and other connection properties.

Connection to SQL Server database - AdventureWorks sample

Step 2: Reverse engineer the database structure

Go to the Connections page and click Connect and Load Existing Database Structure to reverse engineer the database and create the ER diagram.

Reverse engineering of the AdventureWorks sample database

Step 3: Create sub-diagrams

For more convenient work with the ER diagram, it is a good idea to divide it into smaller parts. In Luna Modeler you can easily split the main diagram and automatically create a sub-diagram for each database schema.

To split the diagram, right click the diagram area and choose Add diagrams by Schemas.

Main ERD created with Luna Modeler.

Step 4: Change the layout and rearrange items

Rearrange items on the main diagram or on any sub-diagram. You can add notes, images and other elements to the ER diagram.

Subdiagrams created for each database schema.

Step 5: Change the display mode and line mode

Use the display mode and/or line mode that best suits your needs.

AdventureWorks sample & different display mode and line mode used in ERD created with Luna Modeler.

Other useful features of Luna Modeler

Once you have your ER diagram ready, you can generate an interactive HTML report, export the diagram to PDF or e.g. generate an SQL Script as shown in the screenshot below.

SQL Script generated from ER Diagram  for the AdventureWorks sample database.

Enjoy database modeling with Luna Modeler – the database modeling tool for SQL Server

Download

#

DATA MODELING TOOLS
DRAW Diagrams and
GENERATE Scripts
Download data modeling tools
Blog Categories
Blog by Platforms