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: Averages
|   Column1 |
|----------:|
|         1 |


Table: Budget Allocation
| Month   |   Month Number |   Monthly Allocation |
|:--------|---------------:|---------------------:|
| Jan     |              1 |                 0.04 |
| Feb     |              2 |                 0.07 |
| Mar     |              3 |                 0.07 |
| Apr     |              4 |                 0.1  |
| May     |              5 |                 0.13 |
| Jun     |              6 |                 0.14 |
| Jul     |              7 |                 0.12 |
| Aug     |              8 |                 0.09 |
| Sep     |              9 |                 0.07 |
| Oct     |             10 |                 0.08 |


Table: Budgeting
|   Column1 |
|----------:|
|         1 |


Table: Cumulative Totals
|   Column1 |
|----------:|
|         1 |


Table: Customer Groups
| Client Groups   | Group Code   |   Index |
|:----------------|:-------------|--------:|
| Top Clients     | Top          |       1 |
| Average Clients | Average      |       2 |
| Lower Clients   | Lower        |       3 |


Table: Customers
| Customer ID   | Customer Name   | Customer Address   | Longitude   | Latitude   |   Client Revenue | Client Group   |
|:--------------|:----------------|:-------------------|:------------|:-----------|-----------------:|:---------------|
| C1000         | Jesse Evans     |                    |             |            |            45271 | High           |
| C1001         | Victor Ramos    |                    |             |            |            30424 | Mid            |
| C1002         | Mark Montgomery |                    |             |            |            48920 | High           |
| C1003         | Dennis Morris   |                    |             |            |            59362 | High           |
| C1004         | Gregory Simmons |                    |             |            |            35704 | Mid            |
| C1005         | Jeremy Vasquez  |                    |             |            |            41258 | High           |
| C1006         | Anthony Simpson |                    |             |            |            37182 | Mid            |
| C1007         | Ernest Rivera   |                    |             |            |            59468 | High           |
| C1008         | Victor Martinez |                    |             |            |            33924 | Mid            |
| C1009         | Bobby Burton    |                    |             |            |            51496 | High           |


Table: Date Ranges
| Time Frame   |   Days |   Index |
|:-------------|-------:|--------:|
| 7d           |      7 |       1 |
| 14d          |     14 |       2 |
| 30d          |     30 |       3 |
| 90d          |     90 |       4 |
| 180d         |    180 |       5 |
| 360d         |    360 |       6 |


Table: Dates
| Date                    |   Year |   QuarterOfYear |   MonthOfYear |   DayOfMonth | MonthName   | Month & Year   | Quarter & Year   |   DayInWeek | DayOfWeekName   | WeekEnding              |   Week Number |   MonthnYear |   QuarternYear |   ShortYear | FY   |
|:------------------------|-------:|----------------:|--------------:|-------------:|:------------|:---------------|:-----------------|------------:|:----------------|:------------------------|--------------:|-------------:|---------------:|------------:|:-----|
| 2015-07-01 00:00:00.000 |   2015 |               3 |             7 |            1 | July        | Jul 2015       | Q3 2015          |           2 | Wednesday       | 2015-07-05 00:00:00.000 |            27 |     20150700 |       20150300 |          15 | FY16 |
| 2015-07-02 00:00:00.000 |   2015 |               3 |             7 |            2 | July        | Jul 2015       | Q3 2015          |           3 | Thursday        | 2015-07-05 00:00:00.000 |            27 |     20150700 |       20150300 |          15 | FY16 |
| 2015-07-03 00:00:00.000 |   2015 |               3 |             7 |            3 | July        | Jul 2015       | Q3 2015          |           4 | Friday          | 2015-07-05 00:00:00.000 |            27 |     20150700 |       20150300 |          15 | FY16 |
| 2015-07-04 00:00:00.000 |   2015 |               3 |             7 |            4 | July        | Jul 2015       | Q3 2015          |           5 | Saturday        | 2015-07-05 00:00:00.000 |            27 |     20150700 |       20150300 |          15 | FY16 |
| 2015-07-05 00:00:00.000 |   2015 |               3 |             7 |            5 | July        | Jul 2015       | Q3 2015          |           6 | Sunday          | 2015-07-05 00:00:00.000 |            27 |     20150700 |       20150300 |          15 | FY16 |
| 2015-07-06 00:00:00.000 |   2015 |               3 |             7 |            6 | July        | Jul 2015       | Q3 2015          |           0 | Monday          | 2015-07-12 00:00:00.000 |            28 |     20150700 |       20150300 |          15 | FY16 |
| 2015-07-07 00:00:00.000 |   2015 |               3 |             7 |            7 | July        | Jul 2015       | Q3 2015          |           1 | Tuesday         | 2015-07-12 00:00:00.000 |            28 |     20150700 |       20150300 |          15 | FY16 |
| 2015-07-08 00:00:00.000 |   2015 |               3 |             7 |            8 | July        | Jul 2015       | Q3 2015          |           2 | Wednesday       | 2015-07-12 00:00:00.000 |            28 |     20150700 |       20150300 |          15 | FY16 |
| 2015-07-09 00:00:00.000 |   2015 |               3 |             7 |            9 | July        | Jul 2015       | Q3 2015          |           3 | Thursday        | 2015-07-12 00:00:00.000 |            28 |     20150700 |       20150300 |          15 | FY16 |
| 2015-07-10 00:00:00.000 |   2015 |               3 |             7 |           10 | July        | Jul 2015       | Q3 2015          |           4 | Friday          | 2015-07-12 00:00:00.000 |            28 |     20150700 |       20150300 |          15 | FY16 |


