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: All Dax



Table: Calendar
| Date                    |
|:------------------------|
| 2015-01-01 00:00:00.000 |
| 2015-01-02 00:00:00.000 |
| 2015-01-03 00:00:00.000 |
| 2015-01-04 00:00:00.000 |
| 2015-01-05 00:00:00.000 |
| 2015-01-06 00:00:00.000 |
| 2015-01-07 00:00:00.000 |
| 2015-01-08 00:00:00.000 |
| 2015-01-09 00:00:00.000 |
| 2015-01-10 00:00:00.000 |


Table: Customers
|   CustomerKey | Prefix   | FirstName   | LastName   | BirthDate               | Column1   | MaritalStatus   | Gender   | EmailAddress              | AnnualIncome   |   TotalChildren | EducationLevel   | Occupation   | HomeOwner   |
|--------------:|:---------|:------------|:-----------|:------------------------|:----------|:----------------|:---------|:--------------------------|:---------------|----------------:|:-----------------|:-------------|:------------|
|         11009 | MR.      | SHANNON     | CARLSON    | 1964-01-04 00:00:00.000 |           | S               | M        | shannon38@learnsector.com | $70,000        |               0 | Bachelors        | Professional | N           |
|         11106 | MR.      | JESSIE      | LIU        | 1964-11-09 00:00:00.000 |           | S               | M        | jessie9@learnsector.com   | $70,000        |               0 | Bachelors        | Professional | N           |
|         11109 | MR.      | RUBEN       | KAPOOR     | 1963-05-11 00:00:00.000 |           | S               | M        | ruben1@learnsector.com    | $70,000        |               0 | Bachelors        | Professional | N           |
|         11451 | MR.      | RUBEN       | MUÃ‘OZ     | 1974-09-11 00:00:00.000 |           | S               | M        | ruben30@learnsector.com   | $70,000        |               0 | Bachelors        | Professional | N           |
|         11916 | MR.      | JOE         | RANA       | 1965-07-09 00:00:00.000 |           | S               | M        | joe14@learnsector.com     | $70,000        |               0 | Bachelors        | Professional | N           |
|         12004 | MR.      | JARROD      | SURI       | 1963-12-20 00:00:00.000 |           | S               | M        | jarrod0@learnsector.com   | $70,000        |               0 | Bachelors        | Professional | N           |
|         12337 | MR.      | DUSTIN      | GOLDSTEIN  | 1975-09-10 00:00:00.000 |           | S               | M        | dustin20@learnsector.com  | $70,000        |               0 | Bachelors        | Professional | N           |
|         12339 | MR.      | CLAYTON     | JAI        | 1976-08-07 00:00:00.000 |           | S               | M        | clayton29@learnsector.com | $70,000        |               0 | Bachelors        | Professional | N           |
|         12669 | MR.      | IRVING      | SCHMIDT    | 1976-04-03 00:00:00.000 |           | S               | M        | irving0@learnsector.com   | $70,000        |               0 | Bachelors        | Professional | N           |
|         12671 | MR.      | ALAN        | HUANG      | 1974-11-02 00:00:00.000 |           | S               | M        | alan10@learnsector.com    | $70,000        |               0 | Bachelors        | Professional | N           |


Table: Product-Categories
|   ProductCategoryKey | CategoryName   |
|---------------------:|:---------------|
|                    1 | Bikes          |
|                    2 | Components     |
|                    3 | Clothing       |
|                    4 | Accessories    |


Table: Product-Subcategories
|   ProductSubcategoryKey | SubcategoryName   |   ProductCategoryKey |
|------------------------:|:------------------|---------------------:|
|                       1 | Mountain Bikes    |                    1 |
|                       2 | Road Bikes        |                    1 |
|                       3 | Touring Bikes     |                    1 |
|                       4 | Handlebars        |                    2 |
|                       5 | Bottom Brackets   |                    2 |
|                       6 | Brakes            |                    2 |
|                       7 | Chains            |                    2 |
|                       8 | Cranksets         |                    2 |
|                       9 | Derailleurs       |                    2 |
|                      10 | Forks             |                    2 |


