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: purchasedw dimcalendar
|   Date_Durable_SK | date_standard   |   month_number | First_of_month   | month_name   |   week_number |   ISOweek |   day_of_week |   quater |   year |
|------------------:|:----------------|---------------:|:-----------------|:-------------|--------------:|----------:|--------------:|---------:|-------:|
|          19700706 | 7/6/1970        |              7 | 7/1/1970         | July         |            28 |        28 |             2 |        3 |   1970 |
|          19700707 | 7/7/1970        |              7 | 7/1/1970         | July         |            28 |        28 |             3 |        3 |   1970 |
|          19700708 | 7/8/1970        |              7 | 7/1/1970         | July         |            28 |        28 |             4 |        3 |   1970 |
|          19700709 | 7/9/1970        |              7 | 7/1/1970         | July         |            28 |        28 |             5 |        3 |   1970 |
|          19700710 | 7/10/1970       |              7 | 7/1/1970         | July         |            28 |        28 |             6 |        3 |   1970 |
|          19700711 | 7/11/1970       |              7 | 7/1/1970         | July         |            28 |        28 |             7 |        3 |   1970 |
|          19730709 | 7/9/1973        |              7 | 7/1/1973         | July         |            28 |        28 |             2 |        3 |   1973 |
|          19730710 | 7/10/1973       |              7 | 7/1/1973         | July         |            28 |        28 |             3 |        3 |   1973 |
|          19730711 | 7/11/1973       |              7 | 7/1/1973         | July         |            28 |        28 |             4 |        3 |   1973 |
|          19730712 | 7/12/1973       |              7 | 7/1/1973         | July         |            28 |        28 |             5 |        3 |   1973 |


Table: purchasedw dimemployee
|   Employee_Durable_SK |   BusinessEntityID | FirstName   | LastName   | MiddleName   | EmailAddress                 | PhoneNumber         | LoginID   | MaritalStatus   | Gender   | SalariedFlag   | VacationHours   | SickLeaveHours   | Rate   | PayFrequency   | BirthDate_SK   | HireDate_SK   | EffectiveDate_SK   | InEffectiveDate_SK   |   Status |
|----------------------:|-------------------:|:------------|:-----------|:-------------|:-----------------------------|:--------------------|:----------|:----------------|:---------|:---------------|:----------------|:-----------------|:-------|:---------------|:---------------|:--------------|:-------------------|:---------------------|---------:|
|                   490 |                601 | Gustavo     | Camargo    |              | gustavo1@adventure-works.com | 1 (11) 500 555-0118 |           |                 |          |                |                 |                  |        |                |                |               |                    |                      |        1 |
|                   587 |                795 | Bruno       | Deniut     |              | bruno1@adventure-works.com   | 1 (11) 500 555-0118 |           |                 |          |                |                 |                  |        |                |                |               |                    |                      |        1 |
|                  1989 |               2750 | Andy        | Vazquez    |              | andy19@adventure-works.com   | 1 (11) 500 555-0118 |           |                 |          |                |                 |                  |        |                |                |               |                    |                      |        1 |
|                  2111 |               2872 | Harold      | Prasad     |              | harold6@adventure-works.com  | 1 (11) 500 555-0118 |           |                 |          |                |                 |                  |        |                |                |               |                    |                      |        1 |
|                  2488 |               3249 | Maria       | Watson     |              | maria19@adventure-works.com  | 1 (11) 500 555-0118 |           |                 |          |                |                 |                  |        |                |                |               |                    |                      |        1 |
|                  2518 |               3279 | Ruth        | Rana       |              | ruth15@adventure-works.com   | 1 (11) 500 555-0118 |           |                 |          |                |                 |                  |        |                |                |               |                    |                      |        1 |
|                  2990 |               3751 | Barry       | Madan      |              | barry8@adventure-works.com   | 1 (11) 500 555-0118 |           |                 |          |                |                 |                  |        |                |                |               |                    |                      |        1 |
|                  3268 |               4029 | Stanley     | Sai        |              | stanley6@adventure-works.com | 1 (11) 500 555-0118 |           |                 |          |                |                 |                  |        |                |                |               |                    |                      |        1 |
|                  3388 |               4149 | Blake       | Miller     |              | blake5@adventure-works.com   | 1 (11) 500 555-0118 |           |                 |          |                |                 |                  |        |                |                |               |                    |                      |        1 |
|                  3803 |               4564 | Mindy       | Nara       |              | mindy21@adventure-works.com  | 1 (11) 500 555-0118 |           |                 |          |                |                 |                  |        |                |                |               |                    |                      |        1 |


