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: Customer_Data
| Customer ID   | Customer Name    |
|:--------------|:-----------------|
| C1000         | Thomas Duncan    |
| C1001         | Kenneth Ross     |
| C1002         | Henry Reyes      |
| C1003         | Benjamin Carter  |
| C1004         | Jeremy Schmidt   |
| C1005         | Joe Hanson       |
| C1006         | Henry Reyes      |
| C1007         | Benjamin Vasquez |
| C1008         | Benjamin Kim     |
| C1009         | Howard Morgan    |


Table: DatesTable
| Date                    |   Year |   QuarterOfYear |   MonthOfYear |   DayOfMonth |   DateInt | MonthName   | MonthInCalendar   | QuarterInCalendar   |   DayInWeek | DayOfWeekName   | WeekEnding              |   Week Number |   MonthnYear |   QuarternYear |   ShortYear | FY   |
|:------------------------|-------:|----------------:|--------------:|-------------:|----------:|:------------|:------------------|:--------------------|------------:|:----------------|:------------------------|--------------:|-------------:|---------------:|------------:|:-----|
| 2017-07-01 00:00:00.000 |   2017 |               3 |             7 |            1 |  20170701 | July        | Jul 2017          | Q3 2017             |           5 | Saturday        | 2017-07-02 00:00:00.000 |            27 |     20170700 |       20170300 |          17 | FY18 |
| 2017-07-02 00:00:00.000 |   2017 |               3 |             7 |            2 |  20170702 | July        | Jul 2017          | Q3 2017             |           6 | Sunday          | 2017-07-02 00:00:00.000 |            27 |     20170700 |       20170300 |          17 | FY18 |
| 2017-07-03 00:00:00.000 |   2017 |               3 |             7 |            3 |  20170703 | July        | Jul 2017          | Q3 2017             |           0 | Monday          | 2017-07-09 00:00:00.000 |            28 |     20170700 |       20170300 |          17 | FY18 |
| 2017-07-04 00:00:00.000 |   2017 |               3 |             7 |            4 |  20170704 | July        | Jul 2017          | Q3 2017             |           1 | Tuesday         | 2017-07-09 00:00:00.000 |            28 |     20170700 |       20170300 |          17 | FY18 |
| 2017-07-05 00:00:00.000 |   2017 |               3 |             7 |            5 |  20170705 | July        | Jul 2017          | Q3 2017             |           2 | Wednesday       | 2017-07-09 00:00:00.000 |            28 |     20170700 |       20170300 |          17 | FY18 |
| 2017-07-06 00:00:00.000 |   2017 |               3 |             7 |            6 |  20170706 | July        | Jul 2017          | Q3 2017             |           3 | Thursday        | 2017-07-09 00:00:00.000 |            28 |     20170700 |       20170300 |          17 | FY18 |
| 2017-07-07 00:00:00.000 |   2017 |               3 |             7 |            7 |  20170707 | July        | Jul 2017          | Q3 2017             |           4 | Friday          | 2017-07-09 00:00:00.000 |            28 |     20170700 |       20170300 |          17 | FY18 |
| 2017-07-08 00:00:00.000 |   2017 |               3 |             7 |            8 |  20170708 | July        | Jul 2017          | Q3 2017             |           5 | Saturday        | 2017-07-09 00:00:00.000 |            28 |     20170700 |       20170300 |          17 | FY18 |
| 2017-07-09 00:00:00.000 |   2017 |               3 |             7 |            9 |  20170709 | July        | Jul 2017          | Q3 2017             |           6 | Sunday          | 2017-07-09 00:00:00.000 |            28 |     20170700 |       20170300 |          17 | FY18 |
| 2017-07-10 00:00:00.000 |   2017 |               3 |             7 |           10 |  20170710 | July        | Jul 2017          | Q3 2017             |           0 | Monday          | 2017-07-16 00:00:00.000 |            29 |     20170700 |       20170300 |          17 | FY18 |


Table: Location_Data
| Location ID   | Name        | County              | State Code   | State      | Type   |   Latitude |   Longitude |   Area Code |   Population |   Households |   Median Income |   Land Area |   Water Area | Time Zone           |
|:--------------|:------------|:--------------------|:-------------|:-----------|:-------|-----------:|------------:|------------:|-------------:|-------------:|----------------:|------------:|-------------:|:--------------------|
| A100          | Anaheim     | Orange County       | CA           | California | City   |    33.8353 |    -117.915 |         657 |       350742 |        99670 |           60752 |   129438076 |      2457142 | America/Los Angeles |
| A101          | Antioch     | Contra Costa County | CA           | California | City   |    38.0049 |    -121.806 |         925 |       110542 |        33718 |           64329 |    76173197 |      1842711 | America/Los Angeles |
| A102          | Bakersfield | Kern County         | CA           | California | City   |    35.3733 |    -119.019 |         661 |       373640 |       112439 |           57095 |   385366784 |      3809676 | America/Los Angeles |
| A103          | Berkeley    | Alameda County      | CA           | California | City   |    37.8716 |    -122.273 |         510 |       120972 |        45917 |           66237 |    27106077 |     18715614 | America/Los Angeles |
| A104          | Burbank     | Los Angeles County  | CA           | California | City   |    34.1808 |    -118.309 |         818 |       105319 |        41361 |           66076 |    44947219 |        94286 | America/Los Angeles |
| A105          | Carlsbad    | San Diego County    | CA           | California | City   |    33.1581 |    -117.351 |         760 |       113453 |        42791 |           90597 |    97713477 |      3595655 | America/Los Angeles |
| A106          | Chula Vista | San Diego County    | CA           | California | City   |    32.64   |    -117.084 |         619 |       265757 |        78066 |           65185 |   128544440 |      6380135 | America/Los Angeles |
| A107          | Clovis      | Fresno County       | CA           | California | City   |    36.8252 |    -119.703 |         559 |       104180 |        34512 |           62666 |    62693928 |            0 | America/Los Angeles |
| A108          | Concord     | Contra Costa County | CA           | California | City   |    37.978  |    -122.031 |         925 |       128667 |        45409 |           68318 |    79108534 |            0 | America/Los Angeles |
| A109          | Corona      | Riverside County    | CA           | California | City   |    33.8753 |    -117.566 |         951 |       164226 |        48156 |           74149 |   102233537 |       211897 | America/Los Angeles |


