AdventureWorks
| Table Name: | Sales.Customer |
| Description: | Current customer information. Also see the Individual and Store tables. |
| Primary Keys: | CustomerID |
| Field | Type | Defaults | Nulls? | Comments |
|---|---|---|---|---|
| CustomerID | int - Identity | None | No | Primary key for Customer records. |
| TerritoryID | int | None | Yes | ID of the territory in which the customer is located. Foreign key to SalesTerritory.SalesTerritoryID. |
| AccountNumber | varchar (10) | None | No | Unique number identifying the customer assigned by the accounting system. |
| CustomerType | nchar (1) | None | No | Customer type: I = Individual, S = Store |
| rowguid | uniqueidentifier | (newid()) | No | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| ModifiedDate | datetime | (getdate()) | No | Date and time the record was last updated. |
| Index | Clustered? | Unique? | Fields |
|---|---|---|---|
| PK_Customer_CustomerID | Yes | Yes | CustomerID |
| AK_Customer_rowguid | No | Yes | rowguid |
| AK_Customer_AccountNumber | No | Yes | AccountNumber |
| IX_Customer_TerritoryID | No | No | TerritoryID |
| Check Constraint | Text |
|---|---|
| CK_Customer_CustomerType | (upper([CustomerType])='I' OR upper([CustomerType])='S') |
| Internal Foreign Key Constraint | Affected Field | Source Table |
|---|---|---|
| FK_Customer_SalesTerritory_TerritoryID | TerritoryID | Sales.SalesTerritory |
| Primary Key as Foreign Key Constraint | Affected Table | Affected Field |
|---|---|---|
| FK_CustomerAddress_Customer_CustomerID | Sales.CustomerAddress | CustomerID |
| FK_Individual_Customer_CustomerID | Sales.Individual | CustomerID |
| FK_SalesOrderHeader_Customer_CustomerID | Sales.SalesOrderHeader | CustomerID |
| FK_Store_Customer_CustomerID | Sales.Store | CustomerID |