Table: purchasedw dimgeography
|   Geography_Durable_SK | City          |   PostalCode | StateProvinceCode   | CountryRegionCode   | StateProvinceName   | CountryRegionName   |
|-----------------------:|:--------------|-------------:|:--------------------|:--------------------|:--------------------|:--------------------|
|                      5 | Alhambra      |        91801 | CA                  | US                  | California          | United States       |
|                      6 | Alpine        |        91901 | CA                  | US                  | California          | United States       |
|                      7 | Altadena      |        91001 | CA                  | US                  | California          | United States       |
|                     13 | Auburn        |        95603 | CA                  | US                  | California          | United States       |
|                     22 | Baldwin Park  |        91706 | CA                  | US                  | California          | United States       |
|                     26 | Barstow       |        92311 | CA                  | US                  | California          | United States       |
|                     30 | Bell Gardens  |        90201 | CA                  | US                  | California          | United States       |
|                     32 | Bellflower    |        90706 | CA                  | US                  | California          | United States       |
|                     35 | Berkeley      |        94704 | CA                  | US                  | California          | United States       |
|                     47 | Beverly Hills |        90210 | CA                  | US                  | California          | United States       |


Table: purchasedw diminventorylocation
|   Location_Durable_SK |   ProductID |   LocationID | Shelf   |   Bin |
|----------------------:|------------:|-------------:|:--------|------:|
|                   610 |         707 |            7 | N/A     |     0 |
|                   611 |         708 |            7 | N/A     |     0 |
|                   612 |         709 |            7 | N/A     |     0 |
|                   613 |         710 |            7 | N/A     |     0 |
|                   614 |         711 |            7 | N/A     |     0 |
|                   615 |         712 |            7 | N/A     |     0 |
|                   616 |         713 |            7 | N/A     |     0 |
|                   617 |         714 |            7 | N/A     |     0 |
|                   618 |         715 |            7 | N/A     |     0 |
|                   619 |         716 |            7 | N/A     |     0 |


Table: purchasedw dimproduct
|   Product_Durable_SK |   ProductID_NK | Product Name          |   CurrListPrice |   CurStandardCost | ModelID   | SubCategoryID   | SubcategoryName   | CategoryID   | CategoryName   | ModelName   |
|---------------------:|---------------:|:----------------------|----------------:|------------------:|:----------|:----------------|:------------------|:-------------|:---------------|:------------|
|                    1 |              1 | Adjustable Race       |               0 |                 0 |           |                 |                   |              |                |             |
|                    2 |              2 | Bearing Ball          |               0 |                 0 |           |                 |                   |              |                |             |
|                    3 |              3 | BB Ball Bearing       |               0 |                 0 |           |                 |                   |              |                |             |
|                    4 |              4 | Headset Ball Bearings |               0 |                 0 |           |                 |                   |              |                |             |
|                    5 |            316 | Blade                 |               0 |                 0 |           |                 |                   |              |                |             |
|                    6 |            317 | LL Crankarm           |               0 |                 0 |           |                 |                   |              |                |             |
|                    7 |            318 | ML Crankarm           |               0 |                 0 |           |                 |                   |              |                |             |
|                    8 |            319 | HL Crankarm           |               0 |                 0 |           |                 |                   |              |                |             |
|                    9 |            320 | Chainring Bolts       |               0 |                 0 |           |                 |                   |              |                |             |
|                   10 |            321 | Chainring Nut         |               0 |                 0 |           |                 |                   |              |                |             |


Table: purchasedw dimproductpricehistory
|   PricePriceID_SK |   StandardCost |   Product_Durable_SK |   ListPrice |   SCD_StartDate | SCD_EndDate   |
|------------------:|---------------:|---------------------:|------------:|----------------:|:--------------|
|                 1 |        12.0278 |                  393 |     33.6442 |        20110531 | 20120529      |
|                 2 |        13.8782 |                  393 |     33.6442 |        20120530 | 20130529      |
|                 3 |        13.0863 |                  393 |     33.6442 |        20130530 |               |
|                 4 |        12.0278 |                  393 |     33.6442 |        20110531 | 20120529      |
|                 5 |        13.8782 |                  393 |     33.6442 |        20120530 | 20130529      |
|                 6 |        13.0863 |                  393 |     33.6442 |        20130530 |               |
|                 7 |        12.0278 |                  393 |     34.99   |        20110531 | 20120529      |
|                 8 |        13.8782 |                  393 |     34.99   |        20120530 | 20130529      |
|                 9 |        13.0863 |                  393 |     34.99   |        20130530 |               |
|                10 |        12.0278 |                  394 |     33.6442 |        20110531 | 20120529      |


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