Table: Product_Data
| Product ID   | Product Name   |   Cost |   Original Sale Price |   Discount |   Current Price |   Taxes |
|:-------------|:---------------|-------:|----------------------:|-----------:|----------------:|--------:|
| PID2000      | Product 1      |   1367 |                  2241 |          0 |            2241 |  336.15 |
| PID2001      | Product 2      |    504 |                   951 |          0 |             951 |  142.65 |
| PID2002      | Product 3      |    534 |                   847 |          0 |             847 |  127.05 |
| PID2003      | Product 4      |   1516 |                  1783 |          0 |            1783 |  267.45 |
| PID2004      | Product 5      |    665 |                  1278 |          0 |            1278 |  191.7  |
| PID2005      | Product 6      |    561 |                   684 |          0 |             684 |  102.6  |
| PID2006      | Product 7      |   1443 |                  1826 |          0 |            1826 |  273.9  |
| PID2007      | Product 8      |   1054 |                  1405 |          0 |            1405 |  210.75 |
| PID2008      | Product 9      |    208 |                   315 |          0 |             315 |   47.25 |
| PID2009      | Product 10     |    420 |                   584 |          0 |             584 |   87.6  |


Table: Salespeople_Data
| Salesperson ID   | Salesperson Name   |
|:-----------------|:-------------------|
| EMP1000          | Fred Robertson     |
| EMP1001          | Kevin Butler       |
| EMP1002          | Andrew Bowman      |
| EMP1003          | Christopher Tucker |
| EMP1004          | Kenneth Bradley    |
| EMP1005          | Ryan Welch         |
| EMP1006          | Sean Miller        |
| EMP1007          | Jeremy Mendoza     |
| EMP1008          | Carl Elliott       |
| EMP1009          | Kenneth Fields     |


Table: SalesTable
| Order ID   | Product ID   | Location ID   | Sales Person ID   | Customer ID   | Purchase Date           |   Quantity |   Price |
|:-----------|:-------------|:--------------|:------------------|:--------------|:------------------------|-----------:|--------:|
| OID10331   | PID2032      | A141          | EMP1043           | C1002         | 2019-01-11 00:00:00.000 |          1 |    1967 |
| OID11833   | PID2092      | A153          | EMP1043           | C1744         | 2019-02-11 00:00:00.000 |          1 |    1639 |
| OID12261   | PID2050      | A157          | EMP1043           | C1672         | 2019-02-05 00:00:00.000 |          1 |    2391 |
| OID13469   | PID2080      | A148          | EMP1043           | C1065         | 2019-01-17 00:00:00.000 |          1 |    2353 |
| OID15599   | PID2080      | A164          | EMP1043           | C1359         | 2019-02-02 00:00:00.000 |          1 |    2353 |
| OID17381   | PID2039      | A159          | EMP1043           | C1204         | 2019-02-10 00:00:00.000 |          1 |     817 |
| OID18806   | PID2092      | A128          | EMP1043           | C1778         | 2019-01-14 00:00:00.000 |          1 |    1639 |
| OID19857   | PID2039      | A119          | EMP1043           | C1789         | 2019-03-05 00:00:00.000 |          1 |     817 |
| OID20426   | PID2047      | A137          | EMP1043           | C1392         | 2019-01-19 00:00:00.000 |          1 |     290 |
| OID20616   | PID2070      | A102          | EMP1043           | C1092         | 2019-03-10 00:00:00.000 |          1 |    1671 |

 


tables: name: Customer_Data
data: Customer_Data.csv
name: DatesTable
data: DatesTable.csv
name: Location_Data
data: Location_Data.csv
name: Product_Data
data: Product_Data.csv
name: Salespeople_Data
data: Salespeople_Data.csv
name: SalesTable
data: SalesTable.csv
label: SalesTable
Customer ID
Customer_Data
Customer ID
SalesTable
Location ID
Location_Data
Location ID
SalesTable
Product ID
Product_Data
Product ID
SalesTable
Sales Person ID
Salespeople_Data
Salesperson ID
SalesTable
Purchase Date
DatesTable
Date
output: {
    "joins": [
        {
            "from_table": "SalesTable",
            "from_column": "Customer ID",
            "to_table": "Customer_Data",
            "to_column": "Customer ID"
        },
        {
            "from_table": "SalesTable",
            "from_column": "Location ID",
            "to_table": "Location_Data",
            "to_column": "Location ID"
        },
        {
            "from_table": "SalesTable",
            "from_column": "Product ID",
            "to_table": "Product_Data",
            "to_column": "Product ID"
        },
        {
            "from_table": "SalesTable",
            "from_column": "Sales Person ID",
            "to_table": "Salespeople_Data",
            "to_column": "Salesperson ID"
        },
        {
            "from_table": "SalesTable",
            "from_column": "Purchase Date",
            "to_table": "DatesTable",
            "to_column": "Date"
        }
    ]
}