Cross-reference table mapping vendors with the products they supply.
| Idx | Field Name | Data Type | Description |
|---|---|---|---|
| * | ProductID | int | Primary key. Foreign key to Product.ProductID. |
| * | BusinessEntityID | int | Primary key. Foreign key to Vendor.BusinessEntityID. |
| * | AverageLeadTime | int | The average span of time (in days) between placing an order with the vendor and receiving the purchased product. |
| * | StandardPrice | money | 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 | The maximum quantity that should be ordered. |
| * | MaxOrderQty | int | The minimum quantity that should be ordered. |
| OnOrderQty | int | The quantity currently on order. | |
| * | UnitMeasureCode | nchar(3) | The product's unit of measure. |
| * | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
| Indexes | |||
| PK_ProductVendor_ProductID_BusinessEntityID | ON ProductID, BusinessEntityID | Clustered index created by a primary key constraint. | |
| IX_ProductVendor_BusinessEntityID | ON BusinessEntityID | Nonclustered index. | |
| IX_ProductVendor_UnitMeasureCode | ON UnitMeasureCode | Nonclustered index. | |
| Foreign Keys | |||
| FK_ProductVendor_Product_ProductID | ( ProductID ) ref Product (ProductID) | Foreign key constraint referencing Product.ProductID. | |
| FK_ProductVendor_UnitMeasure_UnitMeasureCode | ( UnitMeasureCode ) ref UnitMeasure (UnitMeasureCode) | Foreign key constraint referencing UnitMeasure.UnitMeasureCode. | |
| FK_ProductVendor_Vendor_BusinessEntityID | ( BusinessEntityID ) ref Vendor (BusinessEntityID) | Foreign key constraint referencing Vendor.BusinessEntityID. | |
| 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) | ||
Individual products associated with a specific purchase order. See PurchaseOrderHeader.
| Idx | Field Name | Data Type | Description |
|---|---|---|---|
| * | PurchaseOrderID | int | Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID. |
| * | PurchaseOrderDetailID | int AUTOINCREMENT | Primary key. One line number per purchased product. |
| * | DueDate | datetime | Date the product is expected to be received. |
| * | OrderQty | smallint | Quantity ordered. |
| * | ProductID | int | Product identification number. Foreign key to Product.ProductID. |
| * | UnitPrice | money | Vendor's selling price of a single product. |
| * | LineTotal | money | Per product subtotal. Computed as OrderQty * UnitPrice. |
| * | ReceivedQty | decimal(8,2) | Quantity actually received from the vendor. |
| * | RejectedQty | decimal(8,2) | Quantity rejected during inspection. |
| * | StockedQty | decimal(9,2) | Quantity accepted into inventory. Computed as ReceivedQty - RejectedQty. |
| * | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
| Indexes | |||
| PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailID | ON PurchaseOrderID, PurchaseOrderDetailID | Clustered index created by a primary key constraint. | |
| IX_PurchaseOrderDetail_ProductID | ON ProductID | Nonclustered index. | |
| Foreign Keys | |||
| FK_PurchaseOrderDetail_Product_ProductID | ( ProductID ) ref Product (ProductID) | Foreign key constraint referencing Product.ProductID. | |
| FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID | ( PurchaseOrderID ) ref PurchaseOrderHeader (PurchaseOrderID) | Foreign key constraint referencing PurchaseOrderHeader.PurchaseOrderID. | |
| 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 | |||
| iPurchaseOrderDetail | |||
| uPurchaseOrderDetail | |||
General purchase order information. See PurchaseOrderDetail.
| Idx | Field Name | Data Type | Description |
|---|---|---|---|
| * | PurchaseOrderID | int AUTOINCREMENT | Primary key. |
| * | RevisionNumber | tinyint DEFAULT 0 | Incremental number to track changes to the purchase order over time. |
| * | Status | tinyint DEFAULT 1 | Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete |
| * | EmployeeID | int | Employee who created the purchase order. Foreign key to Employee.BusinessEntityID. |
| * | VendorID | int | Vendor with whom the purchase order is placed. Foreign key to Vendor.BusinessEntityID. |
| * | ShipMethodID | int | Shipping method. Foreign key to ShipMethod.ShipMethodID. |
| * | OrderDate | datetime DEFAULT getdate() | Purchase order creation date. |
| ShipDate | datetime | Estimated shipment date from the vendor. | |
| * | SubTotal | money DEFAULT 0.00 | Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. |
| * | TaxAmt | money DEFAULT 0.00 | Tax amount. |
| * | Freight | money DEFAULT 0.00 | Shipping cost. |
| * | TotalDue | money | Total due to vendor. Computed as Subtotal + TaxAmt + Freight. |
| * | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
| Indexes | |||
| PK_PurchaseOrderHeader_PurchaseOrderID | ON PurchaseOrderID | Clustered index created by a primary key constraint. | |
| IX_PurchaseOrderHeader_EmployeeID | ON EmployeeID | Nonclustered index. | |
| IX_PurchaseOrderHeader_VendorID | ON VendorID | Nonclustered index. | |
| Foreign Keys | |||
| FK_PurchaseOrderHeader_Employee_EmployeeID | ( EmployeeID ) ref Employee (BusinessEntityID) | Foreign key constraint referencing Employee.EmployeeID. | |
| FK_PurchaseOrderHeader_ShipMethod_ShipMethodID | ( ShipMethodID ) ref ShipMethod (ShipMethodID) | Foreign key constraint referencing ShipMethod.ShipMethodID. | |
| FK_PurchaseOrderHeader_Vendor_VendorID | ( VendorID ) ref Vendor (BusinessEntityID) | Foreign key constraint referencing Vendor.VendorID. | |
| Constraints | |||
| CK_PurchaseOrderHeader_Status | [Status]>=(1) AND [Status]<=(4) | ||
| CK_PurchaseOrderHeader_ShipDate | [ShipDate]>=[OrderDate] OR [ShipDate] IS NULL | ||
| 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 | |||
| uPurchaseOrderHeader | |||
Shipping company lookup table.
| Idx | Field Name | Data Type | Description |
|---|---|---|---|
| * | ShipMethodID | int AUTOINCREMENT | Primary key for ShipMethod records. |
| * | Name | name | Shipping company name. |
| * | ShipBase | money DEFAULT 0.00 | Minimum shipping charge. |
| * | ShipRate | money DEFAULT 0.00 | Shipping charge per pound. |
| * | 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_ShipMethod_ShipMethodID | ON ShipMethodID | Clustered index created by a primary key constraint. | |
| AK_ShipMethod_Name | ON Name | Unique nonclustered index. | |
| AK_ShipMethod_rowguid | ON rowguid | Unique nonclustered index. Used to support replication samples. | |
| Constraints | |||
| CK_ShipMethod_ShipBase | [ShipBase]>(0.00) | ||
| CK_ShipMethod_ShipRate | [ShipRate]>(0.00) | ||
Companies from whom Adventure Works Cycles purchases parts or other goods.
| Idx | Field Name | Data Type | Description |
|---|---|---|---|
| * | BusinessEntityID | int | Primary key for Vendor records. Foreign key to BusinessEntity.BusinessEntityID |
| * | AccountNumber | accountnumber | Vendor account (identification) number. |
| * | Name | name | Company name. |
| * | CreditRating | tinyint | 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average |
| * | PreferredVendorStatus | flag DEFAULT 1 | 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. |
| * | ActiveFlag | flag DEFAULT 1 | 0 = Vendor no longer used. 1 = Vendor is actively used. |
| PurchasingWebServiceURL | nvarchar(1024) | Vendor URL. | |
| * | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
| Indexes | |||
| PK_Vendor_BusinessEntityID | ON BusinessEntityID | Clustered index created by a primary key constraint. | |
| AK_Vendor_AccountNumber | ON AccountNumber | Unique nonclustered index. | |
| Foreign Keys | |||
| FK_Vendor_BusinessEntity_BusinessEntityID | ( BusinessEntityID ) ref BusinessEntity (BusinessEntityID) | Foreign key constraint referencing BusinessEntity.BusinessEntityID | |
| Constraints | |||
| CK_Vendor_CreditRating | [CreditRating]>=(1) AND [CreditRating]<=(5) | ||
| Triggers | |||
| dVendor | |||