Table: purchasedw dimshipmethod
|   ShipMethod_Durable_SK |   ShipMethodID_NK | Name               |   ShipBase |   ShipRate |
|------------------------:|------------------:|:-------------------|-----------:|-----------:|
|                       1 |                 1 | XRQ - TRUCK GROUND |       3.95 |       0.99 |
|                       2 |                 2 | ZY - EXPRESS       |       9.95 |       1.99 |
|                       3 |                 3 | OVERSEAS - DELUXE  |      29.95 |       2.99 |
|                       4 |                 4 | OVERNIGHT J-FAST   |      21.95 |       1.29 |
|                       5 |                 5 | CARGO TRANSPORT 5  |       8.99 |       1.49 |


Table: purchasedw dimvendor
|   Vendor_Durable_SK |   BusinessEntityID | AccountNumber   | Name                       | ActiveFlag   |
|--------------------:|-------------------:|:----------------|:---------------------------|:-------------|
|                   1 |               1492 | AUSTRALI0001    | Australia Bike Retailer    | True         |
|                   2 |               1494 | ALLENSON0001    | Allenson Cycles            | True         |
|                   3 |               1496 | ADVANCED0001    | Advanced Bicycles          | True         |
|                   4 |               1498 | TRIKES0001      | Trikes, Inc.               | True         |
|                   5 |               1500 | MORGANB0001     | Morgan Bike Accessories    | True         |
|                   6 |               1502 | CYCLING0001     | Cycling Master             | True         |
|                   7 |               1504 | CHICAGO0002     | Chicago Rent-All           | True         |
|                   8 |               1506 | GREENWOO0001    | Greenwood Athletic Company | True         |
|                   9 |               1508 | COMPETE0001     | Compete Enterprises, Inc   | True         |
|                  10 |               1510 | INTERNAT0001    | International              | True         |


Table: purchasedw factinventory
|   Inventory_Durable_SK |   Quantity |   Location_Durable_SK |   Date_Durable_SK |
|-----------------------:|-----------:|----------------------:|------------------:|
|                   2345 |        180 |                   837 |       2.01304e+07 |
|                   2346 |        216 |                   838 |       2.01304e+07 |
|                   2347 |        252 |                   839 |       2.01304e+07 |
|                   2348 |        216 |                   840 |       2.01304e+07 |
|                   2349 |        252 |                   841 |       2.01304e+07 |
|                   2350 |        288 |                   842 |       2.01304e+07 |
|                   2351 |        252 |                   843 |       2.01304e+07 |
|                   2352 |        288 |                   844 |       2.01304e+07 |
|                   2353 |        324 |                   845 |       2.01304e+07 |
|                   2354 |        180 |                   846 |       2.01304e+07 |


Table: purchasedw factpurchaseorder
|   PurchaseOrderKey |   OrderQty |   UnitPrice |   LineTotal |   ReceivedQty |   RejectedQty |   StockedQty |   RevisionNumber |   Status |   SubTotal |   TaxAmt |   Freight |   TotalDue |   Product_Durable_SK |   ShipMethod_Durable_SK |   Vendor_Durable_SK |   Employee_Durable_SK |   SalesTerritory_Durable_SK |   DueDate_SK |   OrderDate_SK |   ShipDate_SK |
|-------------------:|-----------:|------------:|------------:|--------------:|--------------:|-------------:|-----------------:|---------:|-----------:|---------:|----------:|-----------:|---------------------:|------------------------:|--------------------:|----------------------:|----------------------------:|-------------:|---------------:|--------------:|
|                222 |          3 |     39.123  |     117.369 |             3 |             0 |            3 |                4 |        4 |    2421.12 |   193.69 |    60.528 |    2675.34 |                  122 |                       4 |                  25 |                   286 |                           1 |  2.01309e+07 |    2.01308e+07 |   2.01309e+07 |
|                223 |          3 |     37.023  |     111.069 |             3 |             0 |            3 |                4 |        4 |    2421.12 |   193.69 |    60.528 |    2675.34 |                  123 |                       4 |                  25 |                   286 |                           1 |  2.01309e+07 |    2.01308e+07 |   2.01309e+07 |
|                224 |          3 |     41.2965 |     123.889 |             3 |             0 |            3 |                4 |        4 |    2421.12 |   193.69 |    60.528 |    2675.34 |                  124 |                       4 |                  25 |                   286 |                           1 |  2.01309e+07 |    2.01308e+07 |   2.01309e+07 |
|                225 |          3 |     37.023  |     111.069 |             3 |             0 |            3 |                4 |        4 |    2421.12 |   193.69 |    60.528 |    2675.34 |                  125 |                       4 |                  25 |                   286 |                           1 |  2.01309e+07 |    2.01308e+07 |   2.01309e+07 |
|                226 |          3 |     47.6805 |     143.042 |             3 |             0 |            3 |                4 |        4 |    2421.12 |   193.69 |    60.528 |    2675.34 |                  126 |                       4 |                  25 |                   286 |                           1 |  2.01309e+07 |    2.01308e+07 |   2.01309e+07 |
|                227 |          3 |     45.5805 |     136.742 |             3 |             0 |            3 |                4 |        4 |    2421.12 |   193.69 |    60.528 |    2675.34 |                  127 |                       4 |                  25 |                   286 |                           1 |  2.01309e+07 |    2.01308e+07 |   2.01309e+07 |
|                228 |          3 |     49.854  |     149.562 |             3 |             0 |            3 |                4 |        4 |    2421.12 |   193.69 |    60.528 |    2675.34 |                  128 |                       4 |                  25 |                   286 |                           1 |  2.01309e+07 |    2.01308e+07 |   2.01309e+07 |
|                229 |          3 |     45.5805 |     136.742 |             3 |             0 |            3 |                4 |        4 |    2421.12 |   193.69 |    60.528 |    2675.34 |                  129 |                       4 |                  25 |                   286 |                           1 |  2.01309e+07 |    2.01308e+07 |   2.01309e+07 |
|                230 |          3 |     43.4805 |     130.441 |             3 |             0 |            3 |                4 |        4 |    2421.12 |   193.69 |    60.528 |    2675.34 |                  130 |                       4 |                  25 |                   286 |                           1 |  2.01309e+07 |    2.01308e+07 |   2.01309e+07 |
|                231 |          3 |     47.754  |     143.262 |             3 |             0 |            3 |                4 |        4 |    2421.12 |   193.69 |    60.528 |    2675.34 |                  131 |                       4 |                  25 |                   286 |                           1 |  2.01309e+07 |    2.01308e+07 |   2.01309e+07 |

 


