You are on page 1of 1

AdventureWorks 2008

OLTP Schema

Sales
SalesPerson

Rev 10.00.0009
PK,FK1

Best Print Results if:
11X17 paper
Samples and Sample Databases at
Landscape
http://CodePlex.com/SqlServerSamples
Fit to 1 sheet

dbo
PK

DatabaseLog

ErrorLogID

PK

ErrorTime
UserName
ErrorNumber
ErrorSeverity
ErrorState
ErrorProcedure
ErrorLine
ErrorMessage

AWBuildVersion
PK

PK,FK1
PK

BusinessEntityID
QuotaDate

U1

SalesQuota
rowguid
ModifiedDate

SalesTerritoryHistory
ErrorLog

SystemInformationID
Database Version
VersionDate
ModifiedDate

FK2

SalesPersonQuotaHistory

DatabaseLogID
PostTime
DatabaseUser
Event
Schema
Object
TSQL
XmlEvent

PK,FK1
PK,FK2
PK

BusinessEntityID
TerritoryID
StartDate

U1

EndDate
rowguid
ModifiedDate

CurrencyRate

BusinessEntityID
SalesOrderHeader

TerritoryID
SalesQuota
Bonus
CommissionPct
SalesYTD
SalesLastYear
rowguid
ModifiedDate

U1

SalesTerritory
PK
U1

Customer

Store

PK

U2

CustomerID

PK,FK5
PK

BusinessEntityID
SalesOrderID

FK7

ShipMethodID
RevisionNumber
OrderDate
DueDate
ShipDate
Status
OnlineOrderFlag
SalesOrderNumber
PurchaseOrderNumber
AccountNumber
TerritoryID
BillToAddressID
ShipToAddressID
CreditCardID
CreditCardApprovalCode
CurrencyRateID
SubTotal
TaxAmt
Freight
TotalDue
Comment
rowguid
ModifiedDate

U2

TerritoryID
FK6
FK1
FK2
FK8

Name
CountryRegionCode
Group
SalesYTD
SalesLastYear
CostYTD
CostLastYear
rowguid
ModifiedDate

FK4

PK,FK1,FK2 BusinessEntityID

HumanResources
U1

FK2
FK3
FK1
U1
U2

Name
Demographics
rowguid
ModifiedDate

Department
EmployeeDepartmentHistory
PK,FK2
PK,FK1
PK
PK,FK3

PK
U1

BusinessEntityID
DepartmentID
StartDate
ShiftID

PersonID
StoreID
TerritoryID
AccountNumber
rowguid
ModifiedDate

U1

PersonCreditCard

DepartmentID

PK,FK2
PK,FK1

Name
GroupName
ModifiedDate

BusinessEntityID
CreditCardID

U1

ModifiedDate

EndDate
ModifiedDate

CurrencyRateID

U1
FK1,U1
FK2,U1

CurrencyRateDate
FromCurrencyCode
ToCurrencyCode
AverageRate
EndOfDayRate
ModifiedDate

Currency
CurrencyCode

U1

Name
ModifiedDate

SpecialOffer
PK

SpecialOfferID
Description
DiscountPct
Type
Category
StartDate
EndDate
MinQty
MaxQty
rowguid
ModifiedDate

PK

SalesReasonID

SalesOrderHeaderSalesReason
PK,FK1
PK,FK1
PK,FK2

Name
ReasonType
ModifiedDate

BusinessEntityID
SalesOrderID
SalesReasonID

U1

ModifiedDate
SalesOrderDetail
PK,FK1
PK,FK1
PK

PK

SalesTaxRateID

CardType
CardNumber
ExpMonth
ExpYear
ModifiedDate

FK1,U2
U2

StateProvinceID
TaxType
TaxRate
Name
rowguid
ModifiedDate

U1

BusinessEntityID
SalesOrderID
SalesOrderDetailID

PK

ShoppingCartItemID

FK1

ShoppingCartID
Quantity
ProductID
DateCreated
ModifiedDate

SpecialOfferProduct

