🇧🇾 Java Enum: Belarus’ Regions
Belarus is divided into 6 regions (voblasts) and the capital city of Minsk. Here’s the Java enum using the ISO 3166-2:BY codes.
java
public enum BelarusRegion {
MINSK("BY-01"),
BREST("BY-02"),
GOMEL("BY-03"),
GRODNO("BY-04"),
MOGILEV("BY-06"),
VITEBSK("BY-07"),
MINSK_CITY("BY-03");
private final String code;
BelarusRegion(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}
🗃️ SQL Table and Insert Statements
sql
CREATE TABLE belarus_regions (
id SERIAL PRIMARY KEY,
name VARCHAR(64) NOT NULL,
code VARCHAR(8) NOT NULL UNIQUE
);
INSERT INTO belarus_regions (name, code) VALUES
('Minsk', 'BY-01'),
('Brest', 'BY-02'),
('Gomel', 'BY-03'),
('Grodno', 'BY-04'),
('Mogilev', 'BY-06'),
('Vitebsk', 'BY-07'),
('Minsk City', 'BY-03');
✅ Summary
This setup represents Belarus' 6 regions (voblasts) and the capital city Minsk using the ISO 3166-2:BY codes. This structure is great for region-based data handling, administrative tasks, and geographical functionalities.