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          |                53 |            -101 | 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          |                53 |            -101 | 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          |                54 |            -100 | 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          |                54 |            -100 | 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          |                54 |            -100 | 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          |                54 |            -100 | 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          |                54 |            -100 | 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          |                55 |             -99 | 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          |                55 |             -99 | 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          |                55 |             -99 | 2016-01-01 00:00:00.000 |            |              2 |       |         2 |       |         2 |


Table: contahours
| Fecha Contadores        |   zoneId |   teamId |   moWorkerId |   moId |   workerId |   quantity |   cost |   normalHours | extraHours   | initialKm   | finalKm   | totalKm   | fuel   | planHours   | extraHoursNight   | expenses   |
|:------------------------|---------:|---------:|-------------:|-------:|-----------:|-----------:|-------:|--------------:|:-------------|:------------|:----------|:----------|:-------|:------------|:------------------|:-----------|
| 2017-06-10 00:00:00.000 |        4 |       67 |          635 |    159 |        102 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-09 00:00:00.000 |        4 |       67 |          893 |    224 |        102 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-01 00:00:00.000 |        4 |       67 |          972 |    244 |        102 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-13 00:00:00.000 |        4 |       67 |         1008 |    253 |        102 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-14 00:00:00.000 |        4 |       67 |         1183 |    296 |        102 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-02 00:00:00.000 |        4 |       67 |         1335 |    334 |        102 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-03 00:00:00.000 |        4 |       67 |         1382 |    346 |        102 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-05 00:00:00.000 |        4 |       67 |         1468 |    366 |        102 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-06 00:00:00.000 |        4 |       67 |         1516 |    378 |        102 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-07 00:00:00.000 |        4 |       67 |         1560 |    389 |        102 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |


Table: lumhours
| Fecha Luminaria         |   zoneId |   teamId |   moWorkerId |   moId |   workerId |   quantity |   cost |   normalHours | extraHours   | initialKm   | finalKm   | totalKm   | fuel   | planHours   | extraHoursNight   | expenses   |
|:------------------------|---------:|---------:|-------------:|-------:|-----------:|-----------:|-------:|--------------:|:-------------|:------------|:----------|:----------|:-------|:------------|:------------------|:-----------|
| 2017-06-01 00:00:00.000 |        2 |       22 |         2742 |    683 |        264 |          8 |   4.88 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-05 00:00:00.000 |        2 |       22 |         2899 |    722 |        264 |          8 |   4.88 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-06 00:00:00.000 |        2 |       22 |         2903 |    723 |        264 |          8 |   4.88 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-07 00:00:00.000 |        2 |       22 |         2907 |    724 |        264 |          8 |   4.88 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-09 00:00:00.000 |        2 |       22 |         2911 |    725 |        264 |          8 |   4.88 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-10 00:00:00.000 |        2 |       22 |         2915 |    726 |        264 |          8 |   4.88 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-15 00:00:00.000 |        2 |       22 |         2919 |    727 |        264 |          8 |   4.88 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-19 00:00:00.000 |        2 |       22 |         2923 |    728 |        264 |          8 |   4.88 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-21 00:00:00.000 |        2 |       22 |         2927 |    729 |        264 |          8 |   4.88 |             8 |              |             |           |           |        |             |                   |            |
| 2017-06-23 00:00:00.000 |        2 |       22 |         2931 |    730 |        264 |          8 |   4.88 |             8 |              |             |           |           |        |             |                   |            |


Table: pws
|   pwId |       reference | pwName                               | description   | initDate                |   statusId | statusName   |   zoneId | zoneName             |   initInChargeId | initInChargeName   |
|-------:|----------------:|:-------------------------------------|:--------------|:------------------------|-----------:|:-------------|---------:|:---------------------|-----------------:|:-------------------|
|    996 | 202022016120969 | JORGE ARNULFO MOLINA ACOSTA          |               | 2017-01-03 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|   1001 | 201012015020018 | OER LOS REYES                        |               | 2016-12-01 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|   1007 | 202022016080206 | HIELO CRISTAL, S.A.                  |               | 2016-12-31 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|   1008 | 201012016080541 | YAMAIRA TREJOS MUÑOZ                 |               | 2016-09-16 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|   1012 | 201012016120777 | S.A. RUEDCA                          |               | 2017-06-30 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|   1021 | 202022017010154 | DILSA YANETH SANCHEZ RODRIGUEZ       |               | 2017-03-07 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|   1025 | 201012016120754 | YARIELA SANCHEZ OLACIREGUI DE VINDAS |               | 2016-12-21 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|   1026 | 201012017010098 | ROLANDO ENRIQUE DE SALAS QUIROS      |               | 2017-01-10 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|   1036 | 201012016040908 | COLEGIO SAN AGUSTIN PENONOME         |               | 2016-07-07 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |
|   1041 | 202022017020156 | DELFILIA QUINTERO ALMANZA            |               | 2017-04-20 00:00:00.000 |          1 | ACEPTADO     |        2 | Provincias Centrales |               17 | RODRIGUEZ, SIMON   |


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


