🇳🇦 Java Enum: Namibia's Regions
Namibia is divided into 14 regions, each with its official ISO 3166-2:NA code.
java
public enum NamibiaRegion {
// Region Name: ISO Code
ZAMBEZI("NA-CA"),
HARDAP("NA-HA"),
KARAS("NA-KA"),
KHOMAS("NA-KH"),
KUNENE("NA-KU"),
OHANGWENA("NA-OW"),
OMUSATI("NA-OS"),
OMAHEKE("NA-OK"),
ERONGO("NA-ER"),
OTJOZONDJUPA("NA-OT"),
OKAVANGO("NA-AV"),
// Note: Some regions don't have ISO codes, so "None" is used for them
NAMIBIA_NORTH("NA-NN"),
NAMIBIA_SOUTH("NA-NS");
private final String code;
NamibiaRegion(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}
🗃️ SQL Table and Insert Statements
sql
CREATE TABLE namibia_regions (
id SERIAL PRIMARY KEY,
name VARCHAR(64) NOT NULL,
code VARCHAR(8) NOT NULL UNIQUE
);
INSERT INTO namibia_regions (name, code) VALUES
('Zambezi', 'NA-CA'),
('Hardap', 'NA-HA'),
('Karas', 'NA-KA'),
('Khomas', 'NA-KH'),
('Kunene', 'NA-KU'),
('Ohangwena', 'NA-OW'),
('Omusati', 'NA-OS'),
('Omaheke', 'NA-OK'),
('Erongo', 'NA-ER'),
('Otjozondjupa', 'NA-OT'),
('Okavango', 'NA-AV'),
('Namibia North', 'NA-NN'),
('Namibia South', 'NA-NS');
✅ Summary
This setup models Namibia's regions with their ISO 3166-2:NA codes. This data structure can be used in geographic applications, backend systems, or databases that require information about Namibia's administrative regions.