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 Rank
|   Customer Rank |
|----------------:|
|               0 |
|               1 |
|               2 |
|               3 |
|               4 |
|               5 |
|               6 |
|               7 |
|               8 |
|               9 |


Table: Customers
|   Customer Index | Customer Names   |
|-----------------:|:-----------------|
|                1 | Jesse Evans      |
|                2 | Victor Ramos     |
|                3 | Mark Montgomery  |
|                4 | Dennis Morris    |
|                5 | Gregory Simmons  |
|                6 | Jeremy Vasquez   |
|                7 | Anthony Simpson  |
|                8 | Ernest Rivera    |
|                9 | Victor Martinez  |
|               10 | Bobby Burton     |


Table: Dates
| Date                    |   Year |   QuarterOfYear |   MonthOfYear |   DayOfMonth | Months   | Month & Year   | Quarter & Year   |   DayInWeek | DayOfWeekName   |   Week Number |   MonthnYear |   QuarternYear |   ShortYear | FY   | Short Month   |
|:------------------------|-------:|----------------:|--------------:|-------------:|:---------|:---------------|:-----------------|------------:|:----------------|--------------:|-------------:|---------------:|------------:|:-----|:--------------|
| 2016-07-01 00:00:00.000 |   2016 |               3 |             7 |            1 | July     | Jul 2016       | Q3 2016          |           4 | Friday          |            27 |     20160700 |       20160300 |          16 | FY17 | Jul           |
| 2016-07-02 00:00:00.000 |   2016 |               3 |             7 |            2 | July     | Jul 2016       | Q3 2016          |           5 | Saturday        |            27 |     20160700 |       20160300 |          16 | FY17 | Jul           |
| 2016-07-03 00:00:00.000 |   2016 |               3 |             7 |            3 | July     | Jul 2016       | Q3 2016          |           6 | Sunday          |            27 |     20160700 |       20160300 |          16 | FY17 | Jul           |
| 2016-07-04 00:00:00.000 |   2016 |               3 |             7 |            4 | July     | Jul 2016       | Q3 2016          |           0 | Monday          |            28 |     20160700 |       20160300 |          16 | FY17 | Jul           |
| 2016-07-05 00:00:00.000 |   2016 |               3 |             7 |            5 | July     | Jul 2016       | Q3 2016          |           1 | Tuesday         |            28 |     20160700 |       20160300 |          16 | FY17 | Jul           |
| 2016-07-06 00:00:00.000 |   2016 |               3 |             7 |            6 | July     | Jul 2016       | Q3 2016          |           2 | Wednesday       |            28 |     20160700 |       20160300 |          16 | FY17 | Jul           |
| 2016-07-07 00:00:00.000 |   2016 |               3 |             7 |            7 | July     | Jul 2016       | Q3 2016          |           3 | Thursday        |            28 |     20160700 |       20160300 |          16 | FY17 | Jul           |
| 2016-07-08 00:00:00.000 |   2016 |               3 |             7 |            8 | July     | Jul 2016       | Q3 2016          |           4 | Friday          |            28 |     20160700 |       20160300 |          16 | FY17 | Jul           |
| 2016-07-09 00:00:00.000 |   2016 |               3 |             7 |            9 | July     | Jul 2016       | Q3 2016          |           5 | Saturday        |            28 |     20160700 |       20160300 |          16 | FY17 | Jul           |
| 2016-07-10 00:00:00.000 |   2016 |               3 |             7 |           10 | July     | Jul 2016       | Q3 2016          |           6 | Sunday          |            28 |     20160700 |       20160300 |          16 | FY17 | Jul           |


Table: Products
|   Index | Product Name   | Product Category   |
|--------:|:---------------|:-------------------|
|       1 | Product 1      | Category 10        |
|       2 | Product 2      | Category 7         |
|       3 | Product 3      | Category 8         |
|       4 | Product 4      | Category 4         |
|       5 | Product 5      | Category 4         |
|       6 | Product 6      | Category 11        |
|       7 | Product 7      | Category 1         |
|       8 | Product 8      | Category 10        |
|       9 | Product 9      | Category 11        |
|      10 | Product 10     | Category 10        |


