|
Adventureworks Sample Database
Here is an analysis of the AdventureWorks sample database from Microsoft Codeplex.
Related Topics: | Topics this page:
| Screen: Max • 1024 • 800
|
The name AdventureWorks refers to a ficticious large, multinational manufacturing company. "The company manufactures and sells metal and composite bicycles to North American, European and Asian commercial markets. While its base operation is located in Bothell, Washington with 290 employees, several regional sales teams are located throughout their market base. In 2000, Adventure Works Cycles bought a small manufacturing plant, Importadores Neptuno, located in Mexico. Importadores Neptuno manufactures several critical subcomponents for the Adventure Works Cycles product line. These subcomponents are shipped to the Bothell location for final product assembly. In 2001, Importadores Neptuno became the sole manufacturer and distributor of the touring bicycle product group. Coming off a successful fiscal year, Adventure Works Cycles is looking to broaden its market share by targeting their sales to their best customers, extending their product availability through an external Web site, and reducing their cost of sales through lower production costs."
There are several editions of SQL Server.
TIP:
Download and install the Express with Advanced Services edition.
It has the full-text search feature with FILESTREAM needed by AdventureWorks.
The Analysis Service Project (AdventureWorksAS) uses Microsoft SRSS (SQL Server Reporting Services).
Each version set of AdventureWorks has separate types of database:
DBCI and BICI -- Case Insensitive versions of DB and BI in the 2005 version -- are not offered in the 2008 version.
To satisfy the need for a simple database, Microsoft provides LT (for LighT) - a highly simplified and smaller sample database for developers and ITPros that are just starting to learn about relational database technology. [Yet there fewer examples for this.]
The Adventureworks database has grown in size and complexity over the years.
Microsoft offers in their CodePlex.com website several samples for Microsoft's SQL Server database under Microsoft's Public MS-PL license agreement)
Version | Download Page | Video | Size |
---|---|---|---|
2014 | Download | Video | - |
2012 | Download | - | - |
2008 | Download | - | - |
2005 | Download | - | - |
Each version has hardware platform-specific 32-bit (x86) and 64-bit (x64 and ia64) installers.
https://msftdbprodsamples.codeplex.com/releases/view/125550 Tutorial
VIDEO:
The Tech Brothers (Aamir and Raza) have created a
playlist of 200 videos
covering basic to advance level topics around SQL Server 2014.
Their
website sqlage.blogspot.com
also provides interview questions and tutorials on TFS and Windows Server.
www.sqlservermanagementstudio.net
Walkthrough: Installing the AdventureWorks 2008 Database with Visual Studio 2012 (on MSDN)
https://msdn.microsoft.com/en-us/library/hh231699(v=sql.110).aspx Tutorial
http://social.technet.microsoft.com/wiki/contents/articles/3735.sql-server-samples-readme.aspx#About_Crescent_Sample_Images SQL Server Samples
Power View is a feature of SQL Server 2014 Reporting Services Add-in for Microsoft SharePoint Server 2010 Enterprise Edition. Get https://www.microsoft.com/en-us/download/details.aspx?id=26719 Image Files for HelloWorldPicnic Sample Model in PowerPivot and Power View
Walkthrough: Installing the AdventureWorks 2008 Database (on MSDN)
SQL Server 2005 SP2a released May 7, 2007 assumes 32-bit (x86) in file name AdventureWorksDB.msi.
The .msi file for this version installs to
folder \Program Files\Microsoft SQL Server\100\Samples.
Before installing this, install Visual Studio 2008 SP3 (for .NET Framework 3.5 SP1) and install SQL Server 2008. During setup, "enable FILESTREAM for Transact-SQL access" and "enable FILESTREAM for file I/O streaming access" should be selected along with the Windows share name and "Allow remote clients to have streaming access to FILESTREAM data" control.
If FILESTREAM remains disabled by default after setup, you would need to enable the two separate layers of FILESTREAM in sp_configure/reconfigure from Start > All Programs > Microsoft SQL Server 2008 > Configuration Tools > SQL Server Configuration Manager.
MS MVP Pinal Dave does such a great job explaining the install steps.
After running the Database.msi file for this version, click Start > Programs > Microsoft Community.
Invoke SQL Server Management Studio.
Pull down the Quote menu to enable SQLCMD mode.
Dig into folder
C:\Program Files\Microsoft SQL Server\100\Tools\Samples\AdvertureWorks OLTP\
and edit file instawdb.sql.
To avoid creating empty tables, in the sql file uncomment the :SET @data_path lines.
Confirm the installation by invoking the SQL Management Studio's Object Explorer and under "Databases", open AdventureWorks2008.
The supertype/subtype contact tables in 2005 are no longer in 2008. In 2005, when full address information is needed from subtype tables (EmployeeAddress, CustomerAddress, and VendorAddress), they are joined to supertype table Contact. This drew criticism from those using Microsoft's ADO.NET Entity Framework 1.0 (EF) to access AdventureWorks 2005 in isolatation from the underlying logical database schemas by referencing XML Entity Data Models (EDM) or LINQ classes mapped from the physical schema.
Ironically, this refactoring cannot be easily used within EF 1.0 because EF has not yet been refactored to use the new SQL Server 2008 datatypes in AdventureWorks2008 sample databases. So there is no end-to-end for 2008?
The hierarchyid datatype. This uses Common Language Runtime User Defined Type (CLR UDT) facilities insteads of the reflexive pattern of recursive self-joined adjency pairs (illustrated as "elephant ears" on diagrams) for organizational reporting structures, geographical jurisdictions, geneologies, species lists, etc.
The 2008 Person.Address table column SpatialLocation is defined with new Geography datatype that meets Open Geospatial Consortium (OGC) Simple Features Specification for SQL in spatial (geographical) operations. Unlike human-readable longitude/latitude numbers, these 47-character values make sense only to mapping software.
Notice that both 2005 and 2008 versions avoid human-understandable, simpler natural primary keys but use more efficient surrogate integer keys (such as guids). Keys consisting of strings are slower because they take up more room than interger keys which cause database page splits and fragmentation.
Click to pop-up a full-size image in
Searchable PDF or
gif
Older versions of .vsd (Visio) files used to generate pdf and *.png graphics of Conceptual Entity Model diagrams and OLTP Schemas are on the web from this page.
Schema | Tables | |
---|---|---|
OLTP | dbo | 3 |
Sales | 18 | |
Human Resources | 6 | |
Person | 13 | |
Purchasing (and Vendor Management) | 5 | |
Production (Manufacturing) | 25 | |
BI/DW for data mining & OLAP scenarios | Dim(Dimensions) | 17 |
Fact | 8 |
dbo tables are not populated from .csv files.
2008 OLTP Table | Type | .csv Bytes | Recs | Growth | |
---|---|---|---|---|---|
Person | Address | - | 5922184 | 19,614 | - |
Person | AddressType | - | 434 | 6 | A |
dbo | AWBuildVersion | dbo | - | - | - |
Production | BillOfMaterials | - | 201602 | 2,679 | E.4 |
Person | BusinessEntity | - | 2969678 | 20,777 | - |
Person | BusinessEntityAddress | - | 3193116 | 19,614 | B |
Person | BusinessEntityContact | - | 145764 | 909 | - |
- | ContactCreditCard | - | 686310 | 19,118 | - |
Person | ContactType | - | 966 | 20 | A |
- | CountryCurrency | - | 3488 | 109 | A |
Person | CountryRegion | - | 18596 | 238 | A |
Sales | CountryRegionCurrency | - | 6978 | 109 | A |
Sales | CreditCard | - | 1222791 | 19,118 | C |
Production | Culture | - | 345 | 8 | A |
Sales | Currency | - | 4417 | 105 | A |
Sales | CurrencyRate | - | 1036481 | 13,532 | A |
Sales | Customer | - | 1737144 | 19,820 | F.1 |
dbo | DatabaseLog | dbo | - | - | - |
HumanResources | Department | - | 1091 | 16 | D.3 |
Production | Document | - | 1157842 | 13 | D.10 |
HumanResources | Employee | - | 98290 | 290 | D.1 |
Person | EmailAddress | - | 4295040 | 19,972 | C |
HumanResources | EmployeeDepartmentHistory | - | 13317 | 295 | D.3 |
HumanResources | EmployeePayHistory | - | 19741 | 316 | D.2 |
dbo | ErrorLog | dbo | - | - | - |
Production | Illustration | - | 240856 | 5 | D.9 |
HumanResources | JobCandidate | - | 108310 | 13 | E.2 |
Production | Location | - | 766 | 14 | D |
Person | Password | - | 5092940 | 19,972 | C |
Person | Person | - | 27146068 | 19,972 | - |
Sales | PersonCreditCard | Link | 687600 | 19,118 | B |
Person | PersonPhone | - | 2145870 | 19,972 | C |
Person | PhoneNumberType | - | 218 | 3 | A |
Production | Product | - | 89040 | 504 | D.5 |
Production | ProductCategory | - | 294 | 4 | D.8 |
Production | ProductCostHistory | - | 29373 | 395 | F.3 |
Production | ProductDescription | - | 207930 | 762 | D.9 |
Production | ProductDocument | Link | 1088 | 32 | B |
Production | ProductInventory | - | 82454 | 1,069 | E.1 |
Production | ProductListPriceHistory | - | 29483 | 395 | F.3 |
Production | ProductModel | - | 107398 | 128 | D.7 |
Production | ProductModelIllustration | Link | 209 | 7 | B |
Production | ProductModelProductDescriptionCulture | - | 30496 | 7 | D.9 |
Production | ProductPhoto | - | 8044206 | 101 | E.6 |
Production | ProductProductPhoto | Link | 16904 | 504 | B |
Production | ProductReview | - | 5289 | 4 | F.2 |
Production | ProductSubCategory | - | 2836 | 37 | D.7 |
Purchasing | ProductVendor | - | 40642 | 460 | - |
Purchasing | PurchaseOrderDetail | - | 877620 | 8,845 | C |
Purchasing | PurchaseOrderHeader | - | 520980 | 4,012 | C |
Sales | SalesOrderDetail | - | 13849228 | 121,317 | - |
Sales | SalesOrderHeader | - | 7900478 | 31.465 | C |
Sales | SalesOrderHeaderSalesReason | - | 913746 | 27,647 | - |
Sales | SalesPerson | - | 1985 | 17 | D.1 |
Sales | SalesPersonQuotaHistory | - | 16635 | 163 | D.6 |
Sales | SalesReason | - | 476 | 10 | A |
Sales | SalesTaxRate | - | 2826 | 29 | A |
Sales | SalesTerritory | - | 1259 | 10 | D.6 |
Sales | SalesTerritoryHistory | - | 1674 | 17 | D.6 |
Production | ScrapReason | - | 796 | 16 | A |
HumanResources | Shift | - | 243 | 3 | A |
Purchasing | ShipMethod | - | 476 | 5 | A |
Sales | ShoppingCartItem | - | 189 | 3 | F.2 |
Sales | SpecialOffer | - | 2744 | 16 | C.4 |
Sales | SpecialOfferProduct | - | 36630 | 538 | B |
Person | StateProvince | - | 31438 | 181 | A |
Sales | Store | - | 725756 | 701 | D.4 |
Production | TransactionHistory | - | 8940132 | 113,443 | E.3 |
Production | TransactionHistoryArchive | - | 7017667 | 89,253 | B |
Production | UnitMeasure | - | 1462 | 38 | A |
Purchasing | Vendor | - | 7265 | 104 | D |
Production | WorkOrder | - | 8312485 | 72,591 | F |
Production | WorkOrderRouting | - | 10665560 | 67,131 | E.5 |
"dbo" tables are not loaded from CSV files (and can be referenced in SQL without the schema prefix).
2008 DW Table | Dimension | .csv Bytes | Recs |
---|---|---|---|
AdventureWorksDWBuildVersion | - | 40 | 1 |
DimAccount | Account | 5,639 | 99 |
DimCurrency | Destination Currency | 2,209 | 105 |
DimCustomer | Customer Clustered Customer | 8,927,244 | 18,484 |
DimDate | Date | 231,256 | 1,188 |
DimDepartmentGroup | Y | 179 | 7 |
DimEmployee | Employee | 140,064 | 296 |
DimGeography | Geography | 96,206 | 655 |
DimOrganization | Organization | 402 | 14 |
DimProduct | Product | 18,127,706 | 606 |
DimProductCategory | Product | 266 | 4 |
DimProductSubCategory | Product | 3,126 | 37 |
DimPromotion | Promotion | 7,922 | 16 |
DimProspect | DW | 278,795 | 2054 |
ProspectiveBuyer (Prospect.csv) | DW | 376,677 | 2,059 |
DimReseller | Reseller | 119,811 | 701 |
- | Sales Channel | - | - |
DimSalesReason | Sales Reason | 257 | 10 |
- | Sales Summary Order Details | - | - |
DimSalesTerritory | DW | 392 | 11 |
DimScenario | Scenario | 32 | 3 |
- | Subcategory Basket Analysis | - | - |
FactCallCenter | - | 8,093 | 160 |
FactCurrencyRate | - | 707,591 | 14,264 |
FactFinance | - | 1,359,328 | 39,409 |
FactInternetSales | Internet Sales Order Details | 7,438,622 | 60,855 |
FactInternetSalesReason | - | 842,348 | 64,515 |
FactResellerSales | Reseller Sales Order Details | 9,632,344 | 60,855 |
FactSalesQuota | DW | 5,932 | 163 |
FactSurveyResponse | DW | 122,981 | 2,727 |
Click to pop-up a full-size image in
searcheable PDF or
gif format
Observation: Tables FactSurveyResponse and ProspectiveBuyer are not linked to any other table.
Before running Data Warehouse Tuning examples, run these sql statements to bring AdventureWorksDW2008 to 25GB (1000 times larger than the downloaded default).
In the "AdventureWorks Analysis Services Project\enterprise" folder, explained by Stuart Cox:
Business Cycle Description on MSDN define SQL queries ("scenarios") for
One discussion item mentions the need for a tool to grow the sample database, and performance tests for it.
A database after several years of growth usually exhibits different response times than a small starter database.
Larger database often require a different a different (usually more complex) structure to more efficiently accomodate larger database sizes and higher transaction volumes. For example:
These may not be performed because the process of planning for growth can be time consuming.
AdventureWorks2008 does not use SOUNDEX index on name fields such as Person or City.
I have an MS-Excel spreadsheet containing numbers from the previous section.
Since the above ratios change over time, different ratios are defined for each year.
To validate the number, forecasts about the future may need to consider dollar-based operational ratios which imply delivery on KPIs (Key Performance Indicators) by various levels of management:
How well can a .Net Admin application be generated using .NetTiers.cst CodeSmith5 template?
I'm working on it. Let me know if you're working it too so we can collaborate on this.
2008 Refresh 1 without databases zip contains folders for:
CodeSmith 4 generated the Admin application shown below from the Northwind database using
.NetTiers 2.0 in the back-end on SQL Server 2005, based on
Microsoft's Enterprise Library of reusable software components (application blocks) open source code
addressing challenges common to complex, enterprise-level line-of-business development projects.
Correspondence of .NET, VS, and Entlib
Generated Admin screen: |
The generation was based on these properties: |
AdventureWorks has some but not all the data structures in a full-fledge international web store like PHP-based Magento provides. Magento has these additional tables:
Magento has several tables similar to what is already in AdventureWorks. but are architected based on the Entity-Attribute-Value (EAV) architecture:
Share This |
Next |
|
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page
Human verify: |