AdventureWorks2019
Purchasing.ProductVendor
//
Cross-reference table mapping vendors with the products they supply.
Created: Modified:
Columns
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL//CONSTRAINT: Check constraint [AverageLeadTime] >= (1)([AverageLeadTime]>=(1))
-
//${escapify(column.description)}[money] NOT NULL//CONSTRAINT: Check constraint [StandardPrice] > (0.00)([StandardPrice]>(0.00))
-
//${escapify(column.description)}[money] NULL//CONSTRAINT: Check constraint [LastReceiptCost] > (0.00)([LastReceiptCost]>(0.00))
-
//${escapify(column.description)}[datetime] NULL
-
//${escapify(column.description)}[int] NOT NULL//CONSTRAINT: Check constraint [MinOrderQty] >= (1)([MinOrderQty]>=(1))
-
//${escapify(column.description)}[int] NOT NULL//CONSTRAINT: Check constraint [MaxOrderQty] >= (1)([MaxOrderQty]>=(1))
-
//${escapify(column.description)}[int] NULL//CONSTRAINT: Check constraint [OnOrderQty] >= (0)([OnOrderQty]>=(0))
-
//${escapify(column.description)}[nchar](3) NOT NULL
-
//${escapify(column.description)}[datetime] NOT NULL DEFAULT (getdate())
Indexes
-
//Clustered index created by a primary key constraint.PK_ProductVendor_ProductID_BusinessEntityIDUNIQUE CLUSTEREDProductID , BusinessEntityID
-
//Nonclustered index.IX_ProductVendor_UnitMeasureCodeNONCLUSTEREDUnitMeasureCode
-
//Nonclustered index.IX_ProductVendor_BusinessEntityIDNONCLUSTEREDBusinessEntityID
Foreign Keys
-
//Foreign key constraint referencing Product.ProductID.FK_ProductVendor_Product_ProductIDProduction.ProductProductID ⥱ ProductID
-
//Foreign key constraint referencing UnitMeasure.UnitMeasureCode.FK_ProductVendor_UnitMeasure_UnitMeasureCodeProduction.UnitMeasureUnitMeasureCode ⥱ UnitMeasureCode
-
//Foreign key constraint referencing Vendor.BusinessEntityID.FK_ProductVendor_Vendor_BusinessEntityIDPurchasing.VendorBusinessEntityID ⥱ BusinessEntityID
Sample Data
ProductID
BusinessEntityID
AverageLeadTime
StandardPrice
LastReceiptCost
LastReceiptDate
MinOrderQty
MaxOrderQty
OnOrderQty
UnitMeasureCode
ModifiedDate
1
1580
17
47.87
50.2635
1
5
3
CS
2
1688
19
39.92
41.916
1
5
3
CTN
4
1650
17
54.31
57.0255
1
5
NULL
CTN
317
1578
19
28.17
29.5785
100
1000
300
EA
317
1678
17
25.77
27.0585
100
1000
NULL
EA
318
1578
19
34.38
36.099
100
1000
NULL
EA
318
1678
17
31.98
33.579
100
1000
300
EA
319
1556
19
44.21
46.4205
100
1000
300
EA
319
1578
19
46.27
48.5835
100
1000
NULL
EA
319
1678
17
43.87
46.0635
100
1000
NULL
EA
320
1514
19
47.28
49.644
1
5
3
CAN
320
1602
17
45.21
47.4705
1
5
NULL
CAN
320
1604
17
43.21
45.3705
1
5
NULL
CAN
321
1514
19
42.21
44.3205
1
5
NULL
CAN
321
1602
17
40.76
42.798
1
5
NULL
CAN
321
1604
17
38.56
40.488
1
5
NULL
CAN
322
1514
19
27.33
28.6965
20
100
NULL
DZ
322
1602
17
24.21
25.4205
20
100
NULL
DZ
322
1604
17
25.11
26.3655
20
100
NULL
DZ
323
1698
17
47.87
50.2635
1
5
NULL
CS
325
1590
19
0.2
0.21
500
2000
NULL
EA
326
1590
19
0.2
0.21
500
2000
NULL
EA
332
1608
19
10.3
10.815
100
1000
NULL
EA
341
1598
15
39.21
41.1705
1
5
3
CTN
341
1614
19
45.31
47.5755
1
5
NULL
CTN