Está en la página 1de 6

Your First Look at the SQL Server 2008 R2 Sample Databases

Your First Look at the SQL Server 2008 R2 Sample Databases

Table of Contents
Your First Look at the SQL Server 2008 R2 Sample Databases ................................................. 1
Exercise 1 Exploring the Adventure Works Databases ..................................................................................................2

Your First Look at the SQL Server 2008 R2 Sample Databases

Your First Look at the SQL Server 2008 R2 Sample Databases


Objectives
After completing this lab, you will be better able to: Explore the AdventureWorks2008R2 database Explore the AdventureWorksDW2008R2 database Create a database diagram for the Reseller Sales subject area of the AdventureWorksDW2008R2 database

Scenario

This lab introduces the Adventure Works sample databases. The lab scenarios in this course center around the sales activites of the Adventure Works company. Adventure Works manufactures and sells bicycles and related products to various global markets via reseller and internet channels. 15 Minutes

Estimated Time to Complete This Lab Computers used in this Lab

VEGAS The password for the Administrator account on all computers in this lab is: Password;1

Page 1 of 4

Your First Look at the SQL Server 2008 R2 Sample Databases

Exercise 1 Exploring the Adventure Works Databases


Scenario
In this exercise, you will explore both the AdventureWorks2008R2 and AdventureWorksDW2008R2 databases. The AdventureWorks2008R2 database represents an OLTP database; the AdventureWorksDW2008R2 represents the data warehouse and consists of two subject areas: Sales and Finance. You will then create a database diagram for the Reseller Sales subject area of the AdventureWorksDW2008R2 database. Tasks Complete the following tasks on: VEGAS
1. Exploring the

Detailed Steps Note: In this task, you will use SQL Server Management Studio to explore the tables in the AdventureWorks2008R2 database.
a. Launch the Configuration Wizard for this lab by double-clicking the

AdventureWorks200 8R2 Database

Dependencies.dep file located at C:\LabFiles\Labs\SQL10R2BYFBI01-HOL01\Source\Setup. Install any pre-requisites that are missing (rescanning if necessary) and complete the wizard. Note: If your setup fails, please restart the VEGAS Virtual Machine by hitting Start | Restart, give it a few minutes to restart on the backend then connect to the lab again, then repeat the step above.
b. Open SQL Server Management Studio from Start | All Programs | Microsoft SQL

Server 2008 R2 | SQL Server Management Studio.


c. When prompted, in the Connect to Server window, configure the connection

based on the following values, and then click Connect. Note: If you are not prompted to connect, first ensure that the Object Explorer window is open. If the Object Explorer window is not open, on the View menu, select Object Explorer. Then, inside the Object Explorer window, click Connect, and then select Database Engine.

d. Inside the Object Explorer window, expand the Databases folder, and then

expand the AdventureWorks2008R2 database.


e. Expand the Tables folder and note the large list of tables.

Page 2 of 4

Your First Look at the SQL Server 2008 R2 Sample Databases Tasks Detailed Steps Note: The tables are grouped by schema name, including HumanResources, Production, Purchasing and Sales. Realistically, each of these schemas would likely be a separate database.
f. 2. Exploring the

In the Object Explorer pane, collapse the AdventureWorks2008R2 database folder.

AdventureWorksDW 2008R2 Database

Note: In this task, you will use SQL Server Management Studio to explore the tables in the AdventureWorksDW2008R2 database.
a. In the Object Explorer window, expand the AdventureWorksDW2008R2

database folder.
b. Expand the Tables folder and note the list of tables.

Note: The tables in the data warehouse are prefixed with either Dim or Fact denoting their role in the star schema.
3. Creating the Reseller

Sales Database Diagram

Note: In this task, you will use SQL Server Management Studio to create a database diagram that includes the FactResellerSales and FactSalesQuota tables, and their associated dimension tables.
a. To create a new database diagram, in the Object Explorer window, in the

AdventureWorksDW2008R2 database, right-click the Database Diagrams folder, and then select New Database Diagram.
b. If prompted to create the support objects, click Yes. c. To introduce tables to the database diagram, in the Add Table window, select the

DimDate table. Then, while pressing the Control key, select these additional tables, DimEmployee, DimProduct, DimProductCategory, DimProductSubcategory, DimSalesTerritory, FactResellerSales, FactSalesQuota and then click Add.
d. When the tables have been added to the database diagram, in the Add Table

window, click Close. Note: SQL Server Management Studios database diagramming tool retrieves the metadata that describes each table, including its columns, primary key and any foreign keys to related tables. It then arranges the tables in an easy to read layout.
4. Adding an

Note: In this task, you will add an annotation to provide a title for the diagram.
a. Scroll to the top of the diagram. b. To add an annotation, right-click in the top left corner of the diagram, and then

Annotation to the Database Diagram

select New Text Annotation.


c. Inside the annotation box, type Adventure Works Reseller Sales. d. To format the annotation, right-click the border of the annotation box, and then

select Set Text Annotation Font.


e. In the Font window, modify the Size property to 20, and then click OK. f. 5. Exploring the

If necessary, resize the annotation box to allow the entire text to be displayed by dragging the middle squares located on the borders.

Database Diagram

Note: In this task, you will explore the tables and relationships in the database diagram. To facilitate exploring the database diagram, click on the four-headed arrow located in the bottom right corner. While continuing to hold the click, drag about the thumbnail view to navigate across the diagram.

Page 3 of 4

Your First Look at the SQL Server 2008 R2 Sample Databases Tasks Detailed Steps

a. Explore the database diagram to understand the table and relationship design. In

particular note the following:

The two fact tables comprised of dimension foreign keys and measures The relationships from the two fact tables to the single conformed Date and Employee dimension tables The snowflake Product dimension tables (DimProductCategory > DimProductSubcategory > DimProduct) The StartDate and EndDate columns in the DimEmployee and DimProduct tables that suggest Type 2 Slowly Changing Dimensions are managed The self-referencing relationship on the Employee dimension table to support a parent-child hierarchy

6. Finishing Up

Note: In this task, you will finish up by saving the database diagram and closing all open applications.
a. To save the database diagram, on File menu, select Save Diagram_0. b. In the Choose Name window, replace the text with Reseller Sales, and then click

OK.
c. In the Object Explorer window, in the AdventureWorksDW2008R2 database,

expand the Database Diagrams folder, and then verify that your diagram has been saved.
d. To close SQL Server Management Studio, on the File menu, select Exit.

Page 4 of 4

También podría gustarte