← All tables and views

AdventureWorks OLTP view

Person.vStateProvinceCountryRegion

Native view in the AdventureWorks OLTP sample database.

181rows

7 columns

Schema from the provider contract
ColumnTypeNullableKeyReferences
StateProvinceIDyes——
StateProvinceCodeyes——
IsOnlyStateProvinceFlagyes——
StateProvinceNameyes——
TerritoryIDyes——
CountryRegionCodeyes——
CountryRegionNameyes——

View definition

CREATE VIEW "Person.vStateProvinceCountryRegion" AS
SELECT
    sp."StateProvinceID"
    ,sp."StateProvinceCode"
    ,sp."IsOnlyStateProvinceFlag"
    ,sp."Name" AS "StateProvinceName"
    ,sp."TerritoryID"
    ,cr."CountryRegionCode"
    ,cr."Name" AS "CountryRegionName"
FROM "Person.StateProvince" sp
    INNER JOIN "Person.CountryRegion" cr
    ON sp."CountryRegionCode" = cr."CountryRegionCode"

Data preview

Sample records

181 rows available
StateProvinceIDStateProvinceCodeIsOnlyStateProvinceFlagStateProvinceNameTerritoryIDCountryRegionCodeCountryRegionName
1AB 0Alberta6CACanada
2AK 0Alaska1USUnited States
3AL 0Alabama5USUnited States
4AR 0Arkansas3USUnited States
5AS 1American Samoa1ASAmerican Samoa
6AZ 0Arizona4USUnited States
7BC 0British Columbia6CACanada
8BY 0Bayern8DEGermany