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: Cumulative Measures



Table: Customers
|   CustomerKey | Customer ID   | Customer Name    |
|--------------:|:--------------|:-----------------|
|             1 | EH-13945      | Eric Hoffmann    |
|             2 | RA-19885      | Ruben Ausman     |
|             3 | JO-15280      | Jas O'Carroll    |
|             4 | JG-15160      | James Galang     |
|             5 | GK-14620      | Grace Kelly      |
|             6 | GG-14650      | Greg Guthrie     |
|             7 | AS-10240      | Alan Shonely     |
|             8 | KD-16345      | Katherine Ducich |
|             9 | CC-12145      | Charles Crestani |
|            10 | CC-12100      | Chad Cunningham  |


Table: Dates
| Date                    |   Year |   YearOffset | YearCompleted   |   QuarterOfYear | Quarter & Year   |   QuarternYear |   QuarterOffset | QuarterCompleted   |   MonthOfYear |   DayOfMonth | Month Name   | MonthShortName   | Month Initial   | Month & Year   |   MonthnYear |   MonthOffset | MonthCompleted   | MonthEnding             |   DateInt |   DayOfWeek | DayOfWeekName   | Weekday Initial   | Day Type   |   ISO Year |   ISO YearOffset |   ISO QuarterOfYear | ISO Quarter   | ISO Quarter & Year   |   ISO QuarternYear |   ISO QuarterOffset |   ISO Weeknumber | Week & Year   |   WeeknYear |   WeekOffset | WeekCompleted   | WeekEnding              | Fiscal Year   |   FiscalYearOffset | Fiscal Quarter   |   FQuarternYear | IsCurrentFQ   |   Fiscal Period |   FPeriodnYear | IsCurrentFP   |   Fiscal Week | Fiscal Year & Week   |   FWeeknYear | IsCurrentFW   | IsAfterToday   | IsWorkingDay   | IsHoliday   | IsBusinessDay   | IsPYTD   | IsPFYTD   |   YearQuarterKey |
|:------------------------|-------:|-------------:|:----------------|----------------:|:-----------------|---------------:|----------------:|:-------------------|--------------:|-------------:|:-------------|:-----------------|:----------------|:---------------|-------------:|--------------:|:-----------------|:------------------------|----------:|------------:|:----------------|:------------------|:-----------|-----------:|-----------------:|--------------------:|:--------------|:---------------------|-------------------:|--------------------:|-----------------:|:--------------|------------:|-------------:|:----------------|:------------------------|:--------------|-------------------:|:-----------------|----------------:|:--------------|----------------:|---------------:|:--------------|--------------:|:---------------------|-------------:|:--------------|:---------------|:---------------|:------------|:----------------|:---------|:----------|-----------------:|
| 2014-01-01 00:00:00.000 |   2014 |           -7 | True            |               1 | Q1 2014          |       20140100 |             -30 | True               |             1 |            1 | January      | Jan              | J​               | Jan 2014       |     20140100 |           -91 | True             | 2014-01-31 00:00:00.000 |  20140101 |           2 | Wednesday       | W​​                 | Weekday    |       2014 |               -7 |                   1 | Q1            | Q1 2014              |           20140100 |                 -30 |                1 | 2014-01       |    20140100 |         -397 | True            | 2014-01-05 00:00:00.000 | FY15          |                 -7 | FQ1              |        20150100 | False         |               1 |       20150100 | False         |             1 | 2014-01              |     20140100 | False         | False          | True           | Unknown     | True            | False    | False     |            20141 |
| 2014-01-02 00:00:00.000 |   2014 |           -7 | True            |               1 | Q1 2014          |       20140100 |             -30 | True               |             1 |            2 | January      | Jan              | J​               | Jan 2014       |     20140100 |           -91 | True             | 2014-01-31 00:00:00.000 |  20140102 |           3 | Thursday        | T​​​                 | Weekday    |       2014 |               -7 |                   1 | Q1            | Q1 2014              |           20140100 |                 -30 |                1 | 2014-01       |    20140100 |         -397 | True            | 2014-01-05 00:00:00.000 | FY15          |                 -7 | FQ1              |        20150100 | False         |               1 |       20150100 | False         |             1 | 2014-01              |     20140100 | False         | False          | True           | Unknown     | True            | False    | False     |            20141 |
| 2014-01-03 00:00:00.000 |   2014 |           -7 | True            |               1 | Q1 2014          |       20140100 |             -30 | True               |             1 |            3 | January      | Jan              | J​               | Jan 2014       |     20140100 |           -91 | True             | 2014-01-31 00:00:00.000 |  20140103 |           4 | Friday          | F​​​​                 | Weekday    |       2014 |               -7 |                   1 | Q1            | Q1 2014              |           20140100 |                 -30 |                1 | 2014-01       |    20140100 |         -397 | True            | 2014-01-05 00:00:00.000 | FY15          |                 -7 | FQ1              |        20150100 | False         |               1 |       20150100 | False         |             1 | 2014-01              |     20140100 | False         | False          | True           | Unknown     | True            | False    | False     |            20141 |
| 2014-01-06 00:00:00.000 |   2014 |           -7 | True            |               1 | Q1 2014          |       20140100 |             -30 | True               |             1 |            6 | January      | Jan              | J​               | Jan 2014       |     20140100 |           -91 | True             | 2014-01-31 00:00:00.000 |  20140106 |           0 | Monday          | M                 | Weekday    |       2014 |               -7 |                   1 | Q1            | Q1 2014              |           20140100 |                 -30 |                2 | 2014-02       |    20140200 |         -396 | True            | 2014-01-12 00:00:00.000 | FY15          |                 -7 | FQ1              |        20150100 | False         |               1 |       20150100 | False         |             2 | 2014-02              |     20140200 | False         | False          | True           | Unknown     | True            | False    | False     |            20141 |
| 2014-01-07 00:00:00.000 |   2014 |           -7 | True            |               1 | Q1 2014          |       20140100 |             -30 | True               |             1 |            7 | January      | Jan              | J​               | Jan 2014       |     20140100 |           -91 | True             | 2014-01-31 00:00:00.000 |  20140107 |           1 | Tuesday         | T​                 | Weekday    |       2014 |               -7 |                   1 | Q1            | Q1 2014              |           20140100 |                 -30 |                2 | 2014-02       |    20140200 |         -396 | True            | 2014-01-12 00:00:00.000 | FY15          |                 -7 | FQ1              |        20150100 | False         |               1 |       20150100 | False         |             2 | 2014-02              |     20140200 | False         | False          | True           | Unknown     | True            | False    | False     |            20141 |
| 2014-01-08 00:00:00.000 |   2014 |           -7 | True            |               1 | Q1 2014          |       20140100 |             -30 | True               |             1 |            8 | January      | Jan              | J​               | Jan 2014       |     20140100 |           -91 | True             | 2014-01-31 00:00:00.000 |  20140108 |           2 | Wednesday       | W​​                 | Weekday    |       2014 |               -7 |                   1 | Q1            | Q1 2014              |           20140100 |                 -30 |                2 | 2014-02       |    20140200 |         -396 | True            | 2014-01-12 00:00:00.000 | FY15          |                 -7 | FQ1              |        20150100 | False         |               1 |       20150100 | False         |             2 | 2014-02              |     20140200 | False         | False          | True           | Unknown     | True            | False    | False     |            20141 |
| 2014-01-09 00:00:00.000 |   2014 |           -7 | True            |               1 | Q1 2014          |       20140100 |             -30 | True               |             1 |            9 | January      | Jan              | J​               | Jan 2014       |     20140100 |           -91 | True             | 2014-01-31 00:00:00.000 |  20140109 |           3 | Thursday        | T​​​                 | Weekday    |       2014 |               -7 |                   1 | Q1            | Q1 2014              |           20140100 |                 -30 |                2 | 2014-02       |    20140200 |         -396 | True            | 2014-01-12 00:00:00.000 | FY15          |                 -7 | FQ1              |        20150100 | False         |               1 |       20150100 | False         |             2 | 2014-02              |     20140200 | False         | False          | True           | Unknown     | True            | False    | False     |            20141 |
| 2014-01-10 00:00:00.000 |   2014 |           -7 | True            |               1 | Q1 2014          |       20140100 |             -30 | True               |             1 |           10 | January      | Jan              | J​               | Jan 2014       |     20140100 |           -91 | True             | 2014-01-31 00:00:00.000 |  20140110 |           4 | Friday          | F​​​​                 | Weekday    |       2014 |               -7 |                   1 | Q1            | Q1 2014              |           20140100 |                 -30 |                2 | 2014-02       |    20140200 |         -396 | True            | 2014-01-12 00:00:00.000 | FY15          |                 -7 | FQ1              |        20150100 | False         |               1 |       20150100 | False         |             2 | 2014-02              |     20140200 | False         | False          | True           | Unknown     | True            | False    | False     |            20141 |
| 2014-01-13 00:00:00.000 |   2014 |           -7 | True            |               1 | Q1 2014          |       20140100 |             -30 | True               |             1 |           13 | January      | Jan              | J​               | Jan 2014       |     20140100 |           -91 | True             | 2014-01-31 00:00:00.000 |  20140113 |           0 | Monday          | M                 | Weekday    |       2014 |               -7 |                   1 | Q1            | Q1 2014              |           20140100 |                 -30 |                3 | 2014-03       |    20140300 |         -395 | True            | 2014-01-19 00:00:00.000 | FY15          |                 -7 | FQ1              |        20150100 | False         |               1 |       20150100 | False         |             3 | 2014-03              |     20140300 | False         | False          | True           | Unknown     | True            | False    | False     |            20141 |
| 2014-01-14 00:00:00.000 |   2014 |           -7 | True            |               1 | Q1 2014          |       20140100 |             -30 | True               |             1 |           14 | January      | Jan              | J​               | Jan 2014       |     20140100 |           -91 | True             | 2014-01-31 00:00:00.000 |  20140114 |           1 | Tuesday         | T​                 | Weekday    |       2014 |               -7 |                   1 | Q1            | Q1 2014              |           20140100 |                 -30 |                3 | 2014-03       |    20140300 |         -395 | True            | 2014-01-19 00:00:00.000 | FY15          |                 -7 | FQ1              |        20150100 | False         |               1 |       20150100 | False         |             3 | 2014-03              |     20140300 | False         | False          | True           | Unknown     | True            | False    | False     |            20141 |


