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: Calendario
| Date                    |
|:------------------------|
| 2007-01-01 00:00:00.000 |
| 2007-01-02 00:00:00.000 |
| 2007-01-03 00:00:00.000 |
| 2007-01-04 00:00:00.000 |
| 2007-01-05 00:00:00.000 |
| 2007-01-06 00:00:00.000 |
| 2007-01-07 00:00:00.000 |
| 2007-01-08 00:00:00.000 |
| 2007-01-09 00:00:00.000 |
| 2007-01-10 00:00:00.000 |


Table: Channel
|   ChannelID | ChannelName   |
|------------:|:--------------|
|           1 | Store         |
|           2 | Online        |
|           3 | Catalog       |
|           4 | Reseller      |


Table: Geography
| ContinentName   | GeographyType   | RegionCountryName   |   GeographyKey |
|:----------------|:----------------|:--------------------|---------------:|
| North America   | City            | United States       |            424 |
| North America   | City            | United States       |            430 |
| North America   | City            | United States       |            431 |
| North America   | City            | United States       |            432 |
| North America   | City            | United States       |            433 |
| North America   | City            | United States       |            434 |
| North America   | City            | United States       |            436 |
| North America   | City            | United States       |            438 |
| North America   | City            | United States       |            440 |
| North America   | City            | United States       |            441 |


Table: Product
| BrandName   | ClassName   | Manufacturer   | ProductDescription                                                                                                           |   ProductKey | ProductName                                       |   ProductSubcategoryKey |   UnitCost |   UnitPrice |
|:------------|:------------|:---------------|:-----------------------------------------------------------------------------------------------------------------------------|-------------:|:--------------------------------------------------|------------------------:|-----------:|------------:|
| Contoso     | Economy     | Contoso, Ltd   | ADSL modem splitter/filter X 1                                                                                               |          768 | Contoso ADSL Modem Splitter/Filter X 1 E100 Black |                      22 |        913 |         179 |
| Contoso     | Economy     | Contoso, Ltd   | ADSL modem splitter/filter X 1                                                                                               |          803 | Contoso ADSL Modem Splitter/Filter X 1 E100 White |                      22 |        913 |         179 |
| Contoso     | Economy     | Contoso, Ltd   | ADSL modem splitter/filter X 1                                                                                               |          833 | Contoso ADSL Modem Splitter/Filter X 1 E100 Grey  |                      22 |        913 |         179 |
| Contoso     | Economy     | Contoso, Ltd   | ADSL modem splitter/filter X 2                                                                                               |          769 | Contoso ADSL Modem Splitter/Filter X 2 E200 Black |                      22 |       1168 |         229 |
| Contoso     | Economy     | Contoso, Ltd   | ADSL modem splitter/filter X 2                                                                                               |          804 | Contoso ADSL Modem Splitter/Filter X 2 E200 White |                      22 |       1168 |         229 |
| Contoso     | Economy     | Contoso, Ltd   | ADSL modem splitter/filter X 2                                                                                               |          834 | Contoso ADSL Modem Splitter/Filter X 2 E200 Grey  |                      22 |       1168 |         229 |
| Contoso     | Economy     | Contoso, Ltd   | ADSL modem splitter/filter X 3                                                                                               |          770 | Contoso ADSL Modem Splitter/Filter X 3 E300 Black |                      22 |       2697 |         529 |
| Contoso     | Economy     | Contoso, Ltd   | ADSL modem splitter/filter X 3                                                                                               |          805 | Contoso ADSL Modem Splitter/Filter X 3 E300 White |                      22 |       2697 |         529 |
| Contoso     | Economy     | Contoso, Ltd   | ADSL modem splitter/filter X 3                                                                                               |          835 | Contoso ADSL Modem Splitter/Filter X 3 E300 Grey  |                      22 |       2697 |         529 |
| Contoso     | Economy     | Contoso, Ltd   | Advanced 2.4 GHz cordless technology makes freedom, hyper-fast scrolling, laser, and cursor control on virtually any surface |          870 | Contoso Wireless Laser Mouse E50 Black            |                      22 |       1069 |        2096 |


