Programming & Development / April 11, 2025

How to Represent Libya’s Regions in Java and SQL Using ISO 3166-2 Codes

Libya regions Java enum Libya ISO 3166-2 LY SQL Libya regions LY region codes Libya administrative divisions backend region enum Libya regions Java SQL Spring Boot regions Libya

🇱🇾 Java Enum: Libya’s Regions

Libya is divided into 3 regions. Here’s the Java enum using ISO 3166-2:LY codes:

java

public enum LibyaRegion {
    FEZZAN("LY-FE"),
    TRIPOLITANIA("LY-TR"),
    CYRENAICA("LY-CY");

    private final String code;

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

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

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

INSERT INTO libya_regions (name, code) VALUES
('Fezzan', 'LY-FE'),
('Tripolitania', 'LY-TR'),
('Cyrenaica', 'LY-CY');

✅ Summary

This setup covers all 3 regions of Libya using ISO 3166-2:LY codes, ideal for backend services, Java applications, and SQL databases.



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