Programming & Development / April 11, 2025

How to Represent Bolivia’s Departments in Java and SQL Using ISO 3166-2 Codes

Bolivia departments Java enum Bolivia ISO 3166-2 BO SQL Bolivia regions Bolivia administrative divisions Spring Boot enum Bolivia departments list BO region codes departments of Bolivia

🇧🇴 Java Enum: Bolivia’s Departments

Bolivia is divided into 9 departments. Here’s the Java enum using the ISO 3166-2:BO codes.

java

public enum BoliviaDepartment {
    LA_PAZ("BO-L"),
    COCHABAMBA("BO-C"),
    SANTA_CRUZ("BO-SC"),
    CHUQUISACA("BO-H"),
    TARIJA("BO-T"),
    PANDO("BO-P"),
    BENI("BO-B"),
    POTOSI("BO-POT"),
    ORURO("BO-O");

    private final String code;

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

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

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

INSERT INTO bolivia_departments (name, code) VALUES
('La Paz', 'BO-L'),
('Cochabamba', 'BO-C'),
('Santa Cruz', 'BO-SC'),
('Chuquisaca', 'BO-H'),
('Tarija', 'BO-T'),
('Pando', 'BO-P'),
('Beni', 'BO-B'),
('Potosi', 'BO-POT'),
('Oruro', 'BO-O');

✅ Summary

This setup represents Bolivia’s 9 departments using the ISO 3166-2:BO codes. This structure is useful for handling geographical data, administrative divisions, or region-based processing in your applications.


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