Table: Products
|   ProductKey |   ProductSubcategoryKey | ProductSKU   | ProductName             | ModelName   | ProductDescription                                                           | ProductColor   |   ProductSize | ProductStyle   |   ProductCost |   ProductPrice |
|-------------:|------------------------:|:-------------|:------------------------|:------------|:-----------------------------------------------------------------------------|:---------------|--------------:|:---------------|--------------:|---------------:|
|          214 |                      31 | HL-U509-R    | Sport-100 Helmet, Red   | Sport-100   | Universal fit, well-vented, lightweight , snap-on visor.                     | Red            |             0 | 0              |       13.0863 |        34.99   |
|          215 |                      31 | HL-U509      | Sport-100 Helmet, Black | Sport-100   | Universal fit, well-vented, lightweight , snap-on visor.                     | Black          |             0 | 0              |       12.0278 |        33.6442 |
|          220 |                      31 | HL-U509-B    | Sport-100 Helmet, Blue  | Sport-100   | Universal fit, well-vented, lightweight , snap-on visor.                     | Blue           |             0 | 0              |       12.0278 |        33.6442 |
|          223 |                      19 | CA-1098      | AWC Logo Cap            | Cycling Cap | Traditional style with a flip-up brim; one-size fits all.                    | Multi          |             0 | U              |        5.7052 |         8.6442 |
|          391 |                      10 | FK-1639      | LL Fork                 | LL Fork     | Stout design absorbs shock and offers more precise steering.                 | NA             |             0 | 0              |       65.8097 |       148.22   |
|          392 |                      10 | FK-5136      | ML Fork                 | ML Fork     | Composite road fork with an aluminum steerer tube.                           | NA             |             0 | 0              |       77.9176 |       175.49   |
|          393 |                      10 | FK-9939      | HL Fork                 | HL Fork     | High-performance carbon road fork with curved legs.                          | NA             |             0 | 0              |      101.894  |       229.49   |
|          394 |                      11 | HS-0296      | LL Headset              | LL Headset  | Threadless headset provides quality at an economical price.                  | NA             |             0 | 0              |       15.1848 |        34.2    |
|          395 |                      11 | HS-2451      | ML Headset              | ML Headset  | Sealed cartridge keeps dirt out.                                             | NA             |             0 | 0              |       45.4168 |       102.29   |
|          396 |                      11 | HS-3479      | HL Headset              | HL Headset  | High-quality 1" threadless headset with a grease port for quick lubrication. | NA             |             0 | 0              |       55.3801 |       124.73   |


Table: Returns
| ReturnDate   |   TerritoryKey |   ProductKey |   ReturnQuantity |
|:-------------|---------------:|-------------:|-----------------:|
| 07-03-2016   |              9 |          477 |                1 |
| 07-11-2016   |              4 |          477 |                1 |
| 7/22/2016    |              1 |          477 |                1 |
| 7/24/2016    |             10 |          477 |                1 |
| 08-02-2016   |              4 |          477 |                1 |
| 08-02-2016   |              6 |          477 |                1 |
| 08-10-2016   |              7 |          477 |                1 |
| 08-11-2016   |              6 |          477 |                1 |
| 08-12-2016   |              8 |          477 |                1 |
| 8/18/2016    |              7 |          477 |                1 |