Table: Sales
| OrderNumber   | OrderDate               | Ship Date               | Due Date                |   Customer Name Index | Channel   | Currency Code   | Warehouse Code   |   Delivery Region Index |   Product Description Index |   Order Quantity |   Unit Price |   Revenue |   Total Unit Cost |
|:--------------|:------------------------|:------------------------|:------------------------|----------------------:|:----------|:----------------|:-----------------|------------------------:|----------------------------:|-----------------:|-------------:|----------:|------------------:|
| SO - 0001119  | 2014-01-01 00:00:00.000 | 2014-01-18 00:00:00.000 | 2014-01-16 00:00:00.000 |                  3268 | Wholesale | USD             | AXW291           |                     956 |                          78 |                6 |       5835.7 |   35014.2 |          4726.92  |
| SO - 0008006  | 2014-01-02 00:00:00.000 | 2014-01-14 00:00:00.000 | 2014-01-30 00:00:00.000 |                  1848 | Wholesale | USD             | AXW291           |                     866 |                          43 |                6 |       3825.7 |   22954.2 |          3251.85  |
| SO - 0003949  | 2014-01-07 00:00:00.000 | 2014-01-27 00:00:00.000 | 2014-02-12 00:00:00.000 |                  1667 | Wholesale | USD             | AXW291           |                     162 |                         114 |                6 |       3088.7 |   18532.2 |          2069.43  |
| SO - 0010153  | 2014-01-08 00:00:00.000 | 2014-02-04 00:00:00.000 | 2014-02-11 00:00:00.000 |                  3096 | Wholesale | USD             | AXW291           |                     854 |                         410 |                6 |        964.8 |    5788.8 |           578.88  |
| SO - 0010672  | 2014-01-08 00:00:00.000 | 2014-02-04 00:00:00.000 | 2014-02-22 00:00:00.000 |                  1435 | Wholesale | USD             | AXW291           |                     396 |                          29 |                6 |       2566.1 |   15396.6 |          1950.24  |
| SO - 0004792  | 2014-01-10 00:00:00.000 | 2014-02-07 00:00:00.000 | 2014-02-05 00:00:00.000 |                  1729 | Wholesale | USD             | AXW291           |                     763 |                         410 |                6 |        167.5 |    1005   |            83.75  |
| SO - 0003742  | 2014-01-11 00:00:00.000 | 2014-01-24 00:00:00.000 | 2014-01-29 00:00:00.000 |                  2777 | Wholesale | USD             | AXW291           |                     934 |                         260 |                6 |       1031.8 |    6190.8 |           691.306 |
| SO - 000201   | 2014-01-12 00:00:00.000 | 2014-01-20 00:00:00.000 | 2014-01-23 00:00:00.000 |                   800 | Wholesale | USD             | AXW291           |                     221 |                         224 |                6 |       1983.2 |   11899.2 |          1447.74  |
| SO - 0009756  | 2014-01-12 00:00:00.000 | 2014-01-30 00:00:00.000 | 2014-02-05 00:00:00.000 |                  1385 | Wholesale | USD             | AXW291           |                     136 |                         128 |                6 |       1105.5 |    6633   |           475.365 |
| SO - 0001685  | 2014-01-12 00:00:00.000 | 2014-02-12 00:00:00.000 | 2014-02-16 00:00:00.000 |                  1440 | Wholesale | USD             | AXW291           |                     608 |                         333 |                6 |        207.7 |    1246.2 |            99.696 |


