Programming & Development / April 12, 2025

Enum Representation of Departments in Uruguay and SQL Table for Storing Department Data

Enum Uruguay Departments Java SQL Montevideo Administrative Divisions Department Code Uruguay Enum South America

✅ Enum Representation in Java

Uruguay is divided into 19 departments (departamentos), with each department serving as an administrative region. The capital city, Montevideo, is also a department with special significance.

Here’s the Java enum representing these departments along with their standard two-letter codes:

java

public enum UruguayDepartment {
    MONTEVIDEO("01"),
    ARTIGAS("02"),
    CANELONES("03"),
    COLONIA("04"),
    DURAZNO("05"),
    FLORIDA("06"),
    FLORES("07"),
    LAVALLEJA("08"),
    MALDONADO("09"),
    PAYSANDU("10"),
    RIVERA("11"),
    ROCHA("12"),
    SALTO("13"),
    SAN_JOSE("14"),
    SAN_SALVADOR("15"),
    TREINTA_Y_TRES("16"),
    TUPAMBAE("17"),
    TACUAREMBO("18"),
    CERRO_LARGO("19");

    private final String code;

    UruguayDepartment(String code) {
        this.code = code;
    }

    public String getCode() {
        return this.code;
    }
}

✅ SQL Representation for Uruguay’s Departments

Here is the SQL schema and insert statements for the 19 departments of Uruguay:

sql

-- Table for Uruguay departments
CREATE TABLE uruguay_departments (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    code CHAR(2) NOT NULL
);

-- Insert Uruguay's departments into the table
INSERT INTO uruguay_departments (name, code) VALUES
('Montevideo', '01'),
('Artigas', '02'),
('Canelones', '03'),
('Colonia', '04'),
('Durazno', '05'),
('Florida', '06'),
('Flores', '07'),
('Lavalleja', '08'),
('Maldonado', '09'),
('Paysandu', '10'),
('Rivera', '11'),
('Rocha', '12'),
('Salto', '13'),
('San Jose', '14'),
('San Salvador', '15'),
('Treinta y Tres', '16'),
('Tupambaé', '17'),
('Tacuarembó', '18'),
('Cerro Largo', '19');

This schema and enum are perfect for organizing the geographic and administrative data of Uruguay. This structure is useful for applications that handle data related to local governance, regional statistics, or logistics.



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