AdventureWorks

Basic Index   Expanded Index

Table Name:Sales.SalesTerritory
Description:Sales territory lookup table.
Primary Keys:TerritoryID
FieldTypeDefaultsNulls?Comments
TerritoryIDint - IdentityNoneNoPrimary key for SalesTerritory records.
Namenvarchar (50)NoneNoSales territory description
CountryRegionCodenvarchar (3)NoneNoISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode.
Groupnvarchar (50)NoneNoGeographic area to which the sales territory belong.
SalesYTDmoney((0.00))NoSales in the territory year to date.
SalesLastYearmoney((0.00))NoSales in the territory the previous year.
CostYTDmoney((0.00))NoBusiness costs in the territory year to date.
CostLastYearmoney((0.00))NoBusiness costs in the territory the previous year.
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_SalesTerritory_TerritoryIDYesYesTerritoryID
AK_SalesTerritory_NameNoYesName
AK_SalesTerritory_rowguidNoYesrowguid

Check ConstraintText
CK_SalesTerritory_SalesYTD([SalesYTD]>=(0.00))
CK_SalesTerritory_SalesLastYear([SalesLastYear]>=(0.00))
CK_SalesTerritory_CostYTD([CostYTD]>=(0.00))
CK_SalesTerritory_CostLastYear([CostLastYear]>=(0.00))

No internal foreign key constraints
Primary Key as Foreign Key ConstraintAffected TableAffected Field
FK_Customer_SalesTerritory_TerritoryIDSales.CustomerTerritoryID
FK_SalesOrderHeader_SalesTerritory_TerritoryIDSales.SalesOrderHeaderTerritoryID
FK_SalesPerson_SalesTerritory_TerritoryIDSales.SalesPersonTerritoryID
FK_SalesTerritoryHistory_SalesTerritory_TerritoryIDSales.SalesTerritoryHistoryTerritoryID
FK_StateProvince_SalesTerritory_TerritoryIDPerson.StateProvinceTerritoryID

No triggers