Programming & Development / April 12, 2025

Enum Representation of Provinces in Zambia and SQL Table for Storing Provincial Data

Enum Zambia Provinces Java SQL Lusaka Administrative Divisions Province Code Zambia Enum Africa

✅ Enum Representation in Java

Zambia is divided into 10 provinces, each with its own unique administrative code. The capital city, Lusaka, is in the Lusaka Province, which is one of the 10 provinces of Zambia.

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

java

public enum ZambiaProvince {
    LUSAKA("01"),
    COPPERBELT("02"),
    EASTERN("03"),
    LUAPULA("04"),
    MUCHINGA("05"),
    NORTHERN("06"),
    NORTH_WESTERN("07"),
    SOUTHERN("08"),
    WESTERN("09"),
    CENTRAL("10");

    private final String code;

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

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

✅ SQL Representation for Zambia’s Provinces

Here is the SQL schema and insert statements for the 10 provinces of Zambia:

sql

-- Table for Zambia provinces
CREATE TABLE zambia_provinces (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    code CHAR(2) NOT NULL
);

-- Insert Zambia's provinces into the table
INSERT INTO zambia_provinces (name, code) VALUES
('Lusaka', '01'),
('Copperbelt', '02'),
('Eastern', '03'),
('Luapula', '04'),
('Muchinga', '05'),
('Northern', '06'),
('North Western', '07'),
('Southern', '08'),
('Western', '09'),
('Central', '10');

This structure helps organize Zambia's administrative and geographic data, ideal for applications related to regional governance, demographic studies, and more.

Would you like to include district-level data or more specific geographic information within any of these provinces?


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