AdventureWorks2025

1 Read column and table comments by hovering the columns and tables. Zoom with CTRL+whell mouse button, pan by dragging the diagram with the right-mouse button DbSchema Database Designer AdventureWorks2025 Read schema comments as mouse-over tooltips DbSchema.com © 2026-06-05 Wise CodersDbSchema.com © 2026-06-05 Wise Coders dbo HumanResources Purchasing Person Sales Production 🔗 Foreign Key FK_Address_StateProvince_StateProvinceID Address ➔ StateProvince ( StateProvinceID ) 🔗 Foreign Key FK_Address_StateProvince_StateProvinceID Address ➔ StateProvince ( StateProvinceID ) 🔗 Foreign Key FK_BillOfMaterials_Product_ComponentID BillOfMaterials ➔ Product ( ComponentID -> ProductID ) 🔗 Foreign Key FK_BillOfMaterials_Product_ComponentID BillOfMaterials ➔ Product ( ComponentID -> ProductID ) 🔗 Foreign Key FK_BillOfMaterials_Product_ProductAssemblyID BillOfMaterials ➔ Product ( ProductAssemblyID -> ProductID ) 🔗 Foreign Key FK_BillOfMaterials_Product_ProductAssemblyID BillOfMaterials ➔ Product ( ProductAssemblyID -> ProductID ) 🔗 Foreign Key FK_BillOfMaterials_UnitMeasure_UnitMeasureCode BillOfMaterials ➔ UnitMeasure ( UnitMeasureCode ) 🔗 Foreign Key FK_BillOfMaterials_UnitMeasure_UnitMeasureCode BillOfMaterials ➔ UnitMeasure ( UnitMeasureCode ) 🔗 Foreign Key FK_BusinessEntityAddress_Address_AddressID BusinessEntityAddress ➔ Address ( AddressID ) 🔗 Foreign Key FK_BusinessEntityAddress_Address_AddressID BusinessEntityAddress ➔ Address ( AddressID ) 🔗 Foreign Key FK_BusinessEntityAddress_AddressType_AddressTypeID BusinessEntityAddress ➔ AddressType ( AddressTypeID ) 🔗 Foreign Key FK_BusinessEntityAddress_AddressType_AddressTypeID BusinessEntityAddress ➔ AddressType ( AddressTypeID ) 🔗 Foreign Key FK_BusinessEntityAddress_BusinessEntity_BusinessEntityID BusinessEntityAddress ➔ BusinessEntity ( BusinessEntityID ) 🔗 Foreign Key FK_BusinessEntityAddress_BusinessEntity_BusinessEntityID BusinessEntityAddress ➔ BusinessEntity ( BusinessEntityID ) 🔗 Foreign Key FK_BusinessEntityContact_BusinessEntity_BusinessEntityID BusinessEntityContact ➔ BusinessEntity ( BusinessEntityID ) 🔗 Foreign Key FK_BusinessEntityContact_BusinessEntity_BusinessEntityID BusinessEntityContact ➔ BusinessEntity ( BusinessEntityID ) 🔗 Foreign Key FK_BusinessEntityContact_ContactType_ContactTypeID BusinessEntityContact ➔ ContactType ( ContactTypeID ) 🔗 Foreign Key FK_BusinessEntityContact_ContactType_ContactTypeID BusinessEntityContact ➔ ContactType ( ContactTypeID ) 🔗 Foreign Key FK_BusinessEntityContact_Person_PersonID BusinessEntityContact ➔ Person ( PersonID -> BusinessEntityID ) 🔗 Foreign Key FK_BusinessEntityContact_Person_PersonID BusinessEntityContact ➔ Person ( PersonID -> BusinessEntityID ) 🔗 Foreign Key FK_CountryRegionCurrency_CountryRegion_CountryRegionCode CountryRegionCurrency ➔ CountryRegion ( CountryRegionCode ) 🔗 Foreign Key FK_CountryRegionCurrency_CountryRegion_CountryRegionCode CountryRegionCurrency ➔ CountryRegion ( CountryRegionCode ) 🔗 Foreign Key FK_CountryRegionCurrency_Currency_CurrencyCode CountryRegionCurrency ➔ Currency ( CurrencyCode ) 🔗 Foreign Key FK_CountryRegionCurrency_Currency_CurrencyCode CountryRegionCurrency ➔ Currency ( CurrencyCode ) 🔗 Foreign Key FK_CurrencyRate_Currency_FromCurrencyCode CurrencyRate ➔ Currency ( FromCurrencyCode -> CurrencyCode ) 🔗 Foreign Key FK_CurrencyRate_Currency_FromCurrencyCode CurrencyRate ➔ Currency ( FromCurrencyCode -> CurrencyCode ) 🔗 Foreign Key FK_CurrencyRate_Currency_ToCurrencyCode CurrencyRate ➔ Currency ( ToCurrencyCode -> CurrencyCode ) 🔗 Foreign Key FK_CurrencyRate_Currency_ToCurrencyCode CurrencyRate ➔ Currency ( ToCurrencyCode -> CurrencyCode ) 🔗 Foreign Key FK_Customer_Person_PersonID Customer ➔ Person ( PersonID -> BusinessEntityID ) 🔗 Foreign Key FK_Customer_Person_PersonID Customer ➔ Person ( PersonID -> BusinessEntityID ) 🔗 Foreign Key FK_Customer_SalesTerritory_TerritoryID Customer ➔ SalesTerritory ( TerritoryID ) 🔗 Foreign Key FK_Customer_SalesTerritory_TerritoryID Customer ➔ SalesTerritory ( TerritoryID ) 🔗 Foreign Key FK_Customer_Store_StoreID Customer ➔ Store ( StoreID -> BusinessEntityID ) 🔗 Foreign Key FK_Customer_Store_StoreID Customer ➔ Store ( StoreID -> BusinessEntityID ) 🔗 Foreign Key FK_Document_Employee_Owner Document ➔ Employee ( Owner -> BusinessEntityID ) 🔗 Foreign Key FK_Document_Employee_Owner Document ➔ Employee ( Owner -> BusinessEntityID ) 🔗 Foreign Key FK_EmailAddress_Person_BusinessEntityID EmailAddress ➔ Person ( BusinessEntityID ) 🔗 Foreign Key FK_EmailAddress_Person_BusinessEntityID EmailAddress ➔ Person ( BusinessEntityID ) 🔗 Foreign Key FK_Employee_Person_BusinessEntityID Employee ➔ Person ( BusinessEntityID ) 🔗 Foreign Key FK_Employee_Person_BusinessEntityID Employee ➔ Person ( BusinessEntityID ) 🔗 Foreign Key FK_EmployeeDepartmentHistory_Department_DepartmentID EmployeeDepartmentHistory ➔ Department ( DepartmentID ) 🔗 Foreign Key FK_EmployeeDepartmentHistory_Department_DepartmentID EmployeeDepartmentHistory ➔ Department ( DepartmentID ) 🔗 Foreign Key FK_EmployeeDepartmentHistory_Employee_BusinessEntityID EmployeeDepartmentHistory ➔ Employee ( BusinessEntityID ) 🔗 Foreign Key FK_EmployeeDepartmentHistory_Employee_BusinessEntityID EmployeeDepartmentHistory ➔ Employee ( BusinessEntityID ) 🔗 Foreign Key FK_EmployeeDepartmentHistory_Shift_ShiftID EmployeeDepartmentHistory ➔ Shift ( ShiftID ) 🔗 Foreign Key FK_EmployeeDepartmentHistory_Shift_ShiftID EmployeeDepartmentHistory ➔ Shift ( ShiftID ) 🔗 Foreign Key FK_EmployeePayHistory_Employee_BusinessEntityID EmployeePayHistory ➔ Employee ( BusinessEntityID ) 🔗 Foreign Key FK_EmployeePayHistory_Employee_BusinessEntityID EmployeePayHistory ➔ Employee ( BusinessEntityID ) 🔗 Foreign Key FK_JobCandidate_Employee_BusinessEntityID JobCandidate ➔ Employee ( BusinessEntityID ) 🔗 Foreign Key FK_JobCandidate_Employee_BusinessEntityID JobCandidate ➔ Employee ( BusinessEntityID ) 🔗 Foreign Key FK_Password_Person_BusinessEntityID Password ➔ Person ( BusinessEntityID ) 🔗 Foreign Key FK_Password_Person_BusinessEntityID Password ➔ Person ( BusinessEntityID ) 🔗 Foreign Key FK_Person_BusinessEntity_BusinessEntityID Person ➔ BusinessEntity ( BusinessEntityID ) 🔗 Foreign Key FK_Person_BusinessEntity_BusinessEntityID Person ➔ BusinessEntity ( BusinessEntityID ) 🔗 Foreign Key FK_PersonCreditCard_CreditCard_CreditCardID PersonCreditCard ➔ CreditCard ( CreditCardID ) 🔗 Foreign Key FK_PersonCreditCard_CreditCard_CreditCardID PersonCreditCard ➔ CreditCard ( CreditCardID ) 🔗 Foreign Key FK_PersonCreditCard_Person_BusinessEntityID PersonCreditCard ➔ Person ( BusinessEntityID ) 🔗 Foreign Key FK_PersonCreditCard_Person_BusinessEntityID PersonCreditCard ➔ Person ( BusinessEntityID ) 🔗 Foreign Key FK_PersonPhone_Person_BusinessEntityID PersonPhone ➔ Person ( BusinessEntityID ) 🔗 Foreign Key FK_PersonPhone_Person_BusinessEntityID PersonPhone ➔ Person ( BusinessEntityID ) 🔗 Foreign Key FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID PersonPhone ➔ PhoneNumberType ( PhoneNumberTypeID ) 🔗 Foreign Key FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID PersonPhone ➔ PhoneNumberType ( PhoneNumberTypeID ) 🔗 Foreign Key FK_Product_ProductModel_ProductModelID Product ➔ ProductModel ( ProductModelID ) 🔗 Foreign Key FK_Product_ProductModel_ProductModelID Product ➔ ProductModel ( ProductModelID ) 🔗 Foreign Key FK_Product_ProductSubcategory_ProductSubcategoryID Product ➔ ProductSubcategory ( ProductSubcategoryID ) 🔗 Foreign Key FK_Product_ProductSubcategory_ProductSubcategoryID Product ➔ ProductSubcategory ( ProductSubcategoryID ) 🔗 Foreign Key FK_Product_UnitMeasure_SizeUnitMeasureCode Product ➔ UnitMeasure ( SizeUnitMeasureCode -> UnitMeasureCode ) 🔗 Foreign Key FK_Product_UnitMeasure_SizeUnitMeasureCode Product ➔ UnitMeasure ( SizeUnitMeasureCode -> UnitMeasureCode ) 🔗 Foreign Key FK_Product_UnitMeasure_WeightUnitMeasureCode Product ➔ UnitMeasure ( WeightUnitMeasureCode -> UnitMeasureCode ) 🔗 Foreign Key FK_Product_UnitMeasure_WeightUnitMeasureCode Product ➔ UnitMeasure ( WeightUnitMeasureCode -> UnitMeasureCode ) 🔗 Foreign Key FK_ProductCostHistory_Product_ProductID ProductCostHistory ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductCostHistory_Product_ProductID ProductCostHistory ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductDocument_Document_DocumentNode ProductDocument ➔ Document ( DocumentNode ) 🔗 Foreign Key FK_ProductDocument_Document_DocumentNode ProductDocument ➔ Document ( DocumentNode ) 🔗 Foreign Key FK_ProductDocument_Product_ProductID ProductDocument ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductDocument_Product_ProductID ProductDocument ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductInventory_Location_LocationID ProductInventory ➔ Location ( LocationID ) 🔗 Foreign Key FK_ProductInventory_Location_LocationID ProductInventory ➔ Location ( LocationID ) 🔗 Foreign Key FK_ProductInventory_Product_ProductID ProductInventory ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductInventory_Product_ProductID ProductInventory ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductListPriceHistory_Product_ProductID ProductListPriceHistory ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductListPriceHistory_Product_ProductID ProductListPriceHistory ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductModelIllustration_Illustration_IllustrationID ProductModelIllustration ➔ Illustration ( IllustrationID ) 🔗 Foreign Key FK_ProductModelIllustration_Illustration_IllustrationID ProductModelIllustration ➔ Illustration ( IllustrationID ) 🔗 Foreign Key FK_ProductModelIllustration_ProductModel_ProductModelID ProductModelIllustration ➔ ProductModel ( ProductModelID ) 🔗 Foreign Key FK_ProductModelIllustration_ProductModel_ProductModelID ProductModelIllustration ➔ ProductModel ( ProductModelID ) 🔗 Foreign Key FK_ProductModelProductDescriptionCulture_Culture_CultureID ProductModelProductDescriptionCulture ➔ Culture ( CultureID ) 🔗 Foreign Key FK_ProductModelProductDescriptionCulture_Culture_CultureID ProductModelProductDescriptionCulture ➔ Culture ( CultureID ) 🔗 Foreign Key FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID ProductModelProductDescriptionCulture ➔ ProductDescription ( ProductDescriptionID ) 🔗 Foreign Key FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID ProductModelProductDescriptionCulture ➔ ProductDescription ( ProductDescriptionID ) 🔗 Foreign Key FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID ProductModelProductDescriptionCulture ➔ ProductModel ( ProductModelID ) 🔗 Foreign Key FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID ProductModelProductDescriptionCulture ➔ ProductModel ( ProductModelID ) 🔗 Foreign Key FK_ProductProductPhoto_Product_ProductID ProductProductPhoto ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductProductPhoto_Product_ProductID ProductProductPhoto ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductProductPhoto_ProductPhoto_ProductPhotoID ProductProductPhoto ➔ ProductPhoto ( ProductPhotoID ) 🔗 Foreign Key FK_ProductProductPhoto_ProductPhoto_ProductPhotoID ProductProductPhoto ➔ ProductPhoto ( ProductPhotoID ) 🔗 Foreign Key FK_ProductReview_Product_ProductID ProductReview ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductReview_Product_ProductID ProductReview ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductSubcategory_ProductCategory_ProductCategoryID ProductSubcategory ➔ ProductCategory ( ProductCategoryID ) 🔗 Foreign Key FK_ProductSubcategory_ProductCategory_ProductCategoryID ProductSubcategory ➔ ProductCategory ( ProductCategoryID ) 🔗 Foreign Key FK_ProductVendor_Product_ProductID ProductVendor ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductVendor_Product_ProductID ProductVendor ➔ Product ( ProductID ) 🔗 Foreign Key FK_ProductVendor_UnitMeasure_UnitMeasureCode ProductVendor ➔ UnitMeasure ( UnitMeasureCode ) 🔗 Foreign Key FK_ProductVendor_UnitMeasure_UnitMeasureCode ProductVendor ➔ UnitMeasure ( UnitMeasureCode ) 🔗 Foreign Key FK_ProductVendor_Vendor_BusinessEntityID ProductVendor ➔ Vendor ( BusinessEntityID ) 🔗 Foreign Key FK_ProductVendor_Vendor_BusinessEntityID ProductVendor ➔ Vendor ( BusinessEntityID ) 🔗 Foreign Key FK_PurchaseOrderDetail_Product_ProductID PurchaseOrderDetail ➔ Product ( ProductID ) 🔗 Foreign Key FK_PurchaseOrderDetail_Product_ProductID PurchaseOrderDetail ➔ Product ( ProductID ) 🔗 Foreign Key FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID PurchaseOrderDetail ➔ PurchaseOrderHeader ( PurchaseOrderID ) 🔗 Foreign Key FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID PurchaseOrderDetail ➔ PurchaseOrderHeader ( PurchaseOrderID ) 🔗 Foreign Key FK_PurchaseOrderHeader_Employee_EmployeeID PurchaseOrderHeader ➔ Employee ( EmployeeID -> BusinessEntityID ) 🔗 Foreign Key FK_PurchaseOrderHeader_Employee_EmployeeID PurchaseOrderHeader ➔ Employee ( EmployeeID -> BusinessEntityID ) 🔗 Foreign Key FK_PurchaseOrderHeader_ShipMethod_ShipMethodID PurchaseOrderHeader ➔ ShipMethod ( ShipMethodID ) 🔗 Foreign Key FK_PurchaseOrderHeader_ShipMethod_ShipMethodID PurchaseOrderHeader ➔ ShipMethod ( ShipMethodID ) 🔗 Foreign Key FK_PurchaseOrderHeader_Vendor_VendorID PurchaseOrderHeader ➔ Vendor ( VendorID -> BusinessEntityID ) 🔗 Foreign Key FK_PurchaseOrderHeader_Vendor_VendorID PurchaseOrderHeader ➔ Vendor ( VendorID -> BusinessEntityID ) 🔗 Foreign Key FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID SalesOrderDetail ➔ SalesOrderHeader ( SalesOrderID ) on delete cascade 🔗 Foreign Key FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID SalesOrderDetail ➔ SalesOrderHeader ( SalesOrderID ) on delete cascade Del(C) 🔗 Foreign Key FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID SalesOrderDetail ➔ SpecialOfferProduct ( SpecialOfferID, ProductID ) 🔗 Foreign Key FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID SalesOrderDetail ➔ SpecialOfferProduct ( SpecialOfferID, ProductID ) 🔗 Foreign Key FK_SalesOrderHeader_Address_BillToAddressID SalesOrderHeader ➔ Address ( BillToAddressID -> AddressID ) 🔗 Foreign Key FK_SalesOrderHeader_Address_BillToAddressID SalesOrderHeader ➔ Address ( BillToAddressID -> AddressID ) 🔗 Foreign Key FK_SalesOrderHeader_Address_ShipToAddressID SalesOrderHeader ➔ Address ( ShipToAddressID -> AddressID ) 🔗 Foreign Key FK_SalesOrderHeader_Address_ShipToAddressID SalesOrderHeader ➔ Address ( ShipToAddressID -> AddressID ) 🔗 Foreign Key FK_SalesOrderHeader_CreditCard_CreditCardID SalesOrderHeader ➔ CreditCard ( CreditCardID ) 🔗 Foreign Key FK_SalesOrderHeader_CreditCard_CreditCardID SalesOrderHeader ➔ CreditCard ( CreditCardID ) 🔗 Foreign Key FK_SalesOrderHeader_CurrencyRate_CurrencyRateID SalesOrderHeader ➔ CurrencyRate ( CurrencyRateID ) 🔗 Foreign Key FK_SalesOrderHeader_CurrencyRate_CurrencyRateID SalesOrderHeader ➔ CurrencyRate ( CurrencyRateID ) 🔗 Foreign Key FK_SalesOrderHeader_Customer_CustomerID SalesOrderHeader ➔ Customer ( CustomerID ) 🔗 Foreign Key FK_SalesOrderHeader_Customer_CustomerID SalesOrderHeader ➔ Customer ( CustomerID ) 🔗 Foreign Key FK_SalesOrderHeader_SalesPerson_SalesPersonID SalesOrderHeader ➔ SalesPerson ( SalesPersonID -> BusinessEntityID ) 🔗 Foreign Key FK_SalesOrderHeader_SalesPerson_SalesPersonID SalesOrderHeader ➔ SalesPerson ( SalesPersonID -> BusinessEntityID ) 🔗 Foreign Key FK_SalesOrderHeader_SalesTerritory_TerritoryID SalesOrderHeader ➔ SalesTerritory ( TerritoryID ) 🔗 Foreign Key FK_SalesOrderHeader_SalesTerritory_TerritoryID SalesOrderHeader ➔ SalesTerritory ( TerritoryID ) 🔗 Foreign Key FK_SalesOrderHeader_ShipMethod_ShipMethodID SalesOrderHeader ➔ ShipMethod ( ShipMethodID ) 🔗 Foreign Key FK_SalesOrderHeader_ShipMethod_ShipMethodID SalesOrderHeader ➔ ShipMethod ( ShipMethodID ) 🔗 Foreign Key FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID SalesOrderHeaderSalesReason ➔ SalesOrderHeader ( SalesOrderID ) on delete cascade 🔗 Foreign Key FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID SalesOrderHeaderSalesReason ➔ SalesOrderHeader ( SalesOrderID ) on delete cascade Del(C) 🔗 Foreign Key FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID SalesOrderHeaderSalesReason ➔ SalesReason ( SalesReasonID ) 🔗 Foreign Key FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID SalesOrderHeaderSalesReason ➔ SalesReason ( SalesReasonID ) 🔗 Foreign Key FK_SalesPerson_Employee_BusinessEntityID SalesPerson ➔ Employee ( BusinessEntityID ) 🔗 Foreign Key FK_SalesPerson_Employee_BusinessEntityID SalesPerson ➔ Employee ( BusinessEntityID ) 🔗 Foreign Key FK_SalesPerson_SalesTerritory_TerritoryID SalesPerson ➔ SalesTerritory ( TerritoryID ) 🔗 Foreign Key FK_SalesPerson_SalesTerritory_TerritoryID SalesPerson ➔ SalesTerritory ( TerritoryID ) 🔗 Foreign Key FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID SalesPersonQuotaHistory ➔ SalesPerson ( BusinessEntityID ) 🔗 Foreign Key FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID SalesPersonQuotaHistory ➔ SalesPerson ( BusinessEntityID ) 🔗 Foreign Key FK_SalesTaxRate_StateProvince_StateProvinceID SalesTaxRate ➔ StateProvince ( StateProvinceID ) 🔗 Foreign Key FK_SalesTaxRate_StateProvince_StateProvinceID SalesTaxRate ➔ StateProvince ( StateProvinceID ) 🔗 Foreign Key FK_SalesTerritory_CountryRegion_CountryRegionCode SalesTerritory ➔ CountryRegion ( CountryRegionCode ) 🔗 Foreign Key FK_SalesTerritory_CountryRegion_CountryRegionCode SalesTerritory ➔ CountryRegion ( CountryRegionCode ) 🔗 Foreign Key FK_SalesTerritoryHistory_SalesPerson_BusinessEntityID SalesTerritoryHistory ➔ SalesPerson ( BusinessEntityID ) 🔗 Foreign Key FK_SalesTerritoryHistory_SalesPerson_BusinessEntityID SalesTerritoryHistory ➔ SalesPerson ( BusinessEntityID ) 🔗 Foreign Key FK_SalesTerritoryHistory_SalesTerritory_TerritoryID SalesTerritoryHistory ➔ SalesTerritory ( TerritoryID ) 🔗 Foreign Key FK_SalesTerritoryHistory_SalesTerritory_TerritoryID SalesTerritoryHistory ➔ SalesTerritory ( TerritoryID ) 🔗 Foreign Key FK_ShoppingCartItem_Product_ProductID ShoppingCartItem ➔ Product ( ProductID ) 🔗 Foreign Key FK_ShoppingCartItem_Product_ProductID ShoppingCartItem ➔ Product ( ProductID ) 🔗 Foreign Key FK_SpecialOfferProduct_Product_ProductID SpecialOfferProduct ➔ Product ( ProductID ) 🔗 Foreign Key FK_SpecialOfferProduct_Product_ProductID SpecialOfferProduct ➔ Product ( ProductID ) 🔗 Foreign Key FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID SpecialOfferProduct ➔ SpecialOffer ( SpecialOfferID ) 🔗 Foreign Key FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID SpecialOfferProduct ➔ SpecialOffer ( SpecialOfferID ) 🔗 Foreign Key FK_StateProvince_CountryRegion_CountryRegionCode StateProvince ➔ CountryRegion ( CountryRegionCode ) 🔗 Foreign Key FK_StateProvince_CountryRegion_CountryRegionCode StateProvince ➔ CountryRegion ( CountryRegionCode ) 🔗 Foreign Key FK_StateProvince_SalesTerritory_TerritoryID StateProvince ➔ SalesTerritory ( TerritoryID ) 🔗 Foreign Key FK_StateProvince_SalesTerritory_TerritoryID StateProvince ➔ SalesTerritory ( TerritoryID ) 🔗 Foreign Key FK_Store_BusinessEntity_BusinessEntityID Store ➔ BusinessEntity ( BusinessEntityID ) 🔗 Foreign Key FK_Store_BusinessEntity_BusinessEntityID Store ➔ BusinessEntity ( BusinessEntityID ) 🔗 Foreign Key FK_Store_SalesPerson_SalesPersonID Store ➔ SalesPerson ( SalesPersonID -> BusinessEntityID ) 🔗 Foreign Key FK_Store_SalesPerson_SalesPersonID Store ➔ SalesPerson ( SalesPersonID -> BusinessEntityID ) 🔗 Foreign Key FK_TransactionHistory_Product_ProductID TransactionHistory ➔ Product ( ProductID ) 🔗 Foreign Key FK_TransactionHistory_Product_ProductID TransactionHistory ➔ Product ( ProductID ) 🔗 Foreign Key FK_Vendor_BusinessEntity_BusinessEntityID Vendor ➔ BusinessEntity ( BusinessEntityID ) 🔗 Foreign Key FK_Vendor_BusinessEntity_BusinessEntityID Vendor ➔ BusinessEntity ( BusinessEntityID ) 🔗 Foreign Key FK_WorkOrder_Product_ProductID WorkOrder ➔ Product ( ProductID ) 🔗 Foreign Key FK_WorkOrder_Product_ProductID WorkOrder ➔ Product ( ProductID ) 🔗 Foreign Key FK_WorkOrder_ScrapReason_ScrapReasonID WorkOrder ➔ ScrapReason ( ScrapReasonID ) 🔗 Foreign Key FK_WorkOrder_ScrapReason_ScrapReasonID WorkOrder ➔ ScrapReason ( ScrapReasonID ) 🔗 Foreign Key FK_WorkOrderRouting_Location_LocationID WorkOrderRouting ➔ Location ( LocationID ) 🔗 Foreign Key FK_WorkOrderRouting_Location_LocationID WorkOrderRouting ➔ Location ( LocationID ) 🔗 Foreign Key FK_WorkOrderRouting_WorkOrder_WorkOrderID WorkOrderRouting ➔ WorkOrder ( WorkOrderID ) 🔗 Foreign Key FK_WorkOrderRouting_WorkOrder_WorkOrderID WorkOrderRouting ➔ WorkOrder ( WorkOrderID ) Table dbo.AWBuildVersion ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Current version number of the AdventureWorks 2025 sample database.dbo.AWBuildVersion 🔑 Pk PK_AWBuildVersion_SystemInformationID ( SystemInformationID ) ⧉ SystemInformationID * tinyint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for AWBuildVersion records.SystemInformationID tinyint ⧉ Database Version * nvarchar(25) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Version number of the database in 9.yy.mm.dd.00 format.Database Version nvarchar(25) ⧉ VersionDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.VersionDate datetime ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.Address ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Street address information for customers, employees, and vendors.Person.Address 🔑 Pk PK_Address_AddressID ( AddressID ) ⧉ AddressID * int ↙ BusinessEntityAddress( AddressID ) ↙ SalesOrderHeader( BillToAddressID ) ↙ SalesOrderHeader( ShipToAddressID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for Address records.AddressID int🔗 Referred by Person.BusinessEntityAddress ( AddressID ) Referred by Sales.SalesOrderHeader ( BillToAddressID -> AddressID ) Referred by Sales.SalesOrderHeader ( ShipToAddressID -> AddressID ) 🔍 Unq IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ( AddressLine1, AddressLine2, City, StateProvinceID, PostalCode ) ⧉ AddressLine1 * nvarchar(60) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ First street address line.AddressLine1 nvarchar(60) 🔍 Unq IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ( AddressLine1, AddressLine2, City, StateProvinceID, PostalCode ) ⧉ AddressLine2 nvarchar(60) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Second street address line.AddressLine2 nvarchar(60) 🔍 Unq IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ( AddressLine1, AddressLine2, City, StateProvinceID, PostalCode ) ⧉ City * nvarchar(30) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Name of the city.City nvarchar(30) 🔍 Unq IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ( AddressLine1, AddressLine2, City, StateProvinceID, PostalCode ) 🔍 IX_Address_StateProvinceID ( StateProvinceID ) ⧉ StateProvinceID * int ↗ StateProvince( StateProvinceID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unique identification number for the state or province. Foreign key to StateProvince table.StateProvinceID int🔗 References Person.StateProvince ( StateProvinceID ) 🔍 Unq IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ( AddressLine1, AddressLine2, City, StateProvinceID, PostalCode ) ⧉ PostalCode * nvarchar(15) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Postal code for the street address.PostalCode nvarchar(15) ⧉ SpatialLocation geography ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Latitude and longitude of this address.SpatialLocation geography 🔍 Unq AK_Address_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.AddressType ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Types of addresses stored in the Address table.Person.AddressType 🔑 Pk PK_AddressType_AddressTypeID ( AddressTypeID ) ⧉ AddressTypeID * int ↙ BusinessEntityAddress( AddressTypeID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for AddressType records.AddressTypeID int🔗 Referred by Person.BusinessEntityAddress ( AddressTypeID ) 🔍 Unq AK_AddressType_Name ( Name ) ⧉ Name * person.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Address type description. For example, Billing, Home, or Shipping.Name Person.Name 🔍 Unq AK_AddressType_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.BillOfMaterials ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Items required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship between a parent product and its components.Production.BillOfMaterials 🔑 Pk PK_BillOfMaterials_BillOfMaterialsID ( BillOfMaterialsID ) ⧉ BillOfMaterialsID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for BillOfMaterials records.BillOfMaterialsID int 🔍 Unq AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate ( ProductAssemblyID, ComponentID, StartDate ) ⧉ ProductAssemblyID int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Parent product identification number. Foreign key to Product.ProductID.ProductAssemblyID int🔗 References Production.Product ( ProductAssemblyID -> ProductID ) 🔍 Unq AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate ( ProductAssemblyID, ComponentID, StartDate ) ⧉ ComponentID * int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Component identification number. Foreign key to Product.ProductID.ComponentID int🔗 References Production.Product ( ComponentID -> ProductID ) 🔍 Unq AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate ( ProductAssemblyID, ComponentID, StartDate ) ⧉ StartDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the component started being used in the assembly item.StartDate datetime ⧉ EndDate datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the component stopped being used in the assembly item.EndDate datetime 🔍 IX_BillOfMaterials_UnitMeasureCode ( UnitMeasureCode ) ⧉ UnitMeasureCode * nchar(3) ↗ UnitMeasure( UnitMeasureCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Standard code identifying the unit of measure for the quantity.UnitMeasureCode nchar(3)🔗 References Production.UnitMeasure ( UnitMeasureCode ) ⧉ BOMLevel * smallint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Indicates the depth the component is from its parent (AssemblyID).BOMLevel smallint ⧉ PerAssemblyQty * decimal(8,2) default 1.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Quantity of the component needed to create the assembly.PerAssemblyQty decimal(8,2) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.BusinessEntity ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Source of the ID that connects vendors, customers, and employees with address and contact information.Person.BusinessEntity 🔑 Pk PK_BusinessEntity_BusinessEntityID ( BusinessEntityID ) ⧉ BusinessEntityID * int ↙ BusinessEntityAddress( BusinessEntityID ) ↙ BusinessEntityContact( BusinessEntityID ) ↙ Person( BusinessEntityID ) ↙ Vendor( BusinessEntityID ) ↙ Store( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for all customers, vendors, and employees.BusinessEntityID int🔗 Referred by Person.BusinessEntityAddress ( BusinessEntityID ) Referred by Person.BusinessEntityContact ( BusinessEntityID ) Referred by Person.Person ( BusinessEntityID ) Referred by Purchasing.Vendor ( BusinessEntityID ) Referred by Sales.Store ( BusinessEntityID ) 🔍 Unq AK_BusinessEntity_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.BusinessEntityAddress ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Cross-reference table mapping customers, vendors, and employees to their addresses.Person.BusinessEntityAddress 🔑 Pk PK_BusinessEntityAddress_BusinessEntityID_AddressID_AddressTypeID ( BusinessEntityID, AddressID, AddressTypeID ) ⧉ BusinessEntityID * int ↗ BusinessEntity( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to BusinessEntity.BusinessEntityID.BusinessEntityID int🔗 References Person.BusinessEntity ( BusinessEntityID ) 🔑 Pk PK_BusinessEntityAddress_BusinessEntityID_AddressID_AddressTypeID ( BusinessEntityID, AddressID, AddressTypeID ) 🔍 IX_BusinessEntityAddress_AddressID ( AddressID ) ⧉ AddressID * int ↗ Address( AddressID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to Address.AddressID.AddressID int🔗 References Person.Address ( AddressID ) 🔑 Pk PK_BusinessEntityAddress_BusinessEntityID_AddressID_AddressTypeID ( BusinessEntityID, AddressID, AddressTypeID ) 🔍 IX_BusinessEntityAddress_AddressTypeID ( AddressTypeID ) ⧉ AddressTypeID * int ↗ AddressType( AddressTypeID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to AddressType.AddressTypeID.AddressTypeID int🔗 References Person.AddressType ( AddressTypeID ) 🔍 Unq AK_BusinessEntityAddress_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.BusinessEntityContact ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Cross-reference table mapping stores, vendors, and employees to peoplePerson.BusinessEntityContact 🔑 Pk PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID ( BusinessEntityID, PersonID, ContactTypeID ) ⧉ BusinessEntityID * int ↗ BusinessEntity( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to BusinessEntity.BusinessEntityID.BusinessEntityID int🔗 References Person.BusinessEntity ( BusinessEntityID ) 🔑 Pk PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID ( BusinessEntityID, PersonID, ContactTypeID ) 🔍 IX_BusinessEntityContact_PersonID ( PersonID ) ⧉ PersonID * int ↗ Person( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to Person.BusinessEntityID.PersonID int🔗 References Person.Person ( PersonID -> BusinessEntityID ) 🔑 Pk PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID ( BusinessEntityID, PersonID, ContactTypeID ) 🔍 IX_BusinessEntityContact_ContactTypeID ( ContactTypeID ) ⧉ ContactTypeID * int ↗ ContactType( ContactTypeID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to ContactType.ContactTypeID.ContactTypeID int🔗 References Person.ContactType ( ContactTypeID ) 🔍 Unq AK_BusinessEntityContact_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.ContactType ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Lookup table containing the types of business entity contacts.Person.ContactType 🔑 Pk PK_ContactType_ContactTypeID ( ContactTypeID ) ⧉ ContactTypeID * int ↙ BusinessEntityContact( ContactTypeID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for ContactType records.ContactTypeID int🔗 Referred by Person.BusinessEntityContact ( ContactTypeID ) 🔍 Unq AK_ContactType_Name ( Name ) ⧉ Name * person.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Contact type description.Name Person.Name ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.CountryRegion ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Lookup table containing the ISO standard codes for countries and regions.Person.CountryRegion 🔑 Pk PK_CountryRegion_CountryRegionCode ( CountryRegionCode ) ⧉ CountryRegionCode * nvarchar(3) ↙ StateProvince( CountryRegionCode ) ↙ CountryRegionCurrency( CountryRegionCode ) ↙ SalesTerritory( CountryRegionCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ISO standard code for countries and regions.CountryRegionCode nvarchar(3)🔗 Referred by Person.StateProvince ( CountryRegionCode ) Referred by Sales.CountryRegionCurrency ( CountryRegionCode ) Referred by Sales.SalesTerritory ( CountryRegionCode ) 🔍 Unq AK_CountryRegion_Name ( Name ) ⧉ Name * person.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Country or region name.Name Person.Name ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.CountryRegionCurrency ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Cross-reference table mapping ISO currency codes to a country or region.Sales.CountryRegionCurrency 🔑 Pk PK_CountryRegionCurrency_CountryRegionCode_CurrencyCode ( CountryRegionCode, CurrencyCode ) ⧉ CountryRegionCode * nvarchar(3) ↗ CountryRegion( CountryRegionCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ISO code for countries and regions. Foreign key to CountryRegion.CountryRegionCode.CountryRegionCode nvarchar(3)🔗 References Person.CountryRegion ( CountryRegionCode ) 🔑 Pk PK_CountryRegionCurrency_CountryRegionCode_CurrencyCode ( CountryRegionCode, CurrencyCode ) 🔍 IX_CountryRegionCurrency_CurrencyCode ( CurrencyCode ) ⧉ CurrencyCode * nchar(3) ↗ Currency( CurrencyCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ISO standard currency code. Foreign key to Currency.CurrencyCode.CurrencyCode nchar(3)🔗 References Sales.Currency ( CurrencyCode ) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.CreditCard ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Customer credit card information.Sales.CreditCard 🔑 Pk PK_CreditCard_CreditCardID ( CreditCardID ) ⧉ CreditCardID * int ↙ PersonCreditCard( CreditCardID ) ↙ SalesOrderHeader( CreditCardID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for CreditCard records.CreditCardID int🔗 Referred by Sales.PersonCreditCard ( CreditCardID ) Referred by Sales.SalesOrderHeader ( CreditCardID ) ⧉ CardType * nvarchar(50) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Credit card name.CardType nvarchar(50) 🔍 Unq AK_CreditCard_CardNumber ( CardNumber ) ⧉ CardNumber * nvarchar(25) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Credit card number.CardNumber nvarchar(25) ⧉ ExpMonth * tinyint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Credit card expiration month.ExpMonth tinyint ⧉ ExpYear * smallint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Credit card expiration year.ExpYear smallint ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.Culture ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Lookup table containing the languages in which some AdventureWorks data is stored.Production.Culture 🔑 Pk PK_Culture_CultureID ( CultureID ) ⧉ CultureID * nchar(6) ↙ ProductModelProductDescriptionCulture( CultureID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for Culture records.CultureID nchar(6)🔗 Referred by Production.ProductModelProductDescriptionCulture ( CultureID ) 🔍 Unq AK_Culture_Name ( Name ) ⧉ Name * production.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Culture description.Name Production.Name ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.Currency ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Lookup table containing standard ISO currencies.Sales.Currency 🔑 Pk PK_Currency_CurrencyCode ( CurrencyCode ) ⧉ CurrencyCode * nchar(3) ↙ CountryRegionCurrency( CurrencyCode ) ↙ CurrencyRate( FromCurrencyCode ) ↙ CurrencyRate( ToCurrencyCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The ISO code for the Currency.CurrencyCode nchar(3)🔗 Referred by Sales.CountryRegionCurrency ( CurrencyCode ) Referred by Sales.CurrencyRate ( FromCurrencyCode -> CurrencyCode ) Referred by Sales.CurrencyRate ( ToCurrencyCode -> CurrencyCode ) 🔍 Unq AK_Currency_Name ( Name ) ⧉ Name * sales.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Currency name.Name Sales.Name ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.CurrencyRate ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Currency exchange rates.Sales.CurrencyRate 🔑 Pk PK_CurrencyRate_CurrencyRateID ( CurrencyRateID ) ⧉ CurrencyRateID * int ↙ SalesOrderHeader( CurrencyRateID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for CurrencyRate records.CurrencyRateID int🔗 Referred by Sales.SalesOrderHeader ( CurrencyRateID ) 🔍 Unq AK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCode ( CurrencyRateDate, FromCurrencyCode, ToCurrencyCode ) ⧉ CurrencyRateDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the exchange rate was obtained.CurrencyRateDate datetime 🔍 Unq AK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCode ( CurrencyRateDate, FromCurrencyCode, ToCurrencyCode ) ⧉ FromCurrencyCode * nchar(3) ↗ Currency( CurrencyCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Exchange rate was converted from this currency code.FromCurrencyCode nchar(3)🔗 References Sales.Currency ( FromCurrencyCode -> CurrencyCode ) 🔍 Unq AK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCode ( CurrencyRateDate, FromCurrencyCode, ToCurrencyCode ) ⧉ ToCurrencyCode * nchar(3) ↗ Currency( CurrencyCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Exchange rate was converted to this currency code.ToCurrencyCode nchar(3)🔗 References Sales.Currency ( ToCurrencyCode -> CurrencyCode ) ⧉ AverageRate * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Average exchange rate for the day.AverageRate money ⧉ EndOfDayRate * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Final exchange rate for the day.EndOfDayRate money ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.Customer ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Current customer information. Also see the Person and Store tables.Sales.Customer 🔑 Pk PK_Customer_CustomerID ( CustomerID ) ⧉ CustomerID * int ↙ SalesOrderHeader( CustomerID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key.CustomerID int🔗 Referred by Sales.SalesOrderHeader ( CustomerID ) ⧉ PersonID int ↗ Person( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Foreign key to Person.BusinessEntityIDPersonID int🔗 References Person.Person ( PersonID -> BusinessEntityID ) ⧉ StoreID int ↗ Store( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Foreign key to Store.BusinessEntityIDStoreID int🔗 References Sales.Store ( StoreID -> BusinessEntityID ) 🔍 IX_Customer_TerritoryID ( TerritoryID ) ⧉ TerritoryID int ↗ SalesTerritory( TerritoryID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID.TerritoryID int🔗 References Sales.SalesTerritory ( TerritoryID ) 🔍 Unq AK_Customer_AccountNumber ( AccountNumber ) ⧉ AccountNumber text ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unique number identifying the customer assigned by the accounting system.AccountNumber text 🔍 Unq AK_Customer_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table dbo.DatabaseLog ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the database trigger ddlDatabaseTriggerLog.dbo.DatabaseLog 🔑 Pk PK_DatabaseLog_DatabaseLogID ( DatabaseLogID ) ⧉ DatabaseLogID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for DatabaseLog records.DatabaseLogID int ⧉ PostTime * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The date and time the DDL change occurred.PostTime datetime ⧉ DatabaseUser * sysname ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The user who implemented the DDL change.DatabaseUser sysname ⧉ Event * sysname ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The type of DDL statement that was executed.Event sysname ⧉ Schema sysname ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The schema to which the changed object belongs.Schema sysname ⧉ Object sysname ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The object that was changed by the DDL statment.Object sysname ⧉ TSQL * nvarchar(max) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The exact Transact-SQL statement that was executed.TSQL nvarchar(max) ⧉ XmlEvent * xml ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The raw XML data generated by database trigger.XmlEvent xml Table HumanResources.Department ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Lookup table containing the departments within the Adventure Works Cycles company.HumanResources.Department 🔑 Pk PK_Department_DepartmentID ( DepartmentID ) ⧉ DepartmentID * smallint ↙ EmployeeDepartmentHistory( DepartmentID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for Department records.DepartmentID smallint🔗 Referred by HumanResources.EmployeeDepartmentHistory ( DepartmentID ) 🔍 Unq AK_Department_Name ( Name ) ⧉ Name * humanresources.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Name of the department.Name HumanResources.Name ⧉ GroupName * humanresources.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Name of the group to which the department belongs.GroupName HumanResources.Name ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.Document ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product maintenance documents.Production.Document 🔑 Pk PK_Document_DocumentNode ( DocumentNode ) 🔍 Unq AK_Document_DocumentLevel_DocumentNode ( DocumentLevel, DocumentNode ) ⧉ DocumentNode * hierarchyid ↙ ProductDocument( DocumentNode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for Document records.DocumentNode hierarchyid🔗 Referred by Production.ProductDocument ( DocumentNode ) 🔍 Unq AK_Document_DocumentLevel_DocumentNode ( DocumentLevel, DocumentNode ) ⧉ DocumentLevel text ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Depth in the document hierarchy.DocumentLevel text ⧉ Title * nvarchar(50) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Title of the document.Title nvarchar(50) ⧉ Owner * int ↗ Employee( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Employee who controls the document. Foreign key to Employee.BusinessEntityIDOwner int🔗 References HumanResources.Employee ( Owner -> BusinessEntityID ) ⧉ FolderFlag * bit default 0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 0 = This is a folder, 1 = This is a document.FolderFlag bit 🔍 IX_Document_FileName_Revision ( FileName, Revision ) ⧉ FileName * nvarchar(400) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ File name of the documentFileName nvarchar(400) ⧉ FileExtension * nvarchar(8) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ File extension indicating the document type. For example, .doc or .txt.FileExtension nvarchar(8) 🔍 IX_Document_FileName_Revision ( FileName, Revision ) ⧉ Revision * nchar(5) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Revision number of the document.Revision nchar(5) ⧉ ChangeNumber * int default 0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Engineering change approval number.ChangeNumber int ⧉ Status * tinyint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 1 = Pending approval, 2 = Approved, 3 = ObsoleteStatus tinyint ⧉ DocumentSummary nvarchar(max) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Document abstract.DocumentSummary nvarchar(max) ⧉ Document varbinary(max) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Complete document.Document varbinary(max) 🔍 Unq AK_Document_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Required for FileStream.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.EmailAddress ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Where to send a person email.Person.EmailAddress 🔑 Pk PK_EmailAddress_BusinessEntityID_EmailAddressID ( BusinessEntityID, EmailAddressID ) ⧉ BusinessEntityID * int ↗ Person( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Person associated with this email address. Foreign key to Person.BusinessEntityIDBusinessEntityID int🔗 References Person.Person ( BusinessEntityID ) 🔑 Pk PK_EmailAddress_BusinessEntityID_EmailAddressID ( BusinessEntityID, EmailAddressID ) ⧉ EmailAddressID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. ID of this email address.EmailAddressID int 🔍 IX_EmailAddress_EmailAddress ( EmailAddress ) ⧉ EmailAddress nvarchar(50) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ E-mail address for the person.EmailAddress nvarchar(50) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table HumanResources.Employee ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Employee information such as salary, department, and title.HumanResources.Employee 🔑 Pk PK_Employee_BusinessEntityID ( BusinessEntityID ) ⧉ BusinessEntityID * int ↗ Person( BusinessEntityID ) ↙ EmployeeDepartmentHistory( BusinessEntityID ) ↙ EmployeePayHistory( BusinessEntityID ) ↙ JobCandidate( BusinessEntityID ) ↙ Document( Owner ) ↙ PurchaseOrderHeader( EmployeeID ) ↙ SalesPerson( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for Employee records. Foreign key to BusinessEntity.BusinessEntityID.BusinessEntityID int🔗 References Person.Person ( BusinessEntityID ) Referred by HumanResources.EmployeeDepartmentHistory ( BusinessEntityID ) Referred by HumanResources.EmployeePayHistory ( BusinessEntityID ) Referred by HumanResources.JobCandidate ( BusinessEntityID ) Referred by Production.Document ( Owner -> BusinessEntityID ) Referred by Purchasing.PurchaseOrderHeader ( EmployeeID -> BusinessEntityID ) Referred by Sales.SalesPerson ( BusinessEntityID ) 🔍 Unq AK_Employee_NationalIDNumber ( NationalIDNumber ) ⧉ NationalIDNumber * nvarchar(15) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unique national identification number such as a social security number.NationalIDNumber nvarchar(15) 🔍 Unq AK_Employee_LoginID ( LoginID ) ⧉ LoginID * nvarchar(256) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Network login.LoginID nvarchar(256) 🔍 IX_Employee_OrganizationNode ( OrganizationNode ) 🔍 IX_Employee_OrganizationLevel_OrganizationNode ( OrganizationLevel, OrganizationNode ) ⧉ OrganizationNode hierarchyid ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Where the employee is located in corporate hierarchy.OrganizationNode hierarchyid 🔍 IX_Employee_OrganizationLevel_OrganizationNode ( OrganizationLevel, OrganizationNode ) ⧉ OrganizationLevel text ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The depth of the employee in the corporate hierarchy.OrganizationLevel text ⧉ JobTitle * nvarchar(50) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Work title such as Buyer or Sales Representative.JobTitle nvarchar(50) ⧉ BirthDate * date ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date of birth.BirthDate date ⧉ MaritalStatus * nchar(1) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ M = Married, S = SingleMaritalStatus nchar(1) ⧉ Gender * nchar(1) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ M = Male, F = FemaleGender nchar(1) ⧉ HireDate * date ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Employee hired on this date.HireDate date ⧉ SalariedFlag * humanresources.flag default ((1)) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining.SalariedFlag HumanResources.Flag ⧉ VacationHours * smallint default 0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Number of available vacation hours.VacationHours smallint ⧉ SickLeaveHours * smallint default 0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Number of available sick leave hours.SickLeaveHours smallint ⧉ CurrentFlag * humanresources.flag default ((1)) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 0 = Inactive, 1 = ActiveCurrentFlag HumanResources.Flag 🔍 Unq AK_Employee_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table HumanResources.EmployeeDepartmentHistory ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Employee department transfers.HumanResources.EmployeeDepartmentHistory 🔑 Pk PK_EmployeeDepartmentHistory_BusinessEntityID_StartDate_DepartmentID ( BusinessEntityID, StartDate, DepartmentID, ShiftID ) ⧉ BusinessEntityID * int ↗ Employee( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Employee identification number. Foreign key to Employee.BusinessEntityID.BusinessEntityID int🔗 References HumanResources.Employee ( BusinessEntityID ) 🔑 Pk PK_EmployeeDepartmentHistory_BusinessEntityID_StartDate_DepartmentID ( BusinessEntityID, StartDate, DepartmentID, ShiftID ) 🔍 IX_EmployeeDepartmentHistory_DepartmentID ( DepartmentID ) ⧉ DepartmentID * smallint ↗ Department( DepartmentID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Department in which the employee worked including currently. Foreign key to Department.DepartmentID.DepartmentID smallint🔗 References HumanResources.Department ( DepartmentID ) 🔑 Pk PK_EmployeeDepartmentHistory_BusinessEntityID_StartDate_DepartmentID ( BusinessEntityID, StartDate, DepartmentID, ShiftID ) 🔍 IX_EmployeeDepartmentHistory_ShiftID ( ShiftID ) ⧉ ShiftID * tinyint ↗ Shift( ShiftID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID.ShiftID tinyint🔗 References HumanResources.Shift ( ShiftID ) 🔑 Pk PK_EmployeeDepartmentHistory_BusinessEntityID_StartDate_DepartmentID ( BusinessEntityID, StartDate, DepartmentID, ShiftID ) ⧉ StartDate * date ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the employee started work in the department.StartDate date ⧉ EndDate date ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the employee left the department. NULL = Current department.EndDate date ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table HumanResources.EmployeePayHistory ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Employee pay history.HumanResources.EmployeePayHistory 🔑 Pk PK_EmployeePayHistory_BusinessEntityID_RateChangeDate ( BusinessEntityID, RateChangeDate ) ⧉ BusinessEntityID * int ↗ Employee( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Employee identification number. Foreign key to Employee.BusinessEntityID.BusinessEntityID int🔗 References HumanResources.Employee ( BusinessEntityID ) 🔑 Pk PK_EmployeePayHistory_BusinessEntityID_RateChangeDate ( BusinessEntityID, RateChangeDate ) ⧉ RateChangeDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the change in pay is effectiveRateChangeDate datetime ⧉ Rate * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Salary hourly rate.Rate money ⧉ PayFrequency * tinyint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 1 = Salary received monthly, 2 = Salary received biweeklyPayFrequency tinyint ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table dbo.ErrorLog ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Audit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct.dbo.ErrorLog 🔑 Pk PK_ErrorLog_ErrorLogID ( ErrorLogID ) ⧉ ErrorLogID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for ErrorLog records.ErrorLogID int ⧉ ErrorTime * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The date and time at which the error occurred.ErrorTime datetime ⧉ UserName * sysname ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The user who executed the batch in which the error occurred.UserName sysname ⧉ ErrorNumber * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The error number of the error that occurred.ErrorNumber int ⧉ ErrorSeverity int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The severity of the error that occurred.ErrorSeverity int ⧉ ErrorState int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The state number of the error that occurred.ErrorState int ⧉ ErrorProcedure nvarchar(126) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The name of the stored procedure or trigger where the error occurred.ErrorProcedure nvarchar(126) ⧉ ErrorLine int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The line number at which the error occurred.ErrorLine int ⧉ ErrorMessage * nvarchar(4000) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The message text of the error that occurred.ErrorMessage nvarchar(4000) Table Production.Illustration ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Bicycle assembly diagrams.Production.Illustration 🔑 Pk PK_Illustration_IllustrationID ( IllustrationID ) ⧉ IllustrationID * int ↙ ProductModelIllustration( IllustrationID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for Illustration records.IllustrationID int🔗 Referred by Production.ProductModelIllustration ( IllustrationID ) ⧉ Diagram xml ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Illustrations used in manufacturing instructions. Stored as XML.Diagram xml ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table HumanResources.JobCandidate ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Résumés submitted to Human Resources by job applicants.HumanResources.JobCandidate 🔑 Pk PK_JobCandidate_JobCandidateID ( JobCandidateID ) ⧉ JobCandidateID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for JobCandidate records.JobCandidateID int 🔍 IX_JobCandidate_BusinessEntityID ( BusinessEntityID ) ⧉ BusinessEntityID int ↗ Employee( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Employee identification number if applicant was hired. Foreign key to Employee.BusinessEntityID.BusinessEntityID int🔗 References HumanResources.Employee ( BusinessEntityID ) ⧉ Resume xml ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Résumé in XML format.Resume xml ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.Location ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product inventory and manufacturing locations.Production.Location 🔑 Pk PK_Location_LocationID ( LocationID ) ⧉ LocationID * smallint ↙ ProductInventory( LocationID ) ↙ WorkOrderRouting( LocationID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for Location records.LocationID smallint🔗 Referred by Production.ProductInventory ( LocationID ) Referred by Production.WorkOrderRouting ( LocationID ) 🔍 Unq AK_Location_Name ( Name ) ⧉ Name * production.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Location description.Name Production.Name ⧉ CostRate * smallmoney default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Standard hourly cost of the manufacturing location.CostRate smallmoney ⧉ Availability * decimal(8,2) default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Work capacity (in hours) of the manufacturing location.Availability decimal(8,2) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.Password ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ One way hashed authentication informationPerson.Password 🔑 Pk PK_Password_BusinessEntityID ( BusinessEntityID ) ⧉ BusinessEntityID * int ↗ Person( BusinessEntityID )BusinessEntityID int🔗 References Person.Person ( BusinessEntityID ) ⧉ PasswordHash * varchar(128) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Password for the e-mail account.PasswordHash varchar(128) ⧉ PasswordSalt * varchar(10) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Random value concatenated with the password string before the password is hashed.PasswordSalt varchar(10) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.Person ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts.Person.Person 🔑 Pk PK_Person_BusinessEntityID ( BusinessEntityID ) ⧉ BusinessEntityID * int ↗ BusinessEntity( BusinessEntityID ) ↙ Employee( BusinessEntityID ) ↙ BusinessEntityContact( PersonID ) ↙ EmailAddress( BusinessEntityID ) ↙ Password( BusinessEntityID ) ↙ PersonPhone( BusinessEntityID ) ↙ Customer( PersonID ) ↙ PersonCreditCard( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for Person records.BusinessEntityID int🔗 References Person.BusinessEntity ( BusinessEntityID ) Referred by HumanResources.Employee ( BusinessEntityID ) Referred by Person.BusinessEntityContact ( PersonID -> BusinessEntityID ) Referred by Person.EmailAddress ( BusinessEntityID ) Referred by Person.Password ( BusinessEntityID ) Referred by Person.PersonPhone ( BusinessEntityID ) Referred by Sales.Customer ( PersonID -> BusinessEntityID ) Referred by Sales.PersonCreditCard ( BusinessEntityID ) ⧉ PersonType * nchar(2) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contactPersonType nchar(2) ⧉ NameStyle * person.namestyle default ((0)) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order.NameStyle Person.NameStyle ⧉ Title nvarchar(8) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ A courtesy title. For example, Mr. or Ms.Title nvarchar(8) 🔍 IX_Person_LastName_FirstName_MiddleName ( LastName, FirstName, MiddleName ) ⧉ FirstName * person.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ First name of the person.FirstName Person.Name 🔍 IX_Person_LastName_FirstName_MiddleName ( LastName, FirstName, MiddleName ) ⧉ MiddleName person.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Middle name or middle initial of the person.MiddleName Person.Name 🔍 IX_Person_LastName_FirstName_MiddleName ( LastName, FirstName, MiddleName ) ⧉ LastName * person.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Last name of the person.LastName Person.Name ⧉ Suffix nvarchar(10) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Surname suffix. For example, Sr. or Jr.Suffix nvarchar(10) ⧉ EmailPromotion * int default 0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners.EmailPromotion int ⧉ AdditionalContactInfo xml ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Additional contact information about the person stored in xml format.AdditionalContactInfo xml ⧉ Demographics xml ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Personal information such as hobbies, and income collected from online shoppers. Used for sales analysis.Demographics xml 🔍 Unq AK_Person_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.PersonCreditCard ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Cross-reference table mapping people to their credit card information in the CreditCard table.Sales.PersonCreditCard 🔑 Pk PK_PersonCreditCard_BusinessEntityID_CreditCardID ( BusinessEntityID, CreditCardID ) ⧉ BusinessEntityID * int ↗ Person( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Business entity identification number. Foreign key to Person.BusinessEntityID.BusinessEntityID int🔗 References Person.Person ( BusinessEntityID ) 🔑 Pk PK_PersonCreditCard_BusinessEntityID_CreditCardID ( BusinessEntityID, CreditCardID ) ⧉ CreditCardID * int ↗ CreditCard( CreditCardID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Credit card identification number. Foreign key to CreditCard.CreditCardID.CreditCardID int🔗 References Sales.CreditCard ( CreditCardID ) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.PersonPhone ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Telephone number and type of a person.Person.PersonPhone 🔑 Pk PK_PersonPhone_BusinessEntityID_PhoneNumber_PhoneNumberTypeID ( BusinessEntityID, PhoneNumber, PhoneNumberTypeID ) ⧉ BusinessEntityID * int ↗ Person( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Business entity identification number. Foreign key to Person.BusinessEntityID.BusinessEntityID int🔗 References Person.Person ( BusinessEntityID ) 🔑 Pk PK_PersonPhone_BusinessEntityID_PhoneNumber_PhoneNumberTypeID ( BusinessEntityID, PhoneNumber, PhoneNumberTypeID ) 🔍 IX_PersonPhone_PhoneNumber ( PhoneNumber ) ⧉ PhoneNumber * person.phone ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Telephone number identification number.PhoneNumber Person.Phone 🔑 Pk PK_PersonPhone_BusinessEntityID_PhoneNumber_PhoneNumberTypeID ( BusinessEntityID, PhoneNumber, PhoneNumberTypeID ) ⧉ PhoneNumberTypeID * int ↗ PhoneNumberType( PhoneNumberTypeID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Kind of phone number. Foreign key to PhoneNumberType.PhoneNumberTypeID.PhoneNumberTypeID int🔗 References Person.PhoneNumberType ( PhoneNumberTypeID ) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.PhoneNumberType ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Type of phone number of a person.Person.PhoneNumberType 🔑 Pk PK_PhoneNumberType_PhoneNumberTypeID ( PhoneNumberTypeID ) ⧉ PhoneNumberTypeID * int ↙ PersonPhone( PhoneNumberTypeID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for telephone number type records.PhoneNumberTypeID int🔗 Referred by Person.PersonPhone ( PhoneNumberTypeID ) ⧉ Name * person.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Name of the telephone number typeName Person.Name ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.Product ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Products sold or used in the manfacturing of sold products.Production.Product 🔑 Pk PK_Product_ProductID ( ProductID ) ⧉ ProductID * int ↙ BillOfMaterials( ComponentID ) ↙ BillOfMaterials( ProductAssemblyID ) ↙ ProductCostHistory( ProductID ) ↙ ProductDocument( ProductID ) ↙ ProductInventory( ProductID ) ↙ ProductListPriceHistory( ProductID ) ↙ ProductProductPhoto( ProductID ) ↙ ProductReview( ProductID ) ↙ TransactionHistory( ProductID ) ↙ WorkOrder( ProductID ) ↙ ProductVendor( ProductID ) ↙ PurchaseOrderDetail( ProductID ) ↙ ShoppingCartItem( ProductID ) ↙ SpecialOfferProduct( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for Product records.ProductID int🔗 Referred by Production.BillOfMaterials ( ComponentID -> ProductID ) Referred by Production.BillOfMaterials ( ProductAssemblyID -> ProductID ) Referred by Production.ProductCostHistory ( ProductID ) Referred by Production.ProductDocument ( ProductID ) Referred by Production.ProductInventory ( ProductID ) Referred by Production.ProductListPriceHistory ( ProductID ) Referred by Production.ProductProductPhoto ( ProductID ) Referred by Production.ProductReview ( ProductID ) Referred by Production.TransactionHistory ( ProductID ) Referred by Production.WorkOrder ( ProductID ) Referred by Purchasing.ProductVendor ( ProductID ) Referred by Purchasing.PurchaseOrderDetail ( ProductID ) Referred by Sales.ShoppingCartItem ( ProductID ) Referred by Sales.SpecialOfferProduct ( ProductID ) 🔍 Unq AK_Product_Name ( Name ) ⧉ Name * production.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Name of the product.Name Production.Name 🔍 Unq AK_Product_ProductNumber ( ProductNumber ) ⧉ ProductNumber * nvarchar(25) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unique product identification number.ProductNumber nvarchar(25) ⧉ MakeFlag * production.flag default ((1)) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 0 = Product is purchased, 1 = Product is manufactured in-house.MakeFlag Production.Flag ⧉ FinishedGoodsFlag * production.flag default ((1)) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 0 = Product is not a salable item. 1 = Product is salable.FinishedGoodsFlag Production.Flag ⧉ Color nvarchar(15) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product color.Color nvarchar(15) ⧉ SafetyStockLevel * smallint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Minimum inventory quantity.SafetyStockLevel smallint ⧉ ReorderPoint * smallint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Inventory level that triggers a purchase order or work order.ReorderPoint smallint ⧉ StandardCost * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Standard cost of the product.StandardCost money ⧉ ListPrice * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Selling price.ListPrice money ⧉ Size nvarchar(5) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product size.Size nvarchar(5) ⧉ SizeUnitMeasureCode nchar(3) ↗ UnitMeasure( UnitMeasureCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unit of measure for Size column.SizeUnitMeasureCode nchar(3)🔗 References Production.UnitMeasure ( SizeUnitMeasureCode -> UnitMeasureCode ) ⧉ WeightUnitMeasureCode nchar(3) ↗ UnitMeasure( UnitMeasureCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unit of measure for Weight column.WeightUnitMeasureCode nchar(3)🔗 References Production.UnitMeasure ( WeightUnitMeasureCode -> UnitMeasureCode ) ⧉ Weight decimal(8,2) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product weight.Weight decimal(8,2) ⧉ DaysToManufacture * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Number of days required to manufacture the product.DaysToManufacture int ⧉ ProductLine nchar(2) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ R = Road, M = Mountain, T = Touring, S = StandardProductLine nchar(2) ⧉ Class nchar(2) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ H = High, M = Medium, L = LowClass nchar(2) ⧉ Style nchar(2) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ W = Womens, M = Mens, U = UniversalStyle nchar(2) ⧉ ProductSubcategoryID int ↗ ProductSubcategory( ProductSubcategoryID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID.ProductSubcategoryID int🔗 References Production.ProductSubcategory ( ProductSubcategoryID ) ⧉ ProductModelID int ↗ ProductModel( ProductModelID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product is a member of this product model. Foreign key to ProductModel.ProductModelID.ProductModelID int🔗 References Production.ProductModel ( ProductModelID ) ⧉ SellStartDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the product was available for sale.SellStartDate datetime ⧉ SellEndDate datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the product was no longer available for sale.SellEndDate datetime ⧉ DiscontinuedDate datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the product was discontinued.DiscontinuedDate datetime 🔍 Unq AK_Product_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductCategory ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ High-level product categorization.Production.ProductCategory 🔑 Pk PK_ProductCategory_ProductCategoryID ( ProductCategoryID ) ⧉ ProductCategoryID * int ↙ ProductSubcategory( ProductCategoryID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for ProductCategory records.ProductCategoryID int🔗 Referred by Production.ProductSubcategory ( ProductCategoryID ) 🔍 Unq AK_ProductCategory_Name ( Name ) ⧉ Name * production.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Category description.Name Production.Name 🔍 Unq AK_ProductCategory_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductCostHistory ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Changes in the cost of a product over time.Production.ProductCostHistory 🔑 Pk PK_ProductCostHistory_ProductID_StartDate ( ProductID, StartDate ) ⧉ ProductID * int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product identification number. Foreign key to Product.ProductIDProductID int🔗 References Production.Product ( ProductID ) 🔑 Pk PK_ProductCostHistory_ProductID_StartDate ( ProductID, StartDate ) ⧉ StartDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product cost start date.StartDate datetime ⧉ EndDate datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product cost end date.EndDate datetime ⧉ StandardCost * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Standard cost of the product.StandardCost money ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductDescription ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product descriptions in several languages.Production.ProductDescription 🔑 Pk PK_ProductDescription_ProductDescriptionID ( ProductDescriptionID ) ⧉ ProductDescriptionID * int ↙ ProductModelProductDescriptionCulture( ProductDescriptionID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for ProductDescription records.ProductDescriptionID int🔗 Referred by Production.ProductModelProductDescriptionCulture ( ProductDescriptionID ) ⧉ Description * nvarchar(400) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Description of the product.Description nvarchar(400) 🔍 Unq AK_ProductDescription_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductDocument ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Cross-reference table mapping products to related product documents.Production.ProductDocument 🔑 Pk PK_ProductDocument_ProductID_DocumentNode ( ProductID, DocumentNode ) ⧉ ProductID * int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product identification number. Foreign key to Product.ProductID.ProductID int🔗 References Production.Product ( ProductID ) 🔑 Pk PK_ProductDocument_ProductID_DocumentNode ( ProductID, DocumentNode ) ⧉ DocumentNode * hierarchyid ↗ Document( DocumentNode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Document identification number. Foreign key to Document.DocumentNode.DocumentNode hierarchyid🔗 References Production.Document ( DocumentNode ) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductInventory ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product inventory information.Production.ProductInventory 🔑 Pk PK_ProductInventory_ProductID_LocationID ( ProductID, LocationID ) ⧉ ProductID * int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product identification number. Foreign key to Product.ProductID.ProductID int🔗 References Production.Product ( ProductID ) 🔑 Pk PK_ProductInventory_ProductID_LocationID ( ProductID, LocationID ) ⧉ LocationID * smallint ↗ Location( LocationID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Inventory location identification number. Foreign key to Location.LocationID.LocationID smallint🔗 References Production.Location ( LocationID ) ⧉ Shelf * nvarchar(10) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Storage compartment within an inventory location.Shelf nvarchar(10) ⧉ Bin * tinyint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Storage container on a shelf in an inventory location.Bin tinyint ⧉ Quantity * smallint default 0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Quantity of products in the inventory location.Quantity smallint ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductListPriceHistory ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Changes in the list price of a product over time.Production.ProductListPriceHistory 🔑 Pk PK_ProductListPriceHistory_ProductID_StartDate ( ProductID, StartDate ) ⧉ ProductID * int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product identification number. Foreign key to Product.ProductIDProductID int🔗 References Production.Product ( ProductID ) 🔑 Pk PK_ProductListPriceHistory_ProductID_StartDate ( ProductID, StartDate ) ⧉ StartDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ List price start date.StartDate datetime ⧉ EndDate datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ List price end dateEndDate datetime ⧉ ListPrice * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product list price.ListPrice money ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductModel ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product model classification.Production.ProductModel 🔑 Pk PK_ProductModel_ProductModelID ( ProductModelID ) ⧉ ProductModelID * int ↙ Product( ProductModelID ) ↙ ProductModelIllustration( ProductModelID ) ↙ ProductModelProductDescriptionCulture( ProductModelID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for ProductModel records.ProductModelID int🔗 Referred by Production.Product ( ProductModelID ) Referred by Production.ProductModelIllustration ( ProductModelID ) Referred by Production.ProductModelProductDescriptionCulture ( ProductModelID ) 🔍 Unq AK_ProductModel_Name ( Name ) ⧉ Name * production.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product model description.Name Production.Name ⧉ CatalogDescription xml ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Detailed product catalog information in xml format.CatalogDescription xml ⧉ Instructions xml ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Manufacturing instructions in xml format.Instructions xml 🔍 Unq AK_ProductModel_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductModelIllustration ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Cross-reference table mapping product models and illustrations.Production.ProductModelIllustration 🔑 Pk PK_ProductModelIllustration_ProductModelID_IllustrationID ( ProductModelID, IllustrationID ) ⧉ ProductModelID * int ↗ ProductModel( ProductModelID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to ProductModel.ProductModelID.ProductModelID int🔗 References Production.ProductModel ( ProductModelID ) 🔑 Pk PK_ProductModelIllustration_ProductModelID_IllustrationID ( ProductModelID, IllustrationID ) ⧉ IllustrationID * int ↗ Illustration( IllustrationID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to Illustration.IllustrationID.IllustrationID int🔗 References Production.Illustration ( IllustrationID ) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductModelProductDescriptionCulture ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Cross-reference table mapping product descriptions and the language the description is written in.Production.ProductModelProductDescriptionCulture 🔑 Pk PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID ( ProductModelID, ProductDescriptionID, CultureID ) ⧉ ProductModelID * int ↗ ProductModel( ProductModelID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to ProductModel.ProductModelID.ProductModelID int🔗 References Production.ProductModel ( ProductModelID ) 🔑 Pk PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID ( ProductModelID, ProductDescriptionID, CultureID ) ⧉ ProductDescriptionID * int ↗ ProductDescription( ProductDescriptionID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to ProductDescription.ProductDescriptionID.ProductDescriptionID int🔗 References Production.ProductDescription ( ProductDescriptionID ) 🔑 Pk PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID ( ProductModelID, ProductDescriptionID, CultureID ) ⧉ CultureID * nchar(6) ↗ Culture( CultureID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Culture identification number. Foreign key to Culture.CultureID.CultureID nchar(6)🔗 References Production.Culture ( CultureID ) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductPhoto ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product images.Production.ProductPhoto 🔑 Pk PK_ProductPhoto_ProductPhotoID ( ProductPhotoID ) ⧉ ProductPhotoID * int ↙ ProductProductPhoto( ProductPhotoID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for ProductPhoto records.ProductPhotoID int🔗 Referred by Production.ProductProductPhoto ( ProductPhotoID ) ⧉ ThumbNailPhoto varbinary(max) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Small image of the product.ThumbNailPhoto varbinary(max) ⧉ ThumbnailPhotoFileName nvarchar(50) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Small image file name.ThumbnailPhotoFileName nvarchar(50) ⧉ LargePhoto varbinary(max) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Large image of the product.LargePhoto varbinary(max) ⧉ LargePhotoFileName nvarchar(50) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Large image file name.LargePhotoFileName nvarchar(50) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductProductPhoto ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Cross-reference table mapping products and product photos.Production.ProductProductPhoto 🔑 Pk PK_ProductProductPhoto_ProductID_ProductPhotoID ( ProductID, ProductPhotoID ) ⧉ ProductID * int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product identification number. Foreign key to Product.ProductID.ProductID int🔗 References Production.Product ( ProductID ) 🔑 Pk PK_ProductProductPhoto_ProductID_ProductPhotoID ( ProductID, ProductPhotoID ) ⧉ ProductPhotoID * int ↗ ProductPhoto( ProductPhotoID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID.ProductPhotoID int🔗 References Production.ProductPhoto ( ProductPhotoID ) ⧉ Primary * production.flag default ((0)) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 0 = Photo is not the principal image. 1 = Photo is the principal image.Primary Production.Flag ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductReview ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Customer reviews of products they have purchased.Production.ProductReview 🔑 Pk PK_ProductReview_ProductReviewID ( ProductReviewID ) ⧉ ProductReviewID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for ProductReview records.ProductReviewID int 🔍 IX_ProductReview_ProductID_Name ( ProductID, ReviewerName ) ⧉ ProductID * int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product identification number. Foreign key to Product.ProductID.ProductID int🔗 References Production.Product ( ProductID ) 🔍 IX_ProductReview_ProductID_Name ( ProductID, ReviewerName ) ⧉ ReviewerName * production.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Name of the reviewer.ReviewerName Production.Name ⧉ ReviewDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date review was submitted.ReviewDate datetime ⧉ EmailAddress * nvarchar(50) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Reviewer's e-mail address.EmailAddress nvarchar(50) ⧉ Rating * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating.Rating int ⧉ Comments nvarchar(3850) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Reviewer's commentsComments nvarchar(3850) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ProductSubcategory ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product subcategories. See ProductCategory table.Production.ProductSubcategory 🔑 Pk PK_ProductSubcategory_ProductSubcategoryID ( ProductSubcategoryID ) ⧉ ProductSubcategoryID * int ↙ Product( ProductSubcategoryID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for ProductSubcategory records.ProductSubcategoryID int🔗 Referred by Production.Product ( ProductSubcategoryID ) ⧉ ProductCategoryID * int ↗ ProductCategory( ProductCategoryID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product category identification number. Foreign key to ProductCategory.ProductCategoryID.ProductCategoryID int🔗 References Production.ProductCategory ( ProductCategoryID ) 🔍 Unq AK_ProductSubcategory_Name ( Name ) ⧉ Name * production.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Subcategory description.Name Production.Name 🔍 Unq AK_ProductSubcategory_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Purchasing.ProductVendor ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Cross-reference table mapping vendors with the products they supply.Purchasing.ProductVendor 🔑 Pk PK_ProductVendor_ProductID_BusinessEntityID ( ProductID, BusinessEntityID ) ⧉ ProductID * int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to Product.ProductID.ProductID int🔗 References Production.Product ( ProductID ) 🔑 Pk PK_ProductVendor_ProductID_BusinessEntityID ( ProductID, BusinessEntityID ) 🔍 IX_ProductVendor_BusinessEntityID ( BusinessEntityID ) ⧉ BusinessEntityID * int ↗ Vendor( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to Vendor.BusinessEntityID.BusinessEntityID int🔗 References Purchasing.Vendor ( BusinessEntityID ) ⧉ AverageLeadTime * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The average span of time (in days) between placing an order with the vendor and receiving the purchased product.AverageLeadTime int ⧉ StandardPrice * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The vendor's usual selling price.StandardPrice money ⧉ LastReceiptCost money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The selling price when last purchased.LastReceiptCost money ⧉ LastReceiptDate datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the product was last received by the vendor.LastReceiptDate datetime ⧉ MinOrderQty * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The maximum quantity that should be ordered.MinOrderQty int ⧉ MaxOrderQty * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The minimum quantity that should be ordered.MaxOrderQty int ⧉ OnOrderQty int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The quantity currently on order.OnOrderQty int 🔍 IX_ProductVendor_UnitMeasureCode ( UnitMeasureCode ) ⧉ UnitMeasureCode * nchar(3) ↗ UnitMeasure( UnitMeasureCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ The product's unit of measure.UnitMeasureCode nchar(3)🔗 References Production.UnitMeasure ( UnitMeasureCode ) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Purchasing.PurchaseOrderDetail ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Individual products associated with a specific purchase order. See PurchaseOrderHeader.Purchasing.PurchaseOrderDetail 🔑 Pk PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailID ( PurchaseOrderID, PurchaseOrderDetailID ) ⧉ PurchaseOrderID * int ↗ PurchaseOrderHeader( PurchaseOrderID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID.PurchaseOrderID int🔗 References Purchasing.PurchaseOrderHeader ( PurchaseOrderID ) 🔑 Pk PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailID ( PurchaseOrderID, PurchaseOrderDetailID ) ⧉ PurchaseOrderDetailID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. One line number per purchased product.PurchaseOrderDetailID int ⧉ DueDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the product is expected to be received.DueDate datetime ⧉ OrderQty * smallint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Quantity ordered.OrderQty smallint 🔍 IX_PurchaseOrderDetail_ProductID ( ProductID ) ⧉ ProductID * int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product identification number. Foreign key to Product.ProductID.ProductID int🔗 References Production.Product ( ProductID ) ⧉ UnitPrice * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Vendor's selling price of a single product.UnitPrice money ⧉ LineTotal text ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Per product subtotal. Computed as OrderQty * UnitPrice.LineTotal text ⧉ ReceivedQty * decimal(8,2) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Quantity actually received from the vendor.ReceivedQty decimal(8,2) ⧉ RejectedQty * decimal(8,2) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Quantity rejected during inspection.RejectedQty decimal(8,2) ⧉ StockedQty text ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Quantity accepted into inventory. Computed as ReceivedQty - RejectedQty.StockedQty text ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Purchasing.PurchaseOrderHeader ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ General purchase order information. See PurchaseOrderDetail.Purchasing.PurchaseOrderHeader 🔑 Pk PK_PurchaseOrderHeader_PurchaseOrderID ( PurchaseOrderID ) ⧉ PurchaseOrderID * int ↙ PurchaseOrderDetail( PurchaseOrderID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key.PurchaseOrderID int🔗 Referred by Purchasing.PurchaseOrderDetail ( PurchaseOrderID ) ⧉ RevisionNumber * tinyint default 0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Incremental number to track changes to the purchase order over time.RevisionNumber tinyint ⧉ Status * tinyint default 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = CompleteStatus tinyint 🔍 IX_PurchaseOrderHeader_EmployeeID ( EmployeeID ) ⧉ EmployeeID * int ↗ Employee( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Employee who created the purchase order. Foreign key to Employee.BusinessEntityID.EmployeeID int🔗 References HumanResources.Employee ( EmployeeID -> BusinessEntityID ) 🔍 IX_PurchaseOrderHeader_VendorID ( VendorID ) ⧉ VendorID * int ↗ Vendor( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Vendor with whom the purchase order is placed. Foreign key to Vendor.BusinessEntityID.VendorID int🔗 References Purchasing.Vendor ( VendorID -> BusinessEntityID ) ⧉ ShipMethodID * int ↗ ShipMethod( ShipMethodID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shipping method. Foreign key to ShipMethod.ShipMethodID.ShipMethodID int🔗 References Purchasing.ShipMethod ( ShipMethodID ) ⧉ OrderDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Purchase order creation date.OrderDate datetime ⧉ ShipDate datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Estimated shipment date from the vendor.ShipDate datetime ⧉ SubTotal * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID.SubTotal money ⧉ TaxAmt * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Tax amount.TaxAmt money ⧉ Freight * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shipping cost.Freight money ⧉ TotalDue text ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Total due to vendor. Computed as Subtotal + TaxAmt + Freight.TotalDue text ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.SalesOrderDetail ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Individual products associated with a specific sales order. See SalesOrderHeader.Sales.SalesOrderDetail 🔑 Pk PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID ( SalesOrderID, SalesOrderDetailID ) ⧉ SalesOrderID * int ↗ SalesOrderHeader( SalesOrderID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to SalesOrderHeader.SalesOrderID.SalesOrderID int🔗 References Sales.SalesOrderHeader ( SalesOrderID ) 🔑 Pk PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID ( SalesOrderID, SalesOrderDetailID ) ⧉ SalesOrderDetailID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. One incremental unique number per product sold.SalesOrderDetailID int ⧉ CarrierTrackingNumber nvarchar(25) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shipment tracking number supplied by the shipper.CarrierTrackingNumber nvarchar(25) ⧉ OrderQty * smallint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Quantity ordered per product.OrderQty smallint 🔍 IX_SalesOrderDetail_ProductID ( ProductID ) ⧉ ProductID * int ↗ SpecialOfferProduct( SpecialOfferID, ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product sold to customer. Foreign key to Product.ProductID.ProductID int🔗 References Sales.SpecialOfferProduct ( SpecialOfferID, ProductID ) ⧉ SpecialOfferID * int ↗ SpecialOfferProduct( SpecialOfferID, ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Promotional code. Foreign key to SpecialOffer.SpecialOfferID.SpecialOfferID int🔗 References Sales.SpecialOfferProduct ( SpecialOfferID, ProductID ) ⧉ UnitPrice * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Selling price of a single product.UnitPrice money ⧉ UnitPriceDiscount * money default 0.0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Discount amount.UnitPriceDiscount money ⧉ LineTotal text ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.LineTotal text 🔍 Unq AK_SalesOrderDetail_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.SalesOrderHeader ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ General sales order information.Sales.SalesOrderHeader 🔑 Pk PK_SalesOrderHeader_SalesOrderID ( SalesOrderID ) ⧉ SalesOrderID * int ↙ SalesOrderDetail( SalesOrderID ) ↙ SalesOrderHeaderSalesReason( SalesOrderID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key.SalesOrderID int🔗 Referred by Sales.SalesOrderDetail ( SalesOrderID ) Referred by Sales.SalesOrderHeaderSalesReason ( SalesOrderID ) ⧉ RevisionNumber * tinyint default 0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Incremental number to track changes to the sales order over time.RevisionNumber tinyint ⧉ OrderDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Dates the sales order was created.OrderDate datetime ⧉ DueDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the order is due to the customer.DueDate datetime ⧉ ShipDate datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the order was shipped to the customer.ShipDate datetime ⧉ Status * tinyint default 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = CancelledStatus tinyint ⧉ OnlineOrderFlag * sales.flag default ((1)) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 0 = Order placed by sales person. 1 = Order placed online by customer.OnlineOrderFlag Sales.Flag 🔍 Unq AK_SalesOrderHeader_SalesOrderNumber ( SalesOrderNumber ) ⧉ SalesOrderNumber text ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unique sales order identification number.SalesOrderNumber text ⧉ PurchaseOrderNumber sales.ordernumber ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Customer purchase order number reference.PurchaseOrderNumber Sales.OrderNumber ⧉ AccountNumber sales.accountnumber ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Financial accounting number reference.AccountNumber Sales.AccountNumber 🔍 IX_SalesOrderHeader_CustomerID ( CustomerID ) ⧉ CustomerID * int ↗ Customer( CustomerID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Customer identification number. Foreign key to Customer.BusinessEntityID.CustomerID int🔗 References Sales.Customer ( CustomerID ) 🔍 IX_SalesOrderHeader_SalesPersonID ( SalesPersonID ) ⧉ SalesPersonID int ↗ SalesPerson( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales person who created the sales order. Foreign key to SalesPerson.BusinessEntityID.SalesPersonID int🔗 References Sales.SalesPerson ( SalesPersonID -> BusinessEntityID ) ⧉ TerritoryID int ↗ SalesTerritory( TerritoryID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Territory in which the sale was made. Foreign key to SalesTerritory.SalesTerritoryID.TerritoryID int🔗 References Sales.SalesTerritory ( TerritoryID ) ⧉ BillToAddressID * int ↗ Address( AddressID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Customer billing address. Foreign key to Address.AddressID.BillToAddressID int🔗 References Person.Address ( BillToAddressID -> AddressID ) ⧉ ShipToAddressID * int ↗ Address( AddressID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Customer shipping address. Foreign key to Address.AddressID.ShipToAddressID int🔗 References Person.Address ( ShipToAddressID -> AddressID ) ⧉ ShipMethodID * int ↗ ShipMethod( ShipMethodID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shipping method. Foreign key to ShipMethod.ShipMethodID.ShipMethodID int🔗 References Purchasing.ShipMethod ( ShipMethodID ) ⧉ CreditCardID int ↗ CreditCard( CreditCardID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Credit card identification number. Foreign key to CreditCard.CreditCardID.CreditCardID int🔗 References Sales.CreditCard ( CreditCardID ) ⧉ CreditCardApprovalCode varchar(15) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Approval code provided by the credit card company.CreditCardApprovalCode varchar(15) ⧉ CurrencyRateID int ↗ CurrencyRate( CurrencyRateID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Currency exchange rate used. Foreign key to CurrencyRate.CurrencyRateID.CurrencyRateID int🔗 References Sales.CurrencyRate ( CurrencyRateID ) ⧉ SubTotal * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID.SubTotal money ⧉ TaxAmt * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Tax amount.TaxAmt money ⧉ Freight * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shipping cost.Freight money ⧉ TotalDue text ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Total due from customer. Computed as Subtotal + TaxAmt + Freight.TotalDue text ⧉ Comment nvarchar(128) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales representative comments.Comment nvarchar(128) 🔍 Unq AK_SalesOrderHeader_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.SalesOrderHeaderSalesReason ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Cross-reference table mapping sales orders to sales reason codes.Sales.SalesOrderHeaderSalesReason 🔑 Pk PK_SalesOrderHeaderSalesReason_SalesOrderID_SalesReasonID ( SalesOrderID, SalesReasonID ) ⧉ SalesOrderID * int ↗ SalesOrderHeader( SalesOrderID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to SalesOrderHeader.SalesOrderID.SalesOrderID int🔗 References Sales.SalesOrderHeader ( SalesOrderID ) 🔑 Pk PK_SalesOrderHeaderSalesReason_SalesOrderID_SalesReasonID ( SalesOrderID, SalesReasonID ) ⧉ SalesReasonID * int ↗ SalesReason( SalesReasonID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to SalesReason.SalesReasonID.SalesReasonID int🔗 References Sales.SalesReason ( SalesReasonID ) ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.SalesPerson ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales representative current information.Sales.SalesPerson 🔑 Pk PK_SalesPerson_BusinessEntityID ( BusinessEntityID ) ⧉ BusinessEntityID * int ↗ Employee( BusinessEntityID ) ↙ SalesOrderHeader( SalesPersonID ) ↙ SalesPersonQuotaHistory( BusinessEntityID ) ↙ SalesTerritoryHistory( BusinessEntityID ) ↙ Store( SalesPersonID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for SalesPerson records. Foreign key to Employee.BusinessEntityIDBusinessEntityID int🔗 References HumanResources.Employee ( BusinessEntityID ) Referred by Sales.SalesOrderHeader ( SalesPersonID -> BusinessEntityID ) Referred by Sales.SalesPersonQuotaHistory ( BusinessEntityID ) Referred by Sales.SalesTerritoryHistory ( BusinessEntityID ) Referred by Sales.Store ( SalesPersonID -> BusinessEntityID ) ⧉ TerritoryID int ↗ SalesTerritory( TerritoryID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID.TerritoryID int🔗 References Sales.SalesTerritory ( TerritoryID ) ⧉ SalesQuota money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Projected yearly sales.SalesQuota money ⧉ Bonus * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Bonus due if quota is met.Bonus money ⧉ CommissionPct * smallmoney default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Commision percent received per sale.CommissionPct smallmoney ⧉ SalesYTD * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales total year to date.SalesYTD money ⧉ SalesLastYear * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales total of previous year.SalesLastYear money 🔍 Unq AK_SalesPerson_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.SalesPersonQuotaHistory ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales performance tracking.Sales.SalesPersonQuotaHistory 🔑 Pk PK_SalesPersonQuotaHistory_BusinessEntityID_QuotaDate ( BusinessEntityID, QuotaDate ) ⧉ BusinessEntityID * int ↗ SalesPerson( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales person identification number. Foreign key to SalesPerson.BusinessEntityID.BusinessEntityID int🔗 References Sales.SalesPerson ( BusinessEntityID ) 🔑 Pk PK_SalesPersonQuotaHistory_BusinessEntityID_QuotaDate ( BusinessEntityID, QuotaDate ) ⧉ QuotaDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales quota date.QuotaDate datetime ⧉ SalesQuota * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales quota amount.SalesQuota money 🔍 Unq AK_SalesPersonQuotaHistory_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.SalesReason ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Lookup table of customer purchase reasons.Sales.SalesReason 🔑 Pk PK_SalesReason_SalesReasonID ( SalesReasonID ) ⧉ SalesReasonID * int ↙ SalesOrderHeaderSalesReason( SalesReasonID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for SalesReason records.SalesReasonID int🔗 Referred by Sales.SalesOrderHeaderSalesReason ( SalesReasonID ) ⧉ Name * sales.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales reason description.Name Sales.Name ⧉ ReasonType * sales.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Category the sales reason belongs to.ReasonType Sales.Name ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.SalesTaxRate ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Tax rate lookup table.Sales.SalesTaxRate 🔑 Pk PK_SalesTaxRate_SalesTaxRateID ( SalesTaxRateID ) ⧉ SalesTaxRateID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for SalesTaxRate records.SalesTaxRateID int 🔍 Unq AK_SalesTaxRate_StateProvinceID_TaxType ( StateProvinceID, TaxType ) ⧉ StateProvinceID * int ↗ StateProvince( StateProvinceID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ State, province, or country/region the sales tax applies to.StateProvinceID int🔗 References Person.StateProvince ( StateProvinceID ) 🔍 Unq AK_SalesTaxRate_StateProvinceID_TaxType ( StateProvinceID, TaxType ) ⧉ TaxType * tinyint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions.TaxType tinyint ⧉ TaxRate * smallmoney default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Tax rate amount.TaxRate smallmoney ⧉ Name * sales.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Tax rate description.Name Sales.Name 🔍 Unq AK_SalesTaxRate_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.SalesTerritory ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales territory lookup table.Sales.SalesTerritory 🔑 Pk PK_SalesTerritory_TerritoryID ( TerritoryID ) ⧉ TerritoryID * int ↙ StateProvince( TerritoryID ) ↙ Customer( TerritoryID ) ↙ SalesOrderHeader( TerritoryID ) ↙ SalesPerson( TerritoryID ) ↙ SalesTerritoryHistory( TerritoryID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for SalesTerritory records.TerritoryID int🔗 Referred by Person.StateProvince ( TerritoryID ) Referred by Sales.Customer ( TerritoryID ) Referred by Sales.SalesOrderHeader ( TerritoryID ) Referred by Sales.SalesPerson ( TerritoryID ) Referred by Sales.SalesTerritoryHistory ( TerritoryID ) 🔍 Unq AK_SalesTerritory_Name ( Name ) ⧉ Name * sales.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales territory descriptionName Sales.Name ⧉ CountryRegionCode * nvarchar(3) ↗ CountryRegion( CountryRegionCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.CountryRegionCode nvarchar(3)🔗 References Person.CountryRegion ( CountryRegionCode ) ⧉ Group * nvarchar(50) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Geographic area to which the sales territory belong.Group nvarchar(50) ⧉ SalesYTD * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales in the territory year to date.SalesYTD money ⧉ SalesLastYear * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales in the territory the previous year.SalesLastYear money ⧉ CostYTD * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Business costs in the territory year to date.CostYTD money ⧉ CostLastYear * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Business costs in the territory the previous year.CostLastYear money 🔍 Unq AK_SalesTerritory_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.SalesTerritoryHistory ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sales representative transfers to other sales territories.Sales.SalesTerritoryHistory 🔑 Pk PK_SalesTerritoryHistory_BusinessEntityID_StartDate_TerritoryID ( BusinessEntityID, StartDate, TerritoryID ) ⧉ BusinessEntityID * int ↗ SalesPerson( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. The sales rep. Foreign key to SalesPerson.BusinessEntityID.BusinessEntityID int🔗 References Sales.SalesPerson ( BusinessEntityID ) 🔑 Pk PK_SalesTerritoryHistory_BusinessEntityID_StartDate_TerritoryID ( BusinessEntityID, StartDate, TerritoryID ) ⧉ TerritoryID * int ↗ SalesTerritory( TerritoryID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID.TerritoryID int🔗 References Sales.SalesTerritory ( TerritoryID ) 🔑 Pk PK_SalesTerritoryHistory_BusinessEntityID_StartDate_TerritoryID ( BusinessEntityID, StartDate, TerritoryID ) ⧉ StartDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Date the sales representive started work in the territory.StartDate datetime ⧉ EndDate datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the sales representative left work in the territory.EndDate datetime 🔍 Unq AK_SalesTerritoryHistory_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.ScrapReason ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Manufacturing failure reasons lookup table.Production.ScrapReason 🔑 Pk PK_ScrapReason_ScrapReasonID ( ScrapReasonID ) ⧉ ScrapReasonID * smallint ↙ WorkOrder( ScrapReasonID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for ScrapReason records.ScrapReasonID smallint🔗 Referred by Production.WorkOrder ( ScrapReasonID ) 🔍 Unq AK_ScrapReason_Name ( Name ) ⧉ Name * production.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failure description.Name Production.Name ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table HumanResources.Shift ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Work shift lookup table.HumanResources.Shift 🔑 Pk PK_Shift_ShiftID ( ShiftID ) ⧉ ShiftID * tinyint ↙ EmployeeDepartmentHistory( ShiftID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for Shift records.ShiftID tinyint🔗 Referred by HumanResources.EmployeeDepartmentHistory ( ShiftID ) 🔍 Unq AK_Shift_Name ( Name ) ⧉ Name * humanresources.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shift description.Name HumanResources.Name 🔍 Unq AK_Shift_StartTime_EndTime ( StartTime, EndTime ) ⧉ StartTime * time ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shift start time.StartTime time 🔍 Unq AK_Shift_StartTime_EndTime ( StartTime, EndTime ) ⧉ EndTime * time ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shift end time.EndTime time ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Purchasing.ShipMethod ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shipping company lookup table.Purchasing.ShipMethod 🔑 Pk PK_ShipMethod_ShipMethodID ( ShipMethodID ) ⧉ ShipMethodID * int ↙ PurchaseOrderHeader( ShipMethodID ) ↙ SalesOrderHeader( ShipMethodID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for ShipMethod records.ShipMethodID int🔗 Referred by Purchasing.PurchaseOrderHeader ( ShipMethodID ) Referred by Sales.SalesOrderHeader ( ShipMethodID ) 🔍 Unq AK_ShipMethod_Name ( Name ) ⧉ Name * purchasing.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shipping company name.Name Purchasing.Name ⧉ ShipBase * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Minimum shipping charge.ShipBase money ⧉ ShipRate * money default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shipping charge per pound.ShipRate money 🔍 Unq AK_ShipMethod_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.ShoppingCartItem ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Contains online customer orders until the order is submitted or cancelled.Sales.ShoppingCartItem 🔑 Pk PK_ShoppingCartItem_ShoppingCartItemID ( ShoppingCartItemID ) ⧉ ShoppingCartItemID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for ShoppingCartItem records.ShoppingCartItemID int 🔍 IX_ShoppingCartItem_ShoppingCartID_ProductID ( ShoppingCartID, ProductID ) ⧉ ShoppingCartID * nvarchar(50) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Shopping cart identification number.ShoppingCartID nvarchar(50) ⧉ Quantity * int default 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product quantity ordered.Quantity int 🔍 IX_ShoppingCartItem_ShoppingCartID_ProductID ( ShoppingCartID, ProductID ) ⧉ ProductID * int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product ordered. Foreign key to Product.ProductID.ProductID int🔗 References Production.Product ( ProductID ) ⧉ DateCreated * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date the time the record was created.DateCreated datetime ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.SpecialOffer ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Sale discounts lookup table.Sales.SpecialOffer 🔑 Pk PK_SpecialOffer_SpecialOfferID ( SpecialOfferID ) ⧉ SpecialOfferID * int ↙ SpecialOfferProduct( SpecialOfferID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for SpecialOffer records.SpecialOfferID int🔗 Referred by Sales.SpecialOfferProduct ( SpecialOfferID ) ⧉ Description * nvarchar(255) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Discount description.Description nvarchar(255) ⧉ DiscountPct * smallmoney default 0.00 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Discount precentage.DiscountPct smallmoney ⧉ Type * nvarchar(50) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Discount type category.Type nvarchar(50) ⧉ Category * nvarchar(50) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Group the discount applies to such as Reseller or Customer.Category nvarchar(50) ⧉ StartDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Discount start date.StartDate datetime ⧉ EndDate * datetime ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Discount end date.EndDate datetime ⧉ MinQty * int default 0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Minimum discount percent allowed.MinQty int ⧉ MaxQty int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Maximum discount percent allowed.MaxQty int 🔍 Unq AK_SpecialOffer_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.SpecialOfferProduct ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Cross-reference table mapping products to special offer discounts.Sales.SpecialOfferProduct 🔑 Pk PK_SpecialOfferProduct_SpecialOfferID_ProductID ( SpecialOfferID, ProductID ) ⧉ SpecialOfferID * int ↗ SpecialOffer( SpecialOfferID ) ↙ SalesOrderDetail( SpecialOfferID, ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for SpecialOfferProduct records.SpecialOfferID int🔗 References Sales.SpecialOffer ( SpecialOfferID ) Referred by Sales.SalesOrderDetail ( SpecialOfferID, ProductID ) 🔑 Pk PK_SpecialOfferProduct_SpecialOfferID_ProductID ( SpecialOfferID, ProductID ) 🔍 IX_SpecialOfferProduct_ProductID ( ProductID ) ⧉ ProductID * int ↗ Product( ProductID ) ↙ SalesOrderDetail( SpecialOfferID, ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product identification number. Foreign key to Product.ProductID.ProductID int🔗 References Production.Product ( ProductID ) Referred by Sales.SalesOrderDetail ( SpecialOfferID, ProductID ) 🔍 Unq AK_SpecialOfferProduct_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Person.StateProvince ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ State and province lookup table.Person.StateProvince 🔑 Pk PK_StateProvince_StateProvinceID ( StateProvinceID ) ⧉ StateProvinceID * int ↙ Address( StateProvinceID ) ↙ SalesTaxRate( StateProvinceID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for StateProvince records.StateProvinceID int🔗 Referred by Person.Address ( StateProvinceID ) Referred by Sales.SalesTaxRate ( StateProvinceID ) 🔍 Unq AK_StateProvince_StateProvinceCode_CountryRegionCode ( StateProvinceCode, CountryRegionCode ) ⧉ StateProvinceCode * nchar(3) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ISO standard state or province code.StateProvinceCode nchar(3) 🔍 Unq AK_StateProvince_StateProvinceCode_CountryRegionCode ( StateProvinceCode, CountryRegionCode ) ⧉ CountryRegionCode * nvarchar(3) ↗ CountryRegion( CountryRegionCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.CountryRegionCode nvarchar(3)🔗 References Person.CountryRegion ( CountryRegionCode ) ⧉ IsOnlyStateProvinceFlag * person.flag default ((1)) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode.IsOnlyStateProvinceFlag Person.Flag 🔍 Unq AK_StateProvince_Name ( Name ) ⧉ Name * person.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ State or province description.Name Person.Name ⧉ TerritoryID * int ↗ SalesTerritory( TerritoryID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID.TerritoryID int🔗 References Sales.SalesTerritory ( TerritoryID ) 🔍 Unq AK_StateProvince_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Sales.Store ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Customers (resellers) of Adventure Works products.Sales.Store 🔑 Pk PK_Store_BusinessEntityID ( BusinessEntityID ) ⧉ BusinessEntityID * int ↗ BusinessEntity( BusinessEntityID ) ↙ Customer( StoreID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key. Foreign key to Customer.BusinessEntityID.BusinessEntityID int🔗 References Person.BusinessEntity ( BusinessEntityID ) Referred by Sales.Customer ( StoreID -> BusinessEntityID ) ⧉ Name * sales.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Name of the store.Name Sales.Name 🔍 IX_Store_SalesPersonID ( SalesPersonID ) ⧉ SalesPersonID int ↗ SalesPerson( BusinessEntityID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ID of the sales person assigned to the customer. Foreign key to SalesPerson.BusinessEntityID.SalesPersonID int🔗 References Sales.SalesPerson ( SalesPersonID -> BusinessEntityID ) ⧉ Demographics xml ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Demographic informationg about the store such as the number of employees, annual sales and store type.Demographics xml 🔍 Unq AK_Store_rowguid ( rowguid ) ⧉ rowguid * uniqueidentifier default newid() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.rowguid uniqueidentifier ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.TransactionHistory ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Record of each purchase order, sales order, or work order transaction year to date.Production.TransactionHistory 🔑 Pk PK_TransactionHistory_TransactionID ( TransactionID ) ⧉ TransactionID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for TransactionHistory records.TransactionID int 🔍 IX_TransactionHistory_ProductID ( ProductID ) ⧉ ProductID * int ↗ Product( ProductID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product identification number. Foreign key to Product.ProductID.ProductID int🔗 References Production.Product ( ProductID ) 🔍 IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) ⧉ ReferenceOrderID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Purchase order, sales order, or work order identification number.ReferenceOrderID int 🔍 IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) ⧉ ReferenceOrderLineID * int default 0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Line number associated with the purchase order, sales order, or work order.ReferenceOrderLineID int ⧉ TransactionDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time of the transaction.TransactionDate datetime ⧉ TransactionType * nchar(1) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ W = WorkOrder, S = SalesOrder, P = PurchaseOrderTransactionType nchar(1) ⧉ Quantity * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product quantity.Quantity int ⧉ ActualCost * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product cost.ActualCost money ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.TransactionHistoryArchive ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Transactions for previous years.Production.TransactionHistoryArchive 🔑 Pk PK_TransactionHistoryArchive_TransactionID ( TransactionID ) ⧉ TransactionID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for TransactionHistoryArchive records.TransactionID int 🔍 IX_TransactionHistoryArchive_ProductID ( ProductID ) ⧉ ProductID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product identification number. Foreign key to Product.ProductID.ProductID int 🔍 IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) ⧉ ReferenceOrderID * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Purchase order, sales order, or work order identification number.ReferenceOrderID int 🔍 IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) ⧉ ReferenceOrderLineID * int default 0 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Line number associated with the purchase order, sales order, or work order.ReferenceOrderLineID int ⧉ TransactionDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time of the transaction.TransactionDate datetime ⧉ TransactionType * nchar(1) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ W = Work Order, S = Sales Order, P = Purchase OrderTransactionType nchar(1) ⧉ Quantity * int ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product quantity.Quantity int ⧉ ActualCost * money ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Product cost.ActualCost money ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Production.UnitMeasure ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unit of measure lookup table.Production.UnitMeasure 🔑 Pk PK_UnitMeasure_UnitMeasureCode ( UnitMeasureCode ) ⧉ UnitMeasureCode * nchar(3) ↙ BillOfMaterials( UnitMeasureCode ) ↙ Product( SizeUnitMeasureCode ) ↙ Product( WeightUnitMeasureCode ) ↙ ProductVendor( UnitMeasureCode ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key.UnitMeasureCode nchar(3)🔗 Referred by Production.BillOfMaterials ( UnitMeasureCode ) Referred by Production.Product ( SizeUnitMeasureCode -> UnitMeasureCode ) Referred by Production.Product ( WeightUnitMeasureCode -> UnitMeasureCode ) Referred by Purchasing.ProductVendor ( UnitMeasureCode ) 🔍 Unq AK_UnitMeasure_Name ( Name ) ⧉ Name * production.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unit of measure description.Name Production.Name ⧉ ModifiedDate * datetime default getdate() ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Date and time the record was last updated.ModifiedDate datetime Table Purchasing.Vendor ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Companies from whom Adventure Works Cycles purchases parts or other goods.Purchasing.Vendor 🔑 Pk PK_Vendor_BusinessEntityID ( BusinessEntityID ) ⧉ BusinessEntityID * int ↗ BusinessEntity( BusinessEntityID ) ↙ ProductVendor( BusinessEntityID ) ↙ PurchaseOrderHeader( VendorID ) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Primary key for Vendor records. Foreign key to BusinessEntity.BusinessEntityIDBusinessEntityID int🔗 References Person.BusinessEntity ( BusinessEntityID ) Referred by Purchasing.ProductVendor ( BusinessEntityID ) Referred by Purchasing.PurchaseOrderHeader ( VendorID -> BusinessEntityID ) 🔍 Unq AK_Vendor_AccountNumber ( AccountNumber ) ⧉ AccountNumber * purchasing.accountnumber ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Vendor account (identification) number.AccountNumber Purchasing.AccountNumber ⧉ Name * purchasing.name ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Company name.Name Purchasing.Name ⧉ CreditRating * tinyint ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below averageCreditRating tinyint ⧉ PreferredVendorStatus * purchasing.flag default ((1)) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product.PreferredVendorStatus Purchasing.Flag ⧉ ActiveFlag * purchasing.flag default ((1)) ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ 0 = Vendor no longer used. 1 = Vendor is actively used.ActiveFlag Purchasing.Flag ⧉ PurchasingWebServiceURL nvarchar(1024)PurchasingWebServiceURL nvarchar(1024) ⧉ ModifiedDate * datetime default getdate()ModifiedDate datetime Table Production.WorkOrderProduction.WorkOrder 🔑 Pk PK_WorkOrder_WorkOrderID ( WorkOrderID ) ⧉ WorkOrderID * int ↙ WorkOrderRouting( WorkOrderID )WorkOrderID int🔗 Referred by Production.WorkOrderRouting ( WorkOrderID ) 🔍 IX_WorkOrder_ProductID ( ProductID ) ⧉ ProductID * int ↗ Product( ProductID )ProductID int🔗 References Production.Product ( ProductID ) ⧉ OrderQty * intOrderQty int ⧉ StockedQty textStockedQty text ⧉ ScrappedQty * smallintScrappedQty smallint ⧉ StartDate * datetimeStartDate datetime ⧉ EndDate datetimeEndDate datetime ⧉ DueDate * datetimeDueDate datetime 🔍 IX_WorkOrder_ScrapReasonID ( ScrapReasonID ) ⧉ ScrapReasonID smallint ↗ ScrapReason( ScrapReasonID )ScrapReasonID smallint🔗 References Production.ScrapReason ( ScrapReasonID ) ⧉ ModifiedDate * datetime default getdate()ModifiedDate datetime Table Production.WorkOrderRoutingProduction.WorkOrderRouting 🔑 Pk PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence ( WorkOrderID, ProductID, OperationSequence ) ⧉ WorkOrderID * int ↗ WorkOrder( WorkOrderID )WorkOrderID int🔗 References Production.WorkOrder ( WorkOrderID ) 🔑 Pk PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence ( WorkOrderID, ProductID, OperationSequence ) 🔍 IX_WorkOrderRouting_ProductID ( ProductID ) ⧉ ProductID * intProductID int 🔑 Pk PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence ( WorkOrderID, ProductID, OperationSequence ) ⧉ OperationSequence * smallintOperationSequence smallint ⧉ LocationID * smallint ↗ Location( LocationID )LocationID smallint🔗 References Production.Location ( LocationID ) ⧉ ScheduledStartDate * datetimeScheduledStartDate datetime ⧉ ScheduledEndDate * datetimeScheduledEndDate datetime ⧉ ActualStartDate datetimeActualStartDate datetime ⧉ ActualEndDate datetimeActualEndDate datetime ⧉ ActualResourceHrs decimal(9,4)ActualResourceHrs decimal(9,4) ⧉ PlannedCost * moneyPlannedCost money ⧉ ActualCost moneyActualCost money ⧉ ModifiedDate * datetime default getdate()ModifiedDate datetime


Schema AdventureWorks2025.HumanResources

Contains objects related to employees and departments.



Table HumanResources.Department

Lookup table containing the departments within the Adventure Works Cycles company.

IdxColumn NameDefinitionDescription
* DepartmentID smallint NOT NULL IDENTITY Primary key for Department records.
* Name HumanResources.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Name of the department.
* GroupName HumanResources.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Name of the group to which the department belongs.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_EmployeeDepartmentHistory_Department_DepartmentID DepartmentID ↙ ❏ HumanResources.EmployeeDepartmentHistory


Table HumanResources.Employee

Employee information such as salary, department, and title.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Primary key for Employee records. Foreign key to BusinessEntity.BusinessEntityID.
* NationalIDNumber nvarchar(15) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Unique national identification number such as a social security number.
* LoginID nvarchar(256) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Network login.
OrganizationNode hierarchyid Where the employee is located in corporate hierarchy.
OrganizationLevel text The depth of the employee in the corporate hierarchy.
* JobTitle nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Work title such as Buyer or Sales Representative.
* BirthDate date NOT NULL Date of birth.
* MaritalStatus nchar(1) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS M = Married, S = Single
* Gender nchar(1) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS M = Male, F = Female
* HireDate date NOT NULL Employee hired on this date.
* SalariedFlag HumanResources.Flag NOT NULL DEFAULT ((1)) Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining.
* VacationHours smallint NOT NULL DEFAULT 0 Number of available vacation hours.
* SickLeaveHours smallint NOT NULL DEFAULT 0 Number of available sick leave hours.
* CurrentFlag HumanResources.Flag NOT NULL DEFAULT ((1)) 0 = Inactive, 1 = Active
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_Employee_Person_BusinessEntityID BusinessEntityID ↗ ❏ Person.Person
Referring Foreign Key
FK_EmployeeDepartmentHistory_Employee_BusinessEntityID BusinessEntityID ↙ ❏ HumanResources.EmployeeDepartmentHistory
FK_EmployeePayHistory_Employee_BusinessEntityID BusinessEntityID ↙ ❏ HumanResources.EmployeePayHistory
FK_JobCandidate_Employee_BusinessEntityID BusinessEntityID ↙ ❏ HumanResources.JobCandidate
FK_Document_Employee_Owner BusinessEntityID ↙ ❏ Production.Document(Owner)
FK_PurchaseOrderHeader_Employee_EmployeeID BusinessEntityID ↙ ❏ Purchasing.PurchaseOrderHeader(EmployeeID)
FK_SalesPerson_Employee_BusinessEntityID BusinessEntityID ↙ ❏ Sales.SalesPerson
Constraints
  CK_Employee_BirthDate [BirthDate]>='1930-01-01' AND [BirthDate]<=dateadd(year,(-18),getdate())
  CK_Employee_MaritalStatus upper([MaritalStatus])='S' OR upper([MaritalStatus])='M'
  CK_Employee_HireDate [HireDate]>='1996-07-01' AND [HireDate]<=dateadd(day,(1),getdate())
  CK_Employee_Gender upper([Gender])='F' OR upper([Gender])='M'
  CK_Employee_VacationHours [VacationHours]>=(-40) AND [VacationHours]<=(240)
  CK_Employee_SickLeaveHours [SickLeaveHours]>=(0) AND [SickLeaveHours]<=(120)
Triggers


Table HumanResources.EmployeeDepartmentHistory

Employee department transfers.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Employee identification number. Foreign key to Employee.BusinessEntityID.
* DepartmentID smallint NOT NULL Department in which the employee worked including currently. Foreign key to Department.DepartmentID.
* ShiftID tinyint NOT NULL Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID.
* StartDate date NOT NULL Date the employee started work in the department.
  EndDate date Date the employee left the department. NULL = Current department.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_EmployeeDepartmentHistory_Department_DepartmentID DepartmentID ↗ ❏ HumanResources.Department
FK_EmployeeDepartmentHistory_Employee_BusinessEntityID BusinessEntityID ↗ ❏ HumanResources.Employee
FK_EmployeeDepartmentHistory_Shift_ShiftID ShiftID ↗ ❏ HumanResources.Shift
Constraints
  CK_EmployeeDepartmentHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL


Table HumanResources.EmployeePayHistory

Employee pay history.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Employee identification number. Foreign key to Employee.BusinessEntityID.
* RateChangeDate datetime NOT NULL Date the change in pay is effective
* Rate money NOT NULL Salary hourly rate.
* PayFrequency tinyint NOT NULL 1 = Salary received monthly, 2 = Salary received biweekly
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_EmployeePayHistory_Employee_BusinessEntityID BusinessEntityID ↗ ❏ HumanResources.Employee
Constraints
  CK_EmployeePayHistory_PayFrequency [PayFrequency]=(2) OR [PayFrequency]=(1)
  CK_EmployeePayHistory_Rate [Rate]>=(6.50) AND [Rate]<=(200.00)


Table HumanResources.JobCandidate

Résumés submitted to Human Resources by job applicants.

IdxColumn NameDefinitionDescription
* JobCandidateID int NOT NULL IDENTITY Primary key for JobCandidate records.
BusinessEntityID int Employee identification number if applicant was hired. Foreign key to Employee.BusinessEntityID.
  Resume xml Résumé in XML format.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_JobCandidate_Employee_BusinessEntityID BusinessEntityID ↗ ❏ HumanResources.Employee


Table HumanResources.Shift

Work shift lookup table.

IdxColumn NameDefinitionDescription
* ShiftID tinyint NOT NULL IDENTITY Primary key for Shift records.
* Name HumanResources.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Shift description.
* StartTime time NOT NULL Shift start time.
* EndTime time NOT NULL Shift end time.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_EmployeeDepartmentHistory_Shift_ShiftID ShiftID ↙ ❏ HumanResources.EmployeeDepartmentHistory


Schema AdventureWorks2025.Person

Contains objects related to names and addresses of customers, vendors, and employees



Table Person.Address

Street address information for customers, employees, and vendors.

IdxColumn NameDefinitionDescription
* AddressID int NOT NULL IDENTITY Primary key for Address records.
* AddressLine1 nvarchar(60) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS First street address line.
AddressLine2 nvarchar(60) COLLATE SQL_Latin1_General_CP1_CI_AS Second street address line.
* City nvarchar(30) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Name of the city.
* StateProvinceID int NOT NULL Unique identification number for the state or province. Foreign key to StateProvince table.
* PostalCode nvarchar(15) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Postal code for the street address.
  SpatialLocation geography Latitude and longitude of this address.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_Address_StateProvince_StateProvinceID StateProvinceID ↗ ❏ Person.StateProvince
Referring Foreign Key
FK_BusinessEntityAddress_Address_AddressID AddressID ↙ ❏ Person.BusinessEntityAddress
FK_SalesOrderHeader_Address_BillToAddressID AddressID ↙ ❏ Sales.SalesOrderHeader(BillToAddressID)
FK_SalesOrderHeader_Address_ShipToAddressID AddressID ↙ ❏ Sales.SalesOrderHeader(ShipToAddressID)


Table Person.AddressType

Types of addresses stored in the Address table.

IdxColumn NameDefinitionDescription
* AddressTypeID int NOT NULL IDENTITY Primary key for AddressType records.
* Name Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Address type description. For example, Billing, Home, or Shipping.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_BusinessEntityAddress_AddressType_AddressTypeID AddressTypeID ↙ ❏ Person.BusinessEntityAddress


Table Person.BusinessEntity

Source of the ID that connects vendors, customers, and employees with address and contact information.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL IDENTITY Primary key for all customers, vendors, and employees.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_BusinessEntityAddress_BusinessEntity_BusinessEntityID BusinessEntityID ↙ ❏ Person.BusinessEntityAddress
FK_BusinessEntityContact_BusinessEntity_BusinessEntityID BusinessEntityID ↙ ❏ Person.BusinessEntityContact
FK_Person_BusinessEntity_BusinessEntityID BusinessEntityID ↙ ❏ Person.Person
FK_Vendor_BusinessEntity_BusinessEntityID BusinessEntityID ↙ ❏ Purchasing.Vendor
FK_Store_BusinessEntity_BusinessEntityID BusinessEntityID ↙ ❏ Sales.Store


Table Person.BusinessEntityAddress

Cross-reference table mapping customers, vendors, and employees to their addresses.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Primary key. Foreign key to BusinessEntity.BusinessEntityID.
* AddressID int NOT NULL Primary key. Foreign key to Address.AddressID.
* AddressTypeID int NOT NULL Primary key. Foreign key to AddressType.AddressTypeID.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_BusinessEntityAddress_Address_AddressID AddressID ↗ ❏ Person.Address
FK_BusinessEntityAddress_AddressType_AddressTypeID AddressTypeID ↗ ❏ Person.AddressType
FK_BusinessEntityAddress_BusinessEntity_BusinessEntityID BusinessEntityID ↗ ❏ Person.BusinessEntity


Table Person.BusinessEntityContact

Cross-reference table mapping stores, vendors, and employees to people

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Primary key. Foreign key to BusinessEntity.BusinessEntityID.
* PersonID int NOT NULL Primary key. Foreign key to Person.BusinessEntityID.
* ContactTypeID int NOT NULL Primary key. Foreign key to ContactType.ContactTypeID.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_BusinessEntityContact_BusinessEntity_BusinessEntityID BusinessEntityID ↗ ❏ Person.BusinessEntity
FK_BusinessEntityContact_ContactType_ContactTypeID ContactTypeID ↗ ❏ Person.ContactType
FK_BusinessEntityContact_Person_PersonID PersonID ↗ ❏ Person.Person(BusinessEntityID)


Table Person.ContactType

Lookup table containing the types of business entity contacts.

IdxColumn NameDefinitionDescription
* ContactTypeID int NOT NULL IDENTITY Primary key for ContactType records.
* Name Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Contact type description.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_BusinessEntityContact_ContactType_ContactTypeID ContactTypeID ↙ ❏ Person.BusinessEntityContact


Table Person.CountryRegion

Lookup table containing the ISO standard codes for countries and regions.

IdxColumn NameDefinitionDescription
* CountryRegionCode nvarchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS ISO standard code for countries and regions.
* Name Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Country or region name.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_StateProvince_CountryRegion_CountryRegionCode CountryRegionCode ↙ ❏ Person.StateProvince
FK_CountryRegionCurrency_CountryRegion_CountryRegionCode CountryRegionCode ↙ ❏ Sales.CountryRegionCurrency
FK_SalesTerritory_CountryRegion_CountryRegionCode CountryRegionCode ↙ ❏ Sales.SalesTerritory


Table Person.EmailAddress

Where to send a person email.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Primary key. Person associated with this email address. Foreign key to Person.BusinessEntityID
* EmailAddressID int NOT NULL IDENTITY Primary key. ID of this email address.
EmailAddress nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS E-mail address for the person.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_EmailAddress_Person_BusinessEntityID BusinessEntityID ↗ ❏ Person.Person


Table Person.Password

One way hashed authentication information

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL
* PasswordHash varchar(128) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Password for the e-mail account.
* PasswordSalt varchar(10) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Random value concatenated with the password string before the password is hashed.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_Password_Person_BusinessEntityID BusinessEntityID ↗ ❏ Person.Person


Table Person.Person

Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Primary key for Person records.
* PersonType nchar(2) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact
* NameStyle Person.NameStyle NOT NULL DEFAULT ((0)) 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order.
  Title nvarchar(8) COLLATE SQL_Latin1_General_CP1_CI_AS A courtesy title. For example, Mr. or Ms.
* FirstName Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS First name of the person.
MiddleName Person.Name COLLATE SQL_Latin1_General_CP1_CI_AS Middle name or middle initial of the person.
* LastName Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Last name of the person.
  Suffix nvarchar(10) COLLATE SQL_Latin1_General_CP1_CI_AS Surname suffix. For example, Sr. or Jr.
* EmailPromotion int NOT NULL DEFAULT 0 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners.
  AdditionalContactInfo xml Additional contact information about the person stored in xml format.
  Demographics xml Personal information such as hobbies, and income collected from online shoppers. Used for sales analysis.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_Person_BusinessEntity_BusinessEntityID BusinessEntityID ↗ ❏ Person.BusinessEntity
Referring Foreign Key
FK_Employee_Person_BusinessEntityID BusinessEntityID ↙ ❏ HumanResources.Employee
FK_BusinessEntityContact_Person_PersonID BusinessEntityID ↙ ❏ Person.BusinessEntityContact(PersonID)
FK_EmailAddress_Person_BusinessEntityID BusinessEntityID ↙ ❏ Person.EmailAddress
FK_Password_Person_BusinessEntityID BusinessEntityID ↙ ❏ Person.Password
FK_PersonPhone_Person_BusinessEntityID BusinessEntityID ↙ ❏ Person.PersonPhone
FK_Customer_Person_PersonID BusinessEntityID ↙ ❏ Sales.Customer(PersonID)
FK_PersonCreditCard_Person_BusinessEntityID BusinessEntityID ↙ ❏ Sales.PersonCreditCard
Constraints
  CK_Person_EmailPromotion [EmailPromotion]>=(0) AND [EmailPromotion]<=(2)
  CK_Person_PersonType [PersonType] IS NULL OR (upper([PersonType])='GC' OR upper([PersonType])='SP' OR upper([PersonType])='EM' OR upper([PersonType])='IN' OR upper([PersonType])='VC' OR upper([PersonType])='SC')
Triggers


Table Person.PersonPhone

Telephone number and type of a person.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Business entity identification number. Foreign key to Person.BusinessEntityID.
* PhoneNumber Person.Phone NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Telephone number identification number.
* PhoneNumberTypeID int NOT NULL Kind of phone number. Foreign key to PhoneNumberType.PhoneNumberTypeID.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_PersonPhone_Person_BusinessEntityID BusinessEntityID ↗ ❏ Person.Person
FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID PhoneNumberTypeID ↗ ❏ Person.PhoneNumberType


Table Person.PhoneNumberType

Type of phone number of a person.

IdxColumn NameDefinitionDescription
* PhoneNumberTypeID int NOT NULL IDENTITY Primary key for telephone number type records.
* Name Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Name of the telephone number type
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID PhoneNumberTypeID ↙ ❏ Person.PersonPhone


Table Person.StateProvince

State and province lookup table.

IdxColumn NameDefinitionDescription
* StateProvinceID int NOT NULL IDENTITY Primary key for StateProvince records.
* StateProvinceCode nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS ISO standard state or province code.
* CountryRegionCode nvarchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
* IsOnlyStateProvinceFlag Person.Flag NOT NULL DEFAULT ((1)) 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode.
* Name Person.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS State or province description.
* TerritoryID int NOT NULL ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_StateProvince_CountryRegion_CountryRegionCode CountryRegionCode ↗ ❏ Person.CountryRegion
FK_StateProvince_SalesTerritory_TerritoryID TerritoryID ↗ ❏ Sales.SalesTerritory
Referring Foreign Key
FK_Address_StateProvince_StateProvinceID StateProvinceID ↙ ❏ Person.Address
FK_SalesTaxRate_StateProvince_StateProvinceID StateProvinceID ↙ ❏ Sales.SalesTaxRate


Schema AdventureWorks2025.Production

Contains objects related to products, inventory, and manufacturing.



Table Production.BillOfMaterials

Items required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship between a parent product and its components.

IdxColumn NameDefinitionDescription
* BillOfMaterialsID int NOT NULL IDENTITY Primary key for BillOfMaterials records.
ProductAssemblyID int Parent product identification number. Foreign key to Product.ProductID.
* ComponentID int NOT NULL Component identification number. Foreign key to Product.ProductID.
* StartDate datetime NOT NULL DEFAULT getdate() Date the component started being used in the assembly item.
  EndDate datetime Date the component stopped being used in the assembly item.
* UnitMeasureCode nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Standard code identifying the unit of measure for the quantity.
* BOMLevel smallint NOT NULL Indicates the depth the component is from its parent (AssemblyID).
* PerAssemblyQty decimal(8,2) NOT NULL DEFAULT 1.00 Quantity of the component needed to create the assembly.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_BillOfMaterials_Product_ComponentID ComponentID ↗ ❏ Production.Product(ProductID)
FK_BillOfMaterials_Product_ProductAssemblyID ProductAssemblyID ↗ ❏ Production.Product(ProductID)
FK_BillOfMaterials_UnitMeasure_UnitMeasureCode UnitMeasureCode ↗ ❏ Production.UnitMeasure
Constraints
  CK_BillOfMaterials_EndDate [EndDate]>[StartDate] OR [EndDate] IS NULL
  CK_BillOfMaterials_ProductAssemblyID [ProductAssemblyID]<>[ComponentID]
  CK_BillOfMaterials_BOMLevel [ProductAssemblyID] IS NULL AND [BOMLevel]=(0) AND [PerAssemblyQty]=(1.00) OR [ProductAssemblyID] IS NOT NULL AND [BOMLevel]>=(1)
  CK_BillOfMaterials_PerAssemblyQty [PerAssemblyQty]>=(1.00)


Table Production.Culture

Lookup table containing the languages in which some AdventureWorks data is stored.

IdxColumn NameDefinitionDescription
* CultureID nchar(6) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Primary key for Culture records.
* Name Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Culture description.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_ProductModelProductDescriptionCulture_Culture_CultureID CultureID ↙ ❏ Production.ProductModelProductDescriptionCulture


Table Production.Document

Product maintenance documents.

IdxColumn NameDefinitionDescription
* DocumentNode hierarchyid NOT NULL Primary key for Document records.
DocumentLevel text Depth in the document hierarchy.
* Title nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Title of the document.
* Owner int NOT NULL Employee who controls the document. Foreign key to Employee.BusinessEntityID
* FolderFlag bit NOT NULL DEFAULT 0 0 = This is a folder, 1 = This is a document.
* FileName nvarchar(400) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS File name of the document
* FileExtension nvarchar(8) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS File extension indicating the document type. For example, .doc or .txt.
* Revision nchar(5) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Revision number of the document.
* ChangeNumber int NOT NULL DEFAULT 0 Engineering change approval number.
* Status tinyint NOT NULL 1 = Pending approval, 2 = Approved, 3 = Obsolete
  DocumentSummary nvarchar(max) COLLATE SQL_Latin1_General_CP1_CI_AS Document abstract.
  Document varbinary(max) Complete document.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Required for FileStream.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_Document_Employee_Owner Owner ↗ ❏ HumanResources.Employee(BusinessEntityID)
Referring Foreign Key
FK_ProductDocument_Document_DocumentNode DocumentNode ↙ ❏ Production.ProductDocument
Constraints
  CK_Document_Status [Status]>=(1) AND [Status]<=(3)


Table Production.Illustration

Bicycle assembly diagrams.

IdxColumn NameDefinitionDescription
* IllustrationID int NOT NULL IDENTITY Primary key for Illustration records.
  Diagram xml Illustrations used in manufacturing instructions. Stored as XML.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_ProductModelIllustration_Illustration_IllustrationID IllustrationID ↙ ❏ Production.ProductModelIllustration


Table Production.Location

Product inventory and manufacturing locations.

IdxColumn NameDefinitionDescription
* LocationID smallint NOT NULL IDENTITY Primary key for Location records.
* Name Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Location description.
* CostRate smallmoney NOT NULL DEFAULT 0.00 Standard hourly cost of the manufacturing location.
* Availability decimal(8,2) NOT NULL DEFAULT 0.00 Work capacity (in hours) of the manufacturing location.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_ProductInventory_Location_LocationID LocationID ↙ ❏ Production.ProductInventory
FK_WorkOrderRouting_Location_LocationID LocationID ↙ ❏ Production.WorkOrderRouting
Constraints
  CK_Location_CostRate [CostRate]>=(0.00)
  CK_Location_Availability [Availability]>=(0.00)


Table Production.Product

Products sold or used in the manfacturing of sold products.

IdxColumn NameDefinitionDescription
* ProductID int NOT NULL IDENTITY Primary key for Product records.
* Name Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Name of the product.
* ProductNumber nvarchar(25) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Unique product identification number.
* MakeFlag Production.Flag NOT NULL DEFAULT ((1)) 0 = Product is purchased, 1 = Product is manufactured in-house.
* FinishedGoodsFlag Production.Flag NOT NULL DEFAULT ((1)) 0 = Product is not a salable item. 1 = Product is salable.
  Color nvarchar(15) COLLATE SQL_Latin1_General_CP1_CI_AS Product color.
* SafetyStockLevel smallint NOT NULL Minimum inventory quantity.
* ReorderPoint smallint NOT NULL Inventory level that triggers a purchase order or work order.
* StandardCost money NOT NULL Standard cost of the product.
* ListPrice money NOT NULL Selling price.
  Size nvarchar(5) COLLATE SQL_Latin1_General_CP1_CI_AS Product size.
SizeUnitMeasureCode nchar(3) COLLATE SQL_Latin1_General_CP1_CI_AS Unit of measure for Size column.
WeightUnitMeasureCode nchar(3) COLLATE SQL_Latin1_General_CP1_CI_AS Unit of measure for Weight column.
  Weight decimal(8,2) Product weight.
* DaysToManufacture int NOT NULL Number of days required to manufacture the product.
  ProductLine nchar(2) COLLATE SQL_Latin1_General_CP1_CI_AS R = Road, M = Mountain, T = Touring, S = Standard
  Class nchar(2) COLLATE SQL_Latin1_General_CP1_CI_AS H = High, M = Medium, L = Low
  Style nchar(2) COLLATE SQL_Latin1_General_CP1_CI_AS W = Womens, M = Mens, U = Universal
ProductSubcategoryID int Product is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID.
ProductModelID int Product is a member of this product model. Foreign key to ProductModel.ProductModelID.
* SellStartDate datetime NOT NULL Date the product was available for sale.
  SellEndDate datetime Date the product was no longer available for sale.
  DiscontinuedDate datetime Date the product was discontinued.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_Product_ProductModel_ProductModelID ProductModelID ↗ ❏ Production.ProductModel
FK_Product_ProductSubcategory_ProductSubcategoryID ProductSubcategoryID ↗ ❏ Production.ProductSubcategory
FK_Product_UnitMeasure_SizeUnitMeasureCode SizeUnitMeasureCode ↗ ❏ Production.UnitMeasure(UnitMeasureCode)
FK_Product_UnitMeasure_WeightUnitMeasureCode WeightUnitMeasureCode ↗ ❏ Production.UnitMeasure(UnitMeasureCode)
Referring Foreign Key
FK_BillOfMaterials_Product_ComponentID ProductID ↙ ❏ Production.BillOfMaterials(ComponentID)
FK_BillOfMaterials_Product_ProductAssemblyID ProductID ↙ ❏ Production.BillOfMaterials(ProductAssemblyID)
FK_ProductCostHistory_Product_ProductID ProductID ↙ ❏ Production.ProductCostHistory
FK_ProductDocument_Product_ProductID ProductID ↙ ❏ Production.ProductDocument
FK_ProductInventory_Product_ProductID ProductID ↙ ❏ Production.ProductInventory
FK_ProductListPriceHistory_Product_ProductID ProductID ↙ ❏ Production.ProductListPriceHistory
FK_ProductProductPhoto_Product_ProductID ProductID ↙ ❏ Production.ProductProductPhoto
FK_ProductReview_Product_ProductID ProductID ↙ ❏ Production.ProductReview
FK_TransactionHistory_Product_ProductID ProductID ↙ ❏ Production.TransactionHistory
FK_WorkOrder_Product_ProductID ProductID ↙ ❏ Production.WorkOrder
FK_ProductVendor_Product_ProductID ProductID ↙ ❏ Purchasing.ProductVendor
FK_PurchaseOrderDetail_Product_ProductID ProductID ↙ ❏ Purchasing.PurchaseOrderDetail
FK_ShoppingCartItem_Product_ProductID ProductID ↙ ❏ Sales.ShoppingCartItem
FK_SpecialOfferProduct_Product_ProductID ProductID ↙ ❏ Sales.SpecialOfferProduct
Constraints
  CK_Product_SafetyStockLevel [SafetyStockLevel]>(0)
  CK_Product_ReorderPoint [ReorderPoint]>(0)
  CK_Product_StandardCost [StandardCost]>=(0.00)
  CK_Product_ListPrice [ListPrice]>=(0.00)
  CK_Product_Weight [Weight]>(0.00)
  CK_Product_DaysToManufacture [DaysToManufacture]>=(0)
  CK_Product_ProductLine upper([ProductLine])='R' OR upper([ProductLine])='M' OR upper([ProductLine])='T' OR upper([ProductLine])='S' OR [ProductLine] IS NULL
  CK_Product_Class upper([Class])='H' OR upper([Class])='M' OR upper([Class])='L' OR [Class] IS NULL
  CK_Product_Style upper([Style])='U' OR upper([Style])='M' OR upper([Style])='W' OR [Style] IS NULL
  CK_Product_SellEndDate [SellEndDate]>=[SellStartDate] OR [SellEndDate] IS NULL


Table Production.ProductCategory

High-level product categorization.

IdxColumn NameDefinitionDescription
* ProductCategoryID int NOT NULL IDENTITY Primary key for ProductCategory records.
* Name Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Category description.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_ProductSubcategory_ProductCategory_ProductCategoryID ProductCategoryID ↙ ❏ Production.ProductSubcategory


Table Production.ProductCostHistory

Changes in the cost of a product over time.

IdxColumn NameDefinitionDescription
* ProductID int NOT NULL Product identification number. Foreign key to Product.ProductID
* StartDate datetime NOT NULL Product cost start date.
  EndDate datetime Product cost end date.
* StandardCost money NOT NULL Standard cost of the product.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_ProductCostHistory_Product_ProductID ProductID ↗ ❏ Production.Product
Constraints
  CK_ProductCostHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_ProductCostHistory_StandardCost [StandardCost]>=(0.00)


Table Production.ProductDescription

Product descriptions in several languages.

IdxColumn NameDefinitionDescription
* ProductDescriptionID int NOT NULL IDENTITY Primary key for ProductDescription records.
* Description nvarchar(400) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Description of the product.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID ProductDescriptionID ↙ ❏ Production.ProductModelProductDescriptionCulture


Table Production.ProductDocument

Cross-reference table mapping products to related product documents.

IdxColumn NameDefinitionDescription
* ProductID int NOT NULL Product identification number. Foreign key to Product.ProductID.
* DocumentNode hierarchyid NOT NULL Document identification number. Foreign key to Document.DocumentNode.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_ProductDocument_Document_DocumentNode DocumentNode ↗ ❏ Production.Document
FK_ProductDocument_Product_ProductID ProductID ↗ ❏ Production.Product


Table Production.ProductInventory

Product inventory information.

IdxColumn NameDefinitionDescription
* ProductID int NOT NULL Product identification number. Foreign key to Product.ProductID.
* LocationID smallint NOT NULL Inventory location identification number. Foreign key to Location.LocationID.
* Shelf nvarchar(10) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Storage compartment within an inventory location.
* Bin tinyint NOT NULL Storage container on a shelf in an inventory location.
* Quantity smallint NOT NULL DEFAULT 0 Quantity of products in the inventory location.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_ProductInventory_Location_LocationID LocationID ↗ ❏ Production.Location
FK_ProductInventory_Product_ProductID ProductID ↗ ❏ Production.Product
Constraints
  CK_ProductInventory_Shelf [Shelf] like '[A-Za-z]' OR [Shelf]='N/A'
  CK_ProductInventory_Bin [Bin]>=(0) AND [Bin]<=(100)


Table Production.ProductListPriceHistory

Changes in the list price of a product over time.

IdxColumn NameDefinitionDescription
* ProductID int NOT NULL Product identification number. Foreign key to Product.ProductID
* StartDate datetime NOT NULL List price start date.
  EndDate datetime List price end date
* ListPrice money NOT NULL Product list price.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_ProductListPriceHistory_Product_ProductID ProductID ↗ ❏ Production.Product
Constraints
  CK_ProductListPriceHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_ProductListPriceHistory_ListPrice [ListPrice]>(0.00)


Table Production.ProductModel

Product model classification.

IdxColumn NameDefinitionDescription
* ProductModelID int NOT NULL IDENTITY Primary key for ProductModel records.
* Name Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Product model description.
  CatalogDescription xml Detailed product catalog information in xml format.
  Instructions xml Manufacturing instructions in xml format.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_Product_ProductModel_ProductModelID ProductModelID ↙ ❏ Production.Product
FK_ProductModelIllustration_ProductModel_ProductModelID ProductModelID ↙ ❏ Production.ProductModelIllustration
FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID ProductModelID ↙ ❏ Production.ProductModelProductDescriptionCulture


Table Production.ProductModelIllustration

Cross-reference table mapping product models and illustrations.

IdxColumn NameDefinitionDescription
* ProductModelID int NOT NULL Primary key. Foreign key to ProductModel.ProductModelID.
* IllustrationID int NOT NULL Primary key. Foreign key to Illustration.IllustrationID.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_ProductModelIllustration_Illustration_IllustrationID IllustrationID ↗ ❏ Production.Illustration
FK_ProductModelIllustration_ProductModel_ProductModelID ProductModelID ↗ ❏ Production.ProductModel


Table Production.ProductModelProductDescriptionCulture

Cross-reference table mapping product descriptions and the language the description is written in.

IdxColumn NameDefinitionDescription
* ProductModelID int NOT NULL Primary key. Foreign key to ProductModel.ProductModelID.
* ProductDescriptionID int NOT NULL Primary key. Foreign key to ProductDescription.ProductDescriptionID.
* CultureID nchar(6) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Culture identification number. Foreign key to Culture.CultureID.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_ProductModelProductDescriptionCulture_Culture_CultureID CultureID ↗ ❏ Production.Culture
FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID ProductDescriptionID ↗ ❏ Production.ProductDescription
FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID ProductModelID ↗ ❏ Production.ProductModel


Table Production.ProductPhoto

Product images.

IdxColumn NameDefinitionDescription
* ProductPhotoID int NOT NULL IDENTITY Primary key for ProductPhoto records.
  ThumbNailPhoto varbinary(max) Small image of the product.
  ThumbnailPhotoFileName nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS Small image file name.
  LargePhoto varbinary(max) Large image of the product.
  LargePhotoFileName nvarchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS Large image file name.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_ProductProductPhoto_ProductPhoto_ProductPhotoID ProductPhotoID ↙ ❏ Production.ProductProductPhoto


Table Production.ProductProductPhoto

Cross-reference table mapping products and product photos.

IdxColumn NameDefinitionDescription
* ProductID int NOT NULL Product identification number. Foreign key to Product.ProductID.
* ProductPhotoID int NOT NULL Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID.
* Primary Production.Flag NOT NULL DEFAULT ((0)) 0 = Photo is not the principal image. 1 = Photo is the principal image.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_ProductProductPhoto_Product_ProductID ProductID ↗ ❏ Production.Product
FK_ProductProductPhoto_ProductPhoto_ProductPhotoID ProductPhotoID ↗ ❏ Production.ProductPhoto


Table Production.ProductReview

Customer reviews of products they have purchased.

IdxColumn NameDefinitionDescription
* ProductReviewID int NOT NULL IDENTITY Primary key for ProductReview records.
* ProductID int NOT NULL Product identification number. Foreign key to Product.ProductID.
* ReviewerName Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Name of the reviewer.
* ReviewDate datetime NOT NULL DEFAULT getdate() Date review was submitted.
* EmailAddress nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Reviewer's e-mail address.
* Rating int NOT NULL Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating.
  Comments nvarchar(3850) COLLATE SQL_Latin1_General_CP1_CI_AS Reviewer's comments
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_ProductReview_Product_ProductID ProductID ↗ ❏ Production.Product
Constraints
  CK_ProductReview_Rating [Rating]>=(1) AND [Rating]<=(5)


Table Production.ProductSubcategory

Product subcategories. See ProductCategory table.

IdxColumn NameDefinitionDescription
* ProductSubcategoryID int NOT NULL IDENTITY Primary key for ProductSubcategory records.
* ProductCategoryID int NOT NULL Product category identification number. Foreign key to ProductCategory.ProductCategoryID.
* Name Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Subcategory description.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_ProductSubcategory_ProductCategory_ProductCategoryID ProductCategoryID ↗ ❏ Production.ProductCategory
Referring Foreign Key
FK_Product_ProductSubcategory_ProductSubcategoryID ProductSubcategoryID ↙ ❏ Production.Product


Table Production.ScrapReason

Manufacturing failure reasons lookup table.

IdxColumn NameDefinitionDescription
* ScrapReasonID smallint NOT NULL IDENTITY Primary key for ScrapReason records.
* Name Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Failure description.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_WorkOrder_ScrapReason_ScrapReasonID ScrapReasonID ↙ ❏ Production.WorkOrder


Table Production.TransactionHistory

Record of each purchase order, sales order, or work order transaction year to date.

IdxColumn NameDefinitionDescription
* TransactionID int NOT NULL IDENTITY Primary key for TransactionHistory records.
* ProductID int NOT NULL Product identification number. Foreign key to Product.ProductID.
* ReferenceOrderID int NOT NULL Purchase order, sales order, or work order identification number.
* ReferenceOrderLineID int NOT NULL DEFAULT 0 Line number associated with the purchase order, sales order, or work order.
* TransactionDate datetime NOT NULL DEFAULT getdate() Date and time of the transaction.
* TransactionType nchar(1) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS W = WorkOrder, S = SalesOrder, P = PurchaseOrder
* Quantity int NOT NULL Product quantity.
* ActualCost money NOT NULL Product cost.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_TransactionHistory_Product_ProductID ProductID ↗ ❏ Production.Product
Constraints
  CK_TransactionHistory_TransactionType upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W'


Table Production.TransactionHistoryArchive

Transactions for previous years.

IdxColumn NameDefinitionDescription
* TransactionID int NOT NULL Primary key for TransactionHistoryArchive records.
* ProductID int NOT NULL Product identification number. Foreign key to Product.ProductID.
* ReferenceOrderID int NOT NULL Purchase order, sales order, or work order identification number.
* ReferenceOrderLineID int NOT NULL DEFAULT 0 Line number associated with the purchase order, sales order, or work order.
* TransactionDate datetime NOT NULL DEFAULT getdate() Date and time of the transaction.
* TransactionType nchar(1) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS W = Work Order, S = Sales Order, P = Purchase Order
* Quantity int NOT NULL Product quantity.
* ActualCost money NOT NULL Product cost.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Constraints
  CK_TransactionHistoryArchive_TransactionType upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W'


Table Production.UnitMeasure

Unit of measure lookup table.

IdxColumn NameDefinitionDescription
* UnitMeasureCode nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Primary key.
* Name Production.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Unit of measure description.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_BillOfMaterials_UnitMeasure_UnitMeasureCode UnitMeasureCode ↙ ❏ Production.BillOfMaterials
FK_Product_UnitMeasure_SizeUnitMeasureCode UnitMeasureCode ↙ ❏ Production.Product(SizeUnitMeasureCode)
FK_Product_UnitMeasure_WeightUnitMeasureCode UnitMeasureCode ↙ ❏ Production.Product(WeightUnitMeasureCode)
FK_ProductVendor_UnitMeasure_UnitMeasureCode UnitMeasureCode ↙ ❏ Purchasing.ProductVendor


Table Production.WorkOrder
IdxColumn NameData Type
* WorkOrderID int NOT NULL IDENTITY
* ProductID int NOT NULL
* OrderQty int NOT NULL
  StockedQty text
* ScrappedQty smallint NOT NULL
* StartDate datetime NOT NULL
  EndDate datetime
* DueDate datetime NOT NULL
ScrapReasonID smallint
* ModifiedDate datetime NOT NULL DEFAULT getdate()
Foreign Key
FK_WorkOrder_Product_ProductID ProductID ↗ ❏ Production.Product
FK_WorkOrder_ScrapReason_ScrapReasonID ScrapReasonID ↗ ❏ Production.ScrapReason
Referring Foreign Key
FK_WorkOrderRouting_WorkOrder_WorkOrderID WorkOrderID ↙ ❏ Production.WorkOrderRouting
Constraints
  CK_WorkOrder_OrderQty [OrderQty]>(0)
  CK_WorkOrder_ScrappedQty [ScrappedQty]>=(0)
  CK_WorkOrder_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
Triggers


Table Production.WorkOrderRouting
IdxColumn NameData Type
* WorkOrderID int NOT NULL
* ProductID int NOT NULL
* OperationSequence smallint NOT NULL
* LocationID smallint NOT NULL
* ScheduledStartDate datetime NOT NULL
* ScheduledEndDate datetime NOT NULL
  ActualStartDate datetime
  ActualEndDate datetime
  ActualResourceHrs decimal(9,4)
* PlannedCost money NOT NULL
  ActualCost money
* ModifiedDate datetime NOT NULL DEFAULT getdate()
Foreign Key
FK_WorkOrderRouting_Location_LocationID LocationID ↗ ❏ Production.Location
FK_WorkOrderRouting_WorkOrder_WorkOrderID WorkOrderID ↗ ❏ Production.WorkOrder
Constraints
  CK_WorkOrderRouting_ScheduledEndDate [ScheduledEndDate]>=[ScheduledStartDate]
  CK_WorkOrderRouting_ActualEndDate [ActualEndDate]>=[ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULL
  CK_WorkOrderRouting_ActualResourceHrs [ActualResourceHrs]>=(0.0000)
  CK_WorkOrderRouting_PlannedCost [PlannedCost]>(0.00)
  CK_WorkOrderRouting_ActualCost [ActualCost]>(0.00)


Schema AdventureWorks2025.Purchasing

Contains objects related to vendors and purchase orders.



Table Purchasing.ProductVendor

Cross-reference table mapping vendors with the products they supply.

IdxColumn NameDefinitionDescription
* ProductID int NOT NULL Primary key. Foreign key to Product.ProductID.
* BusinessEntityID int NOT NULL Primary key. Foreign key to Vendor.BusinessEntityID.
* AverageLeadTime int NOT NULL The average span of time (in days) between placing an order with the vendor and receiving the purchased product.
* StandardPrice money NOT NULL The vendor's usual selling price.
  LastReceiptCost money The selling price when last purchased.
  LastReceiptDate datetime Date the product was last received by the vendor.
* MinOrderQty int NOT NULL The maximum quantity that should be ordered.
* MaxOrderQty int NOT NULL The minimum quantity that should be ordered.
  OnOrderQty int The quantity currently on order.
* UnitMeasureCode nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS The product's unit of measure.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_ProductVendor_Product_ProductID ProductID ↗ ❏ Production.Product
FK_ProductVendor_UnitMeasure_UnitMeasureCode UnitMeasureCode ↗ ❏ Production.UnitMeasure
FK_ProductVendor_Vendor_BusinessEntityID BusinessEntityID ↗ ❏ Purchasing.Vendor
Constraints
  CK_ProductVendor_AverageLeadTime [AverageLeadTime]>=(1)
  CK_ProductVendor_StandardPrice [StandardPrice]>(0.00)
  CK_ProductVendor_LastReceiptCost [LastReceiptCost]>(0.00)
  CK_ProductVendor_MinOrderQty [MinOrderQty]>=(1)
  CK_ProductVendor_MaxOrderQty [MaxOrderQty]>=(1)
  CK_ProductVendor_OnOrderQty [OnOrderQty]>=(0)


Table Purchasing.PurchaseOrderDetail

Individual products associated with a specific purchase order. See PurchaseOrderHeader.

IdxColumn NameDefinitionDescription
* PurchaseOrderID int NOT NULL Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID.
* PurchaseOrderDetailID int NOT NULL IDENTITY Primary key. One line number per purchased product.
* DueDate datetime NOT NULL Date the product is expected to be received.
* OrderQty smallint NOT NULL Quantity ordered.
* ProductID int NOT NULL Product identification number. Foreign key to Product.ProductID.
* UnitPrice money NOT NULL Vendor's selling price of a single product.
  LineTotal text Per product subtotal. Computed as OrderQty * UnitPrice.
* ReceivedQty decimal(8,2) NOT NULL Quantity actually received from the vendor.
* RejectedQty decimal(8,2) NOT NULL Quantity rejected during inspection.
  StockedQty text Quantity accepted into inventory. Computed as ReceivedQty - RejectedQty.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_PurchaseOrderDetail_Product_ProductID ProductID ↗ ❏ Production.Product
FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID PurchaseOrderID ↗ ❏ Purchasing.PurchaseOrderHeader
Constraints
  CK_PurchaseOrderDetail_OrderQty [OrderQty]>(0)
  CK_PurchaseOrderDetail_UnitPrice [UnitPrice]>=(0.00)
  CK_PurchaseOrderDetail_ReceivedQty [ReceivedQty]>=(0.00)
  CK_PurchaseOrderDetail_RejectedQty [RejectedQty]>=(0.00)
Triggers


Table Purchasing.PurchaseOrderHeader

General purchase order information. See PurchaseOrderDetail.

IdxColumn NameDefinitionDescription
* PurchaseOrderID int NOT NULL IDENTITY Primary key.
* RevisionNumber tinyint NOT NULL DEFAULT 0 Incremental number to track changes to the purchase order over time.
* Status tinyint NOT NULL DEFAULT 1 Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete
* EmployeeID int NOT NULL Employee who created the purchase order. Foreign key to Employee.BusinessEntityID.
* VendorID int NOT NULL Vendor with whom the purchase order is placed. Foreign key to Vendor.BusinessEntityID.
* ShipMethodID int NOT NULL Shipping method. Foreign key to ShipMethod.ShipMethodID.
* OrderDate datetime NOT NULL DEFAULT getdate() Purchase order creation date.
  ShipDate datetime Estimated shipment date from the vendor.
* SubTotal money NOT NULL DEFAULT 0.00 Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID.
* TaxAmt money NOT NULL DEFAULT 0.00 Tax amount.
* Freight money NOT NULL DEFAULT 0.00 Shipping cost.
  TotalDue text Total due to vendor. Computed as Subtotal + TaxAmt + Freight.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_PurchaseOrderHeader_Employee_EmployeeID EmployeeID ↗ ❏ HumanResources.Employee(BusinessEntityID)
FK_PurchaseOrderHeader_ShipMethod_ShipMethodID ShipMethodID ↗ ❏ Purchasing.ShipMethod
FK_PurchaseOrderHeader_Vendor_VendorID VendorID ↗ ❏ Purchasing.Vendor(BusinessEntityID)
Referring Foreign Key
FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID PurchaseOrderID ↙ ❏ Purchasing.PurchaseOrderDetail
Constraints
  CK_PurchaseOrderHeader_Status [Status]>=(1) AND [Status]<=(4)
  CK_PurchaseOrderHeader_ShipDate [ShipDate]>=[OrderDate] OR [ShipDate] IS NULL
  CK_PurchaseOrderHeader_SubTotal [SubTotal]>=(0.00)
  CK_PurchaseOrderHeader_TaxAmt [TaxAmt]>=(0.00)
  CK_PurchaseOrderHeader_Freight [Freight]>=(0.00)
Triggers


Table Purchasing.ShipMethod

Shipping company lookup table.

IdxColumn NameDefinitionDescription
* ShipMethodID int NOT NULL IDENTITY Primary key for ShipMethod records.
* Name Purchasing.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Shipping company name.
* ShipBase money NOT NULL DEFAULT 0.00 Minimum shipping charge.
* ShipRate money NOT NULL DEFAULT 0.00 Shipping charge per pound.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_PurchaseOrderHeader_ShipMethod_ShipMethodID ShipMethodID ↙ ❏ Purchasing.PurchaseOrderHeader
FK_SalesOrderHeader_ShipMethod_ShipMethodID ShipMethodID ↙ ❏ Sales.SalesOrderHeader
Constraints
  CK_ShipMethod_ShipBase [ShipBase]>(0.00)
  CK_ShipMethod_ShipRate [ShipRate]>(0.00)


Table Purchasing.Vendor

Companies from whom Adventure Works Cycles purchases parts or other goods.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Primary key for Vendor records. Foreign key to BusinessEntity.BusinessEntityID
* AccountNumber Purchasing.AccountNumber NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Vendor account (identification) number.
* Name Purchasing.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Company name.
* CreditRating tinyint NOT NULL 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average
* PreferredVendorStatus Purchasing.Flag NOT NULL DEFAULT ((1)) 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product.
* ActiveFlag Purchasing.Flag NOT NULL DEFAULT ((1)) 0 = Vendor no longer used. 1 = Vendor is actively used.
  PurchasingWebServiceURL nvarchar(1024) COLLATE SQL_Latin1_General_CP1_CI_AS
* ModifiedDate datetime NOT NULL DEFAULT getdate()
Foreign Key
FK_Vendor_BusinessEntity_BusinessEntityID BusinessEntityID ↗ ❏ Person.BusinessEntity
Referring Foreign Key
FK_ProductVendor_Vendor_BusinessEntityID BusinessEntityID ↙ ❏ Purchasing.ProductVendor
FK_PurchaseOrderHeader_Vendor_VendorID BusinessEntityID ↙ ❏ Purchasing.PurchaseOrderHeader(VendorID)
Constraints
  CK_Vendor_CreditRating [CreditRating]>=(1) AND [CreditRating]<=(5)
Triggers


Schema AdventureWorks2025.Sales

Contains objects related to customers, sales orders, and sales territories.



Table Sales.CountryRegionCurrency

Cross-reference table mapping ISO currency codes to a country or region.

IdxColumn NameDefinitionDescription
* CountryRegionCode nvarchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS ISO code for countries and regions. Foreign key to CountryRegion.CountryRegionCode.
* CurrencyCode nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS ISO standard currency code. Foreign key to Currency.CurrencyCode.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_CountryRegionCurrency_CountryRegion_CountryRegionCode CountryRegionCode ↗ ❏ Person.CountryRegion
FK_CountryRegionCurrency_Currency_CurrencyCode CurrencyCode ↗ ❏ Sales.Currency


Table Sales.CreditCard

Customer credit card information.

IdxColumn NameDefinitionDescription
* CreditCardID int NOT NULL IDENTITY Primary key for CreditCard records.
* CardType nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Credit card name.
* CardNumber nvarchar(25) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Credit card number.
* ExpMonth tinyint NOT NULL Credit card expiration month.
* ExpYear smallint NOT NULL Credit card expiration year.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_PersonCreditCard_CreditCard_CreditCardID CreditCardID ↙ ❏ Sales.PersonCreditCard
FK_SalesOrderHeader_CreditCard_CreditCardID CreditCardID ↙ ❏ Sales.SalesOrderHeader


Table Sales.Currency

Lookup table containing standard ISO currencies.

IdxColumn NameDefinitionDescription
* CurrencyCode nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS The ISO code for the Currency.
* Name Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Currency name.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_CountryRegionCurrency_Currency_CurrencyCode CurrencyCode ↙ ❏ Sales.CountryRegionCurrency
FK_CurrencyRate_Currency_FromCurrencyCode CurrencyCode ↙ ❏ Sales.CurrencyRate(FromCurrencyCode)
FK_CurrencyRate_Currency_ToCurrencyCode CurrencyCode ↙ ❏ Sales.CurrencyRate(ToCurrencyCode)


Table Sales.CurrencyRate

Currency exchange rates.

IdxColumn NameDefinitionDescription
* CurrencyRateID int NOT NULL IDENTITY Primary key for CurrencyRate records.
* CurrencyRateDate datetime NOT NULL Date and time the exchange rate was obtained.
* FromCurrencyCode nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Exchange rate was converted from this currency code.
* ToCurrencyCode nchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Exchange rate was converted to this currency code.
* AverageRate money NOT NULL Average exchange rate for the day.
* EndOfDayRate money NOT NULL Final exchange rate for the day.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_CurrencyRate_Currency_FromCurrencyCode FromCurrencyCode ↗ ❏ Sales.Currency(CurrencyCode)
FK_CurrencyRate_Currency_ToCurrencyCode ToCurrencyCode ↗ ❏ Sales.Currency(CurrencyCode)
Referring Foreign Key
FK_SalesOrderHeader_CurrencyRate_CurrencyRateID CurrencyRateID ↙ ❏ Sales.SalesOrderHeader


Table Sales.Customer

Current customer information. Also see the Person and Store tables.

IdxColumn NameDefinitionDescription
* CustomerID int NOT NULL IDENTITY Primary key.
PersonID int Foreign key to Person.BusinessEntityID
StoreID int Foreign key to Store.BusinessEntityID
TerritoryID int ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID.
AccountNumber text COLLATE SQL_Latin1_General_CP1_CI_AS Unique number identifying the customer assigned by the accounting system.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_Customer_Person_PersonID PersonID ↗ ❏ Person.Person(BusinessEntityID)
FK_Customer_SalesTerritory_TerritoryID TerritoryID ↗ ❏ Sales.SalesTerritory
FK_Customer_Store_StoreID StoreID ↗ ❏ Sales.Store(BusinessEntityID)
Referring Foreign Key
FK_SalesOrderHeader_Customer_CustomerID CustomerID ↙ ❏ Sales.SalesOrderHeader


Table Sales.PersonCreditCard

Cross-reference table mapping people to their credit card information in the CreditCard table.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Business entity identification number. Foreign key to Person.BusinessEntityID.
* CreditCardID int NOT NULL Credit card identification number. Foreign key to CreditCard.CreditCardID.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_PersonCreditCard_CreditCard_CreditCardID CreditCardID ↗ ❏ Sales.CreditCard
FK_PersonCreditCard_Person_BusinessEntityID BusinessEntityID ↗ ❏ Person.Person


Table Sales.SalesOrderDetail

Individual products associated with a specific sales order. See SalesOrderHeader.

IdxColumn NameDefinitionDescription
* SalesOrderID int NOT NULL Primary key. Foreign key to SalesOrderHeader.SalesOrderID.
* SalesOrderDetailID int NOT NULL IDENTITY Primary key. One incremental unique number per product sold.
  CarrierTrackingNumber nvarchar(25) COLLATE SQL_Latin1_General_CP1_CI_AS Shipment tracking number supplied by the shipper.
* OrderQty smallint NOT NULL Quantity ordered per product.
* ProductID int NOT NULL Product sold to customer. Foreign key to Product.ProductID.
* SpecialOfferID int NOT NULL Promotional code. Foreign key to SpecialOffer.SpecialOfferID.
* UnitPrice money NOT NULL Selling price of a single product.
* UnitPriceDiscount money NOT NULL DEFAULT 0.0 Discount amount.
  LineTotal text Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID SalesOrderID ↗ ❏ Sales.SalesOrderHeader on delete cascade
FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID SpecialOfferID, ProductID ↗ ❏ Sales.SpecialOfferProduct
Constraints
  CK_SalesOrderDetail_OrderQty [OrderQty]>(0)
  CK_SalesOrderDetail_UnitPrice [UnitPrice]>=(0.00)
  CK_SalesOrderDetail_UnitPriceDiscount [UnitPriceDiscount]>=(0.00)
Triggers


Table Sales.SalesOrderHeader

General sales order information.

IdxColumn NameDefinitionDescription
* SalesOrderID int NOT NULL IDENTITY Primary key.
* RevisionNumber tinyint NOT NULL DEFAULT 0 Incremental number to track changes to the sales order over time.
* OrderDate datetime NOT NULL DEFAULT getdate() Dates the sales order was created.
* DueDate datetime NOT NULL Date the order is due to the customer.
  ShipDate datetime Date the order was shipped to the customer.
* Status tinyint NOT NULL DEFAULT 1 Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled
* OnlineOrderFlag Sales.Flag NOT NULL DEFAULT ((1)) 0 = Order placed by sales person. 1 = Order placed online by customer.
SalesOrderNumber text COLLATE SQL_Latin1_General_CP1_CI_AS Unique sales order identification number.
  PurchaseOrderNumber Sales.OrderNumber COLLATE SQL_Latin1_General_CP1_CI_AS Customer purchase order number reference.
  AccountNumber Sales.AccountNumber COLLATE SQL_Latin1_General_CP1_CI_AS Financial accounting number reference.
* CustomerID int NOT NULL Customer identification number. Foreign key to Customer.BusinessEntityID.
SalesPersonID int Sales person who created the sales order. Foreign key to SalesPerson.BusinessEntityID.
TerritoryID int Territory in which the sale was made. Foreign key to SalesTerritory.SalesTerritoryID.
* BillToAddressID int NOT NULL Customer billing address. Foreign key to Address.AddressID.
* ShipToAddressID int NOT NULL Customer shipping address. Foreign key to Address.AddressID.
* ShipMethodID int NOT NULL Shipping method. Foreign key to ShipMethod.ShipMethodID.
CreditCardID int Credit card identification number. Foreign key to CreditCard.CreditCardID.
  CreditCardApprovalCode varchar(15) COLLATE SQL_Latin1_General_CP1_CI_AS Approval code provided by the credit card company.
CurrencyRateID int Currency exchange rate used. Foreign key to CurrencyRate.CurrencyRateID.
* SubTotal money NOT NULL DEFAULT 0.00 Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID.
* TaxAmt money NOT NULL DEFAULT 0.00 Tax amount.
* Freight money NOT NULL DEFAULT 0.00 Shipping cost.
  TotalDue text Total due from customer. Computed as Subtotal + TaxAmt + Freight.
  Comment nvarchar(128) COLLATE SQL_Latin1_General_CP1_CI_AS Sales representative comments.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_SalesOrderHeader_Address_BillToAddressID BillToAddressID ↗ ❏ Person.Address(AddressID)
FK_SalesOrderHeader_Address_ShipToAddressID ShipToAddressID ↗ ❏ Person.Address(AddressID)
FK_SalesOrderHeader_CreditCard_CreditCardID CreditCardID ↗ ❏ Sales.CreditCard
FK_SalesOrderHeader_CurrencyRate_CurrencyRateID CurrencyRateID ↗ ❏ Sales.CurrencyRate
FK_SalesOrderHeader_Customer_CustomerID CustomerID ↗ ❏ Sales.Customer
FK_SalesOrderHeader_SalesPerson_SalesPersonID SalesPersonID ↗ ❏ Sales.SalesPerson(BusinessEntityID)
FK_SalesOrderHeader_SalesTerritory_TerritoryID TerritoryID ↗ ❏ Sales.SalesTerritory
FK_SalesOrderHeader_ShipMethod_ShipMethodID ShipMethodID ↗ ❏ Purchasing.ShipMethod
Referring Foreign Key
FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID SalesOrderID ↙ ❏ Sales.SalesOrderDetail
FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID SalesOrderID ↙ ❏ Sales.SalesOrderHeaderSalesReason
Constraints
  CK_SalesOrderHeader_Status [Status]>=(0) AND [Status]<=(8)
  CK_SalesOrderHeader_DueDate [DueDate]>=[OrderDate]
  CK_SalesOrderHeader_ShipDate [ShipDate]>=[OrderDate] OR [ShipDate] IS NULL
  CK_SalesOrderHeader_SubTotal [SubTotal]>=(0.00)
  CK_SalesOrderHeader_TaxAmt [TaxAmt]>=(0.00)
  CK_SalesOrderHeader_Freight [Freight]>=(0.00)
Triggers


Table Sales.SalesOrderHeaderSalesReason

Cross-reference table mapping sales orders to sales reason codes.

IdxColumn NameDefinitionDescription
* SalesOrderID int NOT NULL Primary key. Foreign key to SalesOrderHeader.SalesOrderID.
* SalesReasonID int NOT NULL Primary key. Foreign key to SalesReason.SalesReasonID.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID SalesOrderID ↗ ❏ Sales.SalesOrderHeader on delete cascade
FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID SalesReasonID ↗ ❏ Sales.SalesReason


Table Sales.SalesPerson

Sales representative current information.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Primary key for SalesPerson records. Foreign key to Employee.BusinessEntityID
TerritoryID int Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID.
  SalesQuota money Projected yearly sales.
* Bonus money NOT NULL DEFAULT 0.00 Bonus due if quota is met.
* CommissionPct smallmoney NOT NULL DEFAULT 0.00 Commision percent received per sale.
* SalesYTD money NOT NULL DEFAULT 0.00 Sales total year to date.
* SalesLastYear money NOT NULL DEFAULT 0.00 Sales total of previous year.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_SalesPerson_Employee_BusinessEntityID BusinessEntityID ↗ ❏ HumanResources.Employee
FK_SalesPerson_SalesTerritory_TerritoryID TerritoryID ↗ ❏ Sales.SalesTerritory
Referring Foreign Key
FK_SalesOrderHeader_SalesPerson_SalesPersonID BusinessEntityID ↙ ❏ Sales.SalesOrderHeader(SalesPersonID)
FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID BusinessEntityID ↙ ❏ Sales.SalesPersonQuotaHistory
FK_SalesTerritoryHistory_SalesPerson_BusinessEntityID BusinessEntityID ↙ ❏ Sales.SalesTerritoryHistory
FK_Store_SalesPerson_SalesPersonID BusinessEntityID ↙ ❏ Sales.Store(SalesPersonID)
Constraints
  CK_SalesPerson_SalesQuota [SalesQuota]>(0.00)
  CK_SalesPerson_Bonus [Bonus]>=(0.00)
  CK_SalesPerson_CommissionPct [CommissionPct]>=(0.00)
  CK_SalesPerson_SalesYTD [SalesYTD]>=(0.00)
  CK_SalesPerson_SalesLastYear [SalesLastYear]>=(0.00)


Table Sales.SalesPersonQuotaHistory

Sales performance tracking.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Sales person identification number. Foreign key to SalesPerson.BusinessEntityID.
* QuotaDate datetime NOT NULL Sales quota date.
* SalesQuota money NOT NULL Sales quota amount.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID BusinessEntityID ↗ ❏ Sales.SalesPerson
Constraints
  CK_SalesPersonQuotaHistory_SalesQuota [SalesQuota]>(0.00)


Table Sales.SalesReason

Lookup table of customer purchase reasons.

IdxColumn NameDefinitionDescription
* SalesReasonID int NOT NULL IDENTITY Primary key for SalesReason records.
* Name Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Sales reason description.
* ReasonType Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Category the sales reason belongs to.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID SalesReasonID ↙ ❏ Sales.SalesOrderHeaderSalesReason


Table Sales.SalesTaxRate

Tax rate lookup table.

IdxColumn NameDefinitionDescription
* SalesTaxRateID int NOT NULL IDENTITY Primary key for SalesTaxRate records.
* StateProvinceID int NOT NULL State, province, or country/region the sales tax applies to.
* TaxType tinyint NOT NULL 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) transactions.
* TaxRate smallmoney NOT NULL DEFAULT 0.00 Tax rate amount.
* Name Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Tax rate description.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_SalesTaxRate_StateProvince_StateProvinceID StateProvinceID ↗ ❏ Person.StateProvince
Constraints
  CK_SalesTaxRate_TaxType [TaxType]>=(1) AND [TaxType]<=(3)


Table Sales.SalesTerritory

Sales territory lookup table.

IdxColumn NameDefinitionDescription
* TerritoryID int NOT NULL IDENTITY Primary key for SalesTerritory records.
* Name Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Sales territory description
* CountryRegionCode nvarchar(3) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
* Group nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Geographic area to which the sales territory belong.
* SalesYTD money NOT NULL DEFAULT 0.00 Sales in the territory year to date.
* SalesLastYear money NOT NULL DEFAULT 0.00 Sales in the territory the previous year.
* CostYTD money NOT NULL DEFAULT 0.00 Business costs in the territory year to date.
* CostLastYear money NOT NULL DEFAULT 0.00 Business costs in the territory the previous year.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_SalesTerritory_CountryRegion_CountryRegionCode CountryRegionCode ↗ ❏ Person.CountryRegion
Referring Foreign Key
FK_StateProvince_SalesTerritory_TerritoryID TerritoryID ↙ ❏ Person.StateProvince
FK_Customer_SalesTerritory_TerritoryID TerritoryID ↙ ❏ Sales.Customer
FK_SalesOrderHeader_SalesTerritory_TerritoryID TerritoryID ↙ ❏ Sales.SalesOrderHeader
FK_SalesPerson_SalesTerritory_TerritoryID TerritoryID ↙ ❏ Sales.SalesPerson
FK_SalesTerritoryHistory_SalesTerritory_TerritoryID TerritoryID ↙ ❏ Sales.SalesTerritoryHistory
Constraints
  CK_SalesTerritory_SalesYTD [SalesYTD]>=(0.00)
  CK_SalesTerritory_SalesLastYear [SalesLastYear]>=(0.00)
  CK_SalesTerritory_CostYTD [CostYTD]>=(0.00)
  CK_SalesTerritory_CostLastYear [CostLastYear]>=(0.00)


Table Sales.SalesTerritoryHistory

Sales representative transfers to other sales territories.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Primary key. The sales rep. Foreign key to SalesPerson.BusinessEntityID.
* TerritoryID int NOT NULL Primary key. Territory identification number. Foreign key to SalesTerritory.SalesTerritoryID.
* StartDate datetime NOT NULL Primary key. Date the sales representive started work in the territory.
  EndDate datetime Date the sales representative left work in the territory.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_SalesTerritoryHistory_SalesPerson_BusinessEntityID BusinessEntityID ↗ ❏ Sales.SalesPerson
FK_SalesTerritoryHistory_SalesTerritory_TerritoryID TerritoryID ↗ ❏ Sales.SalesTerritory
Constraints
  CK_SalesTerritoryHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL


Table Sales.ShoppingCartItem

Contains online customer orders until the order is submitted or cancelled.

IdxColumn NameDefinitionDescription
* ShoppingCartItemID int NOT NULL IDENTITY Primary key for ShoppingCartItem records.
* ShoppingCartID nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Shopping cart identification number.
* Quantity int NOT NULL DEFAULT 1 Product quantity ordered.
* ProductID int NOT NULL Product ordered. Foreign key to Product.ProductID.
* DateCreated datetime NOT NULL DEFAULT getdate() Date the time the record was created.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_ShoppingCartItem_Product_ProductID ProductID ↗ ❏ Production.Product
Constraints
  CK_ShoppingCartItem_Quantity [Quantity]>=(1)


Table Sales.SpecialOffer

Sale discounts lookup table.

IdxColumn NameDefinitionDescription
* SpecialOfferID int NOT NULL IDENTITY Primary key for SpecialOffer records.
* Description nvarchar(255) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Discount description.
* DiscountPct smallmoney NOT NULL DEFAULT 0.00 Discount precentage.
* Type nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Discount type category.
* Category nvarchar(50) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Group the discount applies to such as Reseller or Customer.
* StartDate datetime NOT NULL Discount start date.
* EndDate datetime NOT NULL Discount end date.
* MinQty int NOT NULL DEFAULT 0 Minimum discount percent allowed.
  MaxQty int Maximum discount percent allowed.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Referring Foreign Key
FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID SpecialOfferID ↙ ❏ Sales.SpecialOfferProduct
Constraints
  CK_SpecialOffer_EndDate [EndDate]>=[StartDate]
  CK_SpecialOffer_DiscountPct [DiscountPct]>=(0.00)
  CK_SpecialOffer_MinQty [MinQty]>=(0)
  CK_SpecialOffer_MaxQty [MaxQty]>=(0)


Table Sales.SpecialOfferProduct

Cross-reference table mapping products to special offer discounts.

IdxColumn NameDefinitionDescription
* SpecialOfferID int NOT NULL Primary key for SpecialOfferProduct records.
* ProductID int NOT NULL Product identification number. Foreign key to Product.ProductID.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_SpecialOfferProduct_Product_ProductID ProductID ↗ ❏ Production.Product
FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID SpecialOfferID ↗ ❏ Sales.SpecialOffer
Referring Foreign Key
FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID SpecialOfferID, ProductID ↙ ❏ Sales.SalesOrderDetail


Table Sales.Store

Customers (resellers) of Adventure Works products.

IdxColumn NameDefinitionDescription
* BusinessEntityID int NOT NULL Primary key. Foreign key to Customer.BusinessEntityID.
* Name Sales.Name NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Name of the store.
SalesPersonID int ID of the sales person assigned to the customer. Foreign key to SalesPerson.BusinessEntityID.
  Demographics xml Demographic informationg about the store such as the number of employees, annual sales and store type.
* rowguid uniqueidentifier NOT NULL DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.
Foreign Key
FK_Store_BusinessEntity_BusinessEntityID BusinessEntityID ↗ ❏ Person.BusinessEntity
FK_Store_SalesPerson_SalesPersonID SalesPersonID ↗ ❏ Sales.SalesPerson(BusinessEntityID)
Referring Foreign Key
FK_Customer_Store_StoreID BusinessEntityID ↙ ❏ Sales.Customer(StoreID)


Schema AdventureWorks2025.dbo


Table dbo.AWBuildVersion

Current version number of the AdventureWorks 2025 sample database.

IdxColumn NameDefinitionDescription
* SystemInformationID tinyint NOT NULL IDENTITY Primary key for AWBuildVersion records.
* Database Version nvarchar(25) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS Version number of the database in 9.yy.mm.dd.00 format.
* VersionDate datetime NOT NULL Date and time the record was last updated.
* ModifiedDate datetime NOT NULL DEFAULT getdate() Date and time the record was last updated.


Table dbo.DatabaseLog

Audit table tracking all DDL changes made to the AdventureWorks database. Data is captured by the database trigger ddlDatabaseTriggerLog.

IdxColumn NameDefinitionDescription
* DatabaseLogID int NOT NULL IDENTITY Primary key for DatabaseLog records.
* PostTime datetime NOT NULL The date and time the DDL change occurred.
* DatabaseUser sysname NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS The user who implemented the DDL change.
* Event sysname NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS The type of DDL statement that was executed.
  Schema sysname COLLATE SQL_Latin1_General_CP1_CI_AS The schema to which the changed object belongs.
  Object sysname COLLATE SQL_Latin1_General_CP1_CI_AS The object that was changed by the DDL statment.
* TSQL nvarchar(max) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS The exact Transact-SQL statement that was executed.
* XmlEvent xml NOT NULL The raw XML data generated by database trigger.


Table dbo.ErrorLog

Audit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct.

IdxColumn NameDefinitionDescription
* ErrorLogID int NOT NULL IDENTITY Primary key for ErrorLog records.
* ErrorTime datetime NOT NULL DEFAULT getdate() The date and time at which the error occurred.
* UserName sysname NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS The user who executed the batch in which the error occurred.
* ErrorNumber int NOT NULL The error number of the error that occurred.
  ErrorSeverity int The severity of the error that occurred.
  ErrorState int The state number of the error that occurred.
  ErrorProcedure nvarchar(126) COLLATE SQL_Latin1_General_CP1_CI_AS The name of the stored procedure or trigger where the error occurred.
  ErrorLine int The line number at which the error occurred.
* ErrorMessage nvarchar(4000) NOT NULL COLLATE SQL_Latin1_General_CP1_CI_AS The message text of the error that occurred.