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: Date
| Date                    |   MonthNum |   Year | Month   |   Quarter | Quarter Year   |
|:------------------------|-----------:|-------:|:--------|----------:|:---------------|
| 2011-01-01 00:00:00.000 |          1 |   2011 | jan     |         1 | 2011 Q. 1      |
| 2011-01-02 00:00:00.000 |          1 |   2011 | jan     |         1 | 2011 Q. 1      |
| 2011-01-03 00:00:00.000 |          1 |   2011 | jan     |         1 | 2011 Q. 1      |
| 2011-01-04 00:00:00.000 |          1 |   2011 | jan     |         1 | 2011 Q. 1      |
| 2011-01-05 00:00:00.000 |          1 |   2011 | jan     |         1 | 2011 Q. 1      |
| 2011-01-06 00:00:00.000 |          1 |   2011 | jan     |         1 | 2011 Q. 1      |
| 2011-01-07 00:00:00.000 |          1 |   2011 | jan     |         1 | 2011 Q. 1      |
| 2011-01-08 00:00:00.000 |          1 |   2011 | jan     |         1 | 2011 Q. 1      |
| 2011-01-09 00:00:00.000 |          1 |   2011 | jan     |         1 | 2011 Q. 1      |
| 2011-01-10 00:00:00.000 |          1 |   2011 | jan     |         1 | 2011 Q. 1      |


Table: dPerson Person
| PersonType   |   BusinessEntityID | Sales Person      |
|:-------------|-------------------:|:------------------|
| IN           |               1699 | David Robinett    |
| IN           |               1700 | Rebecca Robinson  |
| IN           |               1701 | Dorothy Robinson  |
| IN           |               1702 | Carol Ann Rockne  |
| IN           |               1703 | Scott Rodgers     |
| IN           |               1704 | Jim Rodman        |
| IN           |               1705 | Eric Rothenberg   |
| IN           |               1706 | Michael Rothkugel |
| IN           |               1707 | Pablo Rovira Diez |
| IN           |               1708 | Linda Rousey      |


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


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


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


Table: dProduction 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: dPurchasing ProductVendor
|   ProductID |   BusinessEntityID |   AverageLeadTime |   StandardPrice |   LastReceiptCost |   MinOrderQty |   MaxOrderQty | OnOrderQty   |
|------------:|-------------------:|------------------:|----------------:|------------------:|--------------:|--------------:|:-------------|
|         375 |               1562 |                16 |           41.21 |           43.2705 |             1 |             5 |              |
|         375 |               1656 |                16 |           41.21 |           43.2705 |             1 |             5 |              |
|         376 |               1562 |                16 |           39.21 |           41.1705 |             1 |             5 |              |
|         376 |               1656 |                16 |           45.28 |           47.544  |             1 |             5 |              |
|         377 |               1562 |                16 |           43.28 |           45.444  |             1 |             5 |              |
|         377 |               1656 |                16 |           41.21 |           43.2705 |             1 |             5 |              |
|         378 |               1562 |                16 |           39.21 |           41.1705 |             1 |             5 |              |
|         378 |               1656 |                16 |           39.21 |           41.1705 |             1 |             5 |              |
|         379 |               1562 |                16 |           37.21 |           39.0705 |             1 |             5 |              |
|         379 |               1656 |                16 |           43.28 |           45.444  |             1 |             5 |              |


