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: Calendar
| Date                    |   MonthNum | Month   | MonthLong   | Quarter   |   Year |   FiscalMonthNum | FiscalMonth   | FiscalMonthLong   | FiscalQuarter   | FiscalYear   |   CurMonthOffset |   CurQuarterOffset |   CurYearOffset | FutureDate   |   MonthYearNum | MonthYear   | MonthYearLong   |   WeekdayNum | Weekday   | WeekdayWeekend   |   WeekSequenceNum |   CurWeekOffset | MonthYearDate           | CurMonth   |   CurMonthSort | QTD   |   QTDSort | YTD   |   YTDSort |
|:------------------------|-----------:|:--------|:------------|:----------|-------:|-----------------:|:--------------|:------------------|:----------------|:-------------|-----------------:|-------------------:|----------------:|:-------------|---------------:|:------------|:----------------|-------------:|:----------|:-----------------|------------------:|----------------:|:------------------------|:-----------|---------------:|:------|----------:|:------|----------:|
| 2016-01-01 00:00:00.000 |          1 | ene     | enero       | Q1        |   2016 |                1 | ene           | enero             | FQ1             | FY16         |              -23 |                 -7 |              -1 | Past         |         201601 | ene-16      | ene-2016        |            4 | vie       | Weekday          |                 1 |            -102 | 2016-01-01 00:00:00.000 |            |              2 |       |         2 |       |         2 |
| 2016-01-02 00:00:00.000 |          1 | ene     | enero       | Q1        |   2016 |                1 | ene           | enero             | FQ1             | FY16         |              -23 |                 -7 |              -1 | Past         |         201601 | ene-16      | ene-2016        |            5 | sáb       | Weekday          |                 1 |            -102 | 2016-01-01 00:00:00.000 |            |              2 |       |         2 |       |         2 |
| 2016-01-05 00:00:00.000 |          1 | ene     | enero       | Q1        |   2016 |                1 | ene           | enero             | FQ1             | FY16         |              -23 |                 -7 |              -1 | Past         |         201601 | ene-16      | ene-2016        |            1 | mar       | Weekday          |                 2 |            -101 | 2016-01-01 00:00:00.000 |            |              2 |       |         2 |       |         2 |
| 2016-01-06 00:00:00.000 |          1 | ene     | enero       | Q1        |   2016 |                1 | ene           | enero             | FQ1             | FY16         |              -23 |                 -7 |              -1 | Past         |         201601 | ene-16      | ene-2016        |            2 | mié       | Weekday          |                 2 |            -101 | 2016-01-01 00:00:00.000 |            |              2 |       |         2 |       |         2 |
| 2016-01-07 00:00:00.000 |          1 | ene     | enero       | Q1        |   2016 |                1 | ene           | enero             | FQ1             | FY16         |              -23 |                 -7 |              -1 | Past         |         201601 | ene-16      | ene-2016        |            3 | jue       | Weekday          |                 2 |            -101 | 2016-01-01 00:00:00.000 |            |              2 |       |         2 |       |         2 |
| 2016-01-08 00:00:00.000 |          1 | ene     | enero       | Q1        |   2016 |                1 | ene           | enero             | FQ1             | FY16         |              -23 |                 -7 |              -1 | Past         |         201601 | ene-16      | ene-2016        |            4 | vie       | Weekday          |                 2 |            -101 | 2016-01-01 00:00:00.000 |            |              2 |       |         2 |       |         2 |
| 2016-01-09 00:00:00.000 |          1 | ene     | enero       | Q1        |   2016 |                1 | ene           | enero             | FQ1             | FY16         |              -23 |                 -7 |              -1 | Past         |         201601 | ene-16      | ene-2016        |            5 | sáb       | Weekday          |                 2 |            -101 | 2016-01-01 00:00:00.000 |            |              2 |       |         2 |       |         2 |
| 2016-01-12 00:00:00.000 |          1 | ene     | enero       | Q1        |   2016 |                1 | ene           | enero             | FQ1             | FY16         |              -23 |                 -7 |              -1 | Past         |         201601 | ene-16      | ene-2016        |            1 | mar       | Weekday          |                 3 |            -100 | 2016-01-01 00:00:00.000 |            |              2 |       |         2 |       |         2 |
| 2016-01-13 00:00:00.000 |          1 | ene     | enero       | Q1        |   2016 |                1 | ene           | enero             | FQ1             | FY16         |              -23 |                 -7 |              -1 | Past         |         201601 | ene-16      | ene-2016        |            2 | mié       | Weekday          |                 3 |            -100 | 2016-01-01 00:00:00.000 |            |              2 |       |         2 |       |         2 |
| 2016-01-14 00:00:00.000 |          1 | ene     | enero       | Q1        |   2016 |                1 | ene           | enero             | FQ1             | FY16         |              -23 |                 -7 |              -1 | Past         |         201601 | ene-16      | ene-2016        |            3 | jue       | Weekday          |                 3 |            -100 | 2016-01-01 00:00:00.000 |            |              2 |       |         2 |       |         2 |


