Tables | SQL 2005 Adventure Works OLTP |
Cross-reference table mapping vendors with the products they supply.
Columns
Name Data type Nullable Description ProductID int No Primary key. Foreign key to Product.ProductID. VendorID int No Primary key. Foreign key to Vendor.VendorID. AverageLeadTime int No The average span of time (in days) between placing an order with the vendor and receiving the purchased product. StandardPrice money No The vendor's usual selling price. LastReceiptCost money Yes The selling price when last purchased. LastReceiptDate datetime Yes Date the product was last received by the vendor. MinOrderQty int No The maximum quantity that should be ordered. MaxOrderQty int No The minimum quantity that should be ordered. OnOrderQty int Yes The quantity currently on order. UnitMeasureCode nchar(3) No The product's unit of measure. ModifiedDate datetime No Default value: GETDATE()
Date and time the record was last updated.
Constraints
Name Type Columns Description DF_ProductVendor_ModifiedDate DEFAULT ModifiedDate Value: GETDATE()
Default constraint value of GETDATE()CK_ProductVendor_AverageLeadTime CHECK N/A Value: ([AverageLeadTime] >= 1)
Check constraint [AverageLeadTime]>=(1)CK_ProductVendor_StandardPrice CHECK N/A Value: ([StandardPrice] > 0.00)
Check constraint [StandardPrice]>(0.00)CK_ProductVendor_LastReceiptCost CHECK N/A Value: ([LastReceiptCost] > 0.00)
Check constraint [LastReceiptCost]>(0.00)CK_ProductVendor_MinOrderQty CHECK N/A Value: ([MinOrderQty] >= 1)
Check constraint [MinOrderQty]>=(1)CK_ProductVendor_MaxOrderQty CHECK N/A Value: ([MaxOrderQty] >= 1)
Check constraint [MaxOrderQty]>=(1)CK_ProductVendor_OnOrderQty CHECK N/A Value: ([OnOrderQty] >= 0)
Check constraint [OnOrderQty]>=(0)PK_ProductVendor_ProductID_VendorID PRIMARY KEY ProductID
VendorIDClustered index created by a primary key constraint. FK_ProductVendor_Product_ProductID FOREIGN KEY ProductID Reference table: Production.Product
Foreign key constraint referencing Product.ProductID.FK_ProductVendor_UnitMeasure_UnitMeasureCode FOREIGN KEY UnitMeasureCode Reference table: Production.UnitMeasure
Foreign key constraint referencing UnitMeasure.UnitMeasureCode.FK_ProductVendor_Vendor_VendorID FOREIGN KEY VendorID Reference table: Purchasing.Vendor
Foreign key constraint referencing Vendor.VendorID.
Indices
Name Description IX_ProductVendor_UnitMeasureCode Nonclustered index. IX_ProductVendor_VendorID Nonclustered index.
Triggers
Name Description Purchasing.uProductVendor AFTER UPDATE trigger setting the ModifiedDate column in the ProductVendor table to the current date.
Modified by
Name Description Purchasing.uProductVendor AFTER UPDATE trigger setting the ModifiedDate column in the ProductVendor table to the current date.
Applies to
Tables | User