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: Customers
|   Customer Number | Channel   | Sales Allocation   | Rep Code   |
|------------------:|:----------|:-------------------|:-----------|
|          50230588 | Chnl4     | General            | RC_9       |
|          50231077 | Chnl4     | General            | RC_9       |
|          50230564 | Chnl4     | General            | RC_9       |
|          50230702 | Chnl4     | General            | RC_9       |
|          50230947 | Chnl4     | General            | RC_9       |
|          50230073 | Chnl4     | General            | RC_9       |
|          50230959 | Chnl4     | General            | RC_9       |
|          50230650 | Chnl4     | General            | RC_9       |
|          50231110 | Chnl4     | General            | RC_9       |
|          50231013 | Chnl4     | General            | RC_9       |


Table: DimDate
| Date                    |   Year |   QuarterOfYear |   MonthOfYear |   DayOfMonth |   DateInt | MonthName   | MonthInCalendar   | QuarterInCalendar   |   DayInWeek | DayOfWeekName   | WeekEnding              |   Week Number |   MonthnYear |   QuarternYear | QuarterNum   | MonthShort   |   ShortYear | FY   |
|:------------------------|-------:|----------------:|--------------:|-------------:|----------:|:------------|:------------------|:--------------------|------------:|:----------------|:------------------------|--------------:|-------------:|---------------:|:-------------|:-------------|------------:|:-----|
| 2019-07-01 00:00:00.000 |   2019 |               3 |             7 |            1 |  20190701 | July        | Jul-2019          | Q3-2019             |           1 | Monday          | 2019-07-06 00:00:00.000 |            27 |     20190700 |       20190300 | Q3           | Jul          |          19 | FY20 |
| 2019-07-02 00:00:00.000 |   2019 |               3 |             7 |            2 |  20190702 | July        | Jul-2019          | Q3-2019             |           2 | Tuesday         | 2019-07-06 00:00:00.000 |            27 |     20190700 |       20190300 | Q3           | Jul          |          19 | FY20 |
| 2019-07-03 00:00:00.000 |   2019 |               3 |             7 |            3 |  20190703 | July        | Jul-2019          | Q3-2019             |           3 | Wednesday       | 2019-07-06 00:00:00.000 |            27 |     20190700 |       20190300 | Q3           | Jul          |          19 | FY20 |
| 2019-07-04 00:00:00.000 |   2019 |               3 |             7 |            4 |  20190704 | July        | Jul-2019          | Q3-2019             |           4 | Thursday        | 2019-07-06 00:00:00.000 |            27 |     20190700 |       20190300 | Q3           | Jul          |          19 | FY20 |
| 2019-07-05 00:00:00.000 |   2019 |               3 |             7 |            5 |  20190705 | July        | Jul-2019          | Q3-2019             |           5 | Friday          | 2019-07-06 00:00:00.000 |            27 |     20190700 |       20190300 | Q3           | Jul          |          19 | FY20 |
| 2019-07-06 00:00:00.000 |   2019 |               3 |             7 |            6 |  20190706 | July        | Jul-2019          | Q3-2019             |           6 | Saturday        | 2019-07-06 00:00:00.000 |            27 |     20190700 |       20190300 | Q3           | Jul          |          19 | FY20 |
| 2019-07-07 00:00:00.000 |   2019 |               3 |             7 |            7 |  20190707 | July        | Jul-2019          | Q3-2019             |           0 | Sunday          | 2019-07-13 00:00:00.000 |            28 |     20190700 |       20190300 | Q3           | Jul          |          19 | FY20 |
| 2019-07-08 00:00:00.000 |   2019 |               3 |             7 |            8 |  20190708 | July        | Jul-2019          | Q3-2019             |           1 | Monday          | 2019-07-13 00:00:00.000 |            28 |     20190700 |       20190300 | Q3           | Jul          |          19 | FY20 |
| 2019-07-09 00:00:00.000 |   2019 |               3 |             7 |            9 |  20190709 | July        | Jul-2019          | Q3-2019             |           2 | Tuesday         | 2019-07-13 00:00:00.000 |            28 |     20190700 |       20190300 | Q3           | Jul          |          19 | FY20 |
| 2019-07-10 00:00:00.000 |   2019 |               3 |             7 |           10 |  20190710 | July        | Jul-2019          | Q3-2019             |           3 | Wednesday       | 2019-07-13 00:00:00.000 |            28 |     20190700 |       20190300 | Q3           | Jul          |          19 | FY20 |


Table: Plan
| Rep Code   |   Product Number |   Year | Trimester   | Month   |   Sales Target |
|:-----------|-----------------:|-------:|:------------|:--------|---------------:|
| RC_1       |     202000200004 |   2018 | T3          | 2018-09 |           4833 |
| RC_1       |     202000200005 |   2018 | T3          | 2018-09 |          16201 |
| RC_1       |     202000200006 |   2018 | T3          | 2018-09 |          13102 |
| RC_1       |     202000200007 |   2018 | T3          | 2018-09 |           2658 |
| RC_1       |     202000200004 |   2018 | T3          | 2018-10 |           4833 |
| RC_1       |     202000200005 |   2018 | T3          | 2018-10 |          16201 |
| RC_1       |     202000200006 |   2018 | T3          | 2018-10 |          13102 |
| RC_1       |     202000200007 |   2018 | T3          | 2018-10 |           2658 |
| RC_1       |     202000200004 |   2018 | T3          | 2018-11 |           4833 |
| RC_1       |     202000200005 |   2018 | T3          | 2018-11 |          16201 |