Table: cunits
|   cunitId | reference   | cunitName                                                                    | description                                                                                                                           |   cost |
|----------:|:------------|:-----------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|-------:|
|      1391 | P/C79       | P/C79 - CUCHILLA DE OPERACIÓN EN GRUPO 15KV                                  | ACOPIO, SUMINISTRO Y TRANSPORTE DE MATERIALES. MONTAJE DEL CONJUNTO,  RETENSADO DE CONDUCTORES. APERTURA  Y CIERRE DONDE SE REQUIERA. |      0 |
|      1392 | P/C80       | P/C80 - CUCHILLA DE OPERACIÓN EN GRUPO 35KV                                  | ACOPIO, SUMINISTRO Y TRANSPORTE DE MATERIALES. MONTAJE DEL CONJUNTO,  RETENSADO DE CONDUCTORES. APERTURA  Y CIERRE DONDE SE REQUIERA. |      0 |
|      1411 | 07301208    | 07301208 - MONTAJE BASE SECCIONADOR FUSIBLE FIJACIÓN EN POSTE 34,5 KV 200 A  | ACOPIO, SUMINISTRO Y TRANSPORTE DE MATERIALES. MONTAJE DEL CONJUNTO,  RETENSADO DE CONDUCTORES. APERTURA  Y CIERRE DONDE SE REQUIERA. |      0 |
|      1435 | 07352008    | 07352008 - MONTAJE PARARRAYOS AUTOVALVULAS EN POSTE PARA CIRCUITO TRIFÁSICO  | ACOPIO, SUMINISTRO Y TRANSPORTE DE MATERIALES. MONTAJE DEL CONJUNTO,  RETENSADO DE CONDUCTORES. APERTURA  Y CIERRE DONDE SE REQUIERA. |      0 |
|      1436 | 07352108    | 07352108 - MONTAJE PARARRAYOS AUTOVALVULAS EN POSTE PARA CIRCUITO MONOFÁSICO | ACOPIO, SUMINISTRO Y TRANSPORTE DE MATERIALES. MONTAJE DEL CONJUNTO,  RETENSADO DE CONDUCTORES. APERTURA  Y CIERRE DONDE SE REQUIERA. |      0 |
|      2081 | 27304200    | 27304200 - CENTRO SEC. TRIF.(3L3) CON CASETA PREF. HORMIGÓN 35 KV 400 A      | ACOPIO, SUMINISTRO Y TRANSPORTE DE MATERIALES. MONTAJE DEL CONJUNTO,  RETENSADO DE CONDUCTORES. APERTURA  Y CIERRE DONDE SE REQUIERA. |      0 |
|      2082 | 27305000    | 27305000 - CENTRO SEC. TRIF.(4L4) CON CASETA PREF. HORMIGÓN 15 KV 630 A      | ACOPIO, SUMINISTRO Y TRANSPORTE DE MATERIALES. MONTAJE DEL CONJUNTO,  RETENSADO DE CONDUCTORES. APERTURA  Y CIERRE DONDE SE REQUIERA. |      0 |
|      2083 | 27305200    | 27305200 - CENTRO SEC. TRIF.(4L4) CON CASETA PREF. HORMIGÓN 35 KV 400 A      | ACOPIO, SUMINISTRO Y TRANSPORTE DE MATERIALES. MONTAJE DEL CONJUNTO,  RETENSADO DE CONDUCTORES. APERTURA  Y CIERRE DONDE SE REQUIERA. |      0 |
|      2087 | 27304000    | 27304000 - CENTRO SEC. TRIF.(3L3) CON CASETA PREF. HORMIGÓN 15 KV 630 A      | ACOPIO, SUMINISTRO Y TRANSPORTE DE MATERIALES. MONTAJE DEL CONJUNTO,  RETENSADO DE CONDUCTORES. APERTURA  Y CIERRE DONDE SE REQUIERA. |      0 |
|      2222 | 0314000007  | 0314000007 - ETIQUETADO DE EQUIPOS E INSTALACIONES                           | ACOPIO, SUMINISTRO Y TRANSPORTE DE MATERIALES. MONTAJE DEL CONJUNTO,  RETENSADO DE CONDUCTORES. APERTURA  Y CIERRE DONDE SE REQUIERA. |      0 |