Table: Grouping Measures
|   Column1 |
|----------:|
|         1 |


Table: Invoked Function (2)
| Date                    |   Year |   QuarterOfYear |   MonthOfYear |   DayOfMonth |   DateInt | MonthName   | MonthInCalendar   | QuarterInCalendar   |   DayInWeek | DayOfWeekName   | WeekEnding              |   Week Number |   MonthnYear |   QuarternYear |   ShortYear | FY   |
|:------------------------|-------:|----------------:|--------------:|-------------:|----------:|:------------|:------------------|:--------------------|------------:|:----------------|:------------------------|--------------:|-------------:|---------------:|------------:|:-----|
| 2016-07-01 00:00:00.000 |   2016 |               3 |             7 |            1 |  20160701 | July        | Jul 2016          | Q3 2016             |           4 | Friday          | 2016-07-03 00:00:00.000 |            27 |     20160700 |       20160300 |          16 | FY17 |
| 2016-07-02 00:00:00.000 |   2016 |               3 |             7 |            2 |  20160702 | July        | Jul 2016          | Q3 2016             |           5 | Saturday        | 2016-07-03 00:00:00.000 |            27 |     20160700 |       20160300 |          16 | FY17 |
| 2016-07-03 00:00:00.000 |   2016 |               3 |             7 |            3 |  20160703 | July        | Jul 2016          | Q3 2016             |           6 | Sunday          | 2016-07-03 00:00:00.000 |            27 |     20160700 |       20160300 |          16 | FY17 |
| 2016-07-04 00:00:00.000 |   2016 |               3 |             7 |            4 |  20160704 | July        | Jul 2016          | Q3 2016             |           0 | Monday          | 2016-07-10 00:00:00.000 |            28 |     20160700 |       20160300 |          16 | FY17 |
| 2016-07-05 00:00:00.000 |   2016 |               3 |             7 |            5 |  20160705 | July        | Jul 2016          | Q3 2016             |           1 | Tuesday         | 2016-07-10 00:00:00.000 |            28 |     20160700 |       20160300 |          16 | FY17 |
| 2016-07-06 00:00:00.000 |   2016 |               3 |             7 |            6 |  20160706 | July        | Jul 2016          | Q3 2016             |           2 | Wednesday       | 2016-07-10 00:00:00.000 |            28 |     20160700 |       20160300 |          16 | FY17 |
| 2016-07-07 00:00:00.000 |   2016 |               3 |             7 |            7 |  20160707 | July        | Jul 2016          | Q3 2016             |           3 | Thursday        | 2016-07-10 00:00:00.000 |            28 |     20160700 |       20160300 |          16 | FY17 |
| 2016-07-08 00:00:00.000 |   2016 |               3 |             7 |            8 |  20160708 | July        | Jul 2016          | Q3 2016             |           4 | Friday          | 2016-07-10 00:00:00.000 |            28 |     20160700 |       20160300 |          16 | FY17 |
| 2016-07-09 00:00:00.000 |   2016 |               3 |             7 |            9 |  20160709 | July        | Jul 2016          | Q3 2016             |           5 | Saturday        | 2016-07-10 00:00:00.000 |            28 |     20160700 |       20160300 |          16 | FY17 |
| 2016-07-10 00:00:00.000 |   2016 |               3 |             7 |           10 |  20160710 | July        | Jul 2016          | Q3 2016             |           6 | Sunday          | 2016-07-10 00:00:00.000 |            28 |     20160700 |       20160300 |          16 | FY17 |


