GitPedia

Vietnamese provinces database

A complete SQL dataset of Vietnamese administrative units, includes Vietnamese provinces, districts and wards

From thanglequoc·Updated June 25, 2026·View on GitHub·

A complete SQL (and also non-SQL) databases of Vietnamese administrative units, includes all **34 Vietnamese provinces** and associated districts, wards sub-divisions. Data is updated as of the most recent effective decree: [30/2026/QH16][source government decree] **Add-on includes**: SQL GIS Dataset The project is written primarily in PLpgSQL, distributed under the MIT License license, first published in 2021. It has gained significant community traction with 1,195 stars and 297 forks on GitHub. Key topics include: database, dataset, districts, locality, provinces.

Latest release: v4.0.0🌏 Dữ liệu GIS của các đơn vị hành chính Việt Nam
June 21, 2026View Changelog →

Repository Banner
Made in Vietnam

Đọc phiên bản tiếng Việt

Vietnamese Provinces Database

A complete SQL (and also non-SQL) databases of Vietnamese administrative units, includes all 34 Vietnamese provinces and associated districts, wards sub-divisions.
Data is updated as of the most recent effective decree: 30/2026/QH16
Add-on includes: SQL GIS Dataset

If you find this repository helpful, please consider giving it a ⭐ — it helps us stay motivated to keep improving and delivering valuable tools for the community. Also, starring the repo makes it easier to stay updated with future releases.

Overview

The author(s) of this repository is not associated with the General Statistics Office of Vietnam, nor the Vietnamese government.
The data of provinces and wards are created base on the API province data provided by the General Statistics Office of Vietnam website.

This dataset also include additional information apart from the original provinces, wards data from the original data. Please see section Additional change make by this repository.

Dataset releases and Government issued decrees

The Vietnamese Government may issue decree from time to time to adjust the administrative unit structure. You can track the latest issued decrees here.

The following table contains a list of issued decrees and their effective dates, tracked from the earliest version of this dataset.

Issued Decree/DescriptionIssued onEffect fromRelease Version
Add GIS dataset------v4.0.0
30/2026/QH16, 237/NQ-UBTVQH1614/04/202630/04/2026v3.1.0
19/2025/QĐ-TTg30/06/202501/07/2025v3.0.2
Grammar-correction, data cutoff before 19/2025/QĐ-TTg15/01/202501/03/2025v2.4.1
1365/NQ-UBTVQH1515/01/202501/03/2025v2.4.0
1318/NQ-UBTVQH1530/11/202401/01/2025v2.3.0
1203/NQ-UBTVQH1528/09/202401/11/2024v2.2.0
1106/NQ-UBTVQH1523/07/202401/09/2024v2.1.0
1013/NQ-UBTVQH1519/03/202401/05/2024v2.0.1
939/NQ-UBTVQH1513/12/202301/02/2024v2.0.0
From 721/NQ-UBTVQH15 to<br>730/NQ-UBTVQH1513/02/202310/04/2023v1.0.4.1
569/NQ-UBTVQH15,<br>570/NQ-UBTVQH1511/08/202201/10/2022v1.0.3.1
510/NQ-UBTVQH1512/05/202201/07/2022v1.0.2
469/NQ-UBTVQH1515/02/202210/04/2022v1.0.1
387/NQ-UBTVQH1522/09/202101/11/2021v1.0.0

Additional Changes Made by This Repository

  • Added administrative_regions table
  • Added administrative_units table
  • Assigned administrative units to province and ward data
  • Generated English names for provinces and wards, offering both full and short forms
  • Generated code names (slugs) for provinces and wards
  • Add-on: Additional GIS dataset for administrative units

Installation

Create a database (if applicable):

sql
CREATE DATABASE vietnamese_administrative_units;

Then execute the following scripts in order:

  1. CreateTable_vn_units.sql – creates the database schema.
  2. ImportData_vn_units.sql – imports the dataset.

Choose the scripts from the corresponding database directory:

DatabaseDirectory
PostgreSQLpostgresql/
MySQL / MariaDBmysql/
Microsoft SQL Serversqlserver/
Oracleoracle/

Oracle users may use an existing database/schema, as database creation is environment-specific.

Tables Schema

VN_administrative_units db

administrative_regions table

VN Geographical Regions
The administrative_regions table contains the list of 8 Vietnamese geographical regions with the id increment following the region location from North to South.

Table definition

