✅ Enum Representation in Java
Ukraine is divided into 24 oblasts (regions), and the autonomous republic of Crimea, as well as the city of Kyiv, which holds a special administrative status. Each region has a unique administrative code.
Here’s the Java enum
representing these regions along with their standard two-letter codes:
java
public enum UkraineRegion {
KYIV("01"),
VINNYTSIA("02"),
VOLYN("03"),
DNIPROPETROVSK("04"),
DONETSK("05"),
ZAPORIZHZHIA("06"),
IVANO_FRANKIVSK("07"),
KHERSON("08"),
KHARKIV("09"),
KHERSON("10"),
KYIV_CITY("11"),
KIROVOHRAD("12"),
LUHANSK("13"),
LVIV("14"),
MYKOLAYIV("15"),
ODESA("16"),
POLTAVA("17"),
RIVNE("18"),
SUMY("19"),
TERNOPIL("20"),
KHARKIV("21"),
CHERKASY("22"),
CHERNIVTSI("23"),
CHERNIHIV("24");
private final String code;
UkraineRegion(String code) {
this.code = code;
}
public String getCode() {
return this.code;
}
}
✅ SQL Representation for Ukraine’s Regions
Here is the SQL schema and insert statements for the 25 regions of Ukraine, including Kyiv and Crimea (which holds autonomous status but is treated as part of the country).
sql
-- Table for Ukraine regions
CREATE TABLE ukraine_regions (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
code CHAR(2) NOT NULL
);
-- Insert regions and special administrative city of Kyiv into the table
INSERT INTO ukraine_regions (name, code) VALUES
('Kyiv', '01'),
('Vinnytsia', '02'),
('Volyn', '03'),
('Dnipropetrovsk', '04'),
('Donetsk', '05'),
('Zaporizhzhia', '06'),
('Ivano-Frankivsk', '07'),
('Kherson', '08'),
('Kharkiv', '09'),
('Kyiv City', '10'),
('Kirovohrad', '11'),
('Luhansk', '12'),
('Lviv', '13'),
('Mykolaiv', '14'),
('Odesa', '15'),
('Poltava', '16'),
('Rivne', '17'),
('Sumy', '18'),
('Ternopil', '19'),
('Kharkiv', '20'),
('Cherkasy', '21'),
('Chernivtsi', '22'),
('Chernihiv', '23');
This structure helps in managing the geographic and administrative data for Ukraine, useful for national governance, planning, demographic studies, or geographic services.