CarrierTrackingNumber
OrderQty
ProductID
SpecialOfferID
UnitPrice
UnitPriceDiscount
LineTotal
rowguid
ModifiedDate

FK2
FK2

ShoppingCartItem

SalesTaxRate

CreditCardID

Person

PK

SalesReason

CreditCard
PK

PK

U1

PK,FK2
PK,FK1

SpecialOfferID
ProductID

U1

rowguid
ModifiedDate

Production

ProductModelIllustration

Password
Employee

Shift
PK

ShiftID

U1
U2
U2

Name
StartTime
EndTime
ModifiedDate

BusinessEntityID

U2
U1

NationalIDNumber
LoginID
ShiftID
JobTitle
BirthDate
MaritalStatus
Gender
HireDate
SalariedFlag
VacationHours
SickLeaveHours
CurrentFlag
rowguid
ModifiedDate

JobCandidate
PK,FK1
PK

U3

BusinessEntityID
JobCandidateID

PK,FK1

PK,FK1

Address

BusinessEntityID
PasswordHash
PasswordSalt

AddressID

U2
U2
U2
FK1,U2
U2

AddressLine1
AddressLine2
City
StateProvinceID
PostalCode
SpatialLocation
rowguid
ModifiedDate

Person
PK,FK1

Resume
ModifiedDate
U1

U1

BusinessEntityID

EmallAddress

PersonType
NameStyle
Title
FirstName
MiddleName
LastName
Suffix
EmailPromotion
AdditionalContactInfo
Demographics
rowguid
ModifiedDate

PK,FK1
PK

BusinessEntityID
RateChangeDate

BusinessEntityID
PhoneNumber
PhoneNumberTypeID

PK

StateProvinceID

U3
FK1,U3

StateProvinceCode
CountryRegionCode
IsOnlyStateProvinceFlag
Name
TerritoryID
rowguid
ModifiedDate

U1
FK2
U2

PK,FK3
PK,FK1

BusinessEntityID
PersonID

FK2

ContactTypeID
ModifiedDate

ProductReviewID

FK1

ProductID
ReviewerName
ReviewDate
EmailAddress
Rating
Comments
ModifiedDate

PK

PhoneNumberTypeID

AddressType

ContactType

BusinessEntity
PK

Schemas

PK

ContactTypeID

U1

Name
ModifiedDate

PK

AddressTypeID

U1
U2

Name
rowguid
ModifiedDate

BusinessEntityID
rowguid
ModifiedDate

CountryRegion

BusinessEntityAddress
PK,FK3
PK,FK2

AddressID
BusinessEntityID

FK1

AddressTypeID
ModifiedDate

PK

CountryRegionCode

U1

Name
ModifiedDate

PK

TransactionID

FK1

ProductID
ReferenceOrderID
TransactionDate
TransactionType
Quantity
ActualCost
ModifiedDate
ReferenceOrderLineID

PK

PK

ProductID

U1
U2

Name
ProductNumber
MakeFlag
FinishedGoodsFlag
Color
SafetyStockLevel
ReorderPoint
StandardCost
ListPrice
Size
SizeUnitMeasureCode
WeightUnitMeasureCode
Weight
DaysToManufacture
ProductLine
Class
Style
ProductSubcategoryID
ProductModelID
SellStartDate
SellEndDate
DiscontinuedDate
rowguid
ModifiedDate

FK3
FK4

FK2
FK1

U3

ThumbNailPhoto
ThumbnailPhotoFileName
LargePhoto
LargePhotoFileName
ModifiedDate

Purchasing
Person

PurchaseOrderHeader

Production
HumanResources
dbo

PurchaseOrderDetail
PK,FK2
PK

FK1

PurchaseOrderID
PurchaseOrderDetailID
DueDate
OrderQty
ProductID
UnitPrice
LineTotal
ReceivedQty
RejectedQty
StockedQty
ModifiedDate

PK

PurchaseOrderID

FK1
FK4

ShipMethodID
VendorID
RevisionNumber
Status
OrderDate
ShipDate
SubTotal
TaxAmt
Freight
TotalDue
ModifiedDate