Table: Sales-2015
| OrderDate   | StockDate   | OrderNumber   |   ProductKey |   CustomerKey |   TerritoryKey |   OrderLineItem |   OrderQuantity |
|:------------|:------------|:--------------|-------------:|--------------:|---------------:|----------------:|----------------:|
| 01-01-2015  | 10/29/2001  | SO45082       |          350 |         11455 |              9 |               1 |               1 |
| 01-02-2015  | 12/18/2001  | SO45086       |          314 |         18747 |              9 |               1 |               1 |
| 01-02-2015  | 10-09-2001  | SO45085       |          312 |         18746 |              9 |               1 |               1 |
| 01-03-2015  | 10-03-2001  | SO45093       |          312 |         18906 |              9 |               1 |               1 |
| 01-03-2015  | 10/24/2001  | SO45092       |          313 |         18899 |              9 |               1 |               1 |
| 01-03-2015  | 10/26/2001  | SO45091       |          314 |         18909 |              9 |               1 |               1 |
| 01-07-2015  | 11-09-2001  | SO45111       |          326 |         25713 |              9 |               1 |               1 |
| 01-07-2015  | 12-05-2001  | SO45110       |          311 |         18710 |              9 |               1 |               1 |
| 01-08-2015  | 12/14/2001  | SO45119       |          314 |         18740 |              9 |               1 |               1 |
| 01-08-2015  | 10/29/2001  | SO45118       |          314 |         18722 |              9 |               1 |               1 |


Table: Sales-2016
| OrderDate   | StockDate   | OrderNumber   |   ProductKey |   CustomerKey |   TerritoryKey |   OrderLineItem |   OrderQuantity |
|:------------|:------------|:--------------|-------------:|--------------:|---------------:|----------------:|----------------:|
| 1/3/2016    | 9/6/2002    | SO48819       |          352 |         13622 |              9 |               1 |               1 |
| 1/13/2016   | 9/19/2002   | SO48901       |          352 |         13960 |              9 |               1 |               1 |
| 1/14/2016   | 9/22/2002   | SO48909       |          352 |         13953 |              9 |               1 |               1 |
| 1/16/2016   | 10/23/2002  | SO48929       |          352 |         13526 |              9 |               1 |               1 |
| 1/17/2016   | 12/17/2002  | SO48936       |          352 |         13644 |              9 |               1 |               1 |
| 1/17/2016   | 11/26/2002  | SO48937       |          352 |         13529 |              9 |               1 |               1 |
| 1/18/2016   | 11/25/2002  | SO48943       |          352 |         13973 |              9 |               1 |               1 |
| 1/19/2016   | 12/27/2002  | SO48947       |          352 |         13957 |              9 |               1 |               1 |
| 1/28/2016   | 10/13/2002  | SO49015       |          352 |         13965 |              9 |               1 |               1 |
| 2/1/2016    | 11/25/2002  | SO49173       |          352 |         14047 |              9 |               1 |               1 |


Table: Sales-2017
| OrderDate   | StockDate   | OrderNumber   |   ProductKey |   CustomerKey |   TerritoryKey |   OrderLineItem |   OrderQuantity |
|:------------|:------------|:--------------|-------------:|--------------:|---------------:|----------------:|----------------:|
|             | 10/28/2003  | SO62009       |          354 |         13647 |              9 |               1 |               1 |
|             | 12/5/2003   | SO62021       |          604 |         23100 |              9 |               1 |               1 |
|             | 10/7/2003   | SO62008       |          383 |         24505 |              9 |               1 |               1 |
|             | 10/21/2003  | SO61977       |          477 |         11116 |              9 |               1 |               1 |
|             | 11/29/2003  | SO62018       |          575 |         11906 |              9 |               1 |               1 |
|             | 9/27/2003   | SO61974       |          536 |         16711 |              9 |               1 |               1 |
|             | 10/23/2003  | SO62020       |          576 |         11767 |              9 |               1 |               1 |
|             | 10/18/2003  | SO62007       |          580 |         23433 |              9 |               1 |               1 |
|             | 10/26/2003  | SO62010       |          362 |         13649 |              9 |               1 |               1 |
|             | 9/21/2003   | SO62019       |          560 |         14224 |              9 |               1 |               1 |


