Programming & Development / April 11, 2025

Modeling Nauru's Administrative Divisions in Java and SQL Using ISO 3166-2:NR Codes

Nauru Nauru administrative divisions Java enum Nauru ISO 3166-2 NR SQL Nauru Nauru subdivisions Spring Boot geographic enum Nauru backend regions Nauru regions

🇳🇷 Java Enum: Nauru's Administrative Divisions

Nauru is a small island country that is divided into 14 districts, each with its official ISO 3166-2:NR code.

java

public enum NauruDistrict {
    ANIBARE("NR-01"),
    BAIKOKE("NR-02"),
    BOE("NR-03"),
    DENIGOMODU("NR-04"),
    EWA("NR-05"),
    IFOUROU("NR-06"),
    MENENG("NR-07"),
    NIBOK("NR-08"),
    YAREN("NR-09"),
    WABERWA("NR-10"),
    OBEHO("NR-11"),
    RAEGER ("NR-12"),
    TUTSIWAI("NR-13"),
    ZONDI("NR-14");
    
    private final String code;

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

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

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

INSERT INTO nauru_districts (name, code) VALUES
('Anibare', 'NR-01'),
('Baikoke', 'NR-02'),
('Boe', 'NR-03'),
('Denigomodu', 'NR-04'),
('Ewa', 'NR-05'),
('Ifourou', 'NR-06'),
('Meneng', 'NR-07'),
('Nibok', 'NR-08'),
('Yaren', 'NR-09'),
('Waberwa', 'NR-10'),
('Obeho', 'NR-11'),
('Raeger', 'NR-12'),
('Tutsiwai', 'NR-13'),
('Zondi', 'NR-14');

✅ Summary

This setup models Nauru's administrative divisions (or districts) with their ISO 3166-2:NR codes, making it useful for backend systems, geographic data applications, or database management systems.



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