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
|   CustomerID | FirstName   | LastName   |
|-------------:|:------------|:-----------|
|            1 |             |            |
|            2 |             |            |
|            3 |             |            |
|            4 |             |            |
|            5 |             |            |
|            6 |             |            |
|          697 |             |            |
|          698 |             |            |
|          699 |             |            |
|          700 |             |            |


Table: Product
|   ProductID | Name            | ProductNumber   | Color   |   SafetyStockLevel |   StandardCost |   ListPrice | Size   | SizeUnitMeasureCode   | WeightUnitMeasureCode   | Weight   |   DaysToManufacture | ProductLine   | Class   | Style   | ProductSubcategoryID   |
|------------:|:----------------|:----------------|:--------|-------------------:|---------------:|------------:|:-------|:----------------------|:------------------------|:---------|--------------------:|:--------------|:--------|:--------|:-----------------------|
|           1 | Adjustable Race | AR-5381         |         |               1000 |              0 |           0 |        |                       |                         |          |                   0 |               |         |         |                        |
|           2 | Bearing Ball    | BA-8327         |         |               1000 |              0 |           0 |        |                       |                         |          |                   0 |               |         |         |                        |
|         323 | Crown Race      | CR-9981         |         |               1000 |              0 |           0 |        |                       |                         |          |                   0 |               |         |         |                        |
|         325 | Decal 1         | DC-8732         |         |               1000 |              0 |           0 |        |                       |                         |          |                   0 |               |         |         |                        |
|         326 | Decal 2         | DC-9824         |         |               1000 |              0 |           0 |        |                       |                         |          |                   0 |               |         |         |                        |
|         341 | Flat Washer 1   | FW-1000         |         |               1000 |              0 |           0 |        |                       |                         |          |                   0 |               |         |         |                        |
|         342 | Flat Washer 6   | FW-1200         |         |               1000 |              0 |           0 |        |                       |                         |          |                   0 |               |         |         |                        |
|         343 | Flat Washer 2   | FW-1400         |         |               1000 |              0 |           0 |        |                       |                         |          |                   0 |               |         |         |                        |
|         344 | Flat Washer 9   | FW-3400         |         |               1000 |              0 |           0 |        |                       |                         |          |                   0 |               |         |         |                        |
|         345 | Flat Washer 4   | FW-3800         |         |               1000 |              0 |           0 |        |                       |                         |          |                   0 |               |         |         |                        |


Table: ProductCategory
|   ProductCategoryID | Name        |
|--------------------:|:------------|
|                   1 | Bikes       |
|                   2 | Components  |
|                   3 | Clothing    |
|                   4 | Accessories |


Table: ProductSubcategory
|   ProductSubcategoryID |   ProductCategoryID | Name            |
|-----------------------:|--------------------:|:----------------|
|                      1 |                   1 | Mountain Bikes  |
|                      2 |                   1 | Road Bikes      |
|                      3 |                   1 | Touring Bikes   |
|                      4 |                   2 | Handlebars      |
|                      5 |                   2 | Bottom Brackets |
|                      6 |                   2 | Brakes          |
|                      7 |                   2 | Chains          |
|                      8 |                   2 | Cranksets       |
|                      9 |                   2 | Derailleurs     |
|                     10 |                   2 | Forks           |


Table: SalesOrderDetail
|   SalesOrderID |   SalesOrderDetailID |   OrderQty |   ProductID |   UnitPrice |   UnitPriceDiscount |   LineTotal |
|---------------:|---------------------:|-----------:|------------:|------------:|--------------------:|------------:|
|          51178 |                37753 |          1 |         870 |        4.99 |                   0 |        4.99 |
|          51180 |                37760 |          1 |         870 |        4.99 |                   0 |        4.99 |
|          51191 |                37790 |          1 |         870 |        4.99 |                   0 |        4.99 |
|          51196 |                37804 |          1 |         870 |        4.99 |                   0 |        4.99 |
|          51197 |                37809 |          1 |         870 |        4.99 |                   0 |        4.99 |
|          51198 |                37813 |          1 |         870 |        4.99 |                   0 |        4.99 |
|          51199 |                37817 |          1 |         870 |        4.99 |                   0 |        4.99 |
|          51203 |                37826 |          1 |         870 |        4.99 |                   0 |        4.99 |
|          51205 |                37830 |          1 |         870 |        4.99 |                   0 |        4.99 |
|          51206 |                37834 |          1 |         870 |        4.99 |                   0 |        4.99 |


