Programming & Development / April 11, 2025

How to Represent Armenia’s Provinces in Java and SQL Using ISO 3166-2 Codes

Armenia provinces Java enum Armenia ISO 3166-2 AM SQL Armenia regions Armenia administrative divisions Spring Boot enum Armenian provinces list AM region codes Armenia region codes provinces of Armenia

🇦🇲 Java Enum: Armenia’s Provinces (Marzes)

Armenia is divided into 11 provinces (Marzes) and the capital city, Yerevan. Here’s the Java enum using the ISO 3166-2:AM codes.

java

public enum ArmeniaProvince {
    ARAGATSOTN("AM-AG"),
    ARARAT("AM-AR"),
    ARMAVIR("AM-AV"),
    GEGHARKUNIK("AM-GK"),
    KOTAYK("AM-KT"),
    VAYOTS_DZOR("AM-VD"),
    LORI("AM-LOR"),
    SHIRAK("AM-SH"),
    SYUNIK("AM-SY"),
    TAVUSH("AM-TV"),
    YEREVAN("AM-YEV");

    private final String code;

    ArmeniaProvince(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

CREATE TABLE armenia_provinces (
    id SERIAL PRIMARY KEY,
    name VARCHAR(64) NOT NULL,
    code VARCHAR(6) NOT NULL UNIQUE
);

INSERT INTO armenia_provinces (name, code) VALUES
('Aragatsotn', 'AM-AG'),
('Ararat', 'AM-AR'),
('Armavir', 'AM-AV'),
('Gegharkunik', 'AM-GK'),
('Kotayk', 'AM-KT'),
('Vayots Dzor', 'AM-VD'),
('Lori', 'AM-LOR'),
('Shirak', 'AM-SH'),
('Syunik', 'AM-SY'),
('Tavush', 'AM-TV'),
('Yerevan', 'AM-YEV');

✅ Summary

This setup represents Armenia’s 11 provinces (Marzes), along with the capital city Yerevan, using the official ISO 3166-2:AM codes. It’s perfect for geolocation, address validation, or administrative processing in your applications.


Comments

No comments yet

Add a new Comment

NUHMAN.COM

Information Technology website for Programming & Development, Web Design & UX/UI, Startups & Innovation, Gadgets & Consumer Tech, Cloud Computing & Enterprise Tech, Cybersecurity, Artificial Intelligence (AI) & Machine Learning (ML), Gaming Technology, Mobile Development, Tech News & Trends, Open Source & Linux, Data Science & Analytics

Categories

Tags

©{" "} Nuhmans.com . All Rights Reserved. Designed by{" "} HTML Codex