Programming & Development / April 11, 2025

Modeling Oman's Governorates in Java and SQL Using ISO 3166-2:OM Codes

Oman governorates Oman regions Java enum Oman ISO 3166-2 OM SQL Oman Oman subdivisions Spring Boot geographic enum Oman administrative units backend regions Oman governorates of Oman

🇴🇲 Java Enum: Oman's Governorates

Oman is divided into 11 governorates (sometimes also referred to as regions). Each governorate has its official ISO 3166-2:OM code.

java

public enum OmanGovernorate {
    AL_BURAYMI("OM-BU"),
    AL_DHAHIRAH("OM-DH"),
    AL_DAKHILIYAH("OM-DA"),
    AL_SHARQIYAH_NORTH("OM-SH"),
    AL_SHARQIYAH_SOUTH("OM-SS"),
    MUSCAT("OM-MU"),
    AL_WUSTA("OM-WU"),
    DHOFAR("OM-DH"),
    NORTH_BATINAH("OM-BA"),
    SOUTH_BATINAH("OM-BS"),
    AL_JANUBIYAH("OM-JA");

    private final String code;

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

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

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

INSERT INTO oman_governorates (name, code) VALUES
('Al Buraymi', 'OM-BU'),
('Al Dhahirah', 'OM-DH'),
('Al Dakhiliyah', 'OM-DA'),
('Al Sharqiyah North', 'OM-SH'),
('Al Sharqiyah South', 'OM-SS'),
('Muscat', 'OM-MU'),
('Al Wusta', 'OM-WU'),
('Dhofar', 'OM-DH'),
('North Batinah', 'OM-BA'),
('South Batinah', 'OM-BS'),
('Al Janubiyah', 'OM-JA');

✅ Summary

This setup models Oman's governorates with their ISO 3166-2:OM codes. It can be used in backend systems, geographic applications, or databases dealing with Oman's administrative regions.


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