Task: equi-join-detect (source dataset: Auto-BI)

Your are given a database with related tables used for business intelligence analysis. Your task is to identify all key/foreign-key join relationships between the tables for this database. Recall that a join is a relationship between two tables, that allows rows from one table to be combined with rows from another, based on a set of common join columns.
 
 
No explanation needed. Please return all join relationships in the following JSON format:
{
  "joins": [
    {
      "from_table": "table-1",
      "from_column": "column-1",
      "to_table": "table-2",
      "to_column": "column-3"
    }, 
	...
  ]
}

Tables:

Table: TB_BASE_ESTADOS
|   NR_ID | NM_UF_ESTADO   |   NR_LATITUDE |   NR_LONGITUDE |
|--------:|:---------------|--------------:|---------------:|
|       1 | RO             |        -10.83 |         -63.34 |
|       2 | AC             |         -8.77 |         -70.55 |
|       3 | AM             |         -3.47 |         -65.1  |
|       4 | RR             |          1.99 |         -61.33 |
|       5 | PA             |         -3.79 |         -52.48 |
|       6 | AP             |          1.41 |         -51.77 |
|       7 | TO             |         -9.46 |         -48.26 |
|       8 | MA             |         -5.42 |         -45.44 |
|       9 | PI             |         -6.6  |         -42.28 |
|      10 | CE             |         -5.2  |         -39.53 |


Table: TB_DIM_DATA
|   NM_ANO |   NM_MES | DT_DATA                 |
|---------:|---------:|:------------------------|
|     2020 |        4 | 2020-04-01 00:00:00.000 |


Table: VW_BENEFICIOS_MENOR_MAIOR
|   NM_ANO | MENOR_VLR_PAGO_UF   |   MENOR_VLR_PAGO_TOTAL | MAIOR_VLR_PAGO_UF   |   MAIOR_VLR_PAGO_TOTAL | MENOR_VLR_PAGO_MUN   |   MENOR_VLR_PAGO_MUN_TOTAL | MAIOR_VLR_PAGO_MUN   |   MAIOR_VLR_PAGO_MUN_TOTAL |
|---------:|:--------------------|-----------------------:|:--------------------|-----------------------:|:---------------------|---------------------------:|:---------------------|---------------------------:|
|     2020 | RR                  |              122911800 | SP                  |             5805763800 | UNIAO DA SERRA - RS  |                      39000 | SAO PAULO - SP       |                 1684330800 |


Table: VW_MUNICIPIOS
|   NR_COD_MUNICIPIO | NM_NOME_MUNICIPIO   | NM_UF   | NM_MUNICIPIO_UF          |   NR_LATITUDE |   NR_LONGITUDE |
|-------------------:|:--------------------|:--------|:-------------------------|--------------:|---------------:|
|            3100104 | ABADIA DOS DOURADOS | MG      | ABADIA DOS DOURADOS - MG |      -18.4831 |       -47.3916 |
|            3100203 | ABAETE              | MG      | ABAETE - MG              |      -19.1551 |       -45.4444 |
|            3100302 | ABRE CAMPO          | MG      | ABRE CAMPO - MG          |      -20.2996 |       -42.4743 |
|            3100401 | ACAIACA             | MG      | ACAIACA - MG             |      -20.359  |       -43.1439 |
|            3100500 | ACUCENA             | MG      | ACUCENA - MG             |      -19.0671 |       -42.5419 |
|            3100609 | AGUA BOA            | MG      | AGUA BOA - MG            |      -17.9914 |       -42.3806 |
|            3100708 | AGUA COMPRIDA       | MG      | AGUA COMPRIDA - MG       |      -20.0576 |       -48.1069 |
|            3100807 | AGUANIL             | MG      | AGUANIL - MG             |      -20.9439 |       -45.3915 |
|            3100906 | AGUAS FORMOSAS      | MG      | AGUAS FORMOSAS - MG      |      -17.0802 |       -40.9384 |
|            3101003 | AGUAS VERMELHAS     | MG      | AGUAS VERMELHAS - MG     |      -15.7431 |       -41.4571 |