tables: name: purchasedw dimcalendar
data: purchasedw dimcalendar.csv
name: purchasedw dimemployee
data: purchasedw dimemployee.csv
name: purchasedw dimgeography
data: purchasedw dimgeography.csv
name: purchasedw diminventorylocation
data: purchasedw diminventorylocation.csv
name: purchasedw dimproduct
data: purchasedw dimproduct.csv
name: purchasedw dimproductpricehistory
data: purchasedw dimproductpricehistory.csv
name: purchasedw dimsalesterritory
data: purchasedw dimsalesterritory.csv
name: purchasedw dimshipmethod
data: purchasedw dimshipmethod.csv
name: purchasedw dimvendor
data: purchasedw dimvendor.csv
name: purchasedw factinventory
data: purchasedw factinventory.csv
name: purchasedw factpurchaseorder
data: purchasedw factpurchaseorder.csv
label: purchasedw factpurchaseorder
Employee_Durable_SK
purchasedw dimemployee
Employee_Durable_SK
purchasedw factinventory
Location_Durable_SK
purchasedw diminventorylocation
Location_Durable_SK
purchasedw dimproductpricehistory
Product_Durable_SK
purchasedw dimproduct
Product_Durable_SK
purchasedw factpurchaseorder
Product_Durable_SK
purchasedw dimproduct
Product_Durable_SK
purchasedw factpurchaseorder
SalesTerritory_Durable_SK
purchasedw dimsalesterritory
SalesTerritory_Durable_SK
purchasedw factpurchaseorder
ShipMethod_Durable_SK
purchasedw dimshipmethod
ShipMethod_Durable_SK
purchasedw factpurchaseorder
Vendor_Durable_SK
purchasedw dimvendor
Vendor_Durable_SK
output: {
    "joins": [
        {
            "from_table": "purchasedw factpurchaseorder",
            "from_column": "Employee_Durable_SK",
            "to_table": "purchasedw dimemployee",
            "to_column": "Employee_Durable_SK"
        },
        {
            "from_table": "purchasedw factinventory",
            "from_column": "Location_Durable_SK",
            "to_table": "purchasedw diminventorylocation",
            "to_column": "Location_Durable_SK"
        },
        {
            "from_table": "purchasedw dimproductpricehistory",
            "from_column": "Product_Durable_SK",
            "to_table": "purchasedw dimproduct",
            "to_column": "Product_Durable_SK"
        },
        {
            "from_table": "purchasedw factpurchaseorder",
            "from_column": "Product_Durable_SK",
            "to_table": "purchasedw dimproduct",
            "to_column": "Product_Durable_SK"
        },
        {
            "from_table": "purchasedw factpurchaseorder",
            "from_column": "SalesTerritory_Durable_SK",
            "to_table": "purchasedw dimsalesterritory",
            "to_column": "SalesTerritory_Durable_SK"
        },
        {
            "from_table": "purchasedw factpurchaseorder",
            "from_column": "ShipMethod_Durable_SK",
            "to_table": "purchasedw dimshipmethod",
            "to_column": "ShipMethod_Durable_SK"
        },
        {
            "from_table": "purchasedw factpurchaseorder",
            "from_column": "Vendor_Durable_SK",
            "to_table": "purchasedw dimvendor",
            "to_column": "Vendor_Durable_SK"
        }
    ]
}