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: 2018Monthly
|   Cal. Year/Month |   QTY |   KEY |
|------------------:|------:|------:|
|            1.2018 |     5 |     1 |
|            1.2018 |     5 |     1 |
|            2.2018 |    20 |     1 |
|            1.2018 |    15 |     2 |


Table: Calendar
| Date                    |   Column | Column 2   |   Year |   Month |   Week | MonthName   | Switch   | Switch 2   | Switch 3   |   Expected FW |
|:------------------------|---------:|:-----------|-------:|--------:|-------:|:------------|:---------|:-----------|:-----------|--------------:|
| 2018-01-01 00:00:00.000 |    -1655 | Legend1    |   2018 |       1 |      1 | January     |          |            |            |             1 |
| 2018-01-02 00:00:00.000 |    -1654 | Legend1    |   2018 |       1 |      1 | January     |          |            |            |             1 |
| 2018-01-03 00:00:00.000 |    -1653 | Legend1    |   2018 |       1 |      1 | January     |          |            |            |             1 |
| 2018-01-04 00:00:00.000 |    -1652 | Legend1    |   2018 |       1 |      1 | January     |          |            |            |             1 |
| 2018-01-05 00:00:00.000 |    -1651 | Legend1    |   2018 |       1 |      1 | January     |          |            |            |             1 |
| 2018-01-06 00:00:00.000 |    -1650 | Legend1    |   2018 |       1 |      1 | January     |          |            |            |             1 |
| 2018-01-07 00:00:00.000 |    -1649 | Legend1    |   2018 |       1 |      2 | January     |          |            |            |             2 |
| 2018-01-08 00:00:00.000 |    -1648 | Legend1    |   2018 |       1 |      2 | January     |          |            |            |             2 |
| 2018-01-09 00:00:00.000 |    -1647 | Legend1    |   2018 |       1 |      2 | January     |          |            |            |             2 |
| 2018-01-10 00:00:00.000 |    -1646 | Legend1    |   2018 |       1 |      2 | January     |          |            |            |             2 |


Table: FSP
|   Month | Month Name   |
|--------:|:-------------|
|      12 | December     |
|       9 | September    |
|      10 | October      |
|       3 | March        |
|       7 | July         |
|       4 | April        |
|       6 | June         |
|       1 | January      |
|       2 | February     |
|       5 | May          |


Table: KEY
|   KEY |   01.2018 |
|------:|----------:|
|     1 |        10 |
|     2 |        15 |


Table: Round or Roundup
|   Round or Roundup |
|-------------------:|
|                  0 |
|                  1 |


Table: Sheet4
|                  Column1 |
|-------------------------:|
|   1000000000000000000000 |
|       100000000000000000 |
| 199999999999999980000000 |


Table: Table 1
|   Year |   Month |   My Column |
|-------:|--------:|------------:|
|   2018 |       1 |      -50840 |
|   2018 |       2 |      -45094 |
|   2018 |       3 |      -49011 |
|   2018 |       4 |      -46515 |
|   2018 |       5 |      -47120 |
|   2018 |       6 |      -44685 |
|   2018 |       7 |      -45229 |
|   2018 |       8 |      -44268 |
|   2018 |       9 |      -41925 |
|   2018 |      10 |      -42377 |


Table: Table
| Key     |
|:--------|
| Stan    |
| Michael |
| Devin   |
| Redick  |
| Tom     |
| Patrick |
|         |


Table: Table1
|   Index |   AIF |   Column |
|--------:|------:|---------:|
|       1 |   100 |        0 |
|       2 |   250 |      150 |
|       3 |   300 |       50 |
|       4 |   450 |      150 |


Table: Table10
|   ImageID | SubmissionDate          |
|----------:|:------------------------|
|       389 | 2018-01-25 00:00:00.000 |
|       390 | 2018-01-24 00:00:00.000 |


Table: Table11
| ts                      | State   |
|:------------------------|:--------|
| 2018-12-11 00:02:33.000 | False   |
| 2018-11-11 00:01:05.000 | False   |
| 2018-10-11 13:53:04.000 | False   |
| 2018-10-11 11:24:02.000 | True    |
| 2018-10-11 11:13:02.000 | False   |
| 2018-10-11 07:48:47.000 | True    |
| 2018-10-11 07:47:39.000 | False   |