Table: Invoked Function
| Date                    |   Year |   QuarterOfYear |   MonthOfYear |   DayOfMonth |   DateInt | MonthName   | MonthInCalendar   | QuarterInCalendar   |   DayInWeek | DayOfWeekName   | WeekEnding              |   Week Number |   MonthnYear |   QuarternYear |   ShortYear | FY   |
|:------------------------|-------:|----------------:|--------------:|-------------:|----------:|:------------|:------------------|:--------------------|------------:|:----------------|:------------------------|--------------:|-------------:|---------------:|------------:|:-----|
| 2015-01-01 00:00:00.000 |   2015 |               1 |             1 |            1 |  20150101 | January     | Jan 2015          | Q1 2015             |           3 | Thursday        | 2015-01-04 00:00:00.000 |             1 |     20150100 |       20150100 |          15 | FY15 |
| 2015-01-02 00:00:00.000 |   2015 |               1 |             1 |            2 |  20150102 | January     | Jan 2015          | Q1 2015             |           4 | Friday          | 2015-01-04 00:00:00.000 |             1 |     20150100 |       20150100 |          15 | FY15 |
| 2015-01-03 00:00:00.000 |   2015 |               1 |             1 |            3 |  20150103 | January     | Jan 2015          | Q1 2015             |           5 | Saturday        | 2015-01-04 00:00:00.000 |             1 |     20150100 |       20150100 |          15 | FY15 |
| 2015-01-04 00:00:00.000 |   2015 |               1 |             1 |            4 |  20150104 | January     | Jan 2015          | Q1 2015             |           6 | Sunday          | 2015-01-04 00:00:00.000 |             1 |     20150100 |       20150100 |          15 | FY15 |
| 2015-01-05 00:00:00.000 |   2015 |               1 |             1 |            5 |  20150105 | January     | Jan 2015          | Q1 2015             |           0 | Monday          | 2015-01-11 00:00:00.000 |             2 |     20150100 |       20150100 |          15 | FY15 |
| 2015-01-06 00:00:00.000 |   2015 |               1 |             1 |            6 |  20150106 | January     | Jan 2015          | Q1 2015             |           1 | Tuesday         | 2015-01-11 00:00:00.000 |             2 |     20150100 |       20150100 |          15 | FY15 |
| 2015-01-07 00:00:00.000 |   2015 |               1 |             1 |            7 |  20150107 | January     | Jan 2015          | Q1 2015             |           2 | Wednesday       | 2015-01-11 00:00:00.000 |             2 |     20150100 |       20150100 |          15 | FY15 |
| 2015-01-08 00:00:00.000 |   2015 |               1 |             1 |            8 |  20150108 | January     | Jan 2015          | Q1 2015             |           3 | Thursday        | 2015-01-11 00:00:00.000 |             2 |     20150100 |       20150100 |          15 | FY15 |
| 2015-01-09 00:00:00.000 |   2015 |               1 |             1 |            9 |  20150109 | January     | Jan 2015          | Q1 2015             |           4 | Friday          | 2015-01-11 00:00:00.000 |             2 |     20150100 |       20150100 |          15 | FY15 |
| 2015-01-10 00:00:00.000 |   2015 |               1 |             1 |           10 |  20150110 | January     | Jan 2015          | Q1 2015             |           5 | Saturday        | 2015-01-11 00:00:00.000 |             2 |     20150100 |       20150100 |          15 | FY15 |


Table: Key Measures
|   Column1 |
|----------:|
|         1 |


