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                    |   Month |
|:------------------------|--------:|
| 2020-01-01 00:00:00.000 |       1 |
| 2020-01-02 00:00:00.000 |       1 |
| 2020-01-03 00:00:00.000 |       1 |
| 2020-01-04 00:00:00.000 |       1 |
| 2020-01-05 00:00:00.000 |       1 |
| 2020-01-06 00:00:00.000 |       1 |
| 2020-01-07 00:00:00.000 |       1 |
| 2020-01-08 00:00:00.000 |       1 |
| 2020-01-09 00:00:00.000 |       1 |
| 2020-01-10 00:00:00.000 |       1 |


Table: Merge1
| Date                    | Table (2).Curr From   | Table (2).Cur To   | Table (2).Effective Date   | Table (2). Exchange Rate    |
|:------------------------|:----------------------|:-------------------|:---------------------------|:----------------------------|
| 2014-01-01 00:00:00.000 |                       |                    |                            |                             |
| 2014-01-11 00:00:00.000 | EUR                   | USD                | 2014-01-11 00:00:00.000    | 1.3672                      |
| 2014-01-02 00:00:00.000 | EUR                   | USD                |                            | 1.3672                      |
| 2014-01-03 00:00:00.000 | EUR                   | USD                |                            | 1.3672                      |
| 2014-01-04 00:00:00.000 | EUR                   | USD                |                            | 1.3672                      |
| 2014-01-05 00:00:00.000 | EUR                   | USD                |                            | 1.3672                      |
| 2014-01-06 00:00:00.000 | EUR                   | USD                |                            | 1.3672                      |
| 2014-01-07 00:00:00.000 | EUR                   | USD                |                            | 1.3672                      |
| 2014-01-08 00:00:00.000 | EUR                   | USD                |                            | 1.3672                      |
| 2014-01-09 00:00:00.000 | EUR                   | USD                |                            | 1.3672                      |


Table: Table (10)
|   ID | 2014   | 2015   |
|-----:|:-------|:-------|
|    1 | A      | A      |
|    2 | B      | B      |
|    3 | C      | C      |
|    4 | A      | B      |


Table: Table (11)
| Type   | Date                    |   YTD_Value |
|:-------|:------------------------|------------:|
| A      | 2019-11-01 00:00:00.000 |           0 |
| B      | 2019-11-01 00:00:00.000 |           0 |
| A      | 2019-12-01 00:00:00.000 |           1 |
| B      | 2019-12-01 00:00:00.000 |           1 |
| A      | 2020-01-01 00:00:00.000 |           2 |
| A      | 2020-01-01 00:00:00.000 |           2 |
| B      | 2020-01-01 00:00:00.000 |           2 |
| A      | 2020-02-01 00:00:00.000 |           3 |
| B      | 2020-02-01 00:00:00.000 |           3 |


Table: Table (12)
| Country   |   Index |
|:----------|--------:|
| Candad    |       1 |
| US        |       2 |
| US        |       3 |
| US        |       4 |
| Candad    |       5 |
| Candad    |       6 |
| US        |       7 |
| Candad    |       8 |
| Candad    |       9 |
| US        |      10 |


Table: Table (13)
|   Index | Start                   | End                     |
|--------:|:------------------------|:------------------------|
|       1 | 2020-06-25 11:00:00.000 | 2020-06-25 12:00:00.000 |
|       2 | 2020-06-25 12:00:00.000 | 2020-06-25 12:30:00.000 |
|       3 | 2020-06-25 12:30:00.000 | 2020-06-25 13:00:00.000 |
|       4 | 2020-06-25 13:00:00.000 | 2020-06-25 13:30:00.000 |
|       5 | 2020-06-25 13:00:00.000 | 2020-06-25 14:00:00.000 |
|       6 | 2020-06-25 11:00:00.000 | 2020-06-25 12:00:00.000 |
|       7 | 2020-06-25 13:00:00.000 | 2020-06-25 14:00:00.000 |


Table: Table (14)
|    Duration |
|------------:|
| 0.000115741 |
| 0.00568287  |
| 0.0211574   |
| 0.00128472  |
| 0.00461806  |
| 0.000115741 |
| 0.00649306  |
| 0.0128356   |
| 0.00753472  |


Table: Table (15)
| ID   | Date                    |   Num |
|:-----|:------------------------|------:|
| A    | 2020-01-01 00:00:00.000 |     1 |
| A    | 2020-01-02 00:00:00.000 |     2 |
| A    | 2020-01-03 00:00:00.000 |     3 |
| B    | 2020-01-01 00:00:00.000 |    11 |
| B    | 2020-01-02 00:00:00.000 |    22 |
| B    | 2020-01-03 00:00:00.000 |    33 |
| C    | 2020-01-01 00:00:00.000 |   111 |
| C    | 2020-01-02 00:00:00.000 |   222 |
| C    | 2020-01-03 00:00:00.000 |   333 |


