โ
Enum Representation in Java
Tajikistan is divided into 4 main administrative divisions:
- Sughd Region
- Khatlon Region
- Gorno-Badakhshan Autonomous Region (GBAO)
- Districts under Republic Subordination
- Dushanbe (Capital City)
Here is the Java enum
representing each of these divisions with a two-letter code:
java
public enum TajikistanRegion {
SUGHD("SG"),
KHATLON("KT"),
GBAO("GB"),
DRS("RS"),
DUSHANBE("DU");
private final String code;
TajikistanRegion(String code) {
this.code = code;
}
public String getCode() {
return this.code;
}
}
๐น Notes:
DRS
stands for Districts under Republic Subordination.
- Codes are simplified for system integration and consistent use across applications and databases.
โ
SQL Representation for Storing Region Data
Hereโs the SQL schema and insert script for storing the administrative regions of Tajikistan:
sql
-- Table for Tajikistan administrative regions
CREATE TABLE tajikistan_regions (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
code CHAR(3) NOT NULL
);
-- Insert administrative regions into the table
INSERT INTO tajikistan_regions (name, code) VALUES
('Sughd Region', 'SG'),
('Khatlon Region', 'KT'),
('Gorno-Badakhshan Autonomous Region', 'GB'),
('Districts under Republic Subordination', 'RS'),
('Dushanbe', 'DU');
This enum and SQL structure makes it easy to build systems that interact with Tajikistan's regional administration data.