Table: VW_TOTAL_BENEFICIADOS_POR_MUNICIPIO
|   NM_ANO |   NM_MES | DT_DATA                 | NM_MUNICIPIO_UF          |   NR_TOTAL_REGISTRADOS |   NR_TOTAL_ANONIMOS |   NR_TOTAL_BENEFICIADOS |
|---------:|---------:|:------------------------|:-------------------------|-----------------------:|--------------------:|------------------------:|
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABADIA DE GOIAS - GO     |                   3946 |                   0 |                    3946 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABADIA DOS DOURADOS - MG |                   1454 |                   0 |                    1454 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABADIANIA - GO           |                   3802 |                   0 |                    3802 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABAETE - MG              |                   4860 |                   0 |                    4860 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABAETETUBA - PA          |                  64349 |                   0 |                   64349 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABAIARA - CE             |                   4021 |                   0 |                    4021 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABAIRA - BA              |                   3242 |                   0 |                    3242 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABARE - BA               |                   6762 |                   0 |                    6762 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABATIA - PR              |                   1818 |                   0 |                    1818 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABDON BATISTA - SC       |                    511 |                   0 |                     511 |


Table: VW_TOTAL_BENEFICIADOS_POR_UF
|   NM_ANO |   NM_MES | NM_UF   | DT_DATA                 |   NR_TOTAL_REGISTRADOS |   NR_TOTAL_ANONIMOS |   NR_TOTAL_BENEFICIADOS |
|---------:|---------:|:--------|:------------------------|-----------------------:|--------------------:|------------------------:|
|     2020 |        4 | PA      | 2020-04-01 00:00:00.000 |                2639309 |                   0 |                 2639309 |
|     2020 |        4 | RN      | 2020-04-01 00:00:00.000 |                1036751 |                   0 |                 1036751 |
|     2020 |        4 | BA      | 2020-04-01 00:00:00.000 |                4722354 |                   0 |                 4722354 |
|     2020 |        4 | MT      | 2020-04-01 00:00:00.000 |                 769093 |                   0 |                  769093 |
|     2020 |        4 | RR      | 2020-04-01 00:00:00.000 |                 168346 |                   0 |                  168346 |
|     2020 |        4 | MS      | 2020-04-01 00:00:00.000 |                 588636 |                   0 |                  588636 |
|     2020 |        4 | PE      | 2020-04-01 00:00:00.000 |                2938481 |                   0 |                 2938481 |
|     2020 |        4 | AP      | 2020-04-01 00:00:00.000 |                 243242 |                   0 |                  243242 |
|     2020 |        4 | ES      | 2020-04-01 00:00:00.000 |                 877922 |                   0 |                  877922 |
|     2020 |        4 | AC      | 2020-04-01 00:00:00.000 |                 250324 |                   0 |                  250324 |


Table: VW_TOTAL_BENEFICIOS_POR_ENQUADRAMENTO
|   NM_ANO |   NM_MES | DT_DATA                 | NM_ENQUADRAMENTO   |   NR_TOTAL_PAGO |
|---------:|---------:|:------------------------|:-------------------|----------------:|
|     2020 |        4 | 2020-04-01 00:00:00.000 | EXTRACAD           |     12952638600 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | BOLSA FAMILIA      |     14859579600 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | CADUNICO           |      7018036800 |


Table: VW_TOTAL_BENEFICIOS_POR_MUNICIPIO
|   NM_ANO |   NM_MES | DT_DATA                 | NM_MUNICIPIO_UF          |   NR_TOTAL_PAGO |
|---------:|---------:|:------------------------|:-------------------------|----------------:|
|     2020 |        4 | 2020-04-01 00:00:00.000 | SAO MIGUEL DO GUAMA - PA |        15010800 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | MORRO DO CHAPEU - BA     |         8274600 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ITUIUTABA - MG           |        14280600 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | LAVRAS - MG              |        15168600 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | TOMBOS - MG              |         1583400 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ALEGRE - ES              |         4994400 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | GUARANTA - SP            |         1083600 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ALMIRANTE TAMANDARE - PR |        15923400 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | CAPAO DA CANOA - RS      |         8890200 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | RIO GRANDE - RS          |        27772200 |


