Street address information for customers, employees, and vendors.
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | AddressID | int AUTOINCREMENT | Primary key for Address records. |
* | AddressLine1 | nvarchar( 60 ) | First street address line. |
AddressLine2 | nvarchar( 60 ) | Second street address line. | |
* | City | nvarchar( 30 ) | Name of the city. |
* | StateProvinceID | int | Unique identification number for the state or province. Foreign key to StateProvince table. |
* | PostalCode | nvarchar( 15 ) | Postal code for the street address. |
SpatialLocation | geography | Latitude and longitude of this address. | |
* | rowguid | uniqueidentifier DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_Address_AddressID | ON AddressID | Clustered index created by a primary key constraint. | |
AK_Address_rowguid | ON rowguid | Unique nonclustered index. Used to support replication samples. | |
IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode | ON AddressLine1, AddressLine2, City, StateProvinceID, PostalCode | Nonclustered index. | |
IX_Address_StateProvinceID | ON StateProvinceID | Nonclustered index. | |
Foreign Keys | |||
FK_Address_StateProvince_StateProvinceID | ( StateProvinceID ) ref StateProvince (StateProvinceID) | Foreign key constraint referencing StateProvince.StateProvinceID. |
Types of addresses stored in the Address table.
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | AddressTypeID | int AUTOINCREMENT | Primary key for AddressType records. |
* | Name | name | Address type description. For example, Billing, Home, or Shipping. |
* | rowguid | uniqueidentifier DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_AddressType_AddressTypeID | ON AddressTypeID | Clustered index created by a primary key constraint. | |
AK_AddressType_Name | ON Name | Unique nonclustered index. | |
AK_AddressType_rowguid | ON rowguid | Unique nonclustered index. Used to support replication samples. |
Source of the ID that connects vendors, customers, and employees with address and contact information.
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | BusinessEntityID | int AUTOINCREMENT | Primary key for all customers, vendors, and employees. |
* | rowguid | uniqueidentifier DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_BusinessEntity_BusinessEntityID | ON BusinessEntityID | Clustered index created by a primary key constraint. | |
AK_BusinessEntity_rowguid | ON rowguid | Unique nonclustered index. Used to support replication samples. |
Cross-reference table mapping customers, vendors, and employees to their addresses.
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | BusinessEntityID | int | Primary key. Foreign key to BusinessEntity.BusinessEntityID. |
* | AddressID | int | Primary key. Foreign key to Address.AddressID. |
* | AddressTypeID | int | Primary key. Foreign key to AddressType.AddressTypeID. |
* | rowguid | uniqueidentifier DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_BusinessEntityAddress_BusinessEntityID_AddressID_AddressTypeID | ON BusinessEntityID, AddressID, AddressTypeID | Clustered index created by a primary key constraint. | |
AK_BusinessEntityAddress_rowguid | ON rowguid | Unique nonclustered index. Used to support replication samples. | |
IX_BusinessEntityAddress_AddressID | ON AddressID | Nonclustered index. | |
IX_BusinessEntityAddress_AddressTypeID | ON AddressTypeID | Nonclustered index. | |
Foreign Keys | |||
FK_BusinessEntityAddress_Address_AddressID | ( AddressID ) ref Address (AddressID) | Foreign key constraint referencing Address.AddressID. | |
FK_BusinessEntityAddress_AddressType_AddressTypeID | ( AddressTypeID ) ref AddressType (AddressTypeID) | Foreign key constraint referencing AddressType.AddressTypeID. | |
FK_BusinessEntityAddress_BusinessEntity_BusinessEntityID | ( BusinessEntityID ) ref BusinessEntity (BusinessEntityID) | Foreign key constraint referencing BusinessEntity.BusinessEntityID. |
Cross-reference table mapping stores, vendors, and employees to people
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | BusinessEntityID | int | Primary key. Foreign key to BusinessEntity.BusinessEntityID. |
* | PersonID | int | Primary key. Foreign key to Person.BusinessEntityID. |
* | ContactTypeID | int | Primary key. Foreign key to ContactType.ContactTypeID. |
* | rowguid | uniqueidentifier DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID | ON BusinessEntityID, PersonID, ContactTypeID | Clustered index created by a primary key constraint. | |
AK_BusinessEntityContact_rowguid | ON rowguid | Unique nonclustered index. Used to support replication samples. | |
IX_BusinessEntityContact_ContactTypeID | ON ContactTypeID | Nonclustered index. | |
IX_BusinessEntityContact_PersonID | ON PersonID | Nonclustered index. | |
Foreign Keys | |||
FK_BusinessEntityContact_BusinessEntity_BusinessEntityID | ( BusinessEntityID ) ref BusinessEntity (BusinessEntityID) | Foreign key constraint referencing BusinessEntity.BusinessEntityID. | |
FK_BusinessEntityContact_ContactType_ContactTypeID | ( ContactTypeID ) ref ContactType (ContactTypeID) | Foreign key constraint referencing ContactType.ContactTypeID. | |
FK_BusinessEntityContact_Person_PersonID | ( PersonID ) ref Person (BusinessEntityID) | Foreign key constraint referencing Person.BusinessEntityID. |
Lookup table containing the types of business entity contacts.
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | ContactTypeID | int AUTOINCREMENT | Primary key for ContactType records. |
* | Name | name | Contact type description. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_ContactType_ContactTypeID | ON ContactTypeID | Clustered index created by a primary key constraint. | |
AK_ContactType_Name | ON Name | Unique nonclustered index. |
Lookup table containing the ISO standard codes for countries and regions.
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | CountryRegionCode | nvarchar( 3 ) | ISO standard code for countries and regions. |
* | Name | name | Country or region name. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_CountryRegion_CountryRegionCode | ON CountryRegionCode | Clustered index created by a primary key constraint. | |
AK_CountryRegion_Name | ON Name | Unique nonclustered index. |
Where to send a person email.
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | BusinessEntityID | int | Primary key. Person associated with this email address. Foreign key to Person.BusinessEntityID |
* | EmailAddressID | int AUTOINCREMENT | Primary key. ID of this email address. |
EmailAddress | nvarchar( 50 ) | E-mail address for the person. | |
* | rowguid | uniqueidentifier DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_EmailAddress_BusinessEntityID_EmailAddressID | ON BusinessEntityID, EmailAddressID | Clustered index created by a primary key constraint. | |
IX_EmailAddress_EmailAddress | ON EmailAddress | Nonclustered index. | |
Foreign Keys | |||
FK_EmailAddress_Person_BusinessEntityID | ( BusinessEntityID ) ref Person (BusinessEntityID) | Foreign key constraint referencing Person.BusinessEntityID. |
One way hashed authentication information
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | BusinessEntityID | int | |
* | PasswordHash | varchar( 128 ) | Password for the e-mail account. |
* | PasswordSalt | varchar( 10 ) | Random value concatenated with the password string before the password is hashed. |
* | rowguid | uniqueidentifier DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_Password_BusinessEntityID | ON BusinessEntityID | Clustered index created by a primary key constraint. | |
Foreign Keys | |||
FK_Password_Person_BusinessEntityID | ( BusinessEntityID ) ref Person (BusinessEntityID) | Foreign key constraint referencing Person.BusinessEntityID. |
Human beings involved with AdventureWorks: employees, customer contacts, and vendor contacts.
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | BusinessEntityID | int | Primary key for Person records. |
* | PersonType | nchar( 2 ) | Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor contact, GC = General contact |
* | NameStyle | namestyle DEFAULT 0 | 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. |
Title | nvarchar( 8 ) | A courtesy title. For example, Mr. or Ms. | |
* | FirstName | name | First name of the person. |
MiddleName | name | Middle name or middle initial of the person. | |
* | LastName | name | Last name of the person. |
Suffix | nvarchar( 10 ) | Surname suffix. For example, Sr. or Jr. | |
* | EmailPromotion | int DEFAULT 0 | 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e-mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions from AdventureWorks and selected partners. |
AdditionalContactInfo | xml | Additional contact information about the person stored in xml format. | |
Demographics | xml | Personal information such as hobbies, and income collected from online shoppers. Used for sales analysis. | |
* | rowguid | uniqueidentifier DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_Person_BusinessEntityID | ON BusinessEntityID | Clustered index created by a primary key constraint. | |
AK_Person_rowguid | ON rowguid | Unique nonclustered index. Used to support replication samples. | |
IX_Person_LastName_FirstName_MiddleName | ON LastName, FirstName, MiddleName | ||
Foreign Keys | |||
FK_Person_BusinessEntity_BusinessEntityID | ( BusinessEntityID ) ref BusinessEntity (BusinessEntityID) | Foreign key constraint referencing BusinessEntity.BusinessEntityID. | |
Constraints | |||
CK_Person_PersonType | [PersonType] IS NULL OR (upper([PersonType])='GC' OR upper([PersonType])='SP' OR upper([PersonType])='EM' OR upper([PersonType])='IN' OR upper([PersonType])='VC' OR upper([PersonType])='SC') | ||
CK_Person_EmailPromotion | [EmailPromotion]>=(0) AND [EmailPromotion]<=(2) | ||
Triggers | |||
iuPerson |
Telephone number and type of a person.
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | BusinessEntityID | int | Business entity identification number. Foreign key to Person.BusinessEntityID. |
* | PhoneNumber | phone | Telephone number identification number. |
* | PhoneNumberTypeID | int | Kind of phone number. Foreign key to PhoneNumberType.PhoneNumberTypeID. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_PersonPhone_BusinessEntityID_PhoneNumber_PhoneNumberTypeID | ON BusinessEntityID, PhoneNumber, PhoneNumberTypeID | Clustered index created by a primary key constraint. | |
IX_PersonPhone_PhoneNumber | ON PhoneNumber | Nonclustered index. | |
Foreign Keys | |||
FK_PersonPhone_Person_BusinessEntityID | ( BusinessEntityID ) ref Person (BusinessEntityID) | Foreign key constraint referencing Person.BusinessEntityID. | |
FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID | ( PhoneNumberTypeID ) ref PhoneNumberType (PhoneNumberTypeID) | Foreign key constraint referencing PhoneNumberType.PhoneNumberTypeID. |
Type of phone number of a person.
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | PhoneNumberTypeID | int AUTOINCREMENT | Primary key for telephone number type records. |
* | Name | name | Name of the telephone number type |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_PhoneNumberType_PhoneNumberTypeID | ON PhoneNumberTypeID | Clustered index created by a primary key constraint. |
State and province lookup table.
Indexes | Field Name | Data Type | Description |
---|---|---|---|
* | StateProvinceID | int AUTOINCREMENT | Primary key for StateProvince records. |
* | StateProvinceCode | nchar( 3 ) | ISO standard state or province code. |
* | CountryRegionCode | nvarchar( 3 ) | ISO standard country or region code. Foreign key to CountryRegion.CountryRegionCode. |
* | IsOnlyStateProvinceFlag | flag DEFAULT 1 | 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using CountryRegionCode. |
* | Name | name | State or province description. |
* | TerritoryID | int | ID of the territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID. |
* | rowguid | uniqueidentifier DEFAULT newid() | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
* | ModifiedDate | datetime DEFAULT getdate() | Date and time the record was last updated. |
Indexes | |||
PK_StateProvince_StateProvinceID | ON StateProvinceID | Clustered index created by a primary key constraint. | |
AK_StateProvince_Name | ON Name | Unique nonclustered index. | |
AK_StateProvince_rowguid | ON rowguid | Unique nonclustered index. Used to support replication samples. | |
AK_StateProvince_StateProvinceCode_CountryRegionCode | ON StateProvinceCode, CountryRegionCode | Unique nonclustered index. | |
Foreign Keys | |||
FK_StateProvince_CountryRegion_CountryRegionCode | ( CountryRegionCode ) ref CountryRegion (CountryRegionCode) | Foreign key constraint referencing CountryRegion.CountryRegionCode. | |
FK_StateProvince_SalesTerritory_TerritoryID | ( TerritoryID ) ref SalesTerritory (TerritoryID) | Foreign key constraint referencing SalesTerritory.TerritoryID. |