AdventureWorks

Basic Index   Expanded Index

Table Name:Purchasing.ProductVendor
Description:Cross-reference table mapping vendors with the products they supply.
Primary Keys:ProductID
VendorID
FieldTypeDefaultsNulls?Comments
ProductIDintNoneNoPrimary key. Foreign key to Product.ProductID.
VendorIDintNoneNoPrimary key. Foreign key to Vendor.VendorID.
AverageLeadTimeintNoneNoThe average span of time (in days) between placing an order with the vendor and receiving the purchased product.
StandardPricemoneyNoneNoThe vendor's usual selling price.
LastReceiptCostmoneyNoneYesThe selling price when last purchased.
LastReceiptDatedatetimeNoneYesDate the product was last received by the vendor.
MinOrderQtyintNoneNoThe maximum quantity that should be ordered.
MaxOrderQtyintNoneNoThe minimum quantity that should be ordered.
OnOrderQtyintNoneYesThe quantity currently on order.
UnitMeasureCodenchar (3)NoneNoThe product's unit of measure.
ModifiedDatedatetime(getdate())NoDate and time the record was last updated.

IndexClustered?Unique?Fields
PK_ProductVendor_ProductID_VendorIDYesYesProductID
VendorID
IX_ProductVendor_UnitMeasureCodeNoNoUnitMeasureCode
IX_ProductVendor_VendorIDNoNoVendorID

Check ConstraintText
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))

Internal Foreign Key ConstraintAffected FieldSource Table
FK_ProductVendor_Product_ProductIDProductIDProduction.Product
FK_ProductVendor_UnitMeasure_UnitMeasureCodeUnitMeasureCodeProduction.UnitMeasure
FK_ProductVendor_Vendor_VendorIDVendorIDPurchasing.Vendor

No primary keys as foreign key constraints
No triggers