AdventureWorks

Basic Index   Expanded Index

Table Name:Production.ProductCostHistory
Description:Changes in the cost of a product over time.
Primary Keys:ProductID
StartDate
FieldTypeDefaultsNulls?Comments
ProductIDintNoneNoProduct identification number. Foreign key to Product.ProductID
StartDatedatetimeNoneNoProduct cost start date.
EndDatedatetimeNoneYesProduct cost end date.
StandardCostmoneyNoneNoStandard cost of the product.
ModifiedDatedatetime(getdate())NoDate and time the record was last updated.

IndexClustered?Unique?Fields
PK_ProductCostHistory_ProductID_StartDateYesYesProductID
StartDate

Check ConstraintText
CK_ProductCostHistory_EndDate([EndDate]>=[StartDate] OR [EndDate] IS NULL)
CK_ProductCostHistory_StandardCost([StandardCost]>=(0.00))

Internal Foreign Key ConstraintAffected FieldSource Table
FK_ProductCostHistory_Product_ProductIDProductIDProduction.Product

No primary keys as foreign key constraints
No triggers