Table: Table (16)
|   Shift ID | Staff Name   | Location Name   | shift start      | shift end        |
|-----------:|:-------------|:----------------|:-----------------|:-----------------|
|       1001 | A            | aa              | 10/08/2020 13:00 | 10/08/2020 18:00 |
|       1002 | B            | aa              | 10/08/2020 13:00 | 10/08/2020 15:00 |
|       1003 | C            | aa              | 10/08/2020 13:00 | 10/08/2020 15:00 |
|       1004 | D            | aa              | 10/08/2020 13:00 | 10/08/2020 17:00 |
|       1005 | E            | aa              | 10/08/2020 19:00 | 10/08/2020 20:00 |
|       1006 | F            | aa              | 12/08/2020 21:30 | 13/08/2020 6:30  |
|       1007 | G            | aa              | 12/08/2020 21:30 | 13/08/2020 6:30  |
|       1008 | H            | bb              | 13/08/2020 14:00 | 13/08/2020 15:00 |
|       1009 | I            | bb              | 13/08/2020 15:00 | 13/08/2020 18:00 |
|       1010 | J            | bb              | 13/08/2020 13:00 | 13/08/2020 14:00 |


Table: Table (17)
| Segment        | SubCategory   |   MarketShare |   Value |
|:---------------|:--------------|--------------:|--------:|
| Something      | sub1          |         0.017 |  183294 |
| Something      | sub2          |         0.01  |   34621 |
| Something      | sub3          |         0.005 |   20315 |
| Something      | sub4          |         0.051 |   11641 |
| Something      | sub5          |         0.018 |  192498 |
| Something      | sub6          |         0     |       0 |
| Something      | sub7          |         0     |       0 |
| Something Else | sub1          |         0.208 |  233471 |
| Something Else | sub2          |         0     |       0 |
| Something Else | sub3          |         0.578 |    1880 |


Table: Table (18)
| Date                    |   DayOfWeek |   DayTotalTickets |
|:------------------------|------------:|------------------:|
| 2020-03-18 00:00:00.000 |           3 |               935 |
| 2020-03-18 00:00:00.000 |           2 |               259 |
| 2020-03-17 00:00:00.000 |           1 |               728 |
| 2020-03-16 00:00:00.000 |           0 |               239 |
| 2020-03-15 00:00:00.000 |           6 |               158 |
| 2020-03-14 00:00:00.000 |           5 |               876 |
| 2020-03-13 00:00:00.000 |           4 |               655 |
| 2020-03-12 00:00:00.000 |           3 |               226 |
| 2020-03-11 00:00:00.000 |           2 |               530 |
| 2020-03-10 00:00:00.000 |           1 |               485 |


Table: Table (19)
| Testcase   | Loop Count   | Pass   | Fail   |
|:-----------|:-------------|:-------|:-------|
| AB         | AB1          | 1      |        |
| AB         | AB2          | 1      |        |
| AB         | AB3          |        | 1      |
| ZY         | ZY1          | 1      |        |
| ZY         | ZY2          | 1      |        |
| ZY         | ZY3          |        | 1      |
| ZY         | ZY4          |        | 1      |
| ZY         | ZY5          | 1      |        |


Table: Table (2)
| Curr From   | Cur To   | Effective Date          |    Exchange Rate  |
|:------------|:---------|:------------------------|------------------:|
| EUR         | USD      | 2014-01-11 00:00:00.000 |            1.3672 |
| EUR         | USD      | 2014-01-18 00:00:00.000 |            1.3557 |
| EUR         | USD      | 2014-01-25 00:00:00.000 |            1.3685 |
| EUR         | USD      | 2014-01-31 00:00:00.000 |            1.3484 |
| EUR         | USD      | 2014-02-08 00:00:00.000 |            1.3618 |
| EUR         | USD      | 2014-02-15 00:00:00.000 |            1.3686 |
| EUR         | USD      | 2014-02-22 00:00:00.000 |            1.3745 |
| EUR         | USD      | 2014-02-28 00:00:00.000 |            1.3811 |
| EUR         | USD      | 2014-03-08 00:00:00.000 |            1.3862 |
| EUR         | USD      | 2014-03-15 00:00:00.000 |            1.3916 |


Table: Table (20)
| Column1   | Column2   |
|:----------|:----------|
| One       | End Date  |
| Two       | End       |
| Three     | Date      |


Table: Table (21)
| Column1   | Column2   |
|:----------|:----------|
| One       | End Date  |
| Two       | End Date  |
| Three     | End       |


Table: Table (3)
| Area Path                                 | Column                             |
|:------------------------------------------|:-----------------------------------|
| Produce\Fruit\Apples                      | Produce\Fruit\Apples               |
| Produce\Fruit\Apples\Fuji                 | Produce\Fruit\Apples\Fuji          |
| Produce\Fruit\Apples\Gala                 | Produce\Fruit\Apples               |
| Produce\Fruit\Apples\Gala                 | Produce\Fruit\Apples               |
| Produce\Fruit\Apples\Granny Smith         | Produce\Fruit\Apples               |
| Produce\Fruit\Grapes\Red                  | Produce\Fruit\Grapes               |
| Produce\Fruit\Grapes\Green                | Produce\Fruit\Grapes               |
| Produce\Fruit\Pears                       | Produce\Fruit                      |
| Produce\Vegetables\Squash\Zucchini\Green  | Produce\Vegetables\Squash\Zucchini |
| Produce\Vegetables\Squash\Zucchini\Yellow | Produce\Vegetables\Squash\Zucchini |