Table: pl
|   plId | endDate   |   workerId |   pwId | comments   |   teamId |   zoneId | plDate                  |
|-------:|:----------|-----------:|-------:|:-----------|---------:|---------:|:------------------------|
|      2 |           |        235 |   1064 |            |       18 |        2 | 2017-11-01 00:00:00.000 |
|      4 |           |        235 |   1064 |            |       18 |        2 | 2017-11-02 00:00:00.000 |
|      5 |           |        235 |   1064 |            |       18 |        2 | 2017-11-03 00:00:00.000 |
|      6 |           |        235 |   1207 | 13/11/2017 |       18 |        2 | 2017-11-13 00:00:00.000 |
|      7 |           |        235 |   1207 | 14/11/2017 |       18 |        2 | 2017-11-14 00:00:00.000 |
|      8 |           |        235 |   1207 | 22/11/2017 |       18 |        2 | 2017-11-22 00:00:00.000 |
|      9 |           |        235 |   1273 | dia 1      |       19 |        2 | 2017-11-06 00:00:00.000 |
|     10 |           |        235 |   1250 | 13/11/2017 |       21 |        2 | 2017-11-13 00:00:00.000 |
|     11 |           |        235 |   1250 | 14/11/2017 |       21 |        2 | 2017-11-14 00:00:00.000 |
|     12 |           |        235 |   1250 | 15/11/2017 |       21 |        2 | 2017-11-15 00:00:00.000 |


Table: pllines
|   plLineId |   plId |   cunitId |   estimate | prevPlanned   |   done |   quantity |   chapterId |   pwLineId |   unitCost |   pl.pwId |   pl.teamId |   pl.zoneId | pl.plDate               |
|-----------:|-------:|----------:|-----------:|:--------------|-------:|-----------:|------------:|-----------:|-----------:|----------:|------------:|------------:|:------------------------|
|         40 |      2 |       343 |          1 |               |      0 |          0 |        1316 |      11528 |      74.53 |      1064 |          18 |           2 | 2017-11-01 00:00:00.000 |
|         41 |      2 |      1565 |          1 |               |      0 |          0 |        1316 |      11529 |      19.52 |      1064 |          18 |           2 | 2017-11-01 00:00:00.000 |
|         45 |      2 |      3193 |          1 |               |      0 |          0 |        1316 |      11533 |      21.33 |      1064 |          18 |           2 | 2017-11-01 00:00:00.000 |
|         46 |      2 |      1688 |          1 |               |      0 |          0 |        1317 |      11534 |      13.13 |      1064 |          18 |           2 | 2017-11-01 00:00:00.000 |
|         47 |      2 |      1704 |          1 |               |      0 |          0 |        1317 |      11535 |       6.61 |      1064 |          18 |           2 | 2017-11-01 00:00:00.000 |
|         49 |      2 |      1739 |          1 |               |      0 |          0 |        1317 |      11537 |       0.9  |      1064 |          18 |           2 | 2017-11-01 00:00:00.000 |
|         50 |      2 |      1245 |          1 |               |      0 |          0 |        1318 |      11538 |     124.14 |      1064 |          18 |           2 | 2017-11-01 00:00:00.000 |
|         51 |      2 |      1313 |          1 |               |      0 |          0 |        1318 |      11539 |       1.65 |      1064 |          18 |           2 | 2017-11-01 00:00:00.000 |
|         52 |      2 |      1459 |          1 |               |      0 |          0 |        1318 |      11540 |      14.11 |      1064 |          18 |           2 | 2017-11-01 00:00:00.000 |
|         53 |      2 |      1470 |          1 |               |      0 |          0 |        1318 |      11541 |      74.29 |      1064 |          18 |           2 | 2017-11-01 00:00:00.000 |