ColumnData typeMeaningConstraint
idintegerId of the regionPrimary Key
namevarchar(255)Region name in Vietnamese
name_envarchar(255)Region name in English
code_namevarchar(255)Code name, derived from Vietnamese name, written in lowercase, underscored
code_name_envarchar(255)Code name, derived from English name, written in lowercase, underscored

Data preview

idnamename_encode_namecode_name_en
1Đông Bắc BộNortheastdong_bac_bonorthest
2Tây Bắc BộNorthwesttay_bac_bonorthwest
3Đồng bằng sông HồngRed River Deltadong_bang_song_hongred_river_delta
4Bắc Trung BộNorth Central Coastbac_trung_bonorth_central_coast
5Duyên hải Nam Trung BộSouth Central Coastduyen_hai_nam_trung_bosouth_central_coast
6Tây NguyênCentral Highlandstay_nguyencentral_highlands
7Đông Nam BộSoutheastdong_nam_bosoutheast
8Đồng bằng sông Cửu LongMekong River Deltadong_bang_song_cuu_longsouthwest

administrative_units table

VN Units

The administrative_units table contains a list of administrative units with id sorted by two tier levels.

Table definition

ColumnData typeMeaningConstraint
idintegerId of the administrative unitPrimary Key
full_namevarchar(255)Full name of the administrative unit in Vietnamese
full_name_envarchar(255)Full name of the administrative unit in English
short_namevarchar(255)Short name of the administrative unit in Vietnamese
short_name_envarchar(255)Short name of the administrative unit in English
code_namevarchar(255)Code name, derived from Vietnamese full_name, written in lowercase, underscored
code_name_envarchar(255)Code name, derived from English full_name_en, written in lowercase, underscored

Data preview

idfull_namefull_name_enshort_nameshort_name_encode_namecode_name_en
1Thành phố trực thuộc trung ươngMunicipalityThành phốCitythanh_pho_truc_thuoc_trung_uongmunicipality
2TỉnhProvinceTỉnhProvincetinhprovince
3PhườngWardPhườngWardphuongward
4CommuneCommunexacommune
5Đặc khu tại hải đảoSpecial administrative regionĐặc khuSpecial administrative regiondac_khuspecial_administrative_region

provinces table

Provincial level

The provinces table contains a list of first administrative tier - the provincial level units, includes 34 municipalities and provinces.

Table definition

ColumnData typeMeaningConstraint
codevarchar(20)The official unit code, defined by governmentPrimary Key
namevarchar(255)Name in Vietnamese
name_envarchar(255)Name of in English
full_namevarchar(255)Full name in Vietnamese, includes the administrative unit name
full_name_envarchar(255)Full name in English, includes the administrative unit name
code_namevarchar(255)Code name, derived from name, written in lowercase, underscored
administrative_unit_idintegerThe administrative unit id of this recordForeign Key, references to administrative_units.id

Data preview

codenamename_enfull_namefull_name_encode_nameadministrative_unit_id
01Hà NộiHa NoiThành phố Hà NộiHa Noi Cityha_noi1
56Khánh HòaKhanh HoaTỉnh Khánh HòaKhanh Hoa Provincekhanh_hoa2
79Hồ Chí MinhHo Chi MinhThành phố Hồ Chí MinhHo Chi Minh Cityho_chi_minh1
96Cà MauCa MauTỉnh Cà MauCa Mau Provinceca_mau2
..........................................................................

wards table

Commune level
The wards table contains a list of second administrative tier - the commune level units, includes 3321 wards, communes and special administrative region.

Table definition

ColumnData typeMeaningConstraint
codevarchar(20)The official unit code, defined by governmentPrimary Key
namevarchar(255)Name in Vietnamese
name_envarchar(255)Name of in English
full_namevarchar(255)Full name in Vietnamese, includes the administrative unit name
full_name_envarchar(255)Full name in English, includes the administrative unit name
code_namevarchar(255)Code name, derived from name, written in lowercase, underscored
province_codevarchar(20)The province this record belongs toForeign Key, references to provinces.code
administrative_unit_idintegerThe administrative unit id of this recordForeign Key, references to administrative_units.id

Data preview

codenamename_enfull_namefull_name_encode_nameprovince_codeadministrative_unit_id
25920Tân HiệpTan HiepPhường Tân HiệpTan Hiep Wardtan_hiep793
25942Dĩ AnDi AnPhường Dĩ AnDi An Warddi_an793
25945Tân Đông HiệpTan Dong HiepPhường Tân Đông HiệpTan Dong Hiep Wardtan_dong_hiep793
25951Đông HòaDong HoaPhường Đông HòaDong Hoa Warddong_hoa793
25966Lái ThiêuLai ThieuPhường Lái ThiêuLai Thieu Wardlai_thieu793
25969Thuận GiaoThuan GiaoPhường Thuận GiaoThuan Giao Wardthuan_giao793
25975An PhúAn PhuPhường An PhúAn Phu Wardan_phu793

