AdventureWorks

Basic Index   Expanded Index

Table Name:Sales.Customer
Description:Current customer information. Also see the Individual and Store tables.
Primary Keys:CustomerID
FieldTypeDefaultsNulls?Comments
CustomerIDint - IdentityNoneNoPrimary key for Customer records.
TerritoryIDintNoneYesID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID.
AccountNumbervarchar (10)NoneNoUnique number identifying the customer assigned by the accounting system.
CustomerTypenchar (1)NoneNoCustomer type: I = Individual, S = Store
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_Customer_CustomerIDYesYesCustomerID
AK_Customer_rowguidNoYesrowguid
AK_Customer_AccountNumberNoYesAccountNumber
IX_Customer_TerritoryIDNoNoTerritoryID

Check ConstraintText
CK_Customer_CustomerType(upper([CustomerType])='I' OR upper([CustomerType])='S')

Internal Foreign Key ConstraintAffected FieldSource Table
FK_Customer_SalesTerritory_TerritoryIDTerritoryIDSales.SalesTerritory

Primary Key as Foreign Key ConstraintAffected TableAffected Field
FK_CustomerAddress_Customer_CustomerIDSales.CustomerAddressCustomerID
FK_Individual_Customer_CustomerIDSales.IndividualCustomerID
FK_SalesOrderHeader_Customer_CustomerIDSales.SalesOrderHeaderCustomerID
FK_Store_Customer_CustomerIDSales.StoreCustomerID

No triggers