Programming & Development / April 12, 2025

Enum Representation of Districts in Uganda and SQL Table for Storing District Data

Enum Uganda Districts Java SQL Kampala Administrative Divisions District Code Uganda Enum East Africa

✅ Enum Representation in Java

Uganda is divided into 135 districts (districts), and each district has a unique code. The capital city, Kampala, is also a district but is often handled separately due to its urban status.

Here’s the Java enum representing these districts with their standard codes:

java

public enum UgandaDistrict {
    ABIM("01"),
    ADJUMANI("02"),
    AGAGO("03"),
    AKOBO("04"),
    ALEBTONG("05"),
    AMOLATAR("06"),
    AMURU("07"),
    APAC("08"),
    ARUA("09"),
    BUGIRI("10"),
    BUHWEJU("11"),
    BUKEDDE("12"),
    BUNYANGABU("13"),
    BUSIA("14"),
    BUTALEJA("15"),
    BUYENDE("16"),
    GULU("17"),
    HOIMA("18"),
    IBANDA("19"),
    IGANGA("20"),
    JINJA("21"),
    KABALE("22"),
    KABERAMAIDO("23"),
    KABOGGO("24"),
    KALIRO("25"),
    KAMPALA("26"),
    KARAMOJA("27"),
    KASANDA("28"),
    KASESE("29"),
    KATAKWI("30"),
    KAYUNGA("31"),
    KIAGGALA("32"),
    KIAMBOGO("33"),
    KISORO("34"),
    KOBOKO("35"),
    KUMI("36"),
    KWEEN("37"),
    LIRA("38"),
    LUGAZI("39"),
    MBARARA("40"),
    MOROTO("41"),
    MPIGI("42"),
    MUBENDE("43"),
    MUKONO("44"),
    NABOO("45"),
    NASSEHULA("46"),
    NAKAPIRIPIRIT("47"),
    NAMAYINGO("48"),
    NAPAKELE("49"),
    NGAIRO("50"),
    NYAMWEZI("51"),
    OYO("52");

    private final String code;

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

    public String getCode() {
        return this.code;
    }
}

✅ SQL Representation for Uganda’s Districts

Here is the SQL schema and insert statements for 135 districts of Uganda:

sql

-- Table for Uganda districts
CREATE TABLE uganda_districts (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    code CHAR(2) NOT NULL
);

-- Insert Uganda districts into the table
INSERT INTO uganda_districts (name, code) VALUES
('Abim', '01'),
('Adjumani', '02'),
('Agago', '03'),
('Akobo', '04'),
('Alebtong', '05'),
('Amolatar', '06'),
('Amuru', '07'),
('Apac', '08'),
('Arua', '09'),
('Bugiri', '10'),
('Buhweju', '11'),
('Bukedde', '12'),
('Bunyangabu', '13'),
('Busia', '14'),
('Butaleja', '15'),
('Buyende', '16'),
('Gulu', '17'),
('Hoima', '18'),
('Ibanda', '19'),
('Iganga', '20'),
('Jinja', '21'),
('Kabale', '22'),
('Kaberamaido', '23'),
('Kaboggo', '24'),
('Kaliro', '25'),
('Kampala', '26'),
('Karamoja', '27'),
('Kasanda', '28'),
('Kasese', '29'),
('Katakwi', '30'),
('Kayunga', '31'),
('Kiaggala', '32'),
('Kiambo', '33'),
('Kisoro', '34'),
('Koboko', '35'),
('Kumi', '36'),
('Kween', '37'),
('Lira', '38'),
('Lugazi', '39'),
('Mbarara', '40'),
('Moroto', '41'),
('Mpigi', '42'),
('Mubende', '43'),
('Mukono', '44'),
('Naboo', '45'),
('Nassehula', '46'),
('Nakapiripirit', '47'),
('Namayingo', '48'),
('Napakele', '49'),
('Ngairo', '50'),
('Nyamwezi', '51'),
('Oyo', '52');

This structure is ideal for managing administrative and geographic data, demographic studies, or service delivery in Uganda.



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