Table: States
| State Code   | State                | Region    |
|:-------------|:---------------------|:----------|
| AL           | Alabama              | South     |
| AR           | Arkansas             | South     |
| AZ           | Arizona              | West      |
| CA           | California           | West      |
| CO           | Colorado             | West      |
| CT           | Connecticut          | Northeast |
| DC           | District of Columbia | South     |
| DE           | Delaware             | South     |
| FL           | Florida              | South     |
| GA           | Georgia              | South     |


Table: US Regions
|   id | Stores       | county              | state_code   | state      | type   |   latitude |   longitude |   area_code |   population |   households |   median_income |   land_area |   water_area | time_zone           |
|-----:|:-------------|:--------------------|:-------------|:-----------|:-------|-----------:|------------:|------------:|-------------:|-------------:|----------------:|------------:|-------------:|:--------------------|
|   38 | Alameda      | Alameda County      | CA           | California | City   |    37.7652 |    -122.242 |         510 |        78630 |        30708 |           79312 |    27045458 |     32778370 | America/Los Angeles |
|   39 | Alhambra     | Los Angeles County  | CA           | California | City   |    34.0953 |    -118.127 |         626 |        85551 |        29174 |           53582 |    19764230 |         1730 | America/Los Angeles |
|   40 | Aliso Viejo  | Orange County       | CA           | California | City   |    33.565  |    -117.727 |         949 |        50195 |        18425 |          102367 |    17921214 |            0 | America/Los Angeles |
|   41 | Anaheim      | Orange County       | CA           | California | City   |    33.8353 |    -117.915 |         657 |       350742 |        99670 |           60752 |   129438076 |      2457142 | America/Los Angeles |
|   42 | Antioch      | Contra Costa County | CA           | California | City   |    38.0049 |    -121.806 |         925 |       110542 |        33718 |           64329 |    76173197 |      1842711 | America/Los Angeles |
|   44 | Arcadia      | Los Angeles County  | CA           | California | City   |    34.1397 |    -118.035 |         626 |        58408 |        19559 |           79934 |    28295893 |       540014 | America/Los Angeles |
|   46 | Bakersfield  | Kern County         | CA           | California | City   |    35.3733 |    -119.019 |         661 |       373640 |       112439 |           57095 |   385366784 |      3809676 | America/Los Angeles |
|   47 | Baldwin Park | Los Angeles County  | CA           | California | City   |    34.0853 |    -117.961 |         626 |        77071 |        17674 |           51742 |    17174857 |       399817 | America/Los Angeles |
|   48 | Bellflower   | Los Angeles County  | CA           | California | City   |    33.8817 |    -118.117 |         562 |        78441 |        23176 |           48823 |    15845460 |       138188 | America/Los Angeles |
|   49 | Berkeley     | Alameda County      | CA           | California | City   |    37.8716 |    -122.273 |         510 |       120972 |        45917 |           66237 |    27106077 |     18715614 | America/Los Angeles |

 


tables: name: Customer Rank
data: Customer Rank.csv
name: Customers
data: Customers.csv
name: Dates
data: Dates.csv
name: Products
data: Products.csv
name: Sales
data: Sales.csv
name: States
data: States.csv
name: US Regions
data: US Regions.csv
label: Sales
Customer Name Index
Customers
Customer Index
Sales
OrderDate
Dates
Date
Sales
Delivery Region Index
US Regions
id
Sales
Product Description Index
Products
Index
output: {
    "joins": [
        {
            "from_table": "Sales",
            "from_column": "Customer Name Index",
            "to_table": "Customers",
            "to_column": "Customer Index"
        },
        {
            "from_table": "Sales",
            "from_column": "OrderDate",
            "to_table": "Dates",
            "to_column": "Date"
        },
        {
            "from_table": "Sales",
            "from_column": "Delivery Region Index",
            "to_table": "US Regions",
            "to_column": "id"
        },
        {
            "from_table": "Sales",
            "from_column": "Product Description Index",
            "to_table": "Products",
            "to_column": "Index"
        }
    ]
}