Table: Sales
| OrderDate   | OrderNumber   |   ProductKey |   CustomerKey |   TerritoryKey |   OrderLineItem |   OrderQuantity |   Discount | Price   | Revenue   |
|:------------|:--------------|-------------:|--------------:|---------------:|----------------:|----------------:|-----------:|:--------|:----------|
|             | SO62009       |          354 |         13647 |              9 |               1 |               1 |          0 |         |           |
|             | SO62021       |          604 |         23100 |              9 |               1 |               1 |          0 | 2443.35 | 2443.35   |
|             | SO62008       |          383 |         24505 |              9 |               1 |               1 |          0 |         |           |
|             | SO61977       |          477 |         11116 |              9 |               1 |               1 |          0 |         |           |
|             | SO62018       |          575 |         11906 |              9 |               1 |               1 |          0 | 3374.99 | 3374.99   |
|             | SO61974       |          536 |         16711 |              9 |               1 |               1 |          0 |         |           |
|             | SO62020       |          576 |         11767 |              9 |               1 |               1 |          0 | 3399.99 | 3399.99   |
|             | SO62007       |          580 |         23433 |              9 |               1 |               1 |          0 |         |           |
|             | SO62010       |          362 |         13649 |              9 |               1 |               1 |          0 |         |           |
|             | SO62019       |          560 |         14224 |              9 |               1 |               1 |          0 |         |           |


Table: Territories
|   SalesTerritoryKey | Region         | Country        | Continent     |
|--------------------:|:---------------|:---------------|:--------------|
|                   1 | Northwest      | United States  | North America |
|                   2 | Northeast      | United States  | North America |
|                   3 | Central        | United States  | North America |
|                   4 | Southwest      | United States  | North America |
|                   5 | Southeast      | United States  | North America |
|                   6 | Canada         | Canada         | North America |
|                   7 | France         | France         | Europe        |
|                   8 | Germany        | Germany        | Europe        |
|                   9 | Australia      | Australia      | Pacific       |
|                  10 | United Kingdom | United Kingdom | Europe        |

 


tables: name: All Dax
data: All Dax.csv
name: Calendar
data: Calendar.csv
name: Customers
data: Customers.csv
name: Product-Categories
data: Product-Categories.csv
name: Product-Subcategories
data: Product-Subcategories.csv
name: Products
data: Products.csv
name: Returns
data: Returns.csv
name: Sales-2015
data: Sales-2015.csv
name: Sales-2016
data: Sales-2016.csv
name: Sales-2017
data: Sales-2017.csv
name: Sales
data: Sales.csv
name: Territories
data: Territories.csv
label: Product-Subcategories
ProductCategoryKey
Product-Categories
ProductCategoryKey
Products
ProductSubcategoryKey
Product-Subcategories
ProductSubcategoryKey
Returns
ProductKey
Products
ProductKey
Sales-2015
CustomerKey
Customers
CustomerKey
Sales-2016
CustomerKey
Customers
CustomerKey
Sales-2017
CustomerKey
Customers
CustomerKey
Sales
CustomerKey
Customers
CustomerKey
Sales-2015
ProductKey
Products
ProductKey
output: {
    "joins": [
        {
            "from_table": "Product-Subcategories",
            "from_column": "ProductCategoryKey",
            "to_table": "Product-Categories",
            "to_column": "ProductCategoryKey"
        },
        {
            "from_table": "Products",
            "from_column": "ProductSubcategoryKey",
            "to_table": "Product-Subcategories",
            "to_column": "ProductSubcategoryKey"
        },
        {
            "from_table": "Returns",
            "from_column": "ProductKey",
            "to_table": "Products",
            "to_column": "ProductKey"
        },
        {
            "from_table": "Sales-2015",
            "from_column": "CustomerKey",
            "to_table": "Customers",
            "to_column": "CustomerKey"
        },
        {
            "from_table": "Sales-2016",
            "from_column": "CustomerKey",
            "to_table": "Customers",
            "to_column": "CustomerKey"
        },
        {
            "from_table": "Sales-2017",
            "from_column": "CustomerKey",
            "to_table": "Customers",
            "to_column": "CustomerKey"
        },
        {
            "from_table": "Sales",
            "from_column": "CustomerKey",
            "to_table": "Customers",
            "to_column": "CustomerKey"
        },
        {
            "from_table": "Sales-2015",
            "from_column": "ProductKey",
            "to_table": "Products",
            "to_column": "ProductKey"
        }
    ]
}