Table: wolines
|   woLineId |   woId |   cunitId |   estimate |   done |   quantity |   chapterId |   pwLineId |   pwlCost |   prodCost |
|-----------:|-------:|----------:|-----------:|-------:|-----------:|------------:|-----------:|----------:|-----------:|
|      42153 |    813 |      1687 |          1 |      0 |          1 |        1264 |      11114 |    16.419 |     16.419 |
|      71891 |   1203 |      1687 |          1 |      0 |          1 |        1990 |      17363 |    16.419 |     16.419 |
|      71953 |   1205 |      1687 |          1 |      0 |          1 |        1988 |      17342 |    16.419 |     16.419 |
|      86612 |   1381 |      1687 |          1 |      0 |          1 |        2080 |      17893 |    16.419 |     16.419 |
|      91927 |   1457 |      1687 |          1 |      0 |          1 |        2078 |      17875 |    16.419 |     16.419 |
|      92011 |   1459 |      1687 |          1 |      0 |          1 |        1370 |      11928 |    16.419 |     16.419 |
|     102041 |   1585 |      1687 |          1 |      0 |          1 |        2167 |      18622 |    16.419 |     16.419 |
|     133452 |   1889 |      1687 |          1 |      0 |          1 |        2280 |      19582 |    16.419 |     16.419 |
|     133654 |   1894 |      1687 |          1 |      0 |          1 |        2071 |      17843 |    16.419 |     16.419 |
|     153566 |   2062 |      1687 |          1 |      0 |          1 |        2315 |      19927 |    16.419 |     16.419 |


Table: workedhours
| Fecha Parte             |   zoneId |   teamId |   woWorkerId |   woId |   workerId |   quantity |   cost |   normalHours | extraHours   | initialKm   | finalKm   | totalKm   | fuel   | planHours   | extraHoursNight   | expenses   |   pwId |
|:------------------------|---------:|---------:|-------------:|-------:|-----------:|-----------:|-------:|--------------:|:-------------|:------------|:----------|:----------|:-------|:------------|:------------------|:-----------|-------:|
| 2017-06-09 00:00:00.000 |        1 |        6 |         6190 |   1090 |        188 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |   1292 |
| 2017-06-09 00:00:00.000 |        1 |        6 |         6194 |   1090 |        183 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |   1292 |
| 2017-06-09 00:00:00.000 |        1 |        6 |         6195 |   1090 |        184 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |   1292 |
| 2017-06-09 00:00:00.000 |        1 |        6 |         6196 |   1090 |        210 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |   1292 |
| 2017-06-09 00:00:00.000 |        1 |        6 |         6197 |   1090 |        313 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |   1292 |
| 2017-06-09 00:00:00.000 |        1 |        6 |         6199 |   1090 |        315 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |   1292 |
| 2017-06-09 00:00:00.000 |        1 |        6 |         6201 |   1090 |        317 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |   1292 |
| 2017-06-09 00:00:00.000 |        1 |        6 |         6202 |   1090 |        318 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |   1292 |
| 2017-06-09 00:00:00.000 |        1 |        6 |         6203 |   1090 |        319 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |   1292 |
| 2017-08-02 00:00:00.000 |        1 |        6 |        13908 |   1934 |        183 |          8 |   4.28 |             8 |              |             |           |           |        |             |                   |            |   1292 |


Table: workers
|   workerId | Trabajador         |
|-----------:|:-------------------|
|         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
|   woId | initDate                | endDate   |   workerId |   pwId | comments                              | closureId   |   thirdParty | thirdPartyCompany   |   teamId |   dayTypeId |   zoneId | Fecha parte             | Responsable   |
|-------:|:------------------------|:----------|-----------:|-------:|:--------------------------------------|:------------|-------------:|:--------------------|---------:|------------:|---------:|:------------------------|:--------------|
|   7857 | 2018-01-01 00:00:00.000 |           |        130 |   2280 | PARTE DE LA ORDEN: 5794 DE 01/01/2018 |             |            0 |                     |       67 |           0 |        4 | 2018-01-01 00:00:00.000 | DEAGO, IRMA   |
|   7886 | 2018-01-02 00:00:00.000 |           |        130 |   2280 | PARTE DE LA ORDEN: 5806 DE 02/01/2018 |             |            0 |                     |       67 |           0 |        4 | 2018-01-02 00:00:00.000 | DEAGO, IRMA   |
|   7920 | 2018-01-03 00:00:00.000 |           |        130 |   2280 | PARTE DE LA ORDEN: 5818 DE 03/01/2018 |             |            0 |                     |       67 |           0 |        4 | 2018-01-03 00:00:00.000 | DEAGO, IRMA   |
|   7952 | 2018-01-04 00:00:00.000 |           |        130 |   2280 | PARTE DE LA ORDEN: 5830 DE 04/01/2018 |             |            0 |                     |       67 |           0 |        4 | 2018-01-04 00:00:00.000 | DEAGO, IRMA   |
|   7953 | 2018-01-04 00:00:00.000 |           |        130 |   2280 | PARTE DE LA ORDEN: 5831 DE 04/01/2018 |             |            0 |                     |       67 |           0 |        4 | 2018-01-04 00:00:00.000 | DEAGO, IRMA   |
|   7983 | 2018-01-05 00:00:00.000 |           |        130 |   2280 | PARTE DE LA ORDEN: 5843 DE 05/01/2018 |             |            0 |                     |       67 |           0 |        4 | 2018-01-05 00:00:00.000 | DEAGO, IRMA   |
|   8019 | 2018-01-06 00:00:00.000 |           |        130 |   2280 | PARTE DE LA ORDEN: 5854 DE 06/01/2018 |             |            0 |                     |       67 |           0 |        4 | 2018-01-06 00:00:00.000 | DEAGO, IRMA   |
|   8052 | 2018-01-08 00:00:00.000 |           |        130 |   2280 | PARTE DE LA ORDEN: 5866 DE 08/01/2018 |             |            0 |                     |       67 |           0 |        4 | 2018-01-08 00:00:00.000 | DEAGO, IRMA   |
|   8088 | 2018-01-10 00:00:00.000 |           |        130 |   2280 | PARTE DE LA ORDEN: 5878 DE 10/01/2018 |             |            0 |                     |       67 |           0 |        4 | 2018-01-10 00:00:00.000 | DEAGO, IRMA   |
|   8097 | 2018-01-11 00:00:00.000 |           |        130 |   2280 | PARTE DE LA ORDEN: 5898 DE 11/01/2018 |             |            0 |                     |       67 |           0 |        4 | 2018-01-11 00:00:00.000 | DEAGO, IRMA   |


