Northwind Database (Document! X Sample)
AdventureWorks Database / Person Schema / Person.CountryRegion Table
In This Topic
    Person.CountryRegion Table
    In This Topic
    Description
    Lookup table containing the ISO standard codes for countries and regions.
    Properties
    Creation Date27/10/2017 14:33
    File GroupPRIMARY
    Text File Group
    System Object
    Published for Replication
    Rows238
    Data Space Used16.00 KB
    Index Space Used48.00 KB
    Columns
     Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
    Primary Key ISO standard code for countries and regions.VarWChar3   
     Country or region name.dbo.Name50   
     Date and time the record was last updated.DBTimeStamp4 
    (getdate())
     
    Indexes
    IndexDescriptionPrimaryUnique
    Unique nonclustered index. 
    Primary key (clustered) constraint
    Relationships
    RelationshipDescription
    Foreign key constraint referencing CountryRegion.CountryRegionCode.
    Foreign key constraint referencing CountryRegion.CountryRegionCode.
    Foreign 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.1
    Person.BusinessEntityAddress tablePerson.BusinessEntityAddressTableCross-reference table mapping customers, vendors, and employees to their addresses.1
    Sales.CountryRegionCurrency tableSales.CountryRegionCurrencyTableCross-reference table mapping ISO currency codes to a country or region.1
    Sales.Customer tableSales.CustomerTableCurrent customer information. Also see the Person and Store tables.2
    iduSalesOrderDetail triggeriduSalesOrderDetailTriggerAFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column.3
    Sales.SalesOrderDetail tableSales.SalesOrderDetailTableIndividual products associated with a specific sales order. See SalesOrderHeader.2
    Sales.SalesOrderHeader tableSales.SalesOrderHeaderTableGeneral sales order information.1
    Sales.SalesOrderHeaderSalesReason tableSales.SalesOrderHeaderSalesReasonTableCross-reference table mapping sales orders to sales reason codes.3
    Sales.SalesPerson tableSales.SalesPersonTableSales representative current information.2
    Sales.SalesPersonQuotaHistory tableSales.SalesPersonQuotaHistoryTableSales performance tracking.2
    Sales.SalesTaxRate tableSales.SalesTaxRateTableTax rate lookup table.2
    Sales.SalesTerritory tableSales.SalesTerritoryTableSales territory lookup table.3
    Sales.SalesTerritoryHistory tableSales.SalesTerritoryHistoryTableSales representative transfers to other sales territories.1
    Person.StateProvince tablePerson.StateProvinceTableState and province lookup table.1
    Sales.Store tableSales.StoreTableCustomers (resellers) of Adventure Works products.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.3
    HumanResources.vEmployee viewHumanResources.vEmployeeViewEmployee names and addresses.2
    Sales.vIndividualCustomer viewSales.vIndividualCustomerViewIndividual customers (names and addresses) that purchase Adventure Works Cycles products online.2
    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.3
    Person.vStateProvinceCountryRegion viewPerson.vStateProvinceCountryRegionViewJoins StateProvince table with CountryRegion table.2
    Sales.vStoreWithAddresses viewSales.vStoreWithAddressesViewStores (including store addresses) that sell Adventure Works Cycles products to consumers.1
    Sales.vStoreWithContacts viewSales.vStoreWithContactsViewStores (including store contacts) that sell Adventure Works Cycles products to consumers.1
    Sales.vStoreWithDemographics viewSales.vStoreWithDemographicsViewStores (including demographics) that sell Adventure Works Cycles products to consumers.1
    Purchasing.vVendorWithAddresses viewPurchasing.vVendorWithAddressesViewVendor (company) names and addresses .2
    Objects that Person.CountryRegion depends on
     Database ObjectObject TypeDescriptionDep Level
    dbo.Name datatypedbo.NameUser Defined Data Type 2
    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