Programming & Development / April 11, 2025

How to Represent South Korea’s Provinces in Java and SQL Using ISO 3166-2 Codes

South Korea provinces Java enum South Korea ISO 3166-2 KR SQL South Korea provinces KR province codes South Korea administrative divisions backend region enum South Korea provinces Java SQL Spring Boot regions South Korea

🇰🇷 Java Enum: South Korea’s Provinces

South Korea is divided into 9 provinces and 1 special autonomous city (Seoul). Here’s the Java enum using ISO 3166-2:KR codes:

java

public enum SouthKoreaProvince {
    CHUNGBUK("KR-11"),
    CHUNGNAM("KR-12"),
    GANGWON("KR-13"),
    GYEONGBUK("KR-21"),
    GYEONGNAM("KR-22"),
    JEONBUK("KR-23"),
    JEONNAM("KR-24"),
    SEOUL("KR-11"),
    INCHEON("KR-28"),
    DAEJEON("KR-30"),
    BUSAN("KR-26"),
    GYEONGGI("KR-41"),
    ULSAN("KR-31"),
    SEJONG("KR-36");

    private final String code;

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

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

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

INSERT INTO south_korea_provinces (name, code) VALUES
('Chungbuk', 'KR-11'),
('Chungnam', 'KR-12'),
('Gangwon', 'KR-13'),
('Gyeongbuk', 'KR-21'),
('Gyeongnam', 'KR-22'),
('Jeonbuk', 'KR-23'),
('Jeonnam', 'KR-24'),
('Seoul', 'KR-11'),
('Incheon', 'KR-28'),
('Daejeon', 'KR-30'),
('Busan', 'KR-26'),
('Gyeonggi', 'KR-41'),
('Ulsan', 'KR-31'),
('Sejong', 'KR-36');

✅ Summary

This setup covers all 9 provinces and 1 special autonomous city of South Korea using ISO 3166-2:KR 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