AdventureWorks
Person.CountryRegion Table
Description
Lookup table containing the ISO standard codes for countries and regions.
Properties
Creation Date08/01/2010 08:40
File GroupPRIMARY
Text File Group
System Object
Published for Replication
Rows238
Data Space Used16.00 KB
Index Space Used32.00 KB
Columns
 Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
Primary Key CountryRegionCodeISO standard code for countries and regions.nvarchar3   
 NameCountry or region name.dbo.Name50   
 ModifiedDateDate and time the record was last updated.datetime4 
(getdate())
 
Indexes
IndexDescriptionPrimaryUnique
AK_CountryRegion_NameUnique nonclustered index. 
PK_CountryRegion_CountryRegionCodePrimary key (clustered) constraint
Relationships
RelationshipDescription
FK_CountryRegionCurrency_CountryRegion_CountryRegionCodeForeign key constraint referencing CountryRegion.CountryRegionCode.
FK_StateProvince_CountryRegion_CountryRegionCodeForeign key constraint referencing CountryRegion.CountryRegionCode.
Objects that depend on Person.CountryRegion
 Database ObjectObject TypeDescriptionDep Level
Person.Address tablePerson.AddressTableStreet address information for customers, employees, and vendors.2
Sales.CountryRegionCurrency tableSales.CountryRegionCurrencyTableCross-reference table mapping ISO currency codes to a country or region.1
Sales.CustomerAddress tableSales.CustomerAddressTableCross-reference table mapping customers to their address(es).3
HumanResources.EmployeeAddress tableHumanResources.EmployeeAddressTableCross-reference table mapping employees to their address(es).3
iduSalesOrderDetail triggeriduSalesOrderDetailTriggerAFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column.5
Sales.SalesOrderDetail tableSales.SalesOrderDetailTableIndividual products associated with a specific sales order. See SalesOrderHeader.4
Sales.SalesOrderHeader tableSales.SalesOrderHeaderTableGeneral sales order information.3
Sales.SalesOrderHeaderSalesReason tableSales.SalesOrderHeaderSalesReasonTableCross-reference table mapping sales orders to sales reason codes.4
Sales.SalesTaxRate tableSales.SalesTaxRateTableTax rate lookup table.2
Person.StateProvince tablePerson.StateProvinceTableState and province lookup table.1
uSalesOrderHeader triggeruSalesOrderHeaderTriggerAFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the SalesOrderHeader table.Updates the SalesYTD column in the SalesPerson and SalesTerritory tables.4
HumanResources.vEmployee viewHumanResources.vEmployeeViewEmployee names and addresses.1
Purchasing.VendorAddress tablePurchasing.VendorAddressTableCross-reference mapping vendors and addresses.3
Sales.vIndividualCustomer viewSales.vIndividualCustomerViewIndividual customers (names and addresses) that purchase Adventure Works Cycles products online.1
Sales.vSalesPerson viewSales.vSalesPersonViewSales representiatives (names and addresses) and their sales-related information.1
Sales.vSalesPersonSalesByFiscalYears viewSales.vSalesPersonSalesByFiscalYearsViewUses PIVOT to return aggregated sales information for each sales representative.4
Person.vStateProvinceCountryRegion viewPerson.vStateProvinceCountryRegionViewJoins StateProvince table with CountryRegion table.1
Sales.vStoreWithDemographics viewSales.vStoreWithDemographicsViewStores (names and addresses) that sell Adventure Works Cycles products to consumers.1
Purchasing.vVendor viewPurchasing.vVendorViewVendor (company) names and addresses and the names of vendor employees to contact.1
Objects that Person.CountryRegion depends on
 Database ObjectObject TypeDescriptionDep Level
dbo.Name datatypedbo.NameUser Defined Data Type 1
SQL
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [Person].[CountryRegion](
	[CountryRegionCode] [nvarchar](3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[Name] [dbo].[Name] NOT NULL,
	[ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_CountryRegion_CountryRegionCode] PRIMARY KEY CLUSTERED 
(
	[CountryRegionCode] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

ALTER TABLE [Person].[CountryRegion] ADD  CONSTRAINT [DF_CountryRegion_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
See Also

Related Objects

Person Schema
AdventureWorks Database

 

 


© 2012 All Rights Reserved.

Send comments on this topic.