Table: VW_TOTAL_BENEFICIOS_POR_MUN_ENQUADRAMENTO
|   NM_ANO |   NM_MES | DT_DATA                 | NM_NOME_MUNICIPIO   | NM_UF   | NM_ENQUADRAMENTO   |   NR_TOTAL_PAGO |   NR_TOTAL_PAGO_PERCENT |
|---------:|---------:|:------------------------|:--------------------|:--------|:-------------------|----------------:|------------------------:|
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABADIA DOS DOURADOS | MG      | EXTRACAD           |          439200 |                 0.44825 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABAETE              | MG      | EXTRACAD           |         1654200 |                 0.49973 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ABRE CAMPO          | MG      | EXTRACAD           |          720600 |                 0.32556 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ACAIACA             | MG      | EXTRACAD           |          171600 |                 0.21138 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ACUCENA             | MG      | EXTRACAD           |          508200 |                 0.29177 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | AGUA BOA            | MG      | EXTRACAD           |          742200 |                 0.21476 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | AGUA COMPRIDA       | MG      | EXTRACAD           |          111000 |                 0.33698 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | AGUANIL             | MG      | EXTRACAD           |          210000 |                 0.32437 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | AGUAS FORMOSAS      | MG      | EXTRACAD           |          842400 |                 0.18591 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | AGUAS VERMELHAS     | MG      | EXTRACAD           |          345600 |                 0.11327 |


Table: VW_TOTAL_BENEFICIOS_POR_UF
|   NM_ANO |   NM_MES | DT_DATA                 | NM_UF   |   NR_TOTAL_PAGO |
|---------:|---------:|:------------------------|:--------|----------------:|
|     2020 |        4 | 2020-04-01 00:00:00.000 | PA      |      1920982200 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | RN      |       737323200 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | BA      |      3370416000 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | MT      |       556458600 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | RR      |       122911800 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | MS      |       422526600 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | PE      |      2143114200 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | AP      |       185262000 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | ES      |       612458400 |
|     2020 |        4 | 2020-04-01 00:00:00.000 | AC      |       177501600 |

 