Table: Table (4)
| Root Path                          |
|:-----------------------------------|
| Produce\Fruit\Apples               |
| Produce\Fruit\Apples\Fuji          |
| Produce\Fruit\Grapes               |
| Produce\Fruit                      |
| Produce\Vegetables\Squash\Zucchini |
| Produce\Vegetables\Squash\Acorn    |
| Produce\Vegetables\Squash          |
| Produce\Vegetables\Broccoli        |
| Produce\Vegetables                 |
| Produce\Mushroom\Button            |


Table: Table (5)
| Country   |
|:----------|
| US        |
| Candad    |


Table: Table (6)
| Org   | Country   |
|:------|:----------|
| Org1  | US        |
|       | Candad    |


Table: Table (7)
| Country   |   KPI |
|:----------|------:|
| US        |    10 |
| Candad    |     5 |


Table: Table (8)
| Customer    | Sales Category   |   Sales$ |
|:------------|:-----------------|---------:|
| Bill Gates  | Software         |     1000 |
| Bill Gates  | Hardware         |      500 |
| Bill Gates  | Internet         |      200 |
| Bill Nine   | Science          |      200 |
| Tiger Woods | Golf             |    99999 |
| Tiger Woods | Promo            |        5 |


Table: Table (9)
|   Year | State   |   ID |
|-------:|:--------|-----:|
|   2014 | A       |    1 |
|   2014 | B       |    2 |
|   2014 | C       |    3 |
|   2014 | A       |    4 |
|   2014 | A       |    5 |
|   2014 | B       |    6 |
|   2015 | A       |    1 |
|   2015 | B       |    2 |
|   2015 | C       |    3 |
|   2015 | A       |    4 |


Table: Table
| Date                    |
|:------------------------|
| 2014-01-01 00:00:00.000 |
| 2014-01-02 00:00:00.000 |
| 2014-01-03 00:00:00.000 |
| 2014-01-04 00:00:00.000 |
| 2014-01-05 00:00:00.000 |
| 2014-01-06 00:00:00.000 |
| 2014-01-07 00:00:00.000 |
| 2014-01-08 00:00:00.000 |
| 2014-01-09 00:00:00.000 |
| 2014-01-10 00:00:00.000 |

 


tables: name: Calendar
data: Calendar.csv
name: Merge1
data: Merge1.csv
name: Table (10)
data: Table (10).csv
name: Table (11)
data: Table (11).csv
name: Table (12)
data: Table (12).csv
name: Table (13)
data: Table (13).csv
name: Table (14)
data: Table (14).csv
name: Table (15)
data: Table (15).csv
name: Table (16)
data: Table (16).csv
name: Table (17)
data: Table (17).csv
name: Table (18)
data: Table (18).csv
name: Table (19)
data: Table (19).csv
name: Table (2)
data: Table (2).csv
name: Table (20)
data: Table (20).csv
name: Table (21)
data: Table (21).csv
name: Table (3)
data: Table (3).csv
name: Table (4)
data: Table (4).csv
name: Table (5)
data: Table (5).csv
name: Table (6)
data: Table (6).csv
name: Table (7)
data: Table (7).csv
name: Table (8)
data: Table (8).csv
name: Table (9)
data: Table (9).csv
name: Table
data: Table.csv
label: Merge1
Table (2). Exchange Rate 
Table (2)
 Exchange Rate 
Table (6)
Country
Table (5)
Country
Table (7)
Country
Table (5)
Country
Table (9)
ID
Table (10)
ID
Table (12)
Country
Table (5)
Country
Table (13)
Index
Table (12)
Index
Table (21)
Column2
Table (20)
Column2
output: {
    "joins": [
        {
            "from_table": "Merge1",
            "from_column": "Table (2). Exchange Rate ",
            "to_table": "Table (2)",
            "to_column": " Exchange Rate "
        },
        {
            "from_table": "Table (6)",
            "from_column": "Country",
            "to_table": "Table (5)",
            "to_column": "Country"
        },
        {
            "from_table": "Table (7)",
            "from_column": "Country",
            "to_table": "Table (5)",
            "to_column": "Country"
        },
        {
            "from_table": "Table (9)",
            "from_column": "ID",
            "to_table": "Table (10)",
            "to_column": "ID"
        },
        {
            "from_table": "Table (12)",
            "from_column": "Country",
            "to_table": "Table (5)",
            "to_column": "Country"
        },
        {
            "from_table": "Table (13)",
            "from_column": "Index",
            "to_table": "Table (12)",
            "to_column": "Index"
        },
        {
            "from_table": "Table (21)",
            "from_column": "Column2",
            "to_table": "Table (20)",
            "to_column": "Column2"
        }
    ]
}