Programming & Development / April 12, 2025

Enum Representation of Federal Member States and Regions in Somalia with SQL Table for Storing Region Data

Enum Region State Somalia Java SQL Puntland Jubaland Somaliland Hirshabelle South West State Galmudug Banaadir Region Code

Enum Representation in Java

Somalia consists of 6 Federal Member States, the Banaadir administrative region, and 18 traditional regional divisions. Here's an enum focusing on the Federal Member States and key regions, with representative codes:

java

public enum Region {
    PUNTLAND("PL"),
    SOMALILAND("SL"),
    GALMUDUG("GM"),
    HIRSHABELLE("HS"),
    SOUTH_WEST_STATE("SW"),
    JUBALAND("JL"),
    BANAADIR("BN");

    private final String code;

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

    public String getCode() {
        return this.code;
    }
}
  • This enum covers Somalia’s recognized federal states and the Banaadir region, which includes the capital, Mogadishu.
  • Each entry has a two-character code for easy integration with systems or databases.
  • getCode() returns the abbreviated region/state code.

SQL Representation for Storing Region Data

Below is the SQL schema and insert statements for storing Somalia's federal states and the Banaadir region:

sql

-- Table definition for regions/states of Somalia
CREATE TABLE regions (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    code CHAR(2) NOT NULL
);

-- Insert statements for Federal Member States and Banaadir
INSERT INTO regions (name, code) VALUES
('Puntland', 'PL'),
('Somaliland', 'SL'),
('Galmudug', 'GM'),
('Hirshabelle', 'HS'),
('South West State', 'SW'),
('Jubaland', 'JL'),
('Banaadir', 'BN');

Optional: Traditional Administrative Regions

If you prefer to represent all 18 traditional regions (like Bari, Mudug, Bay, etc.), let me know and I’ll prepare the full enum and SQL insert list for those as well.


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