Table: Key Measures



Table: Location
|   LocationKey | Country       | City          | State      |   Postal Code | Region   |     LAT |      LNG |
|--------------:|:--------------|:--------------|:-----------|--------------:|:---------|--------:|---------:|
|             4 | United States | Los Angeles   | California |         90004 | West     | 34.0762 | -118.311 |
|             6 | United States | Los Angeles   | California |         90008 | West     | 34.0096 | -118.347 |
|             3 | United States | Los Angeles   | California |         90032 | West     | 34.0782 | -118.186 |
|             2 | United States | Los Angeles   | California |         90036 | West     | 34.0704 | -118.35  |
|             5 | United States | Los Angeles   | California |         90045 | West     | 33.9421 | -118.417 |
|             1 | United States | Los Angeles   | California |         90049 | West     | 34.0925 | -118.491 |
|            61 | United States | Redondo Beach | California |         90278 | West     | 33.8732 | -118.37  |
|           474 | United States | Torrance      | California |         90503 | West     | 33.8404 | -118.354 |
|            34 | United States | Montebello    | California |         90640 | West     | 34.0154 | -118.111 |
|            29 | United States | Lakewood      | California |         90712 | West     | 33.849  | -118.148 |


Table: Products
|   ProductKey | Product ID      | Category        | Sub-Category   | Product Name                                                                                 |
|-------------:|:----------------|:----------------|:---------------|:---------------------------------------------------------------------------------------------|
|            5 | OFF-PA-10002377 | Office Supplies | Paper          | Adams Telephone Message Book W/Dividers/Space For Phone Numbers, 5 1/4"X8 1/2", 200/Messages |
|            7 | OFF-PA-10002005 | Office Supplies | Paper          | Xerox 225                                                                                    |
|           11 | OFF-PA-10000477 | Office Supplies | Paper          | Xerox 1952                                                                                   |
|           16 | OFF-PA-10001457 | Office Supplies | Paper          | White GlueTop Scratch Pads                                                                   |
|           23 | OFF-PA-10000552 | Office Supplies | Paper          | Xerox 200                                                                                    |
|           32 | OFF-PA-10000482 | Office Supplies | Paper          | Snap-A-Way Black Print Carbonless Ruled Speed Letter, Triplicate                             |
|           35 | OFF-PA-10001725 | Office Supplies | Paper          | Xerox 1892                                                                                   |
|           36 | OFF-PA-10000477 | Office Supplies | Paper          | Xerox 22                                                                                     |
|           37 | OFF-PA-10004359 | Office Supplies | Paper          | Multicolor Computer Printout Paper                                                           |
|           40 | OFF-PA-10002893 | Office Supplies | Paper          | Wirebound Service Call Books, 5 1/2" x 4"                                                    |


