Sunteți pe pagina 1din 1

AdventureWorks OLTP Schema November 2005

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

Sales
ContactCreditCard SalesPersonQuotaHistory SalesPerson PK,FK1 FK2 SalesTerritoryHistory PK,FK1 PK,FK2 PK SalesPersonID TerritoryID StartDate U1 EndDate rowguid ModifiedDate SalesPersonID TerritoryID SalesQuota Bonus CommissionPct SalesYTD SalesLastYear rowguid ModifiedDate U1 SalesQuota rowguid ModifiedDate SalesOrderHeader PK SalesOrderID RevisionNumber OrderDate DueDate ShipDate Status OnlineOrderFlag SalesOrderNumber PurchaseOrderNumber AccountNumber CustomerID ContactID SalesPersonID TerritoryID BillToAddressID ShipToAddressID ShipMethodID CreditCardApprovalCode CurrencyRateID SubTotal TaxAmt Freight TotalDue Comment rowguid ModifiedDate CreditCardID SalesReason Currency PK U1 CurrencyCode Name ModifiedDate PK SalesReasonID Name ReasonType ModifiedDate PK,FK1 PK SalesPersonID QuotaDate PK,FK2 PK,FK1 ContactID CreditCardID ModifiedDate SalesOrderHeaderSalesReason PK,FK1 PK,FK2 SalesOrderID SalesReasonID ModifiedDate PK CreditCard CreditCardID CardType CardNumber ExpMonth ExpYear ModifiedDate

U1

SpecialOffer PK SpecialOfferID Description DiscountPct Type Category StartDate EndDate MinQty MaxQty rowguid ModifiedDate

dbo
ErrorLog PK ErrorLogID ErrorTime UserName ErrorNumber ErrorSeverity ErrorState ErrorProcedure ErrorLine ErrorMessage PK DatabaseLog DatabaseLogID PostTime DatabaseUser Event Schema Object TSQL XmlEvent

U1

CurrencyRate PK CurrencyRateID

U1

AWBuildVersion PK SystemInformationID Database Version VersionDate ModifiedDate

U2 SalesTerritory PK U1 TerritoryID Name CountryRegionCode Group SalesYTD SalesLastYear CostYTD CostLastYear rowguid ModifiedDate Customer PK FK1 U1 U2 CustomerID TerritoryID AccountNumber CustomerType rowguid ModifiedDate

FK6 FK3 FK7 FK8 FK1 FK2 FK4 FK5 CustomerAddress PK,FK3 PK,FK1 FK2 U1 CustomerID AddressID AddressTypeID rowguid ModifiedDate U1 FK9

U1 CurrencyRateDate FK1,U1 FromCurrencyCode FK2,U1 ToCurrencyCode AverageRate EndOfDayRate ModifiedDate

SalesOrderDetail PK,FK1 PK SalesOrderID SalesOrderDetailID CarrierTrackingNumber OrderQty ProductID SpecialOfferID UnitPrice UnitPriceDiscount LineTotal rowguid ModifiedDate SpecialOfferProduct PK,FK2 PK,FK1 U1 SpecialOfferID ProductID rowguid ModifiedDate

HumanResources
U2 Department PK EmployeeDepartmentHistory PK,FK2 PK,FK1 PK PK,FK3 EmployeeID DepartmentID StartDate ShiftID EndDate ModifiedDate Employee PK U2 FK2 U1 FK1 EmployeeID NationalIDNumber ContactID LoginID ManagerID ShiftID Title BirthDate MaritalStatus Gender HireDate SalariedFlag VacationHours SickLeaveHours CurrentFlag rowguid ModifiedDate U1 Name GroupName ModifiedDate DepartmentID

SalesTaxRate PK SalesTaxRateID PK

ShoppingCartItem ShoppingCartItemID ShoppingCartID Quantity ProductID DateCreated ModifiedDate

FK2 FK2

FK1,U2 StateProvinceID U2 TaxType TaxRate Name U1 rowguid ModifiedDate

U1

FK1

Individual PK,FK2 FK1 CustomerID ContactID Demographics ModifiedDate

Person
StateProvince Contact PK ContactID NameStyle Title FirstName MiddleName LastName Suffix EmailAddress EmailPromotion Phone PasswordHash PasswordSalt AdditionalContactInfo rowguid ModifiedDate PK StateProvinceID U3 StateProvinceCode FK1,U3 CountryRegionCode IsOnlyStateProvinceFlag U1 Name FK2 TerritoryID U2 rowguid ModifiedDate

Production
ProductModelIllustration ProductPhoto PK ProductListPriceHistory PK,FK1 PK ProductID StartDate EndDate ListPrice ModifiedDate ProductPhotoID ThumbNailPhoto ThumbnailPhotoFileName LargePhoto LargePhotoFileName ModifiedDate PK,FK2 PK,FK1 ProductModelID IllustrationID ModifiedDate Illustration PK IllustrationID Diagram ModifiedDate

