Programming & Development / April 11, 2025

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

Iceland regions Java enum Iceland ISO 3166-2 IS SQL Iceland regions IS region codes Iceland administrative divisions backend region enum Iceland provinces Java SQL Spring Boot regions Iceland

🇮🇸 Java Enum: Iceland’s Regions

Iceland is divided into 8 regions. Here’s the Java enum using ISO 3166-2:IS codes:

java

public enum IcelandRegion {
    ARNESSYRI("IS-1"),
    AUSTURLAND("IS-2"),
    HOFUDBORGARSVAEDI("IS-3"),
    NORDLAND("IS-4"),
    SUDURLAND("IS-5"),
    VESTFIRDIR("IS-6"),
    VESTURLAND("IS-7"),
    REYKJANES("IS-8");

    private final String code;

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

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

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

INSERT INTO iceland_regions (name, code) VALUES
('Arnessyri', 'IS-1'),
('Austurland', 'IS-2'),
('Hofudborgarsvaedi', 'IS-3'),
('Nordland', 'IS-4'),
('Sudurland', 'IS-5'),
('Vestfirdir', 'IS-6'),
('Vesturland', 'IS-7'),
('Reykjanes', 'IS-8');

✅ Summary

This setup covers all 8 regions of Iceland using ISO 3166-2:IS codes, perfect for backend systems, 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