Table: Sales
|   Row ID | Order ID       | Order Date              | Ship Date               |   Sales |   Quantity |   Discount |   Profit | Shipping Code   |   ShipModeKey |   CustomerKey |   ProductKey |   SegmentKey |   LocationKey |
|---------:|:---------------|:------------------------|:------------------------|--------:|-----------:|-----------:|---------:|:----------------|--------------:|--------------:|-------------:|-------------:|--------------:|
|     1626 | CA-2015-157084 | 2015-12-19 00:00:00.000 | 2015-12-24 00:00:00.000 | 1265.85 |          3 |          0 | 556.974  | D               |             2 |             4 |            6 |            1 |             1 |
|     2191 | CA-2016-118913 | 2016-06-25 00:00:00.000 | 2016-06-29 00:00:00.000 |   60.81 |          3 |          0 |  17.0268 | D               |             2 |             7 |           15 |            1 |             1 |
|     4484 | CA-2016-109365 | 2016-03-11 00:00:00.000 | 2016-08-11 00:00:00.000 |  116.28 |          3 |          0 |  56.9772 | D               |             2 |            16 |           35 |            1 |             1 |
|     4486 | CA-2016-109365 | 2016-03-11 00:00:00.000 | 2016-08-11 00:00:00.000 |   19.44 |          3 |          0 |   9.3312 | D               |             2 |            16 |           36 |            1 |             1 |
|     4487 | CA-2016-109365 | 2016-03-11 00:00:00.000 | 2016-08-11 00:00:00.000 |  314.55 |          3 |          0 | 150.984  | D               |             2 |            16 |           37 |            1 |             1 |
|     6012 | CA-2015-135580 | 2015-12-30 00:00:00.000 | 2016-03-01 00:00:00.000 |  271.44 |          3 |          0 | 122.148  | D               |             2 |            21 |           38 |            1 |             1 |
|     6009 | CA-2015-135580 | 2015-12-30 00:00:00.000 | 2016-03-01 00:00:00.000 |   68.52 |          3 |          0 |  31.5192 | D               |             2 |            21 |           44 |            1 |             1 |
|     6010 | CA-2015-135580 | 2015-12-30 00:00:00.000 | 2016-03-01 00:00:00.000 |   74.94 |          3 |          0 |  14.2386 | D               |             2 |            21 |           45 |            1 |             1 |
|     6088 | CA-2015-114048 | 2015-12-14 00:00:00.000 | 2015-12-18 00:00:00.000 |   29.22 |          3 |          0 |  12.8568 | D               |             2 |             1 |          413 |            1 |            16 |
|     6737 | CA-2016-123358 | 2016-10-04 00:00:00.000 | 2016-04-17 00:00:00.000 |  579.51 |          3 |          0 |  81.1314 | D               |             2 |           271 |           51 |            1 |             9 |