Table: ProductCategory
| ProductCategory               |   ProductCategoryKey |
|:------------------------------|---------------------:|
| Audio                         |                    1 |
| Cameras and camcorders        |                    4 |
| Cell phones                   |                    5 |
| Computers                     |                    3 |
| Games and Toys                |                    7 |
| Home Appliances               |                    8 |
| Music, Movies and Audio Books |                    6 |
| TV and Video                  |                    2 |


Table: ProductSubcategory
|   ProductCategoryKey | ProductSubcategory               |   ProductSubcategoryKey |
|---------------------:|:---------------------------------|------------------------:|
|                    8 | Air Conditioners                 |                      47 |
|                    1 | Audio Accessories                |                       8 |
|                    6 | Audio Books                      |                      36 |
|                    1 | Bluetooth Headphones             |                       6 |
|                    7 | Boxed Games                      |                      38 |
|                    4 | Camcorders                       |                      27 |
|                    4 | Cameras & Camcorders Accessories |                      28 |
|                    2 | Car Video                        |                      13 |
|                    5 | Cell phones Accessories          |                      33 |
|                    8 | Coffee Machines                  |                      45 |


Table: Promotion
|   DiscountPercent | EndDate                 |   PromotionLabel | PromotionName                          | StartDate               | Priority   |   PromotionKey |
|------------------:|:------------------------|-----------------:|:---------------------------------------|:------------------------|:-----------|---------------:|
|              0    | 2014-12-31 00:00:00.000 |                1 | No Discount                            | 2007-01-01 00:00:00.000 | 1          |              1 |
|              0.05 | 2011-03-31 00:00:00.000 |                2 | North America Spring Promotion         | 2011-01-01 00:00:00.000 |            |              2 |
|              0.1  | 2011-09-30 00:00:00.000 |                3 | North America Back-to-School Promotion | 2011-07-01 00:00:00.000 | 3          |             11 |
|              0.2  | 2011-12-31 00:00:00.000 |                4 | North America Holiday Promotion        | 2011-11-01 00:00:00.000 |            |             20 |
|              0.15 | 2012-01-31 00:00:00.000 |                5 | Asian Holiday Promotion                | 2011-11-01 00:00:00.000 | 4          |              8 |
|              0.2  | 2011-04-30 00:00:00.000 |                6 | Asian Spring Promotion                 | 2011-02-01 00:00:00.000 |            |             17 |
|              0.1  | 2011-06-30 00:00:00.000 |                7 | Asian Summer Promotion                 | 2011-05-01 00:00:00.000 |            |             26 |
|              0.07 | 2011-04-30 00:00:00.000 |                8 | European Spring Promotion              | 2011-02-01 00:00:00.000 | 1          |              7 |
|              0.1  | 2011-09-30 00:00:00.000 |                9 | European Back-to-Scholl Promotion      | 2011-08-01 00:00:00.000 |            |              3 |
|              0.2  | 2012-01-31 00:00:00.000 |               10 | European Holiday Promotion             | 2011-10-01 00:00:00.000 |            |              9 |


Table: Sales
|   channel | DateKey                 |   DiscountAmount |   DiscountQuantity |   Product_ID |   PromotionKey |   ReturnAmount |   ReturnQuantity |   SalesAmount |   SalesKey |   SalesQuantity |   StoreKey |   TotalCost |   UnitCost |   UnitPrice |
|----------:|:------------------------|-----------------:|-------------------:|-------------:|---------------:|---------------:|-----------------:|--------------:|-----------:|----------------:|-----------:|------------:|-----------:|------------:|
|         1 | 2011-01-01 00:00:00.000 |                0 |                  0 |          122 |              2 |              0 |                0 |        251991 |          1 |               9 |        156 |      115884 |      12876 |       27999 |
|         1 | 2011-01-01 00:00:00.000 |                0 |                  0 |          124 |              2 |              0 |                0 |        251991 |          1 |               9 |        123 |      115884 |      12876 |       27999 |
|         1 | 2011-01-01 00:00:00.000 |                0 |                  0 |          154 |              2 |              0 |                0 |        422973 |          1 |               9 |         85 |      194508 |      21612 |       46997 |
|         1 | 2011-01-01 00:00:00.000 |                0 |                  0 |          154 |              2 |              0 |                0 |        422973 |          1 |               9 |        135 |      194508 |      21612 |       46997 |
|         1 | 2011-01-01 00:00:00.000 |                0 |                  0 |          182 |              2 |              0 |                0 |          1071 |          1 |               9 |         49 |       49248 |       5472 |         119 |
|         1 | 2011-01-01 00:00:00.000 |                0 |                  0 |          182 |              2 |              0 |                0 |          1071 |          1 |               9 |         50 |       49248 |       5472 |         119 |
|         1 | 2011-01-01 00:00:00.000 |                0 |                  0 |          206 |              2 |              0 |                0 |          5121 |          1 |               9 |        118 |      235494 |      26166 |         569 |
|         1 | 2011-01-01 00:00:00.000 |                0 |                  0 |          241 |              2 |              0 |                0 |          2961 |          1 |               9 |         47 |      150957 |      16773 |         329 |
|         1 | 2011-01-01 00:00:00.000 |                0 |                  0 |          243 |              2 |              0 |                0 |          3681 |          1 |               9 |        180 |      187668 |      20852 |         409 |
|         1 | 2011-01-01 00:00:00.000 |                0 |                  0 |          256 |              2 |              0 |                0 |          3681 |          1 |               9 |        285 |      187668 |      20852 |         409 |


