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: CRGDetalle
| Efector            | Prestacion   |   NroCrg |   IDPractica | Fecha de Prestacion     |   numero de dph | Fecha Emision CRG       |   EstadoCrg |          Importe | Id_Detalle   | Estado    | ID crg-efector           | Sumar   | ObraSocial                                                     |
|:-------------------|:-------------|---------:|-------------:|:------------------------|----------------:|:------------------------|------------:|-----------------:|:-------------|:----------|:-------------------------|:--------|:---------------------------------------------------------------|
| HOSPITAL FERNANDEZ | GUAR.02      |    30593 |            1 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |           4 |   5231           | 4-30593      | Facturado | 30593 HOSPITAL FERNANDEZ | True    | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | GUAR.03      |    30593 |            2 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |           4 | 147635           | 4-30593      | Facturado | 30593 HOSPITAL FERNANDEZ | True    | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | GUAR.04      |    30593 |            3 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |           4 | 198420           | 4-30593      | Facturado | 30593 HOSPITAL FERNANDEZ | True    | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | IAC.02       |    30593 |            4 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |           4 |  88581           | 4-30593      | Facturado | 30593 HOSPITAL FERNANDEZ | True    | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | IAC.03       |    30593 |            5 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |           4 |      1.62043e+06 | 4-30593      | Facturado | 30593 HOSPITAL FERNANDEZ | True    | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | CGE.01.12    |    30593 |            7 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |           4 |  13666           | 4-30593      | Facturado | 30593 HOSPITAL FERNANDEZ | True    | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | IMA.01       |    30593 |            8 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |           4 |  12409           | 4-30593      | Facturado | 30593 HOSPITAL FERNANDEZ | True    | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | DIAL.04      |    30593 |            9 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |           4 | 131888           | 4-30593      | Facturado | 30593 HOSPITAL FERNANDEZ | True    | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | HEM.23       |    30593 |           10 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |           4 |  78876           | 4-30593      | Facturado | 30593 HOSPITAL FERNANDEZ | True    | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | LAB.04.20    |    30593 |           11 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |           4 |   6384           | 4-30593      | Facturado | 30593 HOSPITAL FERNANDEZ | True    | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |


Table: CRGsFacturados
| Efector            | Factura       | EmisionFactura          | Prestacion   |   NroCrg | ObraSocial                                                     |   IDCRGdet | Fecha de Prestacion     |   numero de dph | Fecha Emision CRG       |       ImporteCRG | Id_Test       | Id_Detalle   |
|:-------------------|:--------------|:------------------------|:-------------|---------:|:---------------------------------------------------------------|-----------:|:------------------------|----------------:|:------------------------|-----------------:|:--------------|:-------------|
| HOSPITAL FERNANDEZ | FACB2-1-22749 | 2021-09-29 00:00:00.000 | GUAR.02      |    30593 | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |          1 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |   5231           | 4-30593-35852 | 4-30593      |
| HOSPITAL FERNANDEZ | FACB2-1-22749 | 2021-09-29 00:00:00.000 | GUAR.03      |    30593 | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |          2 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 | 147635           | 4-30593-35852 | 4-30593      |
| HOSPITAL FERNANDEZ | FACB2-1-22749 | 2021-09-29 00:00:00.000 | GUAR.04      |    30593 | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |          3 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 | 198420           | 4-30593-35852 | 4-30593      |
| HOSPITAL FERNANDEZ | FACB2-1-22749 | 2021-09-29 00:00:00.000 | IAC.02       |    30593 | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |          4 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |  88581           | 4-30593-35852 | 4-30593      |
| HOSPITAL FERNANDEZ | FACB2-1-22749 | 2021-09-29 00:00:00.000 | IAC.03       |    30593 | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |          5 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |      1.62043e+06 | 4-30593-35852 | 4-30593      |
| HOSPITAL FERNANDEZ | FACB2-1-22749 | 2021-09-29 00:00:00.000 | INC.01       |    30593 | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |          6 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 | 282860           | 4-30593-35852 | 4-30593      |
| HOSPITAL FERNANDEZ | FACB2-1-22749 | 2021-09-29 00:00:00.000 | CGE.01.12    |    30593 | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |          7 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |  13666           | 4-30593-35852 | 4-30593      |
| HOSPITAL FERNANDEZ | FACB2-1-22749 | 2021-09-29 00:00:00.000 | IMA.01       |    30593 | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |          8 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |  12409           | 4-30593-35852 | 4-30593      |
| HOSPITAL FERNANDEZ | FACB2-1-22749 | 2021-09-29 00:00:00.000 | DIAL.04      |    30593 | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |          9 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 | 131888           | 4-30593-35852 | 4-30593      |
| HOSPITAL FERNANDEZ | FACB2-1-22749 | 2021-09-29 00:00:00.000 | HEM.23       |    30593 | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |         10 | 2021-06-04 00:00:00.000 |           35852 | 2021-09-08 00:00:00.000 |  78876           | 4-30593-35852 | 4-30593      |