Table: Segment
|   SegmentKey | Segment     |
|-------------:|:------------|
|            1 | Consumer    |
|            2 | Corporate   |
|            3 | Home Office |


Table: ShipMode
|   ShipModeKey | Ship Mode      |
|--------------:|:---------------|
|             1 | Second Class   |
|             2 | Standard Class |
|             3 | First Class    |
|             4 | Same Day       |


Table: ZipInfo
|   ZIP |     LAT |      LNG |
|------:|--------:|---------:|
|   601 | 18.1806 | -66.75   |
|   602 | 18.3619 | -67.1756 |
|   603 | 18.4552 | -67.1199 |
|   606 | 18.1583 | -66.9329 |
|   610 | 18.2954 | -67.1251 |
|   612 | 18.4023 | -66.7114 |
|   616 | 18.4204 | -66.672  |
|   617 | 18.4451 | -66.5597 |
|   622 | 17.9912 | -67.154  |
|   623 | 18.0834 | -67.1539 |

 


tables: name: Cumulative Measures
data: Cumulative Measures.csv
name: Customers
data: Customers.csv
name: Dates
data: Dates.csv
name: Key Measures
data: Key Measures.csv
name: Location
data: Location.csv
name: Products
data: Products.csv
name: Sales
data: Sales.csv
name: Segment
data: Segment.csv
name: ShipMode
data: ShipMode.csv
name: ZipInfo
data: ZipInfo.csv
label: Sales
ProductKey
Products
ProductKey
Sales
Ship Date
Dates
Date
Sales
ShipModeKey
ShipMode
ShipModeKey
Sales
SegmentKey
Segment
SegmentKey
Sales
CustomerKey
Customers
CustomerKey
Sales
LocationKey
Location
LocationKey
output: {
    "joins": [
        {
            "from_table": "Sales",
            "from_column": "ProductKey",
            "to_table": "Products",
            "to_column": "ProductKey"
        },
        {
            "from_table": "Sales",
            "from_column": "Ship Date",
            "to_table": "Dates",
            "to_column": "Date"
        },
        {
            "from_table": "Sales",
            "from_column": "ShipModeKey",
            "to_table": "ShipMode",
            "to_column": "ShipModeKey"
        },
        {
            "from_table": "Sales",
            "from_column": "SegmentKey",
            "to_table": "Segment",
            "to_column": "SegmentKey"
        },
        {
            "from_table": "Sales",
            "from_column": "CustomerKey",
            "to_table": "Customers",
            "to_column": "CustomerKey"
        },
        {
            "from_table": "Sales",
            "from_column": "LocationKey",
            "to_table": "Location",
            "to_column": "LocationKey"
        }
    ]
}