Databases > AdventureWorks2019 > Tables > Production.ProductCostHistory

AdventureWorks2019

Production.ProductCostHistory

//
Changes in the cost of a product over time.

Created: Modified:

Columns

  • //
    ${escapify(column.description)}
    ProductID
    [int] NOT NULL
  • //
    ${escapify(column.description)}
    StartDate
    [datetime] NOT NULL
  • //
    ${escapify(column.description)}
    EndDate
    [datetime] NULL
  • //
    ${escapify(column.description)}
    StandardCost
    [money] NOT NULL
    //
    CONSTRAINT: Check constraint [StandardCost] >= (0.00)
    ([StandardCost]>=(0.00))
  • //
    ${escapify(column.description)}
    ModifiedDate
    [datetime] NOT NULL DEFAULT (getdate())

Indexes

  • //
    Clustered index created by a primary key constraint.
    PK_ProductCostHistory_ProductID_StartDate
    UNIQUE CLUSTERED
    ProductID , StartDate

Foreign Keys

  • //
    Foreign key constraint referencing Product.ProductID.
    FK_ProductCostHistory_Product_ProductID
    Production.Product
    ProductID ⥱ ProductID

Check Constraints

  • //
    Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NULL
    CK_ProductCostHistory_EndDate
    ([EndDate]>=[StartDate] OR [EndDate] IS NULL)

Sample Data

ProductID
StartDate
EndDate
StandardCost
ModifiedDate
707
12.0278
707
13.8782
707
NULL
13.0863
708
12.0278
708
13.8782
708
NULL
13.0863
709
3.3963
710
3.3963
711
12.0278
711
13.8782
711
NULL
13.0863
712
5.7052
712
5.2297
712
NULL
6.9223
713
31.7244
713
29.0807
713
NULL
38.4923
714
31.7244
714
29.0807
714
NULL
38.4923
715
31.7244
715
29.0807
715
NULL
38.4923
716
31.7244
716
29.0807