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: A - Measures
| Column   |
|----------|


Table: B - Date
| Date                    |   WeekDay | WeekEnding              |   WeekNumber |   Year |   YearWeek |
|:------------------------|----------:|:------------------------|-------------:|-------:|-----------:|
| 2019-01-01 00:00:00.000 |         2 | 2019-01-06 00:00:00.000 |            2 |   2019 |      20192 |
| 2019-01-02 00:00:00.000 |         3 | 2019-01-06 00:00:00.000 |            2 |   2019 |      20192 |
| 2019-01-03 00:00:00.000 |         4 | 2019-01-06 00:00:00.000 |            2 |   2019 |      20192 |
| 2019-01-04 00:00:00.000 |         5 | 2019-01-06 00:00:00.000 |            2 |   2019 |      20192 |
| 2019-01-05 00:00:00.000 |         6 | 2019-01-06 00:00:00.000 |            2 |   2019 |      20192 |
| 2019-01-06 00:00:00.000 |         7 | 2019-01-06 00:00:00.000 |            2 |   2019 |      20192 |
| 2019-01-07 00:00:00.000 |         1 | 2019-01-13 00:00:00.000 |            3 |   2019 |      20193 |
| 2019-01-08 00:00:00.000 |         2 | 2019-01-13 00:00:00.000 |            3 |   2019 |      20193 |
| 2019-01-09 00:00:00.000 |         3 | 2019-01-13 00:00:00.000 |            3 |   2019 |      20193 |
| 2019-01-10 00:00:00.000 |         4 | 2019-01-13 00:00:00.000 |            3 |   2019 |      20193 |


Table: DimAgent
|   ID | Agent    |
|-----:|:---------|
|    1 | Tim      |
|    2 | Stephen  |
|    3 | Mark     |
|    4 | Bob      |
|    5 | Jennifer |
|    6 | Stacey   |
|    7 | John     |
|    8 | Oliver   |
|    9 | Bronwyn  |
|   10 | Maya     |


Table: DimContactReason
|   ID | ContactReason    |
|-----:|:-----------------|
|    1 | New customer     |
|    2 | Claim            |
|    3 | Amendment        |
|    4 | Banking change   |
|    5 | Payment          |
|    6 | Name change      |
|    7 | Device question  |
|    8 | General question |
|    9 | Payment question |
|   10 | Cancel           |


Table: DimCustomerSatisfaction
|   CSATID | CSAT                  |
|---------:|:----------------------|
|        1 | Very dissatisfied     |
|        2 | Somewhat dissatisfied |
|        3 | Satisfied             |
|        4 | Somewhat satisfied    |
|        5 | Very satisfied        |


Table: DimExpectations
|   ExpectationsID | Expectations   |
|-----------------:|:---------------|
|                1 | Did not meet   |
|                2 | Met            |
|                3 | Exceeded       |