tables: name: TB_BASE_ESTADOS
data: TB_BASE_ESTADOS.csv
name: TB_DIM_DATA
data: TB_DIM_DATA.csv
name: VW_BENEFICIOS_MENOR_MAIOR
data: VW_BENEFICIOS_MENOR_MAIOR.csv
name: VW_MUNICIPIOS
data: VW_MUNICIPIOS.csv
name: VW_TOTAL_BENEFICIADOS_POR_MUNICIPIO
data: VW_TOTAL_BENEFICIADOS_POR_MUNICIPIO.csv
name: VW_TOTAL_BENEFICIADOS_POR_UF
data: VW_TOTAL_BENEFICIADOS_POR_UF.csv
name: VW_TOTAL_BENEFICIOS_POR_ENQUADRAMENTO
data: VW_TOTAL_BENEFICIOS_POR_ENQUADRAMENTO.csv
name: VW_TOTAL_BENEFICIOS_POR_MUNICIPIO
data: VW_TOTAL_BENEFICIOS_POR_MUNICIPIO.csv
name: VW_TOTAL_BENEFICIOS_POR_MUN_ENQUADRAMENTO
data: VW_TOTAL_BENEFICIOS_POR_MUN_ENQUADRAMENTO.csv
name: VW_TOTAL_BENEFICIOS_POR_UF
data: VW_TOTAL_BENEFICIOS_POR_UF.csv
label: VW_TOTAL_BENEFICIOS_POR_MUN_ENQUADRAMENTO
DT_DATA
TB_DIM_DATA
DT_DATA
VW_TOTAL_BENEFICIOS_POR_ENQUADRAMENTO
DT_DATA
TB_DIM_DATA
DT_DATA
VW_TOTAL_BENEFICIADOS_POR_MUNICIPIO
DT_DATA
TB_DIM_DATA
DT_DATA
VW_TOTAL_BENEFICIOS_POR_UF
DT_DATA
TB_DIM_DATA
DT_DATA
VW_TOTAL_BENEFICIOS_POR_MUNICIPIO
DT_DATA
TB_DIM_DATA
DT_DATA
VW_TOTAL_BENEFICIADOS_POR_MUNICIPIO
NM_MUNICIPIO_UF
VW_MUNICIPIOS
NM_MUNICIPIO_UF
VW_TOTAL_BENEFICIOS_POR_MUNICIPIO
NM_MUNICIPIO_UF
VW_MUNICIPIOS
NM_MUNICIPIO_UF
VW_MUNICIPIOS
NM_UF
TB_BASE_ESTADOS
NM_UF_ESTADO
VW_TOTAL_BENEFICIADOS_POR_UF
NM_UF
TB_BASE_ESTADOS
NM_UF_ESTADO
VW_TOTAL_BENEFICIOS_POR_UF
NM_UF
TB_BASE_ESTADOS
NM_UF_ESTADO
VW_TOTAL_BENEFICIOS_POR_MUN_ENQUADRAMENTO
NM_UF
TB_BASE_ESTADOS
NM_UF_ESTADO
VW_BENEFICIOS_MENOR_MAIOR
NM_ANO
TB_DIM_DATA
NM_ANO
output: {
    "joins": [
        {
            "from_table": "VW_TOTAL_BENEFICIOS_POR_MUN_ENQUADRAMENTO",
            "from_column": "DT_DATA",
            "to_table": "TB_DIM_DATA",
            "to_column": "DT_DATA"
        },
        {
            "from_table": "VW_TOTAL_BENEFICIOS_POR_ENQUADRAMENTO",
            "from_column": "DT_DATA",
            "to_table": "TB_DIM_DATA",
            "to_column": "DT_DATA"
        },
        {
            "from_table": "VW_TOTAL_BENEFICIADOS_POR_MUNICIPIO",
            "from_column": "DT_DATA",
            "to_table": "TB_DIM_DATA",
            "to_column": "DT_DATA"
        },
        {
            "from_table": "VW_TOTAL_BENEFICIOS_POR_UF",
            "from_column": "DT_DATA",
            "to_table": "TB_DIM_DATA",
            "to_column": "DT_DATA"
        },
        {
            "from_table": "VW_TOTAL_BENEFICIOS_POR_MUNICIPIO",
            "from_column": "DT_DATA",
            "to_table": "TB_DIM_DATA",
            "to_column": "DT_DATA"
        },
        {
            "from_table": "VW_TOTAL_BENEFICIADOS_POR_MUNICIPIO",
            "from_column": "NM_MUNICIPIO_UF",
            "to_table": "VW_MUNICIPIOS",
            "to_column": "NM_MUNICIPIO_UF"
        },
        {
            "from_table": "VW_TOTAL_BENEFICIOS_POR_MUNICIPIO",
            "from_column": "NM_MUNICIPIO_UF",
            "to_table": "VW_MUNICIPIOS",
            "to_column": "NM_MUNICIPIO_UF"
        },
        {
            "from_table": "VW_MUNICIPIOS",
            "from_column": "NM_UF",
            "to_table": "TB_BASE_ESTADOS",
            "to_column": "NM_UF_ESTADO"
        },
        {
            "from_table": "VW_TOTAL_BENEFICIADOS_POR_UF",
            "from_column": "NM_UF",
            "to_table": "TB_BASE_ESTADOS",
            "to_column": "NM_UF_ESTADO"
        },
        {
            "from_table": "VW_TOTAL_BENEFICIOS_POR_UF",
            "from_column": "NM_UF",
            "to_table": "TB_BASE_ESTADOS",
            "to_column": "NM_UF_ESTADO"
        },
        {
            "from_table": "VW_TOTAL_BENEFICIOS_POR_MUN_ENQUADRAMENTO",
            "from_column": "NM_UF",
            "to_table": "TB_BASE_ESTADOS",
            "to_column": "NM_UF_ESTADO"
        },
        {
            "from_table": "VW_BENEFICIOS_MENOR_MAIOR",
            "from_column": "NM_ANO",
            "to_table": "TB_DIM_DATA",
            "to_column": "NM_ANO"
        }
    ]
}