Table: zones
|   zoneId | Zona                                              |
|---------:|:--------------------------------------------------|
|        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                        |

 


tables: name: Calendar
data: Calendar.csv
name: contahours
data: contahours.csv
name: lumhours
data: lumhours.csv
name: pws
data: pws.csv
name: teams
data: teams.csv
name: wolines
data: wolines.csv
name: workedhours
data: workedhours.csv
name: workers
data: workers.csv
name: wos
data: wos.csv
name: zones
data: zones.csv
label: workedhours
zoneId
zones
zoneId
workedhours
teamId
teams
teamId
workedhours
workerId
workers
workerId
lumhours
zoneId
zones
zoneId
contahours
zoneId
zones
zoneId
lumhours
teamId
teams
teamId
contahours
teamId
teams
teamId
lumhours
workerId
workers
workerId
contahours
workerId
workers
workerId
workedhours
Fecha Parte
Calendar
Date
lumhours
Fecha Luminaria
Calendar
Date
contahours
Fecha Contadores
Calendar
Date
workedhours
pwId
pws
pwId
wolines
woId
wos
woId
wos
pwId
pws
pwId
wos
initDate
Calendar
Date
output: {
    "joins": [
        {
            "from_table": "workedhours",
            "from_column": "zoneId",
            "to_table": "zones",
            "to_column": "zoneId"
        },
        {
            "from_table": "workedhours",
            "from_column": "teamId",
            "to_table": "teams",
            "to_column": "teamId"
        },
        {
            "from_table": "workedhours",
            "from_column": "workerId",
            "to_table": "workers",
            "to_column": "workerId"
        },
        {
            "from_table": "lumhours",
            "from_column": "zoneId",
            "to_table": "zones",
            "to_column": "zoneId"
        },
        {
            "from_table": "contahours",
            "from_column": "zoneId",
            "to_table": "zones",
            "to_column": "zoneId"
        },
        {
            "from_table": "lumhours",
            "from_column": "teamId",
            "to_table": "teams",
            "to_column": "teamId"
        },
        {
            "from_table": "contahours",
            "from_column": "teamId",
            "to_table": "teams",
            "to_column": "teamId"
        },
        {
            "from_table": "lumhours",
            "from_column": "workerId",
            "to_table": "workers",
            "to_column": "workerId"
        },
        {
            "from_table": "contahours",
            "from_column": "workerId",
            "to_table": "workers",
            "to_column": "workerId"
        },
        {
            "from_table": "workedhours",
            "from_column": "Fecha Parte",
            "to_table": "Calendar",
            "to_column": "Date"
        },
        {
            "from_table": "lumhours",
            "from_column": "Fecha Luminaria",
            "to_table": "Calendar",
            "to_column": "Date"
        },
        {
            "from_table": "contahours",
            "from_column": "Fecha Contadores",
            "to_table": "Calendar",
            "to_column": "Date"
        },
        {
            "from_table": "workedhours",
            "from_column": "pwId",
            "to_table": "pws",
            "to_column": "pwId"
        },
        {
            "from_table": "wolines",
            "from_column": "woId",
            "to_table": "wos",
            "to_column": "woId"
        },
        {
            "from_table": "wos",
            "from_column": "pwId",
            "to_table": "pws",
            "to_column": "pwId"
        },
        {
            "from_table": "wos",
            "from_column": "initDate",
            "to_table": "Calendar",
            "to_column": "Date"
        }
    ]
}