Table: Products
|   Product Number | Product Name   |   Liter Conversion Rate | Plan Product   |
|-----------------:|:---------------|------------------------:|:---------------|
|     202000200004 | Product A      |                 0.237   | True           |
|     202000600006 | Product B      |                 1       | False          |
|     202002300028 | Product C      |                 0.22    | False          |
|     202002300027 | Product D      |                 0.125   | False          |
|     202002400002 | Product E      |                 0.22    | False          |
|     202002400003 | Product F      |                 0.22    | False          |
|     202001000003 | Product G      |                 1       | False          |
|     202001300002 | Product H      |                 0.22    | False          |
|     202000900020 | Product I      |                 1.79664 | False          |
|     202002300029 | Product J      |                 1       | False          |


Table: Reps
| Rep Code   | Rep Name   | Wholesaler Rep   |
|:-----------|:-----------|:-----------------|
| RC_0       | NR         | True             |
| RC_1       | KR         | True             |
| RC_2       | SG         | True             |
| RC_3       | TM         | True             |
| RC_4       | LT         | True             |
| RC_5       | RT         | True             |
| RC_6       | SL         | True             |
| RC_7       | MY         | True             |
| RC_8       | MR         | True             |
| RC_9       | SG         | True             |


Table: Sales
|   Customer Number |   Product Number |   Year | Trimester   | Month                   |   Value Sales |   Volume Sales |   Actual Sales Converted |   CLM Calculating Sales Allocation |
|------------------:|-----------------:|-------:|:------------|:------------------------|--------------:|---------------:|-------------------------:|-----------------------------------:|
|          50001111 |     202000200005 |   2018 | T3          | 2018-09-01 00:00:00.000 |        210.96 |             24 |                    5.688 |                                  0 |
|          50001111 |     202000200005 |   2018 | T3          | 2018-11-01 00:00:00.000 |        210.96 |             24 |                    5.688 |                                  0 |
|          50001113 |     202000200005 |   2018 | T3          | 2018-09-01 00:00:00.000 |        210.96 |             24 |                    5.688 |                                  0 |
|          50001114 |     202000200005 |   2018 | T3          | 2018-10-01 00:00:00.000 |        210.96 |             24 |                    5.688 |                                  0 |
|          50001115 |     202000200005 |   2018 | T3          | 2018-11-01 00:00:00.000 |        210.96 |             24 |                    5.688 |                                  0 |
|          50001117 |     202000200005 |   2018 | T3          | 2018-09-01 00:00:00.000 |        210.96 |             24 |                    5.688 |                                  0 |
|          50001118 |     202000200005 |   2018 | T3          | 2018-11-01 00:00:00.000 |        210.96 |             24 |                    5.688 |                                  0 |
|          50001121 |     202000200005 |   2018 | T3          | 2018-10-01 00:00:00.000 |        210.96 |             24 |                    5.688 |                                  0 |
|          50003008 |     202000200005 |   2018 | T3          | 2018-12-01 00:00:00.000 |        210.96 |             24 |                    5.688 |                                  0 |
|          50003009 |     202000200005 |   2018 | T3          | 2018-11-01 00:00:00.000 |        210.96 |             24 |                    5.688 |                                  0 |

 


tables: name: Customers
data: Customers.csv
name: DimDate
data: DimDate.csv
name: Plan
data: Plan.csv
name: Products
data: Products.csv
name: Reps
data: Reps.csv
name: Sales
data: Sales.csv
label: Plan
Product Number
Products
Product Number
Customers
Rep Code
Reps
Rep Code
Plan
Rep Code
Reps
Rep Code
Sales
Customer Number
Customers
Customer Number
Sales
Month
DimDate
Date
Plan
Month
DimDate
Date
Sales
Product Number
Products
Product Number
output: {
    "joins": [
        {
            "from_table": "Plan",
            "from_column": "Product Number",
            "to_table": "Products",
            "to_column": "Product Number"
        },
        {
            "from_table": "Customers",
            "from_column": "Rep Code",
            "to_table": "Reps",
            "to_column": "Rep Code"
        },
        {
            "from_table": "Plan",
            "from_column": "Rep Code",
            "to_table": "Reps",
            "to_column": "Rep Code"
        },
        {
            "from_table": "Sales",
            "from_column": "Customer Number",
            "to_table": "Customers",
            "to_column": "Customer Number"
        },
        {
            "from_table": "Sales",
            "from_column": "Month",
            "to_table": "DimDate",
            "to_column": "Date"
        },
        {
            "from_table": "Plan",
            "from_column": "Month",
            "to_table": "DimDate",
            "to_column": "Date"
        },
        {
            "from_table": "Sales",
            "from_column": "Product Number",
            "to_table": "Products",
            "to_column": "Product Number"
        }
    ]
}