Table: Stores
| CloseReason   |   EmployeeCount |   GeographyKey |   SellingAreaSize | Status   |   StoreKey | StoreName                     | StoreType   |
|:--------------|----------------:|---------------:|------------------:|:---------|-----------:|:------------------------------|:------------|
|               |              19 |            424 |               455 | On       |          4 | Contoso Bellevue Store        | Store       |
|               |              26 |            449 |               680 | On       |        156 | Contoso Cambridge Store       | Store       |
|               |              19 |            453 |               455 | On       |         88 | Contoso Cedar Park Store      | Store       |
|               |              25 |            501 |               680 | On       |        214 | Contoso Leeds Store           | Store       |
|               |              17 |            506 |               462 | On       |        201 | Contoso London Store          | Store       |
|               |              12 |            529 |               680 | On       |        215 | Contoso Paris Store           | Store       |
|               |              25 |            551 |               700 | On       |         17 | Contoso Spokane Store         | Store       |
|               |              20 |            558 |               480 | On       |        253 | Contoso Sydney No.1 Store     | Store       |
|               |              95 |            558 |               480 | On       |        300 | Contoso Sydney  No.2 Store    | Store       |
|               |              95 |            562 |               480 | On       |        289 | Contoso Vancouver  No.1 Store | Store       |

 


tables: name: Calendario
data: Calendario.csv
name: Channel
data: Channel.csv
name: Geography
data: Geography.csv
name: Product
data: Product.csv
name: ProductCategory
data: ProductCategory.csv
name: ProductSubcategory
data: ProductSubcategory.csv
name: Promotion
data: Promotion.csv
name: Sales
data: Sales.csv
name: Stores
data: Stores.csv
label: Product
ProductSubcategoryKey
ProductSubcategory
ProductSubcategoryKey
ProductSubcategory
ProductCategoryKey
ProductCategory
ProductCategoryKey
Sales
channel
Channel
ChannelID
Sales
Product_ID
Product
ProductKey
Stores
GeographyKey
Geography
GeographyKey
Sales
StoreKey
Stores
StoreKey
Sales
PromotionKey
Promotion
DiscountPercent
output: {
    "joins": [
        {
            "from_table": "Product",
            "from_column": "ProductSubcategoryKey",
            "to_table": "ProductSubcategory",
            "to_column": "ProductSubcategoryKey"
        },
        {
            "from_table": "ProductSubcategory",
            "from_column": "ProductCategoryKey",
            "to_table": "ProductCategory",
            "to_column": "ProductCategoryKey"
        },
        {
            "from_table": "Sales",
            "from_column": "channel",
            "to_table": "Channel",
            "to_column": "ChannelID"
        },
        {
            "from_table": "Sales",
            "from_column": "Product_ID",
            "to_table": "Product",
            "to_column": "ProductKey"
        },
        {
            "from_table": "Stores",
            "from_column": "GeographyKey",
            "to_table": "Geography",
            "to_column": "GeographyKey"
        },
        {
            "from_table": "Sales",
            "from_column": "StoreKey",
            "to_table": "Stores",
            "to_column": "StoreKey"
        },
        {
            "from_table": "Sales",
            "from_column": "PromotionKey",
            "to_table": "Promotion",
            "to_column": "DiscountPercent"
        }
    ]
}