Table: dPurchasing PurchaseOrderDetail
|   PurchaseOrderID |   PurchaseOrderDetailID | DueDate                 |   OrderQty |   ProductID |   UnitPrice |   LineTotal |   ReceivedQty |   RejectedQty |   StockedQty | ModifiedDate            |
|------------------:|------------------------:|:------------------------|-----------:|------------:|------------:|------------:|--------------:|--------------:|-------------:|:------------------------|
|                 8 |                      15 | 2011-05-14 00:00:00.000 |          3 |         407 |     43.2705 |     129.811 |             3 |             0 |            3 | 2011-05-07 00:00:00.000 |
|                56 |                     123 | 2012-02-07 00:00:00.000 |          3 |         375 |     43.2705 |     129.811 |             3 |             0 |            3 | 2012-01-31 00:00:00.000 |
|                56 |                     125 | 2012-02-07 00:00:00.000 |          3 |         377 |     43.2705 |     129.811 |             3 |             0 |            3 | 2012-01-31 00:00:00.000 |
|                58 |                     129 | 2012-02-07 00:00:00.000 |          3 |         375 |     43.2705 |     129.811 |             3 |             0 |            3 | 2012-01-31 00:00:00.000 |
|                87 |                     194 | 2012-02-23 00:00:00.000 |          3 |         409 |     43.2705 |     129.811 |             3 |             0 |            3 | 2012-02-16 00:00:00.000 |
|               108 |                     246 | 2012-03-22 00:00:00.000 |          3 |         382 |     43.2705 |     129.811 |             3 |             0 |            3 | 2012-03-15 00:00:00.000 |
|               108 |                     248 | 2012-03-22 00:00:00.000 |          3 |         384 |     43.2705 |     129.811 |             3 |             0 |            3 | 2012-03-15 00:00:00.000 |
|               112 |                     256 | 2012-03-22 00:00:00.000 |          3 |         406 |     43.2705 |     129.811 |             3 |             0 |            3 | 2012-03-15 00:00:00.000 |
|               145 |                     347 | 2012-04-25 00:00:00.000 |          3 |         345 |     43.2705 |     129.811 |             3 |             0 |            3 | 2012-04-18 00:00:00.000 |
|               145 |                     349 | 2012-04-25 00:00:00.000 |          3 |         347 |     43.2705 |     129.811 |             3 |             0 |            3 | 2012-04-18 00:00:00.000 |


Table: dPurchasing PurchaseOrderHeader
|   PurchaseOrderID |   RevisionNumber |   Status |   EmployeeID |   VendorID |   ShipMethodID | OrderDate               | ShipDate                |   SubTotal |   TaxAmt |   Freight |   TotalDue | ModifiedDate            |
|------------------:|-----------------:|---------:|-------------:|-----------:|---------------:|:------------------------|:------------------------|-----------:|---------:|----------:|-----------:|:------------------------|
|                28 |                4 |        4 |          256 |       1658 |              5 | 2011-12-15 00:00:00.000 | 2011-12-24 00:00:00.000 |    43878.4 |  3510.28 |   1096.96 |    48485.7 | 2011-12-24 00:00:00.000 |
|               107 |                4 |        4 |          255 |       1658 |              5 | 2012-03-08 00:00:00.000 | 2012-03-17 00:00:00.000 |    43878.4 |  3510.28 |   1096.96 |    48485.7 | 2012-03-17 00:00:00.000 |
|               117 |                4 |        4 |          255 |       1506 |              5 | 2012-03-09 00:00:00.000 | 2012-03-18 00:00:00.000 |    43878.4 |  3510.28 |   1096.96 |    48485.7 | 2012-03-18 00:00:00.000 |
|               133 |                4 |        4 |          257 |       1586 |              5 | 2012-03-28 00:00:00.000 | 2012-04-06 00:00:00.000 |    43878.4 |  3510.28 |   1096.96 |    48485.7 | 2012-04-06 00:00:00.000 |
|               186 |                4 |        4 |          253 |       1658 |              5 | 2012-06-22 00:00:00.000 | 2012-07-01 00:00:00.000 |    43878.4 |  3510.28 |   1096.96 |    48485.7 | 2012-07-01 00:00:00.000 |
|               196 |                4 |        4 |          253 |       1506 |              5 | 2012-06-25 00:00:00.000 | 2012-07-04 00:00:00.000 |    43878.4 |  3510.28 |   1096.96 |    48485.7 | 2012-07-04 00:00:00.000 |
|               212 |                4 |        4 |          254 |       1586 |              5 | 2012-07-31 00:00:00.000 | 2012-08-09 00:00:00.000 |    43878.4 |  3510.28 |   1096.96 |    48485.7 | 2012-08-09 00:00:00.000 |
|               265 |                4 |        4 |          251 |       1658 |              5 | 2012-10-17 00:00:00.000 | 2012-10-26 00:00:00.000 |    43878.4 |  3510.28 |   1096.96 |    48485.7 | 2012-10-26 00:00:00.000 |
|               275 |                4 |        4 |          251 |       1506 |              5 | 2012-10-17 00:00:00.000 | 2012-10-26 00:00:00.000 |    43878.4 |  3510.28 |   1096.96 |    48485.7 | 2012-10-26 00:00:00.000 |
|               291 |                4 |        4 |          258 |       1586 |              5 | 2013-02-13 00:00:00.000 | 2013-02-22 00:00:00.000 |    43878.4 |  3510.28 |   1096.96 |    48485.7 | 2013-02-22 00:00:00.000 |