PK,FK1

BusinessEntityID

U1

AccountNumber
Name
CreditRating
PreferredVendorStatus
ActiveFlag
PurchasingWebServiceURL
ModifiedDate

ShipMethod

UnitMeasureCode

U1

Name
ModifiedDate

PK

ProductSubcategoryID

FK1
U1
U2

ProductCategoryID
Name
rowguid
ModifiedDate

PK,FK1
PK

ProductID
LocationID
Shelf
Bin
Quantity
rowguid
ModifiedDate

ProductCategoryID

U1
U2

Name
rowguid
ModifiedDate

PK,FK2
PK,FK1

ProductModelID

ProductModelProductDescriptionCulture

U1

Name
CatalogDescription
Instructions
rowguid
ModifiedDate

PK,FK3
PK,FK2
PK,FK1

ProductModelID
ProductDescriptionID
CultureID
ModifiedDate

ProductDescription
PK

ProductDescriptionID

U1

Description
rowguid
ModifiedDate

Culture
PK

CultureID

U1

Name
ModifiedDate

ProductID
DocumentNode
ModifiedDate

WorkOrderRouting
PK,FK2
PK
PK

WorkOrderID
ProductID
OperationSequence

FK1

LocationID
ScheduledStartDate
ScheduledEndDate
ActualStartDate
ActualEndDate
ActualResourceHrs
PlannedCost
ActualCost
ModifiedDate

Location

U1

Name
ShipBase
ShipRate
rowguid
ModifiedDate

U1

Name
CostRate
Availability
ModifiedDate

FK2

PK

ProductID
StartDate

ProductInventory

LocationID

WorkOrder

BusinessEntityID
ProductID
AverageLeadTime
StandardPrice
LastReceiptCost
LastReceiptDate
MinOrderQty
MaxOrderQty
OnOrderQty
UnitMeasureCode
ModifiedDate

PK

Document

PK

PK,FK3
PK,FK1

ProductModel

EndDate
StandardCost
ModifiedDate

ShipMethodID

ProductVendor

ProductID
ProductPhotoID

ProductCategory

ProductCostHistory

PK

U2

PK,FK1
PK,FK2

ProductDocument

UnitMeasure
PK

Diagram
ModifiedDate

ProductSubcategory

PK,FK2
PK,FK1

Vendor

IllustrationID

ProductProductPhoto

U2

Sales
Purchasing

PK

ModifiedDate

ProductPhotoID

Product

Name

TransactionHistory

ProductID
StartDate

Illustration

ProductModelID
IllustrationID

Primary
ModifiedDate

BillOfMaterialsID

FK1,U1 ProductAssemblyID
FK2,U1 ComponentID
U1
StartDate
EndDate
FK3
UnitMeasureCode
BOMLevel
PerAssemblyQty
ModifiedDate

PhoneNumberType
PK

PK

ProductPhoto

EndDate
ListPrice
ModifiedDate

BillOfMaterials

BusinessEntityContact

Rate
PayFrequency
ModifiedDate

PK,FK1
PK

ProductReview

StateProvince

PersonPhone
PK,FK1
PK
PK,FK2

ProductListPriceHistory

BusinessEntityID
EmailAddressID
EmailAddress

EmployeePayHistory
PK,FK1
PK

PK

PK,FK2
PK,FK1

PK

WorkOrderID

FK1

ProductID
OrderQty
StockedQty
ScrappedQty
StartDate
EndDate
DueDate
ScrapReasonID
ModifiedDate

ScrapReason
PK

ScrapReasonID

U1

Name
ModifiedDate

FK2

PK

FK1
U1
U1

DocumentNode
DocumentLevel
Title
Owner
FolderFlag
FileName
FileExtension
Revision
ChangeNumber
Status
DocumentSummary
Document
rowguid
ModifiedDate

TransactionHistoryArchive
PK

TransactionID
ProductID
ReferenceOrderID
TransactionDate
TransactionType
Quantity
ActualCost
ModifiedDate
ReferenceOrderLineID