Sample Queries

You can easily create query to get all the kind of data you need since the tables are clearly referenced between each others.
Here is some sample queries to start with:

Get all wards under a province

Get all wards under Khánh Hoà province

sql
SELECT w.code, w."name" , w.full_name , w.full_name_en ,au.full_name as administrative_unit_name FROM wards w INNER JOIN administrative_units au ON w.administrative_unit_id = au.id WHERE w.province_code = '56' -- Khanh Hoa province code ORDER BY w.code;
codenamefull_namefull_name_enadministrative_unit_name
22333Bắc Nha TrangPhường Bắc Nha TrangBac Nha Trang WardPhường
22366Nha TrangPhường Nha TrangNha Trang WardPhường
22390Tây Nha TrangPhường Tây Nha TrangTay Nha Trang WardPhường
22402Nam Nha TrangPhường Nam Nha TrangNam Nha Trang WardPhường
22411Bắc Cam RanhPhường Bắc Cam RanhBac Cam Ranh WardPhường
22420Cam RanhPhường Cam RanhCam Ranh WardPhường
22423Ba NgòiPhường Ba NgòiBa Ngoi WardPhường
22432Cam LinhPhường Cam LinhCam Linh WardPhường

Non-SQL Formats

Along with traditional SQL dataset, the Vietnamese Provinces Database also comes with non-sql data format, this includes

  • JSON format (feature full, simplified and vn_only_simplified versions)
  • MongoDB
  • Redis

Add-ons

In addition to the administrative units dataset, this repository also includes optional add-on data extend its functionality.

GIS Dataset

image.png

The GIS add-on provides administrative boundary geometries for Vietnamese administrative units and is available for

  • PostgreSQL/PostGIS
  • MySQL
  • Microsoft SQL Server

See GIS Dataset

FAQ

What is the original data source that this repository develope from?

The data of provinces and wards are created base on the API province data provided by the General Statistics Office of Vietnam website.

GIS boundary data was derived from the Vietnam Administrative Units Reference Map, published by the Vietnam Natural Resources, Environment and Cartography Publishing House under the Ministry of Agriculture and Environment.

How are the primary keys defined?

TablePrimary Key
administrative_regionsKey: id. Starting from 1 to 8, follow the geographical location order from North to South
administrative_unitsKey: id. Starting from 1 to 5, follow the tier order from biggest unit to smallest unit
provincesKey: code. Officially referenced from government unit code
wardsKey: code. Officially referenced from government unit code

The province - administrative region relationship is dropped from v3.0.0?

After the provinces merge down to 37 provinces, the new province e.g: Phú Thọ, which is formed from Vĩnh Phúc, Phú Thọ and Hoà Bình that previously span across 3 different regions, so it's no longer applicable to determine which region does the new province belongs to.

Can I use this dataset in commercial projects?

Yes. Absolutely.
This dataset is released under the MIT License, allowing you to use, modify, and distribute it freely in both personal and commercial projects.
No registration, permission request, or licensing fee is required.

If you find the project useful, consider giving it a star ⭐ on GitHub or contributing improvements back to the community.

This repository is an independent community project and is not affiliated with the General Statistics Office of Vietnam or any Vietnamese government agency. The dataset is provided “as is” without warranty of any kind.

I saw some issues in the SQL patch?

If you see any improvement that can be made, please kindly Open a issue and write down your finding. Or even better by Create a Pull Request.
Any contribution is welcomed.

Reference

Vietnam Map in the banner by vietcentertourist

Contributors

<a href="https://github.com/thanglequoc/vietnamese-provinces-database/graphs/contributors"> <img src="https://contrib.rocks/image?repo=thanglequoc/vietnamese-provinces-database" /> </a>

It has been a long run to reach for the ⭐

This project has been around since 2022 and is still actively maintained today.
The continued support from the community — shown through stars, issues, and contributions — has been a big motivation to keep improving it. Thank you for helping this project grow!
Star History Chart

Contributors

Showing top 4 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from thanglequoc/vietnamese-provinces-database via the GitHub API.Last fetched: 6/25/2026