Table: Table12
|    CID |   SD |   SD2 |   SD3 | SD_flag   | SD2_flag   | SD3_flag   |
|-------:|-----:|------:|------:|:----------|:-----------|:-----------|
| 674432 |  177 |   354 |   531 |           |            | 1          |
| 674433 |  177 |   354 |   531 |           |            | 1          |
| 674434 |  177 |   354 |   531 | 1         |            |            |
| 674435 |  177 |   354 |   531 | 1         |            |            |
| 674436 |  177 |   354 |   531 | 1         |            |            |
| 674437 |  177 |   354 |   531 |           | 1          |            |
| 674438 |  177 |   354 |   531 |           | 1          |            |
| 674439 |  177 |   354 |   531 | 1         |            |            |
| 674440 |  177 |   354 |   531 |           | 1          |            |
| 674441 |  177 |   354 |   531 | 1         |            |            |


Table: Table13
| Case created date       | Performance of closed case   |
|:------------------------|:-----------------------------|
| 2018-01-02 00:00:00.000 | On time                      |
| 2018-01-09 00:00:00.000 | Late                         |
| 2018-01-16 00:00:00.000 | Late                         |
| 2018-01-23 00:00:00.000 | On time                      |
| 2018-01-30 00:00:00.000 | On time                      |
| 2018-02-06 00:00:00.000 | On time                      |
| 2018-02-13 00:00:00.000 | On time                      |
| 2018-02-20 00:00:00.000 | On time                      |
| 2018-02-27 00:00:00.000 | Late                         |
| 2018-03-06 00:00:00.000 | Late                         |


Table: Table14
| Date                    | AgentName   | InteractionSource   | SkillName   |   TotalInteractions |   OnlineHours |   AgentId |
|:------------------------|:------------|:--------------------|:------------|--------------------:|--------------:|----------:|
| 2018-05-11 00:00:00.000 | Agent One   | Web Chat            | Skill1      |                  40 |             7 |  98765432 |
| 2018-05-11 00:00:00.000 | Agent Two   | Web Chat            | Skill1      |                  16 |             7 |  12345678 |
| 2018-05-11 00:00:00.000 | Agent Two   | Email               | Skill1      |                  17 |             7 |  12345678 |
| 2018-02-11 00:00:00.000 | Agent Two   | Web Chat            | Skill1      |                  14 |             7 |  12345678 |
| 2018-02-11 00:00:00.000 | Agent Two   | Email               | Skill1      |                  16 |             7 |  12345678 |
| 2018-05-11 00:00:00.000 | Agent One   | Web Chat            | Skill2      |                   2 |             7 |  98765432 |
| 2018-05-11 00:00:00.000 | Agent One   | Web Chat            | Skill2      |                   2 |             7 |  98765432 |
| 2018-05-11 00:00:00.000 | Agent One   | Web Chat            | Skill2      |                   2 |             7 |  98765432 |
| 2018-05-11 00:00:00.000 | Agent Two   | Web Chat            | Skill2      |                   2 |             7 |  12345678 |
| 2018-05-11 00:00:00.000 | Agent Two   | Web Chat            | Skill2      |                   6 |             7 |  12345678 |


Table: Table15
|   Index |   Failures |   ColumnX |
|--------:|-----------:|----------:|
|       1 |          0 |       0   |
|       2 |          0 |       0.2 |
|       3 |          1 |       0   |
|       4 |          0 |       0   |
|       5 |          1 |       0   |
|       6 |          0 |       0.2 |
|       7 |          1 |       0   |


Table: Table16
| Country       | Column1   |
|:--------------|:----------|
| United States | 40        |
| France        | 20        |
| Germany       | 25        |
| Britain       |           |


