🇲🇨 Java Enum: Monaco Administrative Divisions
Monaco is a single district, but for the purpose of this exercise, it can be considered as a region with no subdivisions.
java
public enum MonacoRegion {
MONACO("MC-MC");
private final String code;
MonacoRegion(String code) {
this.code = code;
}
public String getCode() {
return code;
}
}
Since Monaco doesn't have multiple regions or administrative units, it's represented as a single entry in the enum.
🗃️ SQL Table and Insert Statements
sql
CREATE TABLE monaco_regions (
id SERIAL PRIMARY KEY,
name VARCHAR(64) NOT NULL,
code VARCHAR(8) NOT NULL UNIQUE
);
INSERT INTO monaco_regions (name, code) VALUES
('Monaco', 'MC-MC');
✅ Summary
Monaco only has a single administrative unit and is represented with its ISO 3166-2:MC code as MC-MC
. This is useful for representing the country in databases and Java applications.