Programming & Development / April 11, 2025

Modeling Niger's Regions in Java and SQL Using ISO 3166-2:NE Codes

Niger regions Niger departments Java enum Niger ISO 3166-2 NE SQL Niger Niger subdivisions Spring Boot geographic enum Niger administrative units backend regions Niger regions of Niger

🇳🇪 Java Enum: Niger's Regions

Niger is divided into 8 regions, each with its official ISO 3166-2:NE code.

java

public enum NigerRegion {
    AGADEZ("NE-1"),
    DIFFA("NE-2"),
    TAHOUA("NE-3"),
    TILLABERI("NE-4"),
    ZINDER("NE-5"),
    MARADI("NE-6"),
    DOSSO("NE-7"),
    NIAMEY("NE-8");

    private final String code;

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

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

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

INSERT INTO niger_regions (name, code) VALUES
('Agadez', 'NE-1'),
('Diffa', 'NE-2'),
('Tahoua', 'NE-3'),
('Tillabéri', 'NE-4'),
('Zinder', 'NE-5'),
('Maradi', 'NE-6'),
('Dosso', 'NE-7'),
('Niamey', 'NE-8');

✅ Summary

This setup models Niger's regions with their ISO 3166-2:NE codes. It can be used in backend systems, geographic applications, or databases dealing with Niger's administrative regions.



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