AdventureWorks

Basic Index   Expanded Index

Table Name:Production.ProductInventory
Description:Product inventory information.
Primary Keys:ProductID
LocationID
FieldTypeDefaultsNulls?Comments
ProductIDintNoneNoProduct identification number. Foreign key to Product.ProductID.
LocationIDsmallintNoneNoInventory location identification number. Foreign key to Location.LocationID.
Shelfnvarchar (10)NoneNoStorage compartment within an inventory location.
BintinyintNoneNoStorage container on a shelf in an inventory location.
Quantitysmallint((0))NoQuantity of products in the inventory location.
rowguiduniqueidentifier(newid())NoROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDatedatetime(getdate())NoDate and time the record was last updated.

IndexClustered?Unique?Fields
PK_ProductInventory_ProductID_LocationIDYesYesProductID
LocationID

Check ConstraintText
CK_ProductInventory_Shelf([Shelf] like '[A-Za-z]' OR [Shelf]='N/A')
CK_ProductInventory_Bin([Bin]>=(0) AND [Bin]<=(100))

Internal Foreign Key ConstraintAffected FieldSource Table
FK_ProductInventory_Location_LocationIDLocationIDProduction.Location
FK_ProductInventory_Product_ProductIDProductIDProduction.Product

No primary keys as foreign key constraints
No triggers