Table: Table17
| Timestamp               | uID   | Location   |   Value | Column   | Column 1   |   Column 2 |
|:------------------------|:------|:-----------|--------:|:---------|:-----------|-----------:|
| 2018-01-01 15:00:00.000 | A     | Z          |     1   | 360      |            |        1   |
| 2018-01-01 21:00:00.000 | A     | Z          |     1   | 525300   | 360        |        1   |
| 2019-01-01 16:00:00.000 | A     | Z          |     1   |          | 525300     |        1   |
| 2018-01-01 15:00:00.000 | B     | X          |     0.5 | 30       |            |        0.5 |
| 2018-01-01 15:30:00.000 | B     | X          |     0.5 |          | 30         |        0.5 |
| 2018-01-01 16:00:00.000 | B     | Z          |     1   |          |            |        1   |
| 2018-01-01 15:00:00.000 | C     | Y          |     0.5 | 30       |            |        0.5 |
| 2018-01-01 15:30:00.000 | C     | Y          |     0.5 |          | 30         |        0.5 |


Table: Table18
| Name    |   Score |
|:--------|--------:|
| Andie   |      61 |
| Brice   |      98 |
| Gervase |      83 |
| Hattie  |      84 |
| Madelyn |      63 |
| Ulric   |      62 |
| Wystan  |      72 |


Table: Table19
| Company   |   NO. of item sold | Segments   |   FY |
|:----------|-------------------:|:-----------|-----:|
| A         |                  2 | AA         |   13 |
| A         |                  3 | DT         |   13 |
| B         |                  3 | HH         |   14 |
| C         |                  1 | HH         |   15 |
| C         |                  1 | AA         |   17 |
| C         |                  2 | AA         |   18 |
| B         |                  2 | DT         |   16 |


Table: Table2
| Key     | ParentKey   | Conversations   |
|:--------|:------------|:----------------|
| Stan    |             |                 |
| Michael | Stan        | 1               |
| Devin   | Stan        | 1               |
| Redick  | Michael     | 1               |
| Tom     | Devin       | 1               |
| Patrick | Devin       | 1               |


Table: Table20
|   client | Column   |
|---------:|:---------|
|        1 | greg     |
|        2 | sam      |
|        3 | bob      |
|        4 | julie    |


Table: Table21
|   client | consultant   | date                    |
|---------:|:-------------|:------------------------|
|        1 | sam          | 2018-01-01 00:00:00.000 |
|        1 | greg         | 2018-02-01 00:00:00.000 |
|        2 | greg         | 2018-03-01 00:00:00.000 |
|        2 | sam          | 2018-04-01 00:00:00.000 |
|        3 | julie        | 2018-05-01 00:00:00.000 |
|        3 | bob          | 2018-06-01 00:00:00.000 |
|        4 | bob          | 2018-07-01 00:00:00.000 |
|        4 | julie        | 2018-08-01 00:00:00.000 |


Table: Table22
| Date                    |   Sales_A |   Sales_B |
|:------------------------|----------:|----------:|
| 2018-05-15 00:00:00.000 |        20 |        10 |
| 2018-05-16 00:00:00.000 |        30 |        20 |
| 2018-06-15 00:00:00.000 |        10 |        40 |
| 2018-06-16 00:00:00.000 |        20 |        20 |


Table: Table23
| Column1       | First Characters   |
|:--------------|:-------------------|
| not to delete | no                 |


Table: Table3
|   WeekNum |   Fiscal Week |
|----------:|--------------:|
|         1 |            14 |
|         2 |            15 |
|         3 |            16 |
|         4 |            17 |
|         5 |            18 |
|         6 |            19 |
|         7 |            20 |
|         8 |            21 |
|         9 |            22 |
|        10 |            23 |


Table: Table4
| Column1                 | Column2                 | Column                  |
|:------------------------|:------------------------|:------------------------|
| 2018-10-10 00:00:00.000 | 1899-12-30 10:03:00.000 | 2018-10-10 10:03:00.000 |
| 2018-11-10 00:00:00.000 | 1899-12-30 11:52:00.000 | 2018-11-10 11:52:00.000 |


Table: Table5
| status     | source   |   balance | date                    |
|:-----------|:---------|----------:|:------------------------|
| live       | a        |      3000 | 2018-10-31 00:00:00.000 |
| live       | b        |      2000 | 2018-10-30 00:00:00.000 |
| terminated | a        |      1500 | 2018-10-29 00:00:00.000 |
| live       | b        |      1000 | 2018-10-30 00:00:00.000 |
| terminated | a        |      2000 | 2018-10-29 00:00:00.000 |
| terminated | b        |      1000 | 2018-10-31 00:00:00.000 |