Table: dSales SalesOrderHeader
|   SalesOrderID | OrderDate               | DueDate                 | ShipDate                |   Status |   OnlineOrderFlag | SalesOrderNumber   | PurchaseOrderNumber   | AccountNumber   |   CustomerID | SalesPersonID   |   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 |        5 |                 1 | SO43703            |                       | 10-4030-016624  |        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 |        5 |                 1 | SO43709            |                       | 10-4030-016351  |        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 |        5 |                 1 | SO43710            |                       | 10-4030-016517  |        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 |        5 |                 1 | SO43715            |                       | 10-4030-016483  |        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 |        5 |                 1 | SO43716            |                       | 10-4030-016529  |        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 |        5 |                 1 | SO43724            |                       | 10-4030-016520  |        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 |        5 |                 1 | SO43727            |                       | 10-4030-016607  |        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 |        5 |                 1 | SO43731            |                       | 10-4030-016629  |        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 |        5 |                 1 | SO43735            |                       | 10-4030-016522  |        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 |        5 |                 1 | SO43740            |                       | 10-4030-016527  |        16527 |                 |             9 |    3578.27 |  286.262 |   89.4568 |    3953.99 |


Table: dSales SalesPerson
|   BusinessEntityID | TerritoryID   | SalesQuota   |   Bonus |   CommissionPct |         SalesYTD |   SalesLastYear |
|-------------------:|:--------------|:-------------|--------:|----------------:|-----------------:|----------------:|
|                274 |               |              |       0 |           0     | 559698           |     0           |
|                275 | 2             | 300000       |    4100 |           0.012 |      3.76318e+06 |     1.75041e+06 |
|                276 | 4             | 250000       |    2000 |           0.015 |      4.25137e+06 |     1.43916e+06 |
|                277 | 3             | 250000       |    2500 |           0.015 |      3.18942e+06 |     1.99719e+06 |
|                278 | 6             | 250000       |     500 |           0.01  |      1.45372e+06 |     1.62028e+06 |
|                279 | 5             | 300000       |    6700 |           0.01  |      2.31519e+06 |     1.84964e+06 |
|                280 | 1             | 250000       |    5000 |           0.01  |      1.35258e+06 |     1.92706e+06 |
|                281 | 4             | 250000       |    3550 |           0.01  |      2.45854e+06 |     2.07351e+06 |
|                282 | 6             | 250000       |    5000 |           0.015 |      2.60454e+06 |     2.03823e+06 |
|                283 | 1             | 250000       |    3500 |           0.012 |      1.57301e+06 |     1.37164e+06 |


Table: dSales SalesTerritory
|   TerritoryID | Territory      | 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        |


Table: dSales Store
|   BusinessEntityID | Name                               |   SalesPersonID |
|-------------------:|:-----------------------------------|----------------:|
|                292 | Next-Door Bike Store               |             279 |
|                310 | New Bikes Company                  |             279 |
|                326 | Worthwhile Activity Store          |             279 |
|                334 | Global Plaza                       |             279 |
|                340 | eCommerce Bikes                    |             279 |
|                352 | Tiny Bike Boutique                 |             279 |
|                354 | Acclaimed Bicycle Company          |             279 |
|                362 | Distinctive Cycles Sales & Service |             279 |
|                364 | Leading Bike Distributors          |             279 |
|                366 | Activity Center                    |             279 |