Table: DimGoals
|   Year | Month     |   Revenue |   RevenueGoal |   Sales |   SalesGoal |     AHT |   AHTGoal |   CallVolume |   CallVolume Goal |   CallCost |   CallCostGoal |   Productivity |   ProductivityGoal |   CSAT |   CSATGoal |   Expectations |   ExpectationsGoal |     NPS |   NPSGoal |
|-------:|:----------|----------:|--------------:|--------:|------------:|--------:|----------:|-------------:|------------------:|-----------:|---------------:|---------------:|-------------------:|-------:|-----------:|---------------:|-------------------:|--------:|----------:|
|   2020 | January   |    654500 |        687225 |    1309 |     1374.45 | 22.9831 |   21.8339 |         1183 |           1242.15 |       6797 |        6457.15 |           0.25 |                0.5 |   0.76 |        0.8 |           0.93 |                0.8 | 81.9104 |       0.8 |
|   2020 | February  |    567000 |        595350 |    1134 |     1190.7  | 22.244  |   21.1318 |         1049 |           1101.45 |       5834 |        5542.3  |           0.22 |                0.5 |   0.75 |        0.8 |           0.92 |                0.8 | 79.409  |       0.8 |
|   2020 | March     |    280000 |        294000 |     560 |      588    | 22.1536 |   21.0459 |          521 |            547.05 |       2886 |        2741.7  |           0.11 |                0.5 |   0.76 |        0.8 |           0.95 |                0.8 | 84.6449 |       0.8 |
|   2020 | April     |     38000 |         39900 |      76 |       79.8  | 20.5393 |   19.5124 |           89 |             93.45 |        457 |         434.15 |           0.02 |                0.5 |   0.73 |        0.8 |           0.92 |                0.8 | 70.7865 |       0.8 |
|   2020 | May       |     69000 |         72450 |     138 |      144.9  | 21.9545 |   20.8568 |          154 |            161.7  |        845 |         802.75 |           0.03 |                0.5 |   0.74 |        0.8 |           0.92 |                0.8 | 68.1818 |       0.8 |
|   2020 | June      |    127500 |        133875 |     255 |      267.75 | 21.45   |   20.3775 |          280 |            294    |       1502 |        1426.9  |           0.06 |                0.5 |   0.78 |        0.8 |           0.96 |                0.8 | 87.1429 |       0.8 |
|   2020 | July      |    240500 |        252525 |     481 |      505.05 | 21.1265 |   20.0701 |          514 |            539.7  |       2715 |        2579.25 |           0.1  |                0.5 |   0.76 |        0.8 |           0.95 |                0.8 | 86.1868 |       0.8 |
|   2020 | August    |    252500 |        265125 |     505 |      530.25 | 22.0746 |   20.9708 |          523 |            549.15 |       2886 |        2741.7  |           0.11 |                0.5 |   0.74 |        0.8 |           0.9  |                0.8 | 77.6291 |       0.8 |
|   2020 | September |    491500 |        516075 |     983 |     1032.15 | 23.0577 |   21.9048 |          780 |            819    |       4496 |        4271.2  |           0.17 |                0.5 |   0.68 |        0.8 |           0.84 |                0.8 | 63.5897 |       0.8 |
|   2020 | October   |    498000 |        522900 |     996 |     1045.8  | 22.8481 |   21.7057 |          744 |            781.2  |       4250 |        4037.5  |           0.16 |                0.5 |   0.69 |        0.8 |           0.87 |                0.8 | 65.8602 |       0.8 |


Table: DimNps
|   NPSID | NPS       |
|--------:|:----------|
|       0 | Detractor |
|       1 | Detractor |
|       2 | Detractor |
|       3 | Detractor |
|       4 | Detractor |
|       5 | Detractor |
|       6 | Detractor |
|       7 | Neutral   |
|       8 | Neutral   |
|       9 | Promoter  |


Table: DimProduct
|   ID | Product   |
|-----:|:----------|
|    0 | Box 1     |
|    1 | Box 2     |
|    2 | Box 3     |
|    3 | Box 4     |
|    4 | Box 5     |
|    5 | Box 6     |
|    6 | Box 7     |
|    7 | Box 8     |
|    8 | Box 9     |
|    9 | Box 10    |


