Programming & Development / April 11, 2025

Modeling Nicaragua's Departments in Java and SQL Using ISO 3166-2:NI Codes

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

🇳🇮 Java Enum: Nicaragua's Departments

Nicaragua is divided into 15 departments and 2 autonomous regions, each with its official ISO 3166-2:NI code.

java

public enum NicaraguaDepartment {
    BOACO("NI-BO"),
    CHONTALES("NI-CO"),
    CORDOBA("NI-CI"),
    ESTELI("NI-ES"),
    GRANADA("NI-GR"),
    JINOTEGA("NI-JI"),
    LEON("NI-LE"),
    MADRIZ("NI-MD"),
    MANAGUA("NI-MN"),
    MASAYA("NI-MS"),
    MATAGALPA("NI-MT"),
    NUEVA_SEGOVIA("NI-NS"),
    RIVAS("NI-RI"),
    REGIONES_AUTONOMAS_DEL_ATLANTICO_NORTE("NI-AN"),
    REGIONES_AUTONOMAS_DEL_ATLANTICO_SUR("NI-AS");

    private final String code;

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

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

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

INSERT INTO nicaragua_departments (name, code) VALUES
('Boaco', 'NI-BO'),
('Chontales', 'NI-CO'),
('Córdoba', 'NI-CI'),
('Estelí', 'NI-ES'),
('Granada', 'NI-GR'),
('Jinotega', 'NI-JI'),
('León', 'NI-LE'),
('Madriz', 'NI-MD'),
('Managua', 'NI-MN'),
('Masaya', 'NI-MS'),
('Matagalpa', 'NI-MT'),
('Nueva Segovia', 'NI-NS'),
('Rivas', 'NI-RI'),
('Región Autónoma del Atlántico Norte', 'NI-AN'),
('Región Autónoma del Atlántico Sur', 'NI-AS');

✅ Summary

This setup models Nicaragua's departments and autonomous regions with their ISO 3166-2:NI codes. It can be applied in backend systems, geographic applications, or databases dealing with Nicaragua's administrative units.



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