Table: fSales 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 |

 


tables: name: Date
data: Date.csv
name: dPerson Person
data: dPerson Person.csv
name: dProductCategorySubCategory
data: dProductCategorySubCategory.csv
name: dProduction Product
data: dProduction Product.csv
name: dProduction ProductCategory
data: dProduction ProductCategory.csv
name: dProduction ProductSubcategory
data: dProduction ProductSubcategory.csv
name: dPurchasing ProductVendor
data: dPurchasing ProductVendor.csv
name: dPurchasing PurchaseOrderDetail
data: dPurchasing PurchaseOrderDetail.csv
name: dPurchasing PurchaseOrderHeader
data: dPurchasing PurchaseOrderHeader.csv
name: dSales SalesOrderHeader
data: dSales SalesOrderHeader.csv
name: dSales SalesPerson
data: dSales SalesPerson.csv
name: dSales SalesTerritory
data: dSales SalesTerritory.csv
name: dSales Store
data: dSales Store.csv
name: fSales SalesOrderDetail
data: fSales SalesOrderDetail.csv
label: fSales SalesOrderDetail
SalesOrderID
dSales SalesOrderHeader
SalesOrderID
dSales SalesOrderHeader
SalesPersonID
dSales SalesPerson
BusinessEntityID
dSales SalesOrderHeader
TerritoryID
dSales SalesTerritory
TerritoryID
dSales Store
SalesPersonID
dSales SalesPerson
BusinessEntityID
dPurchasing ProductVendor
ProductID
dProduction Product
ProductID
dPurchasing PurchaseOrderDetail
ProductID
dProduction Product
ProductID
dPurchasing PurchaseOrderDetail
PurchaseOrderID
dPurchasing PurchaseOrderHeader
PurchaseOrderID
fSales SalesOrderDetail
ProductID
dProduction Product
ProductID
dSales SalesPerson
BusinessEntityID
dPerson Person
BusinessEntityID
dProduction Product
ProductSubcategoryID
dProductCategorySubCategory
ProductSubcategoryID
output: {
    "joins": [
        {
            "from_table": "fSales SalesOrderDetail",
            "from_column": "SalesOrderID",
            "to_table": "dSales SalesOrderHeader",
            "to_column": "SalesOrderID"
        },
        {
            "from_table": "dSales SalesOrderHeader",
            "from_column": "SalesPersonID",
            "to_table": "dSales SalesPerson",
            "to_column": "BusinessEntityID"
        },
        {
            "from_table": "dSales SalesOrderHeader",
            "from_column": "TerritoryID",
            "to_table": "dSales SalesTerritory",
            "to_column": "TerritoryID"
        },
        {
            "from_table": "dSales Store",
            "from_column": "SalesPersonID",
            "to_table": "dSales SalesPerson",
            "to_column": "BusinessEntityID"
        },
        {
            "from_table": "dPurchasing ProductVendor",
            "from_column": "ProductID",
            "to_table": "dProduction Product",
            "to_column": "ProductID"
        },
        {
            "from_table": "dPurchasing PurchaseOrderDetail",
            "from_column": "ProductID",
            "to_table": "dProduction Product",
            "to_column": "ProductID"
        },
        {
            "from_table": "dPurchasing PurchaseOrderDetail",
            "from_column": "PurchaseOrderID",
            "to_table": "dPurchasing PurchaseOrderHeader",
            "to_column": "PurchaseOrderID"
        },
        {
            "from_table": "fSales SalesOrderDetail",
            "from_column": "ProductID",
            "to_table": "dProduction Product",
            "to_column": "ProductID"
        },
        {
            "from_table": "dSales SalesPerson",
            "from_column": "BusinessEntityID",
            "to_table": "dPerson Person",
            "to_column": "BusinessEntityID"
        },
        {
            "from_table": "dProduction Product",
            "from_column": "ProductSubcategoryID",
            "to_table": "dProductCategorySubCategory",
            "to_column": "ProductSubcategoryID"
        }
    ]
}