### SDGs Tables
#### `sdg_values`
| Column | Data Type | Constraints | Description |
|-----------------------|------------|---------------------------------------|----------------------------------------|
| id | SERIAL | PRIMARY KEY | Unique identifier for the record |
| year | INTEGER | NOT NULL | Year of the data |
| sequence | INTEGER | NOT NULL | Sequence number for the record |
| sdg_id | INTEGER | NOT NULL, REFERENCES `n.codelist` | SDG ID, references `n.codelist` |
| vlr_id | INTEGER | NOT NULL, REFERENCES `n.codelist` | VLR ID, references `n.codelist` |
| base_value_setup_year | INTEGER | | Base value setup year |
| base_value | INTEGER | | Base value |
| real_value_2021 | INTEGER | | Actual value for 2021 |
| real_value_2022 | INTEGER | | Actual value for 2022 |
| predict_value_2023 | INTEGER | | Predicted value for 2023 |
| real_value_2023 | INTEGER | | Actual value for 2023 |
| predict_value_2024 | INTEGER | | Predicted value for 2024 |
| real_value_2024 | INTEGER | | Actual value for 2024 |
| predict_value_2025 | INTEGER | | Predicted value for 2025 |
| real_value_2025 | INTEGER | | Actual value for 2025 |
| predict_value_2026 | INTEGER | | Predicted value for 2026 |
| real_value_2026 | INTEGER | | Actual value for 2026 |
| predict_value_2027 | INTEGER | | Predicted value for 2027 |
| real_value_2027 | INTEGER | | Actual value for 2027 |
| predict_value_2028 | INTEGER | | Predicted value for 2028 |
| real_value_2028 | INTEGER | | Actual value for 2028 |
| predict_value_2029 | INTEGER | | Predicted value for 2029 |
| real_value_2029 | INTEGER | | Actual value for 2029 |
| predict_value_2030 | INTEGER | | Predicted value for 2030 |
| real_value_2030 | INTEGER | | Actual value for 2030 |
#### `sdg_index`
| Column | Data Type | Constraints | Description |
|-----------------------|--------------|---------------------------------------|----------------------------------------|
| id | SERIAL | PRIMARY KEY | Unique identifier for the record |
| year | INTEGER | NOT NULL | Year of the data |
| sdg_id | INTEGER | NOT NULL, REFERENCES `n.codelist` | SDG ID, references `n.codelist` |
| pndirection | VARCHAR(50) | NOT NULL | Direction |
| vlr_id | INTEGER | NOT NULL, REFERENCES `n.codelist` | VLR ID, references `n.codelist` |
| index_definition | VARCHAR(50) | | Definition of the index |
| index_formula | VARCHAR(50) | | Formula of the index |
| index_unit | VARCHAR(50) | | Unit of the index |
| department_code_list | VARCHAR(50) | | List of department codes |
| note | VARCHAR(50) | | Additional notes |
#### `sdgs_year_compare`
| Column | Data Type | Constraints | Description |
|----------------------|--------------|---------------------------------------|----------------------------------------|
| id | SERIAL | PRIMARY KEY | Unique identifier for the record |
| target_year | INTEGER | NOT NULL | Target year |
| prev_year | INTEGER | NOT NULL | Previous year |
| target_year_sdg_id | VARCHAR(50) | NOT NULL, REFERENCES `n.codelist` | Target year SDG ID, references `n.codelist`|
| prev_year_sdg_id | VARCHAR(50) | NOT NULL, REFERENCES `n.codelist` | Previous year SDG ID, references `n.codelist`|
| target_year_vlr_id | VARCHAR(50) | NOT NULL, REFERENCES `n.codelist` | Target year VLR ID, references `n.codelist`|
| prev_year_vlr_id | VARCHAR(50) | NOT NULL, REFERENCES `n.codelist` | Previous year VLR ID, references `n.codelist`|
#### `naming_code` as `n`
| Column | Data Type | Constraints | Description |
|-----------|------------|-------------|----------------------------------------|
| codelist | STRING | | Code list value |
| chinese | STRING | | Corresponding Chinese value |
## ER_model
https://dbdiagram.io/d/SDGs-66c4496ba346f9518c89ab70