AdventureWorks
| Table Name: | Purchasing.ProductVendor |
| Description: | Cross-reference table mapping vendors with the products they supply. |
| Primary Keys: | ProductID VendorID |
| Field | Type | Defaults | Nulls? | Comments |
|---|---|---|---|---|
| ProductID | int | None | No | Primary key. Foreign key to Product.ProductID. |
| VendorID | int | None | No | Primary key. Foreign key to Vendor.VendorID. |
| AverageLeadTime | int | None | No | The average span of time (in days) between placing an order with the vendor and receiving the purchased product. |
| StandardPrice | money | None | No | The vendor's usual selling price. |
| LastReceiptCost | money | None | Yes | The selling price when last purchased. |
| LastReceiptDate | datetime | None | Yes | Date the product was last received by the vendor. |
| MinOrderQty | int | None | No | The maximum quantity that should be ordered. |
| MaxOrderQty | int | None | No | The minimum quantity that should be ordered. |
| OnOrderQty | int | None | Yes | The quantity currently on order. |
| UnitMeasureCode | nchar (3) | None | No | The product's unit of measure. |
| ModifiedDate | datetime | (getdate()) | No | Date and time the record was last updated. |
| Index | Clustered? | Unique? | Fields |
|---|---|---|---|
| PK_ProductVendor_ProductID_VendorID | Yes | Yes | ProductID VendorID |
| IX_ProductVendor_UnitMeasureCode | No | No | UnitMeasureCode |
| IX_ProductVendor_VendorID | No | No | VendorID |
| Check Constraint | Text |
|---|---|
| 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 Constraint | Affected Field | Source Table |
|---|---|---|
| FK_ProductVendor_Product_ProductID | ProductID | Production.Product |
| FK_ProductVendor_UnitMeasure_UnitMeasureCode | UnitMeasureCode | Production.UnitMeasure |
| FK_ProductVendor_Vendor_VendorID | VendorID | Purchasing.Vendor |