Table: SalesOrderHeader
|   SalesOrderID | OrderDate               | DueDate                 | ShipDate                | OnlineOrderFlag   | SalesOrderNumber   |   CustomerID |   TerritoryID |   SubTotal |   TaxAmt |   Freight |   TotalDue |
|---------------:|:------------------------|:------------------------|:------------------------|:------------------|:-------------------|-------------:|--------------:|-----------:|---------:|----------:|-----------:|
|          43703 | 2011-06-01 00:00:00.000 | 2011-06-13 00:00:00.000 | 2011-06-08 00:00:00.000 | True              | SO43703            |        16624 |             9 |    3578.27 |  286.262 |   89.4568 |    3953.99 |
|          43709 | 2011-06-02 00:00:00.000 | 2011-06-14 00:00:00.000 | 2011-06-09 00:00:00.000 | True              | SO43709            |        16351 |             9 |    3578.27 |  286.262 |   89.4568 |    3953.99 |
|          43710 | 2011-06-02 00:00:00.000 | 2011-06-14 00:00:00.000 | 2011-06-09 00:00:00.000 | True              | SO43710            |        16517 |             9 |    3578.27 |  286.262 |   89.4568 |    3953.99 |
|          43715 | 2011-06-04 00:00:00.000 | 2011-06-16 00:00:00.000 | 2011-06-11 00:00:00.000 | True              | SO43715            |        16483 |             9 |    3578.27 |  286.262 |   89.4568 |    3953.99 |
|          43716 | 2011-06-04 00:00:00.000 | 2011-06-16 00:00:00.000 | 2011-06-11 00:00:00.000 | True              | SO43716            |        16529 |             9 |    3578.27 |  286.262 |   89.4568 |    3953.99 |
|          43724 | 2011-06-06 00:00:00.000 | 2011-06-18 00:00:00.000 | 2011-06-13 00:00:00.000 | True              | SO43724            |        16520 |             9 |    3578.27 |  286.262 |   89.4568 |    3953.99 |
|          43727 | 2011-06-07 00:00:00.000 | 2011-06-19 00:00:00.000 | 2011-06-14 00:00:00.000 | True              | SO43727            |        16607 |             9 |    3578.27 |  286.262 |   89.4568 |    3953.99 |
|          43731 | 2011-06-08 00:00:00.000 | 2011-06-20 00:00:00.000 | 2011-06-15 00:00:00.000 | True              | SO43731            |        16629 |             9 |    3578.27 |  286.262 |   89.4568 |    3953.99 |
|          43735 | 2011-06-09 00:00:00.000 | 2011-06-21 00:00:00.000 | 2011-06-16 00:00:00.000 | True              | SO43735            |        16522 |             9 |    3578.27 |  286.262 |   89.4568 |    3953.99 |
|          43740 | 2011-06-10 00:00:00.000 | 2011-06-22 00:00:00.000 | 2011-06-17 00:00:00.000 | True              | SO43740            |        16527 |             9 |    3578.27 |  286.262 |   89.4568 |    3953.99 |


Table: SalesTerritory
|   TerritoryID | Name           | CountryRegionCode   | Group         |
|--------------:|:---------------|:--------------------|:--------------|
|             1 | Northwest      | US                  | North America |
|             2 | Northeast      | US                  | North America |
|             3 | Central        | US                  | North America |
|             4 | Southwest      | US                  | North America |
|             5 | Southeast      | US                  | North America |
|             6 | Canada         | CA                  | North America |
|             7 | France         | FR                  | Europe        |
|             8 | Germany        | DE                  | Europe        |
|             9 | Australia      | AU                  | Pacific       |
|            10 | United Kingdom | GB                  | Europe        |

 


tables: name: Customer
data: Customer.csv
name: Product
data: Product.csv
name: ProductCategory
data: ProductCategory.csv
name: ProductSubcategory
data: ProductSubcategory.csv
name: SalesOrderDetail
data: SalesOrderDetail.csv
name: SalesOrderHeader
data: SalesOrderHeader.csv
name: SalesTerritory
data: SalesTerritory.csv
label: SalesOrderDetail
SalesOrderID
SalesOrderHeader
SalesOrderID
SalesOrderHeader
TerritoryID
SalesTerritory
TerritoryID
Product
ProductSubcategoryID
ProductSubcategory
ProductSubcategoryID
ProductSubcategory
ProductCategoryID
ProductCategory
ProductCategoryID
SalesOrderDetail
ProductID
Product
ProductID
SalesOrderHeader
CustomerID
Customer
CustomerID
output: {
    "joins": [
        {
            "from_table": "SalesOrderDetail",
            "from_column": "SalesOrderID",
            "to_table": "SalesOrderHeader",
            "to_column": "SalesOrderID"
        },
        {
            "from_table": "SalesOrderHeader",
            "from_column": "TerritoryID",
            "to_table": "SalesTerritory",
            "to_column": "TerritoryID"
        },
        {
            "from_table": "Product",
            "from_column": "ProductSubcategoryID",
            "to_table": "ProductSubcategory",
            "to_column": "ProductSubcategoryID"
        },
        {
            "from_table": "ProductSubcategory",
            "from_column": "ProductCategoryID",
            "to_table": "ProductCategory",
            "to_column": "ProductCategoryID"
        },
        {
            "from_table": "SalesOrderDetail",
            "from_column": "ProductID",
            "to_table": "Product",
            "to_column": "ProductID"
        },
        {
            "from_table": "SalesOrderHeader",
            "from_column": "CustomerID",
            "to_table": "Customer",
            "to_column": "CustomerID"
        }
    ]
}