Programming & Development / April 11, 2025

How to Represent Eritrea’s Regions in Java and SQL Using ISO 3166-2 Codes

Eritrea regions Java enum Eritrea ISO 3166-2 ER SQL Eritrea regions ER region codes Eritrea administrative divisions backend region enum Eritrea provinces Java SQL Spring Boot ISO codes

🇪🇷 Java Enum: Eritrea’s Regions

Eritrea is divided into 6 regions (also known as zobas), each with an ISO 3166-2:ER code. Here’s the Java enum:

java

public enum EritreaRegion {
    ANSEBA("ER-AN"),
    DEBUB("ER-DU"),
    DEBUBAWI_KEYIH_BAHRI("ER-DK"),
    GASH_BARKA("ER-GB"),
    MAEKEL("ER-MA"),
    SEMENAWI_KEYIH_BAHRI("ER-SK");

    private final String code;

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

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

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

INSERT INTO eritrea_regions (name, code) VALUES
('Anseba', 'ER-AN'),
('Debub', 'ER-DU'),
('Debubawi Keyih Bahri', 'ER-DK'),
('Gash-Barka', 'ER-GB'),
('Maekel', 'ER-MA'),
('Semenawi Keyih Bahri', 'ER-SK');

✅ Summary

This structure provides full support for all 6 Eritrean regions, using the official ISO 3166-2:ER codes — ready for Java applications, SQL databases, and RESTful services.


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