Table: FactCalls
| Date                    |   Agent |   ContactReason |   CSAT |   NPS |   Effort |   Expectations |   CallCost |   CallLength |   WaitTime |   Sales |   Amount |   CallId | Column15   | Column16   | Column17   | Column18   | Column19   | Column14   |
|:------------------------|--------:|----------------:|-------:|------:|---------:|---------------:|-----------:|-------------:|-----------:|--------:|---------:|---------:|:-----------|:-----------|:-----------|:-----------|:-----------|:-----------|
| 2019-01-30 00:00:00.000 |       2 |               5 |      4 |     9 |        4 |              2 |        5.5 |           22 |    7.33333 |       1 |      500 |      347 |            |            |            |            |            |            |
| 2019-04-02 00:00:00.000 |       2 |               5 |      4 |     9 |        4 |              2 |        5.5 |           22 |    7.33333 |       1 |      500 |      467 |            |            |            |            |            |            |
| 2019-03-01 00:00:00.000 |       2 |               5 |      4 |     9 |        4 |              2 |        5.5 |           22 |    7.33333 |       1 |      500 |     1037 |            |            |            |            |            |            |
| 2019-03-16 00:00:00.000 |       2 |               5 |      4 |     9 |        4 |              2 |        5.5 |           22 |    7.33333 |       1 |      500 |     1052 |            |            |            |            |            |            |
| 2019-05-13 00:00:00.000 |       2 |               5 |      4 |     9 |        4 |              2 |        5.5 |           22 |    7.33333 |       1 |      500 |     1067 |            |            |            |            |            |            |
| 2019-06-26 00:00:00.000 |       2 |               5 |      4 |     9 |        4 |              2 |        5.5 |           22 |    7.33333 |       1 |      500 |     1082 |            |            |            |            |            |            |
| 2019-08-04 00:00:00.000 |       2 |               5 |      4 |     9 |        4 |              2 |        5.5 |           22 |    7.33333 |       1 |      500 |     1097 |            |            |            |            |            |            |
| 2019-08-12 00:00:00.000 |       2 |               5 |      4 |     9 |        4 |              2 |        5.5 |           22 |    7.33333 |       1 |      500 |     1112 |            |            |            |            |            |            |
| 2019-10-14 00:00:00.000 |       2 |               5 |      4 |     9 |        4 |              2 |        5.5 |           22 |    7.33333 |       1 |      500 |     1127 |            |            |            |            |            |            |
| 2019-03-21 00:00:00.000 |       2 |               5 |      4 |     9 |        4 |              2 |        5.5 |           22 |    7.33333 |       1 |      500 |     1637 |            |            |            |            |            |            |


Table: FactContacts
| ContactReason    |   ID |
|:-----------------|-----:|
| New customer     |    1 |
| Claim            |    2 |
| Amendment        |    3 |
| Banking change   |    4 |
| Payment          |    5 |
| Name change      |    6 |
| Device question  |    7 |
| General question |    8 |
| Payment question |    9 |
| Cancel           |   10 |

 


tables: name: A - Measures
data: A - Measures.csv
name: B - Date
data: B - Date.csv
name: DimAgent
data: DimAgent.csv
name: DimContactReason
data: DimContactReason.csv
name: DimCustomerSatisfaction
data: DimCustomerSatisfaction.csv
name: DimExpectations
data: DimExpectations.csv
name: DimGoals
data: DimGoals.csv
name: DimNps
data: DimNps.csv
name: DimProduct
data: DimProduct.csv
name: FactCalls
data: FactCalls.csv
name: FactContacts
data: FactContacts.csv
label: FactCalls
Agent
DimAgent
ID
FactCalls
ContactReason
DimContactReason
ID
FactCalls
Expectations
DimExpectations
ExpectationsID
FactCalls
NPS
DimNps
NPSID
FactCalls
CSAT
DimCustomerSatisfaction
CSATID
FactContacts
ID
DimAgent
ID
output: {
    "joins": [
        {
            "from_table": "FactCalls",
            "from_column": "Agent",
            "to_table": "DimAgent",
            "to_column": "ID"
        },
        {
            "from_table": "FactCalls",
            "from_column": "ContactReason",
            "to_table": "DimContactReason",
            "to_column": "ID"
        },
        {
            "from_table": "FactCalls",
            "from_column": "Expectations",
            "to_table": "DimExpectations",
            "to_column": "ExpectationsID"
        },
        {
            "from_table": "FactCalls",
            "from_column": "NPS",
            "to_table": "DimNps",
            "to_column": "NPSID"
        },
        {
            "from_table": "FactCalls",
            "from_column": "CSAT",
            "to_table": "DimCustomerSatisfaction",
            "to_column": "CSATID"
        },
        {
            "from_table": "FactContacts",
            "from_column": "ID",
            "to_table": "DimAgent",
            "to_column": "ID"
        }
    ]
}