Shift PK U1 U2 U2 ShiftID Name StartTime EndTime ModifiedDate

Address PK U2 U2 U2 FK1,U2 U2 U1 AddressID AddressLine1 AddressLine2 City StateProvinceID PostalCode rowguid ModifiedDate

ProductProductPhoto PK,FK1 PK,FK2 ProductID ProductPhotoID Primary ModifiedDate PK

Store PK,FK1 CustomerID Name Demographics rowguid ModifiedDate SalesPersonID U1

ProductReview PK FK1 ProductReviewID ProductID ReviewerName ReviewDate EmailAddress Rating Comments ModifiedDate

ProductModel ProductModelID Name CatalogDescription Instructions rowguid ModifiedDate ProductModelProductDescriptionCulture PK,FK3 PK,FK2 PK,FK1 ProductModelID ProductDescriptionID CultureID ModifiedDate

U1 FK2

JobCandidate PK FK1 JobCandidateID EmployeeID Resume ModifiedDate U3

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

CountryRegion PK StoreContact U1 PK,FK3 PK,FK1 CustomerID ContactID PK FK2 U1 ContactTypeID rowguid ModifiedDate U1 ContactType ContactTypeID Name ModifiedDate PK U1 U2 AddressType AddressTypeID Name rowguid ModifiedDate Name ModifiedDate CountryRegionCode

BillOfMaterials PK BillOfMaterialsID

ProductSubcategory PK FK1 U1 U2 ProductSubcategoryID ProductCategoryID Name rowguid ModifiedDate PK U1 U2 ProductCategory ProductCategoryID ProductDescription Name rowguid ModifiedDate PK ProductDescriptionID Description rowguid ModifiedDate PK U1 Culture CultureID Name ModifiedDate

EmployeePayHistory PK,FK1 PK EmployeeID RateChangeDate Rate PayFrequency ModifiedDate

EmployeeAddress PK,FK1 PK,FK2 U1 EmployeeID AddressID rowguid ModifiedDate

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

FK3 FK4

U1 ProductDocument ProductCostHistory PK,FK1 PK ProductID StartDate EndDate StandardCost ModifiedDate PK,FK2 PK,FK1 ProductID DocumentID ModifiedDate

FK2 FK1

Purchasing
ShipMethod VendorContact PK,FK3 PK,FK1 VendorID ContactID ContactTypeID ModifiedDate VendorAddress PK,FK3 PK,FK1 Vendor PK VendorID AccountNumber Name CreditRating PreferredVendorStatus ActiveFlag PurchasingWebServiceURL ModifiedDate FK2 VendorID AddressID AddressTypeID ModifiedDate ProductVendor PK,FK1 PK,FK3 ProductID VendorID AverageLeadTime StandardPrice LastReceiptCost LastReceiptDate MinOrderQty MaxOrderQty OnOrderQty UnitMeasureCode ModifiedDate PK U1 ShipMethodID Name ShipBase ShipRate rowguid ModifiedDate

UnitMeasure PK U1 UnitMeasureCode U3 Name ModifiedDate

Schemas
Sales Purchasing
PurchaseOrderHeader U1

FK2

U2

TransactionHistory PK FK1 TransactionID ProductID ReferenceOrderID TransactionDate TransactionType Quantity ActualCost ModifiedDate ReferenceOrderLineID

ProductInventory PK,FK2 PK,FK1 ProductID LocationID Shelf Bin Quantity rowguid ModifiedDate

WorkOrderRouting PK,FK2 PK PK FK1 WorkOrderID ProductID OperationSequence LocationID ScheduledStartDate ScheduledEndDate ActualStartDate ActualEndDate ActualResourceHrs PlannedCost ActualCost ModifiedDate PK

Document DocumentID Title FileName FileExtension Revision ChangeNumber Status DocumentSummary Document ModifiedDate

TransactionHistoryArchive PK TransactionID ProductID ReferenceOrderID TransactionDate TransactionType Quantity ActualCost ModifiedDate ReferenceOrderLineID

U1 U1

Person Production HumanResources dbo

PK PK,FK3

PurchaseOrderID ShipMethodID RevisionNumber Status EmployeeID VendorID OrderDate ShipDate SubTotal TaxAmt Freight TotalDue ModifiedDate

Location PK U1 LocationID Name CostRate Availability ModifiedDate

FK1 FK2

FK2 PurchaseOrderDetail PK,FK2 PK,FK2 PK ShipMethodID PurchaseOrderID PurchaseOrderDetailID DueDate OrderQty ProductID UnitPrice LineTotal ReceivedQty RejectedQty StockedQty ModifiedDate

WorkOrder PK FK1 WorkOrderID ProductID OrderQty StockedQty ScrappedQty StartDate EndDate DueDate ScrapReasonID ModifiedDate PK U1

ScrapReason ScrapReasonID Name ModifiedDate

FK1

FK2

S-ar putea să vă placă și