1 Production Move the mouse over tables & columns to read the comments. Fk FK_Product_ProductModel_ProductModelID Product ref ProductModel ( ProductModelID ) Fk FK_Product_ProductSubcategory_ProductSubcategoryID Product ref ProductSubcategory ( ProductSubcategoryID ) Fk FK_Product_UnitMeasure_SizeUnitMeasureCode Product ref UnitMeasure ( SizeUnitMeasureCode -> UnitMeasureCode ) Fk FK_Product_UnitMeasure_WeightUnitMeasureCode Product ref UnitMeasure ( WeightUnitMeasureCode -> UnitMeasureCode ) Fk FK_ProductDocument_Document_DocumentNode ProductDocument ref Document ( DocumentNode ) Fk FK_ProductDocument_Product_ProductID ProductDocument ref Product ( ProductID ) Fk FK_ProductListPriceHistory_Product_ProductID ProductListPriceHistory ref Product ( ProductID ) Fk FK_ProductReview_Product_ProductID ProductReview ref Product ( ProductID ) Fk FK_ProductSubcategory_ProductCategory_ProductCategoryID ProductSubcategory ref ProductCategory ( ProductCategoryID ) Fk FK_WorkOrderRouting_Location_LocationID WorkOrderRouting ref Location ( LocationID ) Fk FK_WorkOrderRouting_WorkOrder_WorkOrderID WorkOrderRouting ref WorkOrder ( WorkOrderID ) Fk FK_WorkOrder_Product_ProductID WorkOrder ref Product ( ProductID ) Fk FK_WorkOrder_ScrapReason_ScrapReasonID WorkOrder ref ScrapReason ( ScrapReasonID ) Fk FK_ProductCostHistory_Product_ProductID ProductCostHistory ref Product ( ProductID ) Fk FK_BillOfMaterials_Product_ComponentID BillOfMaterials ref Product ( ComponentID -> ProductID ) Fk FK_BillOfMaterials_Product_ProductAssemblyID BillOfMaterials ref Product ( ProductAssemblyID -> ProductID ) Fk FK_BillOfMaterials_UnitMeasure_UnitMeasureCode BillOfMaterials ref UnitMeasure ( UnitMeasureCode ) Fk FK_ProductInventory_Location_LocationID ProductInventory ref Location ( LocationID ) Fk FK_ProductInventory_Product_ProductID ProductInventory ref Product ( ProductID ) Fk FK_TransactionHistory_Product_ProductID TransactionHistory ref Product ( ProductID ) Fk FK_ProductProductPhoto_Product_ProductID ProductProductPhoto ref Product ( ProductID ) Fk FK_ProductProductPhoto_ProductPhoto_ProductPhotoID ProductProductPhoto ref ProductPhoto ( ProductPhotoID ) Fk FK_ProductModelProductDescriptionCulture_Culture_CultureID ProductModelProductDescriptionCulture ref Culture ( CultureID ) Fk FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID ProductModelProductDescriptionCulture ref ProductDescription ( ProductDescriptionID ) Fk FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID ProductModelProductDescriptionCulture ref ProductModel ( ProductModelID ) Fk FK_ProductModelIllustration_Illustration_IllustrationID ProductModelIllustration ref Illustration ( IllustrationID ) Fk FK_ProductModelIllustration_ProductModel_ProductModelID ProductModelIllustration ref ProductModel ( ProductModelID ) DocumentTable Production.Document Product maintenance documents. Pk PK_Document_DocumentNode ( DocumentNode ) Clustered index created by a primary key constraint.Unq AK_Document_DocumentLevel_DocumentNode ( DocumentLevel, DocumentNode ) Unique nonclustered index. DocumentNodehierarchyidDocumentNode * hierarchyid Primary key for Document records. Referred by ProductDocument ( DocumentNode ) Unq AK_Document_DocumentLevel_DocumentNode ( DocumentLevel, DocumentNode ) Unique nonclustered index. DocumentLevelsmallintDocumentLevel smallint Depth in the document hierarchy. # Titlenvarchar(50)Title * nvarchar(50) Title of the document. t OwnerintOwner * int Employee who controls the document. Foreign key to Employee.BusinessEntityID References Employee ( Owner -> BusinessEntityID ) FolderFlagbitFolderFlag * bit default 0 0 = This is a folder, 1 = This is a document. b IX_Document_FileName_Revision ( FileName, Revision ) Unique nonclustered index. FileNamenvarchar(400)FileName * nvarchar(400) File name of the document t FileExtensionnvarchar(8)FileExtension * nvarchar(8) File extension indicating the document type. For example, .doc or .txt. t IX_Document_FileName_Revision ( FileName, Revision ) Unique nonclustered index. Revisionnchar(5)Revision * nchar(5) Revision number of the document. c ChangeNumberintChangeNumber * int default 0 Engineering change approval number. # StatustinyintStatus * tinyint 1 = Pending approval, 2 = Approved, 3 = Obsolete # DocumentSummarynvarchar(max)DocumentSummary nvarchar(max) Document abstract. t Documentvarbinary(max)Document varbinary(max) Complete document. ~ Unq UQ__Document__F73921F7C5112C2E ( rowguid ) rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Required for FileStream. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductTable Production.Product Products sold or used in the manfacturing of sold products. Pk PK_Product_ProductID ( ProductID ) Clustered index created by a primary key constraint. ProductIDintProductID * int Primary key for Product records. Referred by BillOfMaterials ( ComponentID -> ProductID ) Referred by BillOfMaterials ( ProductAssemblyID -> ProductID ) Referred by ProductCostHistory ( ProductID ) Referred by ProductDocument ( ProductID ) Referred by ProductInventory ( ProductID ) Referred by ProductListPriceHistory ( ProductID ) Referred by ProductProductPhoto ( ProductID ) Referred by ProductReview ( ProductID ) Referred by TransactionHistory ( ProductID ) Referred by WorkOrder ( ProductID ) Referred by ProductVendor ( ProductID ) Referred by PurchaseOrderDetail ( ProductID ) Referred by ShoppingCartItem ( ProductID ) Referred by SpecialOfferProduct ( ProductID ) Unq AK_Product_Name ( Name ) Unique nonclustered index. NamenameName * name Name of the product. t Unq AK_Product_ProductNumber ( ProductNumber ) Unique nonclustered index. ProductNumbernvarchar(25)ProductNumber * nvarchar(25) Unique product identification number. t MakeFlagflagMakeFlag * flag default 1 0 = Product is purchased, 1 = Product is manufactured in-house. b FinishedGoodsFlagflagFinishedGoodsFlag * flag default 1 0 = Product is not a salable item. 1 = Product is salable. b Colornvarchar(15)Color nvarchar(15) Product color. t SafetyStockLevelsmallintSafetyStockLevel * smallint Minimum inventory quantity. # ReorderPointsmallintReorderPoint * smallint Inventory level that triggers a purchase order or work order. # StandardCostmoneyStandardCost * money Standard cost of the product. # ListPricemoneyListPrice * money Selling price. # Sizenvarchar(5)Size nvarchar(5) Product size. t SizeUnitMeasureCodenchar(3)SizeUnitMeasureCode nchar(3) Unit of measure for Size column. References UnitMeasure ( SizeUnitMeasureCode -> UnitMeasureCode ) WeightUnitMeasureCodenchar(3)WeightUnitMeasureCode nchar(3) Unit of measure for Weight column. References UnitMeasure ( WeightUnitMeasureCode -> UnitMeasureCode ) Weightdecimal(8,2)Weight decimal(8,2) Product weight. # DaysToManufactureintDaysToManufacture * int Number of days required to manufacture the product. # ProductLinenchar(2)ProductLine nchar(2) R = Road, M = Mountain, T = Touring, S = Standard c Classnchar(2)Class nchar(2) H = High, M = Medium, L = Low c Stylenchar(2)Style nchar(2) W = Womens, M = Mens, U = Universal c ProductSubcategoryIDintProductSubcategoryID int Product is a member of this product subcategory. Foreign key to ProductSubCategory.ProductSubCategoryID. References ProductSubcategory ( ProductSubcategoryID ) ProductModelIDintProductModelID int Product is a member of this product model. Foreign key to ProductModel.ProductModelID. References ProductModel ( ProductModelID ) SellStartDatedatetimeSellStartDate * datetime Date the product was available for sale. d SellEndDatedatetimeSellEndDate datetime Date the product was no longer available for sale. d DiscontinuedDatedatetimeDiscontinuedDate datetime Date the product was discontinued. d Unq AK_Product_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples. rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductDocumentTable Production.ProductDocument Cross-reference table mapping products to related product documents. Pk PK_ProductDocument_ProductID_DocumentNode ( ProductID, DocumentNode ) Clustered index created by a primary key constraint. ProductIDintProductID * int Product identification number. Foreign key to Product.ProductID. References Product ( ProductID ) Pk PK_ProductDocument_ProductID_DocumentNode ( ProductID, DocumentNode ) Clustered index created by a primary key constraint. DocumentNodehierarchyidDocumentNode * hierarchyid Document identification number. Foreign key to Document.DocumentNode. References Document ( DocumentNode ) ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductListPriceHistoryTable Production.ProductListPriceHistory Changes in the list price of a product over time. Pk PK_ProductListPriceHistory_ProductID_StartDate ( ProductID, StartDate ) Clustered index created by a primary key constraint. ProductIDintProductID * int Product identification number. Foreign key to Product.ProductID References Product ( ProductID ) Pk PK_ProductListPriceHistory_ProductID_StartDate ( ProductID, StartDate ) Clustered index created by a primary key constraint. StartDatedatetimeStartDate * datetime List price start date. d EndDatedatetimeEndDate datetime List price end date d ListPricemoneyListPrice * money Product list price. # ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductReviewTable Production.ProductReview Customer reviews of products they have purchased. Pk PK_ProductReview_ProductReviewID ( ProductReviewID ) Clustered index created by a primary key constraint. ProductReviewIDintProductReviewID * int Primary key for ProductReview records. # IX_ProductReview_ProductID_Name ( ProductID, ReviewerName ) Nonclustered index. ProductIDintProductID * int Product identification number. Foreign key to Product.ProductID. References Product ( ProductID ) IX_ProductReview_ProductID_Name ( ProductID, ReviewerName ) Nonclustered index. ReviewerNamenameReviewerName * name Name of the reviewer. t ReviewDatedatetimeReviewDate * datetime default getdate() Date review was submitted. d EmailAddressnvarchar(50)EmailAddress * nvarchar(50) Reviewer's e-mail address. t RatingintRating * int Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating. # Commentsnvarchar(3850)Comments nvarchar(3850) Reviewer's comments t ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductSubcategoryTable Production.ProductSubcategory Product subcategories. See ProductCategory table. Pk PK_ProductSubcategory_ProductSubcategoryID ( ProductSubcategoryID ) Clustered index created by a primary key constraint. ProductSubcategoryIDintProductSubcategoryID * int Primary key for ProductSubcategory records. Referred by Product ( ProductSubcategoryID ) ProductCategoryIDintProductCategoryID * int Product category identification number. Foreign key to ProductCategory.ProductCategoryID. References ProductCategory ( ProductCategoryID ) Unq AK_ProductSubcategory_Name ( Name ) Unique nonclustered index. NamenameName * name Subcategory description. t Unq AK_ProductSubcategory_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples. rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductCategoryTable Production.ProductCategory High-level product categorization. Pk PK_ProductCategory_ProductCategoryID ( ProductCategoryID ) Clustered index created by a primary key constraint. ProductCategoryIDintProductCategoryID * int Primary key for ProductCategory records. Referred by ProductSubcategory ( ProductCategoryID ) Unq AK_ProductCategory_Name ( Name ) Unique nonclustered index. NamenameName * name Category description. t Unq AK_ProductCategory_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples. rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d CultureTable Production.Culture Lookup table containing the languages in which some AdventureWorks data is stored. Pk PK_Culture_CultureID ( CultureID ) Clustered index created by a primary key constraint. CultureIDnchar(6)CultureID * nchar(6) Primary key for Culture records. Referred by ProductModelProductDescriptionCulture ( CultureID ) Unq AK_Culture_Name ( Name ) Unique nonclustered index. NamenameName * name Culture description. t ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d WorkOrderRoutingTable Production.WorkOrderRouting Work order details. Pk PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence ( WorkOrderID, ProductID, OperationSequence ) Clustered index created by a primary key constraint. WorkOrderIDintWorkOrderID * int Primary key. Foreign key to WorkOrder.WorkOrderID. References WorkOrder ( WorkOrderID ) Pk PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence ( WorkOrderID, ProductID, OperationSequence ) Clustered index created by a primary key constraint.IX_WorkOrderRouting_ProductID ( ProductID ) Nonclustered index. ProductIDintProductID * int Primary key. Foreign key to Product.ProductID. # Pk PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence ( WorkOrderID, ProductID, OperationSequence ) Clustered index created by a primary key constraint. OperationSequencesmallintOperationSequence * smallint Primary key. Indicates the manufacturing process sequence. # LocationIDsmallintLocationID * smallint Manufacturing location where the part is processed. Foreign key to Location.LocationID. References Location ( LocationID ) ScheduledStartDatedatetimeScheduledStartDate * datetime Planned manufacturing start date. d ScheduledEndDatedatetimeScheduledEndDate * datetime Planned manufacturing end date. d ActualStartDatedatetimeActualStartDate datetime Actual start date. d ActualEndDatedatetimeActualEndDate datetime Actual end date. d ActualResourceHrsdecimal(9,4)ActualResourceHrs decimal(9,4) Number of manufacturing hours used. # PlannedCostmoneyPlannedCost * money Estimated manufacturing cost. # ActualCostmoneyActualCost money Actual manufacturing cost. # ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ScrapReasonTable Production.ScrapReason Manufacturing failure reasons lookup table. Pk PK_ScrapReason_ScrapReasonID ( ScrapReasonID ) Clustered index created by a primary key constraint. ScrapReasonIDsmallintScrapReasonID * smallint Primary key for ScrapReason records. Referred by WorkOrder ( ScrapReasonID ) Unq AK_ScrapReason_Name ( Name ) Unique nonclustered index. NamenameName * name Failure description. t ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d WorkOrderTable Production.WorkOrder Manufacturing work orders. Pk PK_WorkOrder_WorkOrderID ( WorkOrderID ) Clustered index created by a primary key constraint. WorkOrderIDintWorkOrderID * int Primary key for WorkOrder records. Referred by WorkOrderRouting ( WorkOrderID ) IX_WorkOrder_ProductID ( ProductID ) Nonclustered index. ProductIDintProductID * int Product identification number. Foreign key to Product.ProductID. References Product ( ProductID ) OrderQtyintOrderQty * int Product quantity to build. # StockedQtyintStockedQty * int Quantity built and put in inventory. # ScrappedQtysmallintScrappedQty * smallint Quantity that failed inspection. # StartDatedatetimeStartDate * datetime Work order start date. d EndDatedatetimeEndDate datetime Work order end date. d DueDatedatetimeDueDate * datetime Work order due date. d IX_WorkOrder_ScrapReasonID ( ScrapReasonID ) Nonclustered index. ScrapReasonIDsmallintScrapReasonID smallint Reason for inspection failure. References ScrapReason ( ScrapReasonID ) ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductCostHistoryTable Production.ProductCostHistory Changes in the cost of a product over time. Pk PK_ProductCostHistory_ProductID_StartDate ( ProductID, StartDate ) Clustered index created by a primary key constraint. ProductIDintProductID * int Product identification number. Foreign key to Product.ProductID References Product ( ProductID ) Pk PK_ProductCostHistory_ProductID_StartDate ( ProductID, StartDate ) Clustered index created by a primary key constraint. StartDatedatetimeStartDate * datetime Product cost start date. d EndDatedatetimeEndDate datetime Product cost end date. d StandardCostmoneyStandardCost * money Standard cost of the product. # ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d BillOfMaterialsTable Production.BillOfMaterials Items required to make bicycles and bicycle subassemblies. It identifies the heirarchical relationship between a parent product and its components. Pk PK_BillOfMaterials_BillOfMaterialsID ( BillOfMaterialsID ) Nonclustered index created by a primary key constraint. BillOfMaterialsIDintBillOfMaterialsID * int Primary key for BillOfMaterials records. # Unq AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate ( ProductAssemblyID, ComponentID, StartDate ) Clustered index. ProductAssemblyIDintProductAssemblyID int Parent product identification number. Foreign key to Product.ProductID. References Product ( ProductAssemblyID -> ProductID ) Unq AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate ( ProductAssemblyID, ComponentID, StartDate ) Clustered index. ComponentIDintComponentID * int Component identification number. Foreign key to Product.ProductID. References Product ( ComponentID -> ProductID ) Unq AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate ( ProductAssemblyID, ComponentID, StartDate ) Clustered index. StartDatedatetimeStartDate * datetime default getdate() Date the component started being used in the assembly item. d EndDatedatetimeEndDate datetime Date the component stopped being used in the assembly item. d IX_BillOfMaterials_UnitMeasureCode ( UnitMeasureCode ) Nonclustered index. UnitMeasureCodenchar(3)UnitMeasureCode * nchar(3) Standard code identifying the unit of measure for the quantity. References UnitMeasure ( UnitMeasureCode ) BOMLevelsmallintBOMLevel * smallint Indicates the depth the component is from its parent (AssemblyID). # PerAssemblyQtydecimal(8,2)PerAssemblyQty * decimal(8,2) default 1.00 Quantity of the component needed to create the assembly. # ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d UnitMeasureTable Production.UnitMeasure Unit of measure lookup table. Pk PK_UnitMeasure_UnitMeasureCode ( UnitMeasureCode ) Clustered index created by a primary key constraint. UnitMeasureCodenchar(3)UnitMeasureCode * nchar(3) Primary key. Referred by BillOfMaterials ( UnitMeasureCode ) Referred by Product ( SizeUnitMeasureCode -> UnitMeasureCode ) Referred by Product ( WeightUnitMeasureCode -> UnitMeasureCode ) Referred by ProductVendor ( UnitMeasureCode ) Unq AK_UnitMeasure_Name ( Name ) Unique nonclustered index. NamenameName * name Unit of measure description. t ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductInventoryTable Production.ProductInventory Product inventory information. Pk PK_ProductInventory_ProductID_LocationID ( ProductID, LocationID ) Clustered index created by a primary key constraint. ProductIDintProductID * int Product identification number. Foreign key to Product.ProductID. References Product ( ProductID ) Pk PK_ProductInventory_ProductID_LocationID ( ProductID, LocationID ) Clustered index created by a primary key constraint. LocationIDsmallintLocationID * smallint Inventory location identification number. Foreign key to Location.LocationID. References Location ( LocationID ) Shelfnvarchar(10)Shelf * nvarchar(10) Storage compartment within an inventory location. t BintinyintBin * tinyint Storage container on a shelf in an inventory location. # QuantitysmallintQuantity * smallint default 0 Quantity of products in the inventory location. # rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d LocationTable Production.Location Product inventory and manufacturing locations. Pk PK_Location_LocationID ( LocationID ) Clustered index created by a primary key constraint. LocationIDsmallintLocationID * smallint Primary key for Location records. Referred by ProductInventory ( LocationID ) Referred by WorkOrderRouting ( LocationID ) Unq AK_Location_Name ( Name ) Unique nonclustered index. NamenameName * name Location description. t CostRatesmallmoneyCostRate * smallmoney default 0.00 Standard hourly cost of the manufacturing location. # Availabilitydecimal(8,2)Availability * decimal(8,2) default 0.00 Work capacity (in hours) of the manufacturing location. # ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductModelTable Production.ProductModel Product model classification. Pk PK_ProductModel_ProductModelID ( ProductModelID ) Clustered index created by a primary key constraint. ProductModelIDintProductModelID * int Primary key for ProductModel records. Referred by Product ( ProductModelID ) Referred by ProductModelIllustration ( ProductModelID ) Referred by ProductModelProductDescriptionCulture ( ProductModelID ) Unq AK_ProductModel_Name ( Name ) Unique nonclustered index. NamenameName * name Product model description. t CatalogDescriptionxmlCatalogDescription xml Detailed product catalog information in xml format. t InstructionsxmlInstructions xml Manufacturing instructions in xml format. t Unq AK_ProductModel_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples. rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d TransactionHistoryTable Production.TransactionHistory Record of each purchase order, sales order, or work order transaction year to date. Pk PK_TransactionHistory_TransactionID ( TransactionID ) Clustered index created by a primary key constraint. TransactionIDintTransactionID * int Primary key for TransactionHistory records. # IX_TransactionHistory_ProductID ( ProductID ) Nonclustered index. ProductIDintProductID * int Product identification number. Foreign key to Product.ProductID. References Product ( ProductID ) IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) Nonclustered index. ReferenceOrderIDintReferenceOrderID * int Purchase order, sales order, or work order identification number. # IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) Nonclustered index. ReferenceOrderLineIDintReferenceOrderLineID * int default 0 Line number associated with the purchase order, sales order, or work order. # TransactionDatedatetimeTransactionDate * datetime default getdate() Date and time of the transaction. d TransactionTypenchar(1)TransactionType * nchar(1) W = WorkOrder, S = SalesOrder, P = PurchaseOrder c QuantityintQuantity * int Product quantity. # ActualCostmoneyActualCost * money Product cost. # ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductPhotoTable Production.ProductPhoto Product images. Pk PK_ProductPhoto_ProductPhotoID ( ProductPhotoID ) Clustered index created by a primary key constraint. ProductPhotoIDintProductPhotoID * int Primary key for ProductPhoto records. Referred by ProductProductPhoto ( ProductPhotoID ) ThumbNailPhotovarbinary(max)ThumbNailPhoto varbinary(max) Small image of the product. ~ ThumbnailPhotoFileNamenvarchar(50)ThumbnailPhotoFileName nvarchar(50) Small image file name. t LargePhotovarbinary(max)LargePhoto varbinary(max) Large image of the product. ~ LargePhotoFileNamenvarchar(50)LargePhotoFileName nvarchar(50) Large image file name. t ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductProductPhotoTable Production.ProductProductPhoto Cross-reference table mapping products and product photos. Pk PK_ProductProductPhoto_ProductID_ProductPhotoID ( ProductID, ProductPhotoID ) Nonclustered index created by a primary key constraint. ProductIDintProductID * int Product identification number. Foreign key to Product.ProductID. References Product ( ProductID ) Pk PK_ProductProductPhoto_ProductID_ProductPhotoID ( ProductID, ProductPhotoID ) Nonclustered index created by a primary key constraint. ProductPhotoIDintProductPhotoID * int Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID. References ProductPhoto ( ProductPhotoID ) PrimaryflagPrimary * flag default 0 0 = Photo is not the principal image. 1 = Photo is the principal image. b ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d TransactionHistoryArchiveTable Production.TransactionHistoryArchive Transactions for previous years. Pk PK_TransactionHistoryArchive_TransactionID ( TransactionID ) Clustered index created by a primary key constraint. TransactionIDintTransactionID * int Primary key for TransactionHistoryArchive records. # IX_TransactionHistoryArchive_ProductID ( ProductID ) Nonclustered index. ProductIDintProductID * int Product identification number. Foreign key to Product.ProductID. # IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) Nonclustered index. ReferenceOrderIDintReferenceOrderID * int Purchase order, sales order, or work order identification number. # IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID ( ReferenceOrderID, ReferenceOrderLineID ) Nonclustered index. ReferenceOrderLineIDintReferenceOrderLineID * int default 0 Line number associated with the purchase order, sales order, or work order. # TransactionDatedatetimeTransactionDate * datetime default getdate() Date and time of the transaction. d TransactionTypenchar(1)TransactionType * nchar(1) W = Work Order, S = Sales Order, P = Purchase Order c QuantityintQuantity * int Product quantity. # ActualCostmoneyActualCost * money Product cost. # ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductDescriptionTable Production.ProductDescription Product descriptions in several languages. Pk PK_ProductDescription_ProductDescriptionID ( ProductDescriptionID ) Clustered index created by a primary key constraint. ProductDescriptionIDintProductDescriptionID * int Primary key for ProductDescription records. Referred by ProductModelProductDescriptionCulture ( ProductDescriptionID ) Descriptionnvarchar(400)Description * nvarchar(400) Description of the product. t Unq AK_ProductDescription_rowguid ( rowguid ) Unique nonclustered index. Used to support replication samples. rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductModelProductDescriptionCultureTable Production.ProductModelProductDescriptionCulture Cross-reference table mapping product descriptions and the language the description is written in. Pk PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID ( ProductModelID, ProductDescriptionID, CultureID ) Clustered index created by a primary key constraint. ProductModelIDintProductModelID * int Primary key. Foreign key to ProductModel.ProductModelID. References ProductModel ( ProductModelID ) Pk PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID ( ProductModelID, ProductDescriptionID, CultureID ) Clustered index created by a primary key constraint. ProductDescriptionIDintProductDescriptionID * int Primary key. Foreign key to ProductDescription.ProductDescriptionID. References ProductDescription ( ProductDescriptionID ) Pk PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID ( ProductModelID, ProductDescriptionID, CultureID ) Clustered index created by a primary key constraint. CultureIDnchar(6)CultureID * nchar(6) Culture identification number. Foreign key to Culture.CultureID. References Culture ( CultureID ) ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductModelIllustrationTable Production.ProductModelIllustration Cross-reference table mapping product models and illustrations. Pk PK_ProductModelIllustration_ProductModelID_IllustrationID ( ProductModelID, IllustrationID ) Clustered index created by a primary key constraint. ProductModelIDintProductModelID * int Primary key. Foreign key to ProductModel.ProductModelID. References ProductModel ( ProductModelID ) Pk PK_ProductModelIllustration_ProductModelID_IllustrationID ( ProductModelID, IllustrationID ) Clustered index created by a primary key constraint. IllustrationIDintIllustrationID * int Primary key. Foreign key to Illustration.IllustrationID. References Illustration ( IllustrationID ) ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d IllustrationTable Production.Illustration Bicycle assembly diagrams. Pk PK_Illustration_IllustrationID ( IllustrationID ) Clustered index created by a primary key constraint. IllustrationIDintIllustrationID * int Primary key for Illustration records. Referred by ProductModelIllustration ( IllustrationID ) DiagramxmlDiagram xml Illustrations used in manufacturing instructions. Stored as XML. t ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d