Table: CRGSuma
| Efector            | Prestacion   | Estado    |   EstadoCrg |          Importe |   NroCrg | Fecha Emision CRG       | ID crg-efector           |   IDPractica | Fecha de Prestacion     |   numero de dph | Sumar   | Id_Test       | Id_Detalle   | ObraSocial                                                     |
|:-------------------|:-------------|:----------|------------:|-----------------:|---------:|:------------------------|:-------------------------|-------------:|:------------------------|----------------:|:--------|:--------------|:-------------|:---------------------------------------------------------------|
| HOSPITAL FERNANDEZ | GUAR.02      | Facturado |           4 |   5231           |    30593 | 2021-09-08 00:00:00.000 | 30593 HOSPITAL FERNANDEZ |            1 | 2021-06-04 00:00:00.000 |           35852 | True    | 4-30593-35852 | 4-30593      | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | GUAR.03      | Facturado |           4 | 147635           |    30593 | 2021-09-08 00:00:00.000 | 30593 HOSPITAL FERNANDEZ |            2 | 2021-06-04 00:00:00.000 |           35852 | True    | 4-30593-35852 | 4-30593      | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | GUAR.04      | Facturado |           4 | 198420           |    30593 | 2021-09-08 00:00:00.000 | 30593 HOSPITAL FERNANDEZ |            3 | 2021-06-04 00:00:00.000 |           35852 | True    | 4-30593-35852 | 4-30593      | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | IAC.02       | Facturado |           4 |  88581           |    30593 | 2021-09-08 00:00:00.000 | 30593 HOSPITAL FERNANDEZ |            4 | 2021-06-04 00:00:00.000 |           35852 | True    | 4-30593-35852 | 4-30593      | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | IAC.03       | Facturado |           4 |      1.62043e+06 |    30593 | 2021-09-08 00:00:00.000 | 30593 HOSPITAL FERNANDEZ |            5 | 2021-06-04 00:00:00.000 |           35852 | True    | 4-30593-35852 | 4-30593      | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | CGE.01.12    | Facturado |           4 |  13666           |    30593 | 2021-09-08 00:00:00.000 | 30593 HOSPITAL FERNANDEZ |            7 | 2021-06-04 00:00:00.000 |           35852 | True    | 4-30593-35852 | 4-30593      | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | IMA.01       | Facturado |           4 |  12409           |    30593 | 2021-09-08 00:00:00.000 | 30593 HOSPITAL FERNANDEZ |            8 | 2021-06-04 00:00:00.000 |           35852 | True    | 4-30593-35852 | 4-30593      | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | DIAL.04      | Facturado |           4 | 131888           |    30593 | 2021-09-08 00:00:00.000 | 30593 HOSPITAL FERNANDEZ |            9 | 2021-06-04 00:00:00.000 |           35852 | True    | 4-30593-35852 | 4-30593      | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | HEM.23       | Facturado |           4 |  78876           |    30593 | 2021-09-08 00:00:00.000 | 30593 HOSPITAL FERNANDEZ |           10 | 2021-06-04 00:00:00.000 |           35852 | True    | 4-30593-35852 | 4-30593      | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |
| HOSPITAL FERNANDEZ | LAB.04.20    | Facturado |           4 |   6384           |    30593 | 2021-09-08 00:00:00.000 | 30593 HOSPITAL FERNANDEZ |           11 | 2021-06-04 00:00:00.000 |           35852 | True    | 4-30593-35852 | 4-30593      | OBRA SOCIAL DE LOS EMPLEADOS DE COMERCIO Y ACTIVIDADES CIVILES |


Table: EstadosCRGs
|   id | Estado                |
|-----:|:----------------------|
|    1 | Ingresado             |
|    2 | Remitido              |
|    3 | Proforma              |
|    4 | Facturado             |
|    5 | Remitir Factura       |
|    6 | Envio GCBA            |
|    7 | Liquido Producto      |
|    8 | Comisiones Liquidadas |
|    9 | Auditado              |
|   10 | Pendiente Medico      |


Table: Universo
|   pprid |   crgnum | id_detalle   |
|--------:|---------:|:-------------|
|       4 |    30051 | 4-30051      |
|       4 |    29698 | 4-29698      |
|       4 |    30529 | 4-30529      |
|       4 |    29625 | 4-29625      |
|       4 |    30220 | 4-30220      |
|       4 |    30520 | 4-30520      |
|       4 |    31160 | 4-31160      |
|       4 |    30630 | 4-30630      |
|       4 |    31166 | 4-31166      |
|       4 |    29563 | 4-29563      |

 


tables: name: CRGDetalle
data: CRGDetalle.csv
name: CRGsFacturados
data: CRGsFacturados.csv
name: CRGSuma
data: CRGSuma.csv
name: EstadosCRGs
data: EstadosCRGs.csv
name: Universo
data: Universo.csv
label: CRGSuma
Estado
EstadosCRGs
Estado
CRGDetalle
Estado
EstadosCRGs
Estado
CRGSuma
Id_Detalle
Universo
id_detalle
CRGDetalle
Id_Detalle
Universo
id_detalle
CRGsFacturados
Id_Detalle
Universo
id_detalle
output: {
    "joins": [
        {
            "from_table": "CRGSuma",
            "from_column": "Estado",
            "to_table": "EstadosCRGs",
            "to_column": "Estado"
        },
        {
            "from_table": "CRGDetalle",
            "from_column": "Estado",
            "to_table": "EstadosCRGs",
            "to_column": "Estado"
        },
        {
            "from_table": "CRGSuma",
            "from_column": "Id_Detalle",
            "to_table": "Universo",
            "to_column": "id_detalle"
        },
        {
            "from_table": "CRGDetalle",
            "from_column": "Id_Detalle",
            "to_table": "Universo",
            "to_column": "id_detalle"
        },
        {
            "from_table": "CRGsFacturados",
            "from_column": "Id_Detalle",
            "to_table": "Universo",
            "to_column": "id_detalle"
        }
    ]
}