Table: Table6
| EmplID   | Date                    | Daytype   |   Column |
|:---------|:------------------------|:----------|---------:|
| A        | 2018-10-21 00:00:00.000 | WO        |        8 |
| A        | 2018-10-22 00:00:00.000 | AB        |        7 |
| A        | 2018-10-23 00:00:00.000 | AB        |        6 |
| A        | 2018-10-24 00:00:00.000 | AB        |        5 |
| A        | 2018-10-25 00:00:00.000 | AB        |        4 |
| A        | 2018-10-26 00:00:00.000 | AB        |        3 |
| A        | 2018-10-27 00:00:00.000 | WO        |        3 |
| A        | 2018-10-28 00:00:00.000 | WO        |        3 |
| A        | 2018-10-29 00:00:00.000 | AB        |        2 |
| A        | 2018-10-30 00:00:00.000 | AB        |        1 |


Table: Table7
| Column1                 | NewTime   |
|:------------------------|:----------|
| 1899-12-30 10:30:45.000 | 10:30     |
| 1899-12-30 11:44:33.000 | 11:44     |
| 1899-12-30 20:20:17.000 | 20:20     |


Table: Table8
| Country       |   Price Index |   Price Index Target |
|:--------------|--------------:|---------------------:|
| Germany       |           109 |                  110 |
| Japan         |           108 |                  107 |
| United States |           110 |                  108 |


Table: Table9
|   ImageID | Created                 |   Difference |
|----------:|:------------------------|-------------:|
|       389 | 2018-10-23 14:58:31.000 |          271 |
|       390 | 2018-11-05 07:05:39.000 |          285 |


Table: TimeCard
| Resource Name   |   Project ID |   Billable Days |
|:----------------|-------------:|----------------:|
| Alan            |            1 |              10 |
| John            |            1 |              30 |
| Amy             |            2 |              50 |

 


tables: name: 2018Monthly
data: 2018Monthly.csv
name: Calendar
data: Calendar.csv
name: FSP
data: FSP.csv
name: KEY
data: KEY.csv
name: Round or Roundup
data: Round or Roundup.csv
name: Sheet4
data: Sheet4.csv
name: Table 1
data: Table 1.csv
name: Table
data: Table.csv
name: Table1
data: Table1.csv
name: Table10
data: Table10.csv
name: Table11
data: Table11.csv
name: Table12
data: Table12.csv
name: Table13
data: Table13.csv
name: Table14
data: Table14.csv
name: Table15
data: Table15.csv
name: Table16
data: Table16.csv
name: Table17
data: Table17.csv
name: Table18
data: Table18.csv
name: Table19
data: Table19.csv
name: Table2
data: Table2.csv
name: Table20
data: Table20.csv
name: Table21
data: Table21.csv
name: Table22
data: Table22.csv
name: Table23
data: Table23.csv
name: Table3
data: Table3.csv
name: Table4
data: Table4.csv
name: Table5
data: Table5.csv
name: Table6
data: Table6.csv
name: Table7
data: Table7.csv
name: Table8
data: Table8.csv
name: Table9
data: Table9.csv
name: TimeCard
data: TimeCard.csv
label: Table10
ImageID
Table9
ImageID
Table1
Index
Table15
Index
2018Monthly
KEY
KEY
KEY
Table21
client
Table20
client
output: {
    "joins": [
        {
            "from_table": "Table10",
            "from_column": "ImageID",
            "to_table": "Table9",
            "to_column": "ImageID"
        },
        {
            "from_table": "Table1",
            "from_column": "Index",
            "to_table": "Table15",
            "to_column": "Index"
        },
        {
            "from_table": "2018Monthly",
            "from_column": "KEY",
            "to_table": "KEY",
            "to_column": "KEY"
        },
        {
            "from_table": "Table21",
            "from_column": "client",
            "to_table": "Table20",
            "to_column": "client"
        }
    ]
}