Purchasing |
04/26/2006 |
PRIMARY |
40 |
48 |
460 |
Cross-reference table mapping vendors with the products they supply. |
|
|
ProductID |
int |
4 |
|
|
|
|
Primary key. Foreign key to Product.ProductID. |
|
|
VendorID |
int |
4 |
|
|
|
|
Primary key. Foreign key to Vendor.VendorID. |
|
|
AverageLeadTime |
int |
4 |
|
|
|
|
The average span of time (in days) between placing an order with the vendor and receiving the purchased product. |
|
|
StandardPrice |
money |
8 |
|
|
|
|
The vendor's usual selling price. |
|
|
LastReceiptCost |
money |
8 |
|
|
|
|
The selling price when last purchased. |
|
|
LastReceiptDate |
datetime |
8 |
|
|
|
|
Date the product was last received by the vendor. |
|
|
MinOrderQty |
int |
4 |
|
|
|
|
The maximum quantity that should be ordered. |
|
|
MaxOrderQty |
int |
4 |
|
|
|
|
The minimum quantity that should be ordered. |
|
|
OnOrderQty |
int |
4 |
|
|
|
|
The quantity currently on order. |
|
|
UnitMeasureCode |
nchar |
3 |
|
|
|
|
The product's unit of measure. |
|
|
ModifiedDate |
datetime |
8 |
|
(getdate()) |
|
|
Date and time the record was last updated. |
Total: 11 column(s)
Total: 3 index(es)
|
CK_ProductVendor_AverageLeadTime |
([AverageLeadTime]>=(1)) |
|
CK_ProductVendor_LastReceiptCost |
([LastReceiptCost]>(0.00)) |
|
CK_ProductVendor_MaxOrderQty |
([MaxOrderQty]>=(1)) |
|
CK_ProductVendor_MinOrderQty |
([MinOrderQty]>=(1)) |
|
CK_ProductVendor_OnOrderQty |
([OnOrderQty]>=(0)) |
|
CK_ProductVendor_StandardPrice |
([StandardPrice]>(0.00)) |
Total: 6 constraint(s)
Total: 3 table(s)
Total: 9 object(s)
CREATE TABLE [ProductVendor] (
[ProductID] [int] NOT NULL ,
[VendorID] [int] NOT NULL ,
[AverageLeadTime] [int] NOT NULL ,
[StandardPrice] [money] NOT NULL ,
[LastReceiptCost] [money] NULL ,
[LastReceiptDate] [datetime] NULL ,
[MinOrderQty] [int] NOT NULL ,
[MaxOrderQty] [int] NOT NULL ,
[OnOrderQty] [int] NULL ,
[UnitMeasureCode] [nchar] (3) COLLATE Latin1_General_CS_AS NOT NULL ,
[ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_ProductVendor_ModifiedDate] DEFAULT (getdate()),
CONSTRAINT [PK_ProductVendor_ProductID_VendorID] PRIMARY KEY CLUSTERED
(
[ProductID],
[VendorID]
) ON [PRIMARY] ,
CONSTRAINT [FK_ProductVendor_Product_ProductID] FOREIGN KEY
(
[ProductID]
) REFERENCES [Product] (
[ProductID]
),
CONSTRAINT [FK_ProductVendor_UnitMeasure_UnitMeasureCode] FOREIGN KEY
(
[UnitMeasureCode]
) REFERENCES [UnitMeasure] (
[UnitMeasureCode]
),
CONSTRAINT [FK_ProductVendor_Vendor_VendorID] FOREIGN KEY
(
[VendorID]
) REFERENCES [Vendor] (
[VendorID]
),
CONSTRAINT [CK_ProductVendor_AverageLeadTime] CHECK ([AverageLeadTime]>=(1)),
CONSTRAINT [CK_ProductVendor_LastReceiptCost] CHECK ([LastReceiptCost]>(0.00)),
CONSTRAINT [CK_ProductVendor_MaxOrderQty] CHECK ([MaxOrderQty]>=(1)),
CONSTRAINT [CK_ProductVendor_MinOrderQty] CHECK ([MinOrderQty]>=(1)),
CONSTRAINT [CK_ProductVendor_OnOrderQty] CHECK ([OnOrderQty]>=(0)),
CONSTRAINT [CK_ProductVendor_StandardPrice] CHECK ([StandardPrice]>(0.00))
) ON [PRIMARY]
GO
List of tables