Table BillOfMaterials

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

IndexesField NameData TypeDescription
* BillOfMaterialsID int AUTOINCREMENT Primary key for BillOfMaterials records.
ProductAssemblyID int Parent product identification number. Foreign key to Product.ProductID.
* ComponentID int Component identification number. Foreign key to Product.ProductID.
* StartDate datetime 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 ) Standard code identifying the unit of measure for the quantity.
* BOMLevel smallint Indicates the depth the component is from its parent (AssemblyID).
* PerAssemblyQty decimal( 8, 2 ) DEFAULT 1.00 Quantity of the component needed to create the assembly.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_BillOfMaterials_BillOfMaterialsID ON BillOfMaterialsID Nonclustered index created by a primary key constraint.
AK_BillOfMaterials_ProductAssemblyID_ComponentID_StartDate ON ProductAssemblyID, ComponentID, StartDate Clustered index.
IX_BillOfMaterials_UnitMeasureCode ON UnitMeasureCode Nonclustered index.
Foreign Keys
FK_BillOfMaterials_Product_ComponentID ( ComponentID ) ref Product (ProductID) Foreign key constraint referencing Product.ComponentID.
FK_BillOfMaterials_Product_ProductAssemblyID ( ProductAssemblyID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductAssemblyID.
FK_BillOfMaterials_UnitMeasure_UnitMeasureCode ( UnitMeasureCode ) ref UnitMeasure (UnitMeasureCode) Foreign key constraint referencing UnitMeasure.UnitMeasureCode.
Constraints
  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_ProductAssemblyID [ProductAssemblyID]<>[ComponentID]
  CK_BillOfMaterials_EndDate [EndDate]>[StartDate] OR [EndDate] IS NULL
  CK_BillOfMaterials_EndDate [EndDate]>[StartDate] OR [EndDate] IS NULL
  CK_BillOfMaterials_BOMLevel [ProductAssemblyID] IS NULL AND [BOMLevel]=(0) AND [PerAssemblyQty]=(1.00) OR [ProductAssemblyID] IS NOT NULL AND [BOMLevel]>=(1)
  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 Culture

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

IndexesField NameData TypeDescription
* CultureID nchar( 6 ) Primary key for Culture records.
* Name name Culture description.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Culture_CultureID ON CultureID Clustered index created by a primary key constraint.
AK_Culture_Name ON Name Unique nonclustered index.


Table Document

Product maintenance documents.

IndexesField NameData TypeDescription
* DocumentNode hierarchyid Primary key for Document records.
DocumentLevel smallint Depth in the document hierarchy.
* Title nvarchar( 50 ) Title of the document.
* Owner int Employee who controls the document. Foreign key to Employee.BusinessEntityID
* FolderFlag bit DEFAULT 0 0 = This is a folder, 1 = This is a document.
* FileName nvarchar( 400 ) File name of the document
* FileExtension nvarchar( 8 ) File extension indicating the document type. For example, .doc or .txt.
* Revision nchar( 5 ) Revision number of the document.
* ChangeNumber int DEFAULT 0 Engineering change approval number.
* Status tinyint 1 = Pending approval, 2 = Approved, 3 = Obsolete
  DocumentSummary nvarchar(max) Document abstract.
  Document varbinary(max) Complete document.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Required for FileStream.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Document_DocumentNode ON DocumentNode Clustered index created by a primary key constraint.
AK_Document_DocumentLevel_DocumentNode ON DocumentLevel, DocumentNode Unique nonclustered index.
UQ__Document__F73921F7C5112C2E ON rowguid
IX_Document_FileName_Revision ON FileName, Revision Unique nonclustered index.
Foreign Keys
FK_Document_Employee_Owner ( Owner ) ref Employee (BusinessEntityID) Foreign key constraint referencing Employee.BusinessEntityID.
Constraints
  CK_Document_Status [Status]>=(1) AND [Status]<=(3)


Table Illustration

Bicycle assembly diagrams.

IndexesField NameData TypeDescription
* IllustrationID int AUTOINCREMENT Primary key for Illustration records.
  Diagram xml Illustrations used in manufacturing instructions. Stored as XML.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Illustration_IllustrationID ON IllustrationID Clustered index created by a primary key constraint.


Table Location

Product inventory and manufacturing locations.

IndexesField NameData TypeDescription
* LocationID smallint AUTOINCREMENT Primary key for Location records.
* Name name Location description.
* CostRate smallmoney DEFAULT 0.00 Standard hourly cost of the manufacturing location.
* Availability decimal( 8, 2 ) DEFAULT 0.00 Work capacity (in hours) of the manufacturing location.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Location_LocationID ON LocationID Clustered index created by a primary key constraint.
AK_Location_Name ON Name Unique nonclustered index.
Constraints
  CK_Location_CostRate [CostRate]>=(0.00)
  CK_Location_Availability [Availability]>=(0.00)


Table Product

Products sold or used in the manfacturing of sold products.

IndexesField NameData TypeDescription
* ProductID int AUTOINCREMENT Primary key for Product records.
* Name name Name of the product.
* ProductNumber nvarchar( 25 ) Unique product identification number.
* MakeFlag flag DEFAULT 1 0 = Product is purchased, 1 = Product is manufactured in-house.
* FinishedGoodsFlag flag DEFAULT 1 0 = Product is not a salable item. 1 = Product is salable.
  Color nvarchar( 15 ) Product color.
* SafetyStockLevel smallint Minimum inventory quantity.
* ReorderPoint smallint Inventory level that triggers a purchase order or work order.
* StandardCost money Standard cost of the product.
* ListPrice money Selling price.
  Size nvarchar( 5 ) Product size.
SizeUnitMeasureCode nchar( 3 ) Unit of measure for Size column.
WeightUnitMeasureCode nchar( 3 ) Unit of measure for Weight column.
  Weight decimal( 8, 2 ) Product weight.
* DaysToManufacture int Number of days required to manufacture the product.
  ProductLine nchar( 2 ) R = Road, M = Mountain, T = Touring, S = Standard
  Class nchar( 2 ) H = High, M = Medium, L = Low
  Style nchar( 2 ) 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 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 DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Product_ProductID ON ProductID Clustered index created by a primary key constraint.
AK_Product_Name ON Name Unique nonclustered index.
AK_Product_ProductNumber ON ProductNumber Unique nonclustered index.
AK_Product_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
Foreign Keys
FK_Product_ProductModel_ProductModelID ( ProductModelID ) ref ProductModel (ProductModelID) Foreign key constraint referencing ProductModel.ProductModelID.
FK_Product_ProductSubcategory_ProductSubcategoryID ( ProductSubcategoryID ) ref ProductSubcategory (ProductSubcategoryID) Foreign key constraint referencing ProductSubcategory.ProductSubcategoryID.
FK_Product_UnitMeasure_SizeUnitMeasureCode ( SizeUnitMeasureCode ) ref UnitMeasure (UnitMeasureCode) Foreign key constraint referencing UnitMeasure.UnitMeasureCode.
FK_Product_UnitMeasure_WeightUnitMeasureCode ( WeightUnitMeasureCode ) ref UnitMeasure (UnitMeasureCode) Foreign key constraint referencing UnitMeasure.UnitMeasureCode.
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
  CK_Product_SellEndDate [SellEndDate]>=[SellStartDate] OR [SellEndDate] IS NULL


Table ProductCategory

High-level product categorization.

IndexesField NameData TypeDescription
* ProductCategoryID int AUTOINCREMENT Primary key for ProductCategory records.
* Name name Category description.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductCategory_ProductCategoryID ON ProductCategoryID Clustered index created by a primary key constraint.
AK_ProductCategory_Name ON Name Unique nonclustered index.
AK_ProductCategory_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.


Table ProductCostHistory

Changes in the cost of a product over time.

IndexesField NameData TypeDescription
* ProductID int Product identification number. Foreign key to Product.ProductID
* StartDate datetime Product cost start date.
  EndDate datetime Product cost end date.
* StandardCost money Standard cost of the product.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductCostHistory_ProductID_StartDate ON ProductID, StartDate Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductCostHistory_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
Constraints
  CK_ProductCostHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_ProductCostHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_ProductCostHistory_StandardCost [StandardCost]>=(0.00)


Table ProductDescription

Product descriptions in several languages.

IndexesField NameData TypeDescription
* ProductDescriptionID int AUTOINCREMENT Primary key for ProductDescription records.
* Description nvarchar( 400 ) Description of the product.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductDescription_ProductDescriptionID ON ProductDescriptionID Clustered index created by a primary key constraint.
AK_ProductDescription_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.


Table ProductDocument

Cross-reference table mapping products to related product documents.

IndexesField NameData TypeDescription
* ProductID int Product identification number. Foreign key to Product.ProductID.
* DocumentNode hierarchyid Document identification number. Foreign key to Document.DocumentNode.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductDocument_ProductID_DocumentNode ON ProductID, DocumentNode Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductDocument_Document_DocumentNode ( DocumentNode ) ref Document (DocumentNode) Foreign key constraint referencing Document.DocumentNode.
FK_ProductDocument_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.


Table ProductInventory

Product inventory information.

IndexesField NameData TypeDescription
* ProductID int Product identification number. Foreign key to Product.ProductID.
* LocationID smallint Inventory location identification number. Foreign key to Location.LocationID.
* Shelf nvarchar( 10 ) Storage compartment within an inventory location.
* Bin tinyint Storage container on a shelf in an inventory location.
* Quantity smallint DEFAULT 0 Quantity of products in the inventory location.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductInventory_ProductID_LocationID ON ProductID, LocationID Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductInventory_Location_LocationID ( LocationID ) ref Location (LocationID) Foreign key constraint referencing Location.LocationID.
FK_ProductInventory_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
Constraints
  CK_ProductInventory_Shelf [Shelf] like '[A-Za-z]' OR [Shelf]='N/A'
  CK_ProductInventory_Bin [Bin]>=(0) AND [Bin]<=(100)


Table ProductListPriceHistory

Changes in the list price of a product over time.

IndexesField NameData TypeDescription
* ProductID int Product identification number. Foreign key to Product.ProductID
* StartDate datetime List price start date.
  EndDate datetime List price end date
* ListPrice money Product list price.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductListPriceHistory_ProductID_StartDate ON ProductID, StartDate Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductListPriceHistory_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
Constraints
  CK_ProductListPriceHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_ProductListPriceHistory_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_ProductListPriceHistory_ListPrice [ListPrice]>(0.00)


Table ProductModel

Product model classification.

IndexesField NameData TypeDescription
* ProductModelID int AUTOINCREMENT Primary key for ProductModel records.
* Name name Product model description.
  CatalogDescription xml Detailed product catalog information in xml format.
  Instructions xml Manufacturing instructions in xml format.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductModel_ProductModelID ON ProductModelID Clustered index created by a primary key constraint.
AK_ProductModel_Name ON Name Unique nonclustered index.
AK_ProductModel_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.


Table ProductModelIllustration

Cross-reference table mapping product models and illustrations.

IndexesField NameData TypeDescription
* ProductModelID int Primary key. Foreign key to ProductModel.ProductModelID.
* IllustrationID int Primary key. Foreign key to Illustration.IllustrationID.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductModelIllustration_ProductModelID_IllustrationID ON ProductModelID, IllustrationID Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductModelIllustration_Illustration_IllustrationID ( IllustrationID ) ref Illustration (IllustrationID) Foreign key constraint referencing Illustration.IllustrationID.
FK_ProductModelIllustration_ProductModel_ProductModelID ( ProductModelID ) ref ProductModel (ProductModelID) Foreign key constraint referencing ProductModel.ProductModelID.


Table ProductModelProductDescriptionCulture

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

IndexesField NameData TypeDescription
* ProductModelID int Primary key. Foreign key to ProductModel.ProductModelID.
* ProductDescriptionID int Primary key. Foreign key to ProductDescription.ProductDescriptionID.
* CultureID nchar( 6 ) Culture identification number. Foreign key to Culture.CultureID.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID ON ProductModelID, ProductDescriptionID, CultureID Clustered index created by a primary key constraint.
Foreign Keys
FK_ProductModelProductDescriptionCulture_Culture_CultureID ( CultureID ) ref Culture (CultureID) Foreign key constraint referencing Culture.CultureID.
FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID ( ProductDescriptionID ) ref ProductDescription (ProductDescriptionID) Foreign key constraint referencing ProductDescription.ProductDescriptionID.
FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID ( ProductModelID ) ref ProductModel (ProductModelID) Foreign key constraint referencing ProductModel.ProductModelID.


Table ProductPhoto

Product images.

IndexesField NameData TypeDescription
* ProductPhotoID int AUTOINCREMENT Primary key for ProductPhoto records.
  ThumbNailPhoto varbinary(max) Small image of the product.
  ThumbnailPhotoFileName nvarchar( 50 ) Small image file name.
  LargePhoto varbinary(max) Large image of the product.
  LargePhotoFileName nvarchar( 50 ) Large image file name.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductPhoto_ProductPhotoID ON ProductPhotoID Clustered index created by a primary key constraint.


Table ProductProductPhoto

Cross-reference table mapping products and product photos.

IndexesField NameData TypeDescription
* ProductID int Product identification number. Foreign key to Product.ProductID.
* ProductPhotoID int Product photo identification number. Foreign key to ProductPhoto.ProductPhotoID.
* Primary flag DEFAULT 0 0 = Photo is not the principal image. 1 = Photo is the principal image.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductProductPhoto_ProductID_ProductPhotoID ON ProductID, ProductPhotoID Nonclustered index created by a primary key constraint.
Foreign Keys
FK_ProductProductPhoto_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
FK_ProductProductPhoto_ProductPhoto_ProductPhotoID ( ProductPhotoID ) ref ProductPhoto (ProductPhotoID) Foreign key constraint referencing ProductPhoto.ProductPhotoID.


Table ProductReview

Customer reviews of products they have purchased.

IndexesField NameData TypeDescription
* ProductReviewID int AUTOINCREMENT Primary key for ProductReview records.
* ProductID int Product identification number. Foreign key to Product.ProductID.
* ReviewerName name Name of the reviewer.
* ReviewDate datetime DEFAULT getdate() Date review was submitted.
* EmailAddress nvarchar( 50 ) Reviewer's e-mail address.
* Rating int Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating.
  Comments nvarchar( 3850 ) Reviewer's comments
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductReview_ProductReviewID ON ProductReviewID Clustered index created by a primary key constraint.
IX_ProductReview_ProductID_Name ON ProductID, ReviewerName Nonclustered index.
Foreign Keys
FK_ProductReview_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
Constraints
  CK_ProductReview_Rating [Rating]>=(1) AND [Rating]<=(5)


Table ProductSubcategory

Product subcategories. See ProductCategory table.

IndexesField NameData TypeDescription
* ProductSubcategoryID int AUTOINCREMENT Primary key for ProductSubcategory records.
* ProductCategoryID int Product category identification number. Foreign key to ProductCategory.ProductCategoryID.
* Name name Subcategory description.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductSubcategory_ProductSubcategoryID ON ProductSubcategoryID Clustered index created by a primary key constraint.
AK_ProductSubcategory_Name ON Name Unique nonclustered index.
AK_ProductSubcategory_rowguid ON rowguid Unique nonclustered index. Used to support replication samples.
Foreign Keys
FK_ProductSubcategory_ProductCategory_ProductCategoryID ( ProductCategoryID ) ref ProductCategory (ProductCategoryID) Foreign key constraint referencing ProductCategory.ProductCategoryID.


Table ScrapReason

Manufacturing failure reasons lookup table.

IndexesField NameData TypeDescription
* ScrapReasonID smallint AUTOINCREMENT Primary key for ScrapReason records.
* Name name Failure description.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ScrapReason_ScrapReasonID ON ScrapReasonID Clustered index created by a primary key constraint.
AK_ScrapReason_Name ON Name Unique nonclustered index.


Table TransactionHistory

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

IndexesField NameData TypeDescription
* TransactionID int AUTOINCREMENT Primary key for TransactionHistory records.
* ProductID int Product identification number. Foreign key to Product.ProductID.
* ReferenceOrderID int Purchase order, sales order, or work order identification number.
* ReferenceOrderLineID int DEFAULT 0 Line number associated with the purchase order, sales order, or work order.
* TransactionDate datetime DEFAULT getdate() Date and time of the transaction.
* TransactionType nchar( 1 ) W = WorkOrder, S = SalesOrder, P = PurchaseOrder
* Quantity int Product quantity.
* ActualCost money Product cost.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_TransactionHistory_TransactionID ON TransactionID Clustered index created by a primary key constraint.
IX_TransactionHistory_ProductID ON ProductID Nonclustered index.
IX_TransactionHistory_ReferenceOrderID_ReferenceOrderLineID ON ReferenceOrderID, ReferenceOrderLineID Nonclustered index.
Foreign Keys
FK_TransactionHistory_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
Constraints
  CK_TransactionHistory_TransactionType upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W'


Table TransactionHistoryArchive

Transactions for previous years.

IndexesField NameData TypeDescription
* TransactionID int Primary key for TransactionHistoryArchive records.
* ProductID int Product identification number. Foreign key to Product.ProductID.
* ReferenceOrderID int Purchase order, sales order, or work order identification number.
* ReferenceOrderLineID int DEFAULT 0 Line number associated with the purchase order, sales order, or work order.
* TransactionDate datetime DEFAULT getdate() Date and time of the transaction.
* TransactionType nchar( 1 ) W = Work Order, S = Sales Order, P = Purchase Order
* Quantity int Product quantity.
* ActualCost money Product cost.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_TransactionHistoryArchive_TransactionID ON TransactionID Clustered index created by a primary key constraint.
IX_TransactionHistoryArchive_ProductID ON ProductID Nonclustered index.
IX_TransactionHistoryArchive_ReferenceOrderID_ReferenceOrderLineID ON ReferenceOrderID, ReferenceOrderLineID Nonclustered index.
Constraints
  CK_TransactionHistoryArchive_TransactionType upper([TransactionType])='P' OR upper([TransactionType])='S' OR upper([TransactionType])='W'


Table UnitMeasure

Unit of measure lookup table.

IndexesField NameData TypeDescription
* UnitMeasureCode nchar( 3 ) Primary key.
* Name name Unit of measure description.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_UnitMeasure_UnitMeasureCode ON UnitMeasureCode Clustered index created by a primary key constraint.
AK_UnitMeasure_Name ON Name Unique nonclustered index.


Table WorkOrder

Manufacturing work orders.

IndexesField NameData TypeDescription
* WorkOrderID int AUTOINCREMENT Primary key for WorkOrder records.
* ProductID int Product identification number. Foreign key to Product.ProductID.
* OrderQty int Product quantity to build.
* StockedQty int Quantity built and put in inventory.
* ScrappedQty smallint Quantity that failed inspection.
* StartDate datetime Work order start date.
  EndDate datetime Work order end date.
* DueDate datetime Work order due date.
ScrapReasonID smallint Reason for inspection failure.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_WorkOrder_WorkOrderID ON WorkOrderID Clustered index created by a primary key constraint.
IX_WorkOrder_ProductID ON ProductID Nonclustered index.
IX_WorkOrder_ScrapReasonID ON ScrapReasonID Nonclustered index.
Foreign Keys
FK_WorkOrder_Product_ProductID ( ProductID ) ref Product (ProductID) Foreign key constraint referencing Product.ProductID.
FK_WorkOrder_ScrapReason_ScrapReasonID ( ScrapReasonID ) ref ScrapReason (ScrapReasonID) Foreign key constraint referencing ScrapReason.ScrapReasonID.
Constraints
  CK_WorkOrder_OrderQty [OrderQty]>(0)
  CK_WorkOrder_ScrappedQty [ScrappedQty]>=(0)
  CK_WorkOrder_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
  CK_WorkOrder_EndDate [EndDate]>=[StartDate] OR [EndDate] IS NULL
Triggers
  iWorkOrder
  uWorkOrder


Table WorkOrderRouting

Work order details.

IndexesField NameData TypeDescription
* WorkOrderID int Primary key. Foreign key to WorkOrder.WorkOrderID.
* ProductID int Primary key. Foreign key to Product.ProductID.
* OperationSequence smallint Primary key. Indicates the manufacturing process sequence.
* LocationID smallint Manufacturing location where the part is processed. Foreign key to Location.LocationID.
* ScheduledStartDate datetime Planned manufacturing start date.
* ScheduledEndDate datetime Planned manufacturing end date.
  ActualStartDate datetime Actual start date.
  ActualEndDate datetime Actual end date.
  ActualResourceHrs decimal( 9, 4 ) Number of manufacturing hours used.
* PlannedCost money Estimated manufacturing cost.
  ActualCost money Actual manufacturing cost.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence ON WorkOrderID, ProductID, OperationSequence Clustered index created by a primary key constraint.
IX_WorkOrderRouting_ProductID ON ProductID Nonclustered index.
Foreign Keys
FK_WorkOrderRouting_Location_LocationID ( LocationID ) ref Location (LocationID) Foreign key constraint referencing Location.LocationID.
FK_WorkOrderRouting_WorkOrder_WorkOrderID ( WorkOrderID ) ref WorkOrder (WorkOrderID) Foreign key constraint referencing WorkOrder.WorkOrderID.
Constraints
  CK_WorkOrderRouting_ScheduledEndDate [ScheduledEndDate]>=[ScheduledStartDate]
  CK_WorkOrderRouting_ScheduledEndDate [ScheduledEndDate]>=[ScheduledStartDate]
  CK_WorkOrderRouting_ActualEndDate [ActualEndDate]>=[ActualStartDate] OR [ActualEndDate] IS NULL OR [ActualStartDate] IS NULL
  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)

Powered by DbSchema