Table: pws
|   pwId | reference       | pwName                              | initDate                |   statusId | statusName   |   zoneId | zoneName             |   initInChargeId | initInChargeName   |
|-------:|:----------------|:------------------------------------|:------------------------|-----------:|:-------------|---------:|:---------------------|-----------------:|:-------------------|
|     82 | 201012016090574 | OER LA ORTIGA                       | 2017-02-19 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|     88 | 201012016110670 | S.A. FUDESA                         | 2017-02-19 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|    193 | 201012016110209 | FAUSTINO (AVICOLA) MORAN            | 2016-11-09 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|    195 | 201012016110654 | AMANDA GUILLEN ODA                  | 2016-11-25 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|    206 | 201012016100178 | TERESA ORTEGA GONZALEZ DE RODRIGUEZ | 2017-02-14 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|    246 | 201012016100074 | junta comunal los canelos           | 2016-10-03 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|    253 | 201012016120528 | FEDUROS.A, AGENCIAS                 | 2016-12-15 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|    263 | 201012016100771 | EDUCACION MINISTERIO DE LAS GUIAS   | 2016-10-26 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|    265 | 201022016100052 | ADONAIS MARIN MOJICA                | 2016-10-03 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|    269 | 201012016I10188 | EVELYN ZULEIKA JAEN RAMOS           | 2016-11-07 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |


Table: teams
|   teamId | name           | workerInChargeId   |   zoneId | zones.zoneName   |
|---------:|:---------------|:-------------------|---------:|:-----------------|
|        1 | Operaciones    |                    |        1 | David            |
|        2 | Administracion |                    |        1 | David            |
|        3 | TPR            |                    |        1 | David            |
|        4 | Mantenimiento  |                    |        1 | David            |
|        5 | Almacen        |                    |        1 | David            |
|        6 | Bozzi          | 288                |        1 | David            |
|        7 | Omar           | 288                |        1 | David            |
|        8 | Angel          | 288                |        1 | David            |
|        9 | Juvenal        | 288                |        1 | David            |
|       10 | Edgar Moreno   | 288                |        1 | David            |


Table: wolines
|   woLineId |   woId |   cunitId |   estimate |   done |   quantity |   planned | plLineId   |   pwlCost |   zoneId | plId   | initDateWo   |   woId.1 |   workerId |   pwId |
|-----------:|-------:|----------:|-----------:|-------:|-----------:|----------:|:-----------|----------:|---------:|:-------|:-------------|---------:|-----------:|-------:|
|       8629 |    179 |      2158 |          1 |      0 |          1 |         0 |            |  149.76   |        2 |        | 2017-03-03   |      179 |         17 |     85 |
|       8679 |    182 |       491 |          1 |      0 |          1 |         0 |            |   73.5616 |        2 |        | 2017-03-04   |      182 |         17 |    252 |
|       8686 |    182 |      1625 |          1 |      0 |          1 |         0 |            |   57.7536 |        2 |        | 2017-03-04   |      182 |         17 |    252 |
|       8688 |    182 |      1632 |          1 |      0 |          1 |         0 |            |   54.8736 |        2 |        | 2017-03-04   |      182 |         17 |    252 |
|       9424 |    195 |      2158 |          1 |      0 |          1 |         0 |            |  147.456  |        2 |        | 2017-03-02   |      195 |         17 |    187 |
|       9427 |    195 |      2185 |          1 |      0 |          1 |         0 |            |   48.896  |        2 |        | 2017-03-02   |      195 |         17 |    187 |
|       9431 |    195 |      3626 |          1 |      0 |          1 |         0 |            |    1.3952 |        2 |        | 2017-03-02   |      195 |         17 |    187 |
|       9449 |    196 |      3210 |          1 |      0 |          1 |         0 |            |    0      |        2 |        | 2017-03-06   |      196 |         17 |   1020 |
|       9450 |    196 |      1736 |          1 |      0 |          1 |         0 |            |    1.404  |        2 |        | 2017-03-06   |      196 |         17 |   1020 |
|       9467 |    197 |       469 |          1 |      0 |          1 |         0 |            |   34.918  |        2 |        | 2017-03-06   |      197 |         17 |   1003 |


