Programming & Development / April 12, 2025

Enum Representation of Provinces in Solomon Islands and SQL Table for Storing Province Data

Enum Province Solomon Islands Java SQL Honiara Guadalcanal Malaita Province Code

Enum Representation in Java

The Solomon Islands is divided into 9 provinces and 1 capital territory (Honiara). Here's the enum representation with province codes:

java

public enum Province {
    CENTRAL("CE"),
    CHOISEUL("CH"),
    GUADALCANAL("GU"),
    ISABEL("IS"),
    MAKIRA_ULAWA("MU"),
    MALAITA("ML"),
    RENNELL_BELLONA("RB"),
    TEMOTU("TE"),
    WESTERN("WE"),
    HONIARA("HO"); // Capital Territory

    private final String code;

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

    public String getCode() {
        return this.code;
    }
}
  • The enum Province includes all 9 provinces and Honiara as a separate entity.
  • Each province is assigned a unique two-letter code.
  • getCode() method retrieves the code for use in systems or databases.

SQL Representation for Storing Province Data

Here is the SQL schema and insert statements for storing the Solomon Islands' provinces in a relational database:

sql

-- Table definition for provinces in Solomon Islands
CREATE TABLE provinces (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    code CHAR(2) NOT NULL
);

-- Insert statements for Solomon Islands provinces
INSERT INTO provinces (name, code) VALUES
('Central', 'CE'),
('Choiseul', 'CH'),
('Guadalcanal', 'GU'),
('Isabel', 'IS'),
('Makira-Ulawa', 'MU'),
('Malaita', 'ML'),
('Rennell and Bellona', 'RB'),
('Temotu', 'TE'),
('Western', 'WE'),
('Honiara', 'HO');
  • The provinces table holds the province name and code.
  • Insert values match official administrative regions.

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