🇧🇭 Java Enum: Bahrain’s Governorates
Bahrain is divided into 4 governorates. Here’s the Java enum using the ISO 3166-2:BH codes.
java
public enum BahrainGovernorate {
CAPITAL("BH-01"),
NORTHERN("BH-02"),
SOUTHERN("BH-03"),
MUHARRAQ("BH-04");
private final String code;
BahrainGovernorate(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}
🗃️ SQL Table and Insert Statements
sql
CREATE TABLE bahrain_governorates (
id SERIAL PRIMARY KEY,
name VARCHAR(64) NOT NULL,
code VARCHAR(8) NOT NULL UNIQUE
);
INSERT INTO bahrain_governorates (name, code) VALUES
('Capital', 'BH-01'),
('Northern', 'BH-02'),
('Southern', 'BH-03'),
('Muharraq', 'BH-04');
✅ Summary
This setup represents Bahrain’s 4 governorates using the ISO 3166-2:BH codes. It is perfect for managing administrative divisions, geographical data, or region-based functionalities in applications.