Table: workers
|   workerId | workerName         |
|-----------:|:-------------------|
|         13 | CASTREJON, TOMAS   |
|         14 | AGUILAR, VALENTINA |
|         15 | DE LEON, DAYAN     |
|         16 | MORAN, HERMOGENES  |
|         17 | RODRIGUEZ, SIMON   |
|         18 | HERNANDEZ, DORIS   |
|         19 | SALAZAR, KATHERINE |
|         20 | TREJOS, HADAMEIBYS |
|         21 | CASTRO, FELICIA    |
|         22 | ZAPATA, EVELYN     |


Table: wos
|   zoneId | plId   | initDateWo   |   woId |   workerId |   pwId |
|---------:|:-------|:-------------|-------:|-----------:|-------:|
|        1 |        | 2017-06-01   |   1001 |        288 |   1241 |
|        1 |        | 2017-06-05   |   1004 |        288 |   1241 |
|        1 |        | 2017-06-17   |   1017 |        288 |   1241 |
|        1 |        | 2017-06-06   |   1147 |        288 |   1241 |
|        1 |        | 2017-06-07   |   1149 |        288 |   1241 |
|        1 |        | 2017-06-08   |   1150 |        288 |   1241 |
|        1 |        | 2017-06-09   |   1151 |        288 |   1241 |
|        1 |        | 2017-06-10   |   1152 |        288 |   1241 |
|        1 |        | 2017-06-20   |   1186 |        288 |   1241 |
|        1 |        | 2017-06-22   |   1187 |        288 |   1241 |


Table: zones
|   zoneId | zoneName                                          |
|---------:|:--------------------------------------------------|
|        1 | David                                             |
|        2 | Provincias Centrales                              |
|        3 | Ordenes de Servicio y Medida David                |
|        4 | Ordenes de Servicio y Medida Provincias Centrales |
|        5 | Pruebas                                           |
|        6 | Administrativa                                    |
|        7 | AJUSTE ADMINSTRATIVO                              |
|        8 | David/Provincias Centrales                        |
|       10 | Pruebas PWBI TEST3                                |

 


tables: name: Calendar
data: Calendar.csv
name: cunits
data: cunits.csv
name: pl
data: pl.csv
name: pllines
data: pllines.csv
name: pws
data: pws.csv
name: teams
data: teams.csv
name: wolines
data: wolines.csv
name: workers
data: workers.csv
name: wos
data: wos.csv
name: zones
data: zones.csv
label: pllines
cunitId
cunits
cunitId
pllines
pl.pwId
pws
pwId
pllines
pl.teamId
teams
teamId
pllines
pl.zoneId
zones
zoneId
pllines
pl.plDate
Calendar
Date
pllines
plId
pl
plId
wos
workerId
workers
workerId
wolines
workerId
workers
workerId
wolines
pwId
pws
pwId
wolines
cunitId
cunits
cunitId
wolines
initDateWo
Calendar
Date
output: {
    "joins": [
        {
            "from_table": "pllines",
            "from_column": "cunitId",
            "to_table": "cunits",
            "to_column": "cunitId"
        },
        {
            "from_table": "pllines",
            "from_column": "pl.pwId",
            "to_table": "pws",
            "to_column": "pwId"
        },
        {
            "from_table": "pllines",
            "from_column": "pl.teamId",
            "to_table": "teams",
            "to_column": "teamId"
        },
        {
            "from_table": "pllines",
            "from_column": "pl.zoneId",
            "to_table": "zones",
            "to_column": "zoneId"
        },
        {
            "from_table": "pllines",
            "from_column": "pl.plDate",
            "to_table": "Calendar",
            "to_column": "Date"
        },
        {
            "from_table": "pllines",
            "from_column": "plId",
            "to_table": "pl",
            "to_column": "plId"
        },
        {
            "from_table": "wos",
            "from_column": "workerId",
            "to_table": "workers",
            "to_column": "workerId"
        },
        {
            "from_table": "wolines",
            "from_column": "workerId",
            "to_table": "workers",
            "to_column": "workerId"
        },
        {
            "from_table": "wolines",
            "from_column": "pwId",
            "to_table": "pws",
            "to_column": "pwId"
        },
        {
            "from_table": "wolines",
            "from_column": "cunitId",
            "to_table": "cunits",
            "to_column": "cunitId"
        },
        {
            "from_table": "wolines",
            "from_column": "initDateWo",
            "to_table": "Calendar",
            "to_column": "Date"
        }
    ]
}