Programming & Development / April 11, 2025

How to Represent Barbados’ Parishes in Java and SQL Using ISO 3166-2 Codes

Barbados parishes Java enum Barbados ISO 3166-2 BB SQL Barbados regions Barbados administrative divisions Spring Boot enum Barbados parish list BB region codes parishes of Barbados

🇧🇧 Java Enum: Barbados’ Parishes

Barbados is divided into 11 parishes. Here’s the Java enum using the ISO 3166-2:BB codes.

java

public enum BarbadosParish {
    CHRIST_CHURCH("BB-01"),
    ST_ANDREW("BB-02"),
    ST_GEORGE("BB-03"),
    ST_JAMES("BB-04"),
    ST_JOHN("BB-05"),
    ST_LUCY("BB-06"),
    ST_MICHAEL("BB-07"),
    ST_PETER("BB-08"),
    ST_PHILIP("BB-09"),
    ST_THOMAS("BB-10"),
    QUEENSLAND("BB-11");

    private final String code;

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

    public String getCode() {
        return code;
    }
}

🗃️ SQL Table and Insert Statements

sql

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

INSERT INTO barbados_parishes (name, code) VALUES
('Christ Church', 'BB-01'),
('St Andrew', 'BB-02'),
('St George', 'BB-03'),
('St James', 'BB-04'),
('St John', 'BB-05'),
('St Lucy', 'BB-06'),
('St Michael', 'BB-07'),
('St Peter', 'BB-08'),
('St Philip', 'BB-09'),
('St Thomas', 'BB-10'),
('Queensland', 'BB-11');

✅ Summary

This setup represents Barbados' 11 parishes using the ISO 3166-2:BB codes. It’s ideal for geographical region management, administrative processing, or any location-based tasks 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