Programming & Development / April 12, 2025

Enum Representation of Administrative Regions in Tajikistan and SQL Table for Storing Region Data

Enum Tajikistan Administrative Regions Java SQL Dushanbe Gorno-Badakhshan Sughd Khatlon Region Code Autonomous Province

โœ… Enum Representation in Java

Tajikistan is divided into 4 main administrative divisions:

  1. Sughd Region
  2. Khatlon Region
  3. Gorno-Badakhshan Autonomous Region (GBAO)
  4. Districts under Republic Subordination
  5. 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.



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