Table: Locations
| Location ID   | Name            | County           | State Code   | State       | Type   |   Latitude |   Longitude |   Area Code |   Population |   Households |   Median Income |   Land Area | Time Zone        |
|:--------------|:----------------|:-----------------|:-------------|:------------|:-------|-----------:|------------:|------------:|-------------:|-------------:|----------------:|------------:|:-----------------|
| A100          | Bridgeport      | Fairfield County | CT           | Connecticut | City   |    41.167  |    -73.2048 |         203 |       147629 |        50367 |           41801 |    41591056 | America/New York |
| A102          | Hartford        | Hartford County  | CT           | Connecticut | City   |    41.7637 |    -72.6851 |         959 |       124006 |        45239 |           30630 |    45016120 | America/New York |
| A104          | New Haven       | New Haven County | CT           | Connecticut | City   |    41.3081 |    -72.9282 |         203 |       130322 |        49771 |           37192 |    48407373 | America/New York |
| A106          | Stamford        | Fairfield County | CT           | Connecticut | City   |    41.0534 |    -73.5387 |         203 |       128874 |        46974 |           79359 |    97430571 | America/New York |
| A108          | Waterbury       | New Haven County | CT           | Connecticut | City   |    41.5581 |    -73.0515 |         203 |       108802 |        40213 |           40467 |    73880017 | America/New York |
| A111          | Cape Coral      | Lee County       | FL           | Florida     | City   |    26.5629 |    -81.9495 |         941 |       175229 |        58967 |           50536 |   273544395 | America/New York |
| A112          | Clearwater      | Pinellas County  | FL           | Florida     | City   |    27.979  |    -82.7666 |         727 |       113003 |        46234 |           44198 |    67027321 | America/New York |
| A113          | Coral Springs   | Broward County   | FL           | Florida     | City   |    26.2712 |    -80.2706 |         954 |       129485 |        40571 |           66430 |    61625913 | America/New York |
| A115          | Fort Lauderdale | Broward County   | FL           | Florida     | City   |    26.1223 |    -80.1434 |         954 |       178590 |        73446 |           50778 |    89672308 | America/New York |
| A116          | Gainesville     | Alachua County   | FL           | Florida     | City   |    29.6516 |    -82.3248 |         352 |       130128 |        47968 |           31818 |   161411152 | America/New York |


Table: Metric Selection
| Metric   |   Index |
|:---------|--------:|
| Revenue  |       1 |
| Profits  |       2 |


Table: Moving Averages
|   Column1 |
|----------:|
|         1 |


Table: Price Groups
| Pricing Groups   |   Index |   Low Range |   High Range |
|:-----------------|--------:|------------:|-------------:|
| Low              |       1 |           0 |         1000 |
| Mid-Range        |       2 |        1000 |         2000 |
| High             |       3 |        2000 |      1000000 |


Table: Products
| Product ID   | Product Name   |   Cost |   Original Sale Price | Discount Code   |   Discount |   Current Price |   Taxes | Pricing Group   |
|:-------------|:---------------|-------:|----------------------:|:----------------|-----------:|----------------:|--------:|:----------------|
| ENX2000      | Product 1      |   1367 |                  2241 |                 |          0 |            2241 |  336.15 | High            |
| ENX2001      | Product 2      |    504 |                   951 |                 |          0 |             951 |  142.65 | Low             |
| ENX2002      | Product 3      |    534 |                   847 |                 |          0 |             847 |  127.05 | Low             |
| ENX2003      | Product 4      |   1516 |                  1783 |                 |          0 |            1783 |  267.45 | Mid-Range       |
| ENX2004      | Product 5      |    665 |                  1278 |                 |          0 |            1278 |  191.7  | Mid-Range       |
| ENX2005      | Product 6      |    561 |                   684 |                 |          0 |             684 |  102.6  | Low             |
| ENX2006      | Product 7      |   1443 |                  1826 |                 |          0 |            1826 |  273.9  | Mid-Range       |
| ENX2007      | Product 8      |   1054 |                  1405 |                 |          0 |            1405 |  210.75 | Mid-Range       |
| ENX2008      | Product 9      |    208 |                   315 |                 |          0 |             315 |   47.25 | Low             |
| ENX2009      | Product 10     |    420 |                   584 |                 |          0 |             584 |   87.6  | Low             |


Table: Ranking
|   Column1 |
|----------:|
|         1 |


Table: Sales
| Order ID   | Product ID   | Location ID   | Sales Person ID   | Customer ID   | Purchase Date           |   Quantity |
|:-----------|:-------------|:--------------|:------------------|:--------------|:------------------------|-----------:|
| AX10030    | ENX2028      | A124          | EMP1017           | C1495         | 2017-06-22 00:00:00.000 |          1 |
| AX10091    | ENX2051      | A149          | EMP1017           | C1707         | 2018-04-18 00:00:00.000 |          1 |
| AX10237    | ENX2080      | A169          | EMP1017           | C1578         | 2019-04-10 00:00:00.000 |          1 |
| AX10370    | ENX2011      | A131          | EMP1017           | C1419         | 2016-11-24 00:00:00.000 |          1 |
| AX10395    | ENX2085      | A109          | EMP1017           | C1402         | 2019-06-17 00:00:00.000 |          1 |
| AX10413    | ENX2000      | A137          | EMP1017           | C1345         | 2016-07-06 00:00:00.000 |          1 |
| AX10488    | ENX2028      | A175          | EMP1017           | C1169         | 2017-06-27 00:00:00.000 |          1 |
| AX10534    | ENX2077      | A193          | EMP1017           | C1479         | 2019-03-12 00:00:00.000 |          1 |
| AX10545    | ENX2079      | A128          | EMP1017           | C1695         | 2019-04-08 00:00:00.000 |          1 |
| AX10556    | ENX2097      | A101          | EMP1017           | C1010         | 2019-11-15 00:00:00.000 |          1 |


Table: Salespeople
| 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: Supporting Measures
|   Column1 |
|----------:|
|         1 |


Table: Time Intelligence
|   Column1 |
|----------:|
|         1 |


Table: Yearly Budget
| Location ID   | Name           |   Revenue |
|:--------------|:---------------|----------:|
| A189          | Alexandria     |     46400 |
| A165          | Amherst        |     53400 |
| A190          | Arlington      |     45800 |
| A135          | Athens         |     40200 |
| A136          | Atlanta        |     41700 |
| A137          | Augusta        |     62700 |
| A166          | Babylon (Town) |     53000 |
| A147          | Baltimore      |     46600 |
| A142          | Boston         |     29000 |
| A110          | Brandon        |     76500 |

 


tables: name: Averages
data: Averages.csv
name: Budget Allocation
data: Budget Allocation.csv
name: Budgeting
data: Budgeting.csv
name: Cumulative Totals
data: Cumulative Totals.csv
name: Customer Groups
data: Customer Groups.csv
name: Customers
data: Customers.csv
name: Date Ranges
data: Date Ranges.csv
name: Dates
data: Dates.csv
name: Grouping Measures
data: Grouping Measures.csv
name: Invoked Function (2)
data: Invoked Function (2).csv
name: Invoked Function
data: Invoked Function.csv
name: Key Measures
data: Key Measures.csv
name: Locations
data: Locations.csv
name: Metric Selection
data: Metric Selection.csv
name: Moving Averages
data: Moving Averages.csv
name: Price Groups
data: Price Groups.csv
name: Products
data: Products.csv
name: Ranking
data: Ranking.csv
name: Sales
data: Sales.csv
name: Salespeople
data: Salespeople.csv
name: Supporting Measures
data: Supporting Measures.csv
name: Time Intelligence
data: Time Intelligence.csv
name: Yearly Budget
data: Yearly Budget.csv
label: Sales
Customer ID
Customers
Customer ID
Sales
Product ID
Products
Product ID
Sales
Sales Person ID
Salespeople
Salesperson ID
Sales
Purchase Date
Dates
Date
Sales
Location ID
Locations
Location ID
Yearly Budget
Location ID
Locations
Location ID
output: {
    "joins": [
        {
            "from_table": "Sales",
            "from_column": "Customer ID",
            "to_table": "Customers",
            "to_column": "Customer ID"
        },
        {
            "from_table": "Sales",
            "from_column": "Product ID",
            "to_table": "Products",
            "to_column": "Product ID"
        },
        {
            "from_table": "Sales",
            "from_column": "Sales Person ID",
            "to_table": "Salespeople",
            "to_column": "Salesperson ID"
        },
        {
            "from_table": "Sales",
            "from_column": "Purchase Date",
            "to_table": "Dates",
            "to_column": "Date"
        },
        {
            "from_table": "Sales",
            "from_column": "Location ID",
            "to_table": "Locations",
            "to_column": "Location ID"
        },
        {
            "from_table": "Yearly Budget",
            "from_column": "Location ID",
            "to_table": "Locations",
            "to_column": "Location ID"
        }
    ]
}