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                    |   DateKey |   Calendar Year Number | Calendar Year   |   Calendar Year Quarter Number | Calendar Year Quarter   |   Calendar Year Month Number | Calendar Year Month   |   Month Number | Month   |   Day of Week Number | Day of Week   |   Fiscal Year Number | Fiscal Year   |   Fiscal Quarter Number | Fiscal Quarter   |   Fiscal Year Quarter Number | Fiscal Year Quarter   |   Fiscal Month Number | Fiscal Month   | Working Day   |   Is Holiday | Holiday Name   | Europe Season   | North America Season   | Asia Season   |
|:------------------------|----------:|-----------------------:|:----------------|-------------------------------:|:------------------------|-----------------------------:|:----------------------|---------------:|:--------|---------------------:|:--------------|---------------------:|:--------------|------------------------:|:-----------------|-----------------------------:|:----------------------|----------------------:|:---------------|:--------------|-------------:|:---------------|:----------------|:-----------------------|:--------------|
| 2005-07-01 00:00:00.000 |  20050701 |                   2005 | CY 2005         |                          20053 | Q3-2005                 |                       200507 | July 2005             |              7 | July    |                    6 | Friday        |                 2006 | FY 2006       |                       1 | Q1               |                        20061 | Q1-2006               |                     1 | July           | WorkDay       |            0 | None           | Back to School  | Back to School         | None          |
| 2005-07-04 00:00:00.000 |  20050704 |                   2005 | CY 2005         |                          20053 | Q3-2005                 |                       200507 | July 2005             |              7 | July    |                    2 | Monday        |                 2006 | FY 2006       |                       1 | Q1               |                        20061 | Q1-2006               |                     1 | July           | WorkDay       |            0 | None           | Back to School  | Back to School         | None          |
| 2005-07-05 00:00:00.000 |  20050705 |                   2005 | CY 2005         |                          20053 | Q3-2005                 |                       200507 | July 2005             |              7 | July    |                    3 | Tuesday       |                 2006 | FY 2006       |                       1 | Q1               |                        20061 | Q1-2006               |                     1 | July           | WorkDay       |            0 | None           | Back to School  | Back to School         | None          |
| 2005-07-06 00:00:00.000 |  20050706 |                   2005 | CY 2005         |                          20053 | Q3-2005                 |                       200507 | July 2005             |              7 | July    |                    4 | Wednesday     |                 2006 | FY 2006       |                       1 | Q1               |                        20061 | Q1-2006               |                     1 | July           | WorkDay       |            0 | None           | Back to School  | Back to School         | None          |
| 2005-07-07 00:00:00.000 |  20050707 |                   2005 | CY 2005         |                          20053 | Q3-2005                 |                       200507 | July 2005             |              7 | July    |                    5 | Thursday      |                 2006 | FY 2006       |                       1 | Q1               |                        20061 | Q1-2006               |                     1 | July           | WorkDay       |            0 | None           | Back to School  | Back to School         | None          |
| 2005-07-08 00:00:00.000 |  20050708 |                   2005 | CY 2005         |                          20053 | Q3-2005                 |                       200507 | July 2005             |              7 | July    |                    6 | Friday        |                 2006 | FY 2006       |                       1 | Q1               |                        20061 | Q1-2006               |                     1 | July           | WorkDay       |            0 | None           | Back to School  | Back to School         | None          |
| 2005-07-11 00:00:00.000 |  20050711 |                   2005 | CY 2005         |                          20053 | Q3-2005                 |                       200507 | July 2005             |              7 | July    |                    2 | Monday        |                 2006 | FY 2006       |                       1 | Q1               |                        20061 | Q1-2006               |                     1 | July           | WorkDay       |            0 | None           | Back to School  | Back to School         | None          |
| 2005-07-12 00:00:00.000 |  20050712 |                   2005 | CY 2005         |                          20053 | Q3-2005                 |                       200507 | July 2005             |              7 | July    |                    3 | Tuesday       |                 2006 | FY 2006       |                       1 | Q1               |                        20061 | Q1-2006               |                     1 | July           | WorkDay       |            0 | None           | Back to School  | Back to School         | None          |
| 2005-07-13 00:00:00.000 |  20050713 |                   2005 | CY 2005         |                          20053 | Q3-2005                 |                       200507 | July 2005             |              7 | July    |                    4 | Wednesday     |                 2006 | FY 2006       |                       1 | Q1               |                        20061 | Q1-2006               |                     1 | July           | WorkDay       |            0 | None           | Back to School  | Back to School         | None          |
| 2005-07-14 00:00:00.000 |  20050714 |                   2005 | CY 2005         |                          20053 | Q3-2005                 |                       200507 | July 2005             |              7 | July    |                    5 | Thursday      |                 2006 | FY 2006       |                       1 | Q1               |                        20061 | Q1-2006               |                     1 | July           | WorkDay       |            0 | None           | Back to School  | Back to School         | None          |


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


Table: Product Subcategory
|   ProductSubcategoryKey |   Subcategory Code | Subcategory          |   ProductCategoryKey |
|------------------------:|-------------------:|:---------------------|---------------------:|
|                       1 |                101 | MP4&MP3              |                    1 |
|                       2 |                102 | Recorder             |                    1 |
|                       3 |                103 | Radio                |                    1 |
|                       4 |                104 | Recording Pen        |                    1 |
|                       5 |                105 | Headphones           |                    1 |
|                       6 |                106 | Bluetooth Headphones |                    1 |
|                       7 |                107 | Speakers             |                    1 |
|                       8 |                108 | Audio Accessories    |                    1 |
|                       9 |                201 | Televisions          |                    2 |
|                      10 |                202 | VCD & DVD            |                    2 |


Table: Product
|   ProductKey |   Product Code | Product Name                                            | Product Description                             |   ProductSubcategoryKey | Manufacturer   | Brand         | Class   | Style          | Color   | Size   | Weight   | Weight Unit Measure   |   Stock Type Code | Stock Type   |   Unit Cost |   Unit Price | Available Date          | Status   |
|-------------:|---------------:|:--------------------------------------------------------|:------------------------------------------------|------------------------:|:---------------|:--------------|:--------|:---------------|:--------|:-------|:---------|:----------------------|------------------:|:-------------|------------:|-------------:|:------------------------|:---------|
|         1722 |         702016 | MGS Zoo Tycoon 2: End range Species Expansion Pack E105 | Zoo Tycoon 2: Endangered Species Expansion Pack |                      39 | Tailspin Toys  | Tailspin Toys | Economy | Product0702016 | Silver  |        |          |                       |                 3 | Low          |       28.55 |       56     | 2006-05-12 00:00:00.000 | On       |
|         1723 |         702017 | MGS Age of Empires III: The Asian Dynasties E106        | Age of Empires III: The Asian Dynasties         |                      39 | Tailspin Toys  | Tailspin Toys | Economy | Product0702017 | Pink    |        |          |                       |                 3 | Low          |       28.55 |       56     | 2007-04-05 00:00:00.000 | On       |
|         1724 |         702018 | MGS Fable: The Lost Chapters E107                       | Fable: The Lost Chapters                        |                      39 | Tailspin Toys  | Tailspin Toys | Economy | Product0702018 | Silver  |        |          |                       |                 3 | Low          |       28.55 |       56     | 2007-04-05 00:00:00.000 | On       |
|         1725 |         702019 | MGS Dungeon Siege II E105                               | Dungeon Siege II                                |                      39 | Tailspin Toys  | Tailspin Toys | Economy | Product0702019 | Silver  |        |          |                       |                 3 | Low          |       28.55 |       56     | 2009-01-02 00:00:00.000 | On       |
|         1726 |         702020 | MGS Zoo Tycoon 2 E108                                   | Zoo Tycoon 2                                    |                      39 | Tailspin Toys  | Tailspin Toys | Economy | Product0702020 | Silver  |        |          |                       |                 3 | Low          |       28.55 |       56     | 2009-01-03 00:00:00.000 | On       |
|         1727 |         702021 | MGS Rise of Nations: Gold Edition M300                  | Rise of Nations: Gold Edition                   |                      39 | Tailspin Toys  | Tailspin Toys | Economy | Product0702021 | Pink    |        |          |                       |                 3 | Low          |       25.75 |       56     | 2005-01-04 00:00:00.000 | On       |
|         1733 |         702027 | MGS Halo: Combat Evolved E109                           | Halo: Combat Evolved                            |                      39 | Tailspin Toys  | Tailspin Toys | Economy | Product0702027 | Silver  |        |          |                       |                 3 | Low          |       11.62 |       22.788 | 2005-01-02 00:00:00.000 | On       |
|         1734 |         702028 | MGS Zoo Tycoon Complete Collection E110                 | Zoo Tycoon Complete Collection                  |                      39 | Tailspin Toys  | Tailspin Toys | Economy | Product0702028 | Blue    |        |          |                       |                 3 | Low          |       14.28 |       28     | 2005-01-03 00:00:00.000 | On       |
|         1735 |         702029 | MGS Flight Simulator 2004: A Century of Flight E111     | Flight Simulator 2004: A Century of Flight      |                      39 | Tailspin Toys  | Tailspin Toys | Economy | Product0702029 | Black   |        |          |                       |                 3 | Low          |       14.28 |       28     | 2005-01-04 00:00:00.000 | On       |
|         1736 |         702030 | MGS Rise of Nations E112                                | Rise of Nations                                 |                      39 | Tailspin Toys  | Tailspin Toys | Economy | Product0702030 | White   |        |          |                       |                 3 | Low          |       14.28 |       28     | 2007-04-05 00:00:00.000 | On       |


Table: Promotion
|   PromotionKey |   Promotion Code | Promotion                              |   Discount | Promotion Type    | Promotion Category   | Start Date              | End Date                |
|---------------:|-----------------:|:---------------------------------------|-----------:|:------------------|:---------------------|:------------------------|:------------------------|
|              1 |                1 | No Discount                            |       0    | No Discount       | No Discount          | 2003-01-01 00:00:00.000 | 2010-12-31 00:00:00.000 |
|              2 |                2 | North America Spring Promotion         |       0.05 | Seasonal Discount | Store                | 2007-01-01 00:00:00.000 | 2007-03-31 00:00:00.000 |
|              3 |                3 | North America Back-to-School Promotion |       0.1  | Seasonal Discount | Store                | 2007-07-01 00:00:00.000 | 2007-09-30 00:00:00.000 |
|              4 |                4 | North America Holiday Promotion        |       0.2  | Seasonal Discount | Store                | 2007-11-01 00:00:00.000 | 2007-12-31 00:00:00.000 |
|              5 |                5 | Asian Holiday Promotion                |       0.15 | Seasonal Discount | Store                | 2007-11-01 00:00:00.000 | 2008-01-31 00:00:00.000 |
|              6 |                6 | Asian Spring Promotion                 |       0.2  | Seasonal Discount | Store                | 2007-02-01 00:00:00.000 | 2007-04-30 00:00:00.000 |
|              7 |                7 | Asian Summer Promotion                 |       0.1  | Seasonal Discount | Store                | 2007-05-01 00:00:00.000 | 2007-06-30 00:00:00.000 |
|              8 |                8 | European Spring Promotion              |       0.07 | Seasonal Discount | Store                | 2007-02-01 00:00:00.000 | 2007-04-30 00:00:00.000 |
|              9 |                9 | European Back-to-Scholl Promotion      |       0.1  | Seasonal Discount | Store                | 2007-08-01 00:00:00.000 | 2007-09-30 00:00:00.000 |
|             10 |               10 | European Holiday Promotion             |       0.2  | Seasonal Discount | Store                | 2007-10-01 00:00:00.000 | 2008-01-31 00:00:00.000 |


Table: Sales
|   StoreKey |   ProductKey |   PromotionKey |   CurrencyKey |   CustomerKey |   OrderDateKey |   DueDateKey |   DeliveryDateKey | Order Date              | Due Date                | Delivery Date           |   Quantity |   Unit Price |   Unit Discount |   Unit Cost |   Net Price |
|-----------:|-------------:|---------------:|--------------:|--------------:|---------------:|-------------:|------------------:|:------------------------|:------------------------|:------------------------|-----------:|-------------:|----------------:|------------:|------------:|
|        199 |         1316 |              1 |             1 |         18768 |       20070502 |     20070515 |          20070510 | 2007-05-02 00:00:00.000 | 2007-05-15 00:00:00.000 | 2007-05-10 00:00:00.000 |          1 |         9.99 |               0 |        5.09 |        9.99 |
|        199 |         1316 |              1 |             1 |         18768 |       20070502 |     20070508 |          20070511 | 2007-05-02 00:00:00.000 | 2007-05-08 00:00:00.000 | 2007-05-11 00:00:00.000 |          1 |         9.99 |               0 |        5.09 |        9.99 |
|        199 |         1316 |              1 |             1 |         18768 |       20070502 |     20070509 |          20070512 | 2007-05-02 00:00:00.000 | 2007-05-09 00:00:00.000 | 2007-05-12 00:00:00.000 |          1 |         9.99 |               0 |        5.09 |        9.99 |
|        199 |         1316 |              1 |             1 |         18768 |       20070502 |     20070511 |          20070514 | 2007-05-02 00:00:00.000 | 2007-05-11 00:00:00.000 | 2007-05-14 00:00:00.000 |          1 |         9.99 |               0 |        5.09 |        9.99 |
|        306 |         2505 |              1 |             1 |         19041 |       20070701 |     20070709 |          20070710 | 2007-07-01 00:00:00.000 | 2007-07-09 00:00:00.000 | 2007-07-10 00:00:00.000 |          1 |         9.99 |               0 |        5.09 |        9.99 |
|        306 |         2505 |              1 |             1 |         19041 |       20070701 |     20070710 |          20070711 | 2007-07-01 00:00:00.000 | 2007-07-10 00:00:00.000 | 2007-07-11 00:00:00.000 |          1 |         9.99 |               0 |        5.09 |        9.99 |
|        306 |         2505 |              1 |             1 |         19041 |       20070701 |     20070711 |          20070712 | 2007-07-01 00:00:00.000 | 2007-07-11 00:00:00.000 | 2007-07-12 00:00:00.000 |          1 |         9.99 |               0 |        5.09 |        9.99 |
|        306 |         2505 |              1 |             1 |         19041 |       20070701 |     20070712 |          20070713 | 2007-07-01 00:00:00.000 | 2007-07-12 00:00:00.000 | 2007-07-13 00:00:00.000 |          1 |         9.99 |               0 |        5.09 |        9.99 |
|        306 |         2505 |              1 |             1 |         19041 |       20070701 |     20070714 |          20070708 | 2007-07-01 00:00:00.000 | 2007-07-14 00:00:00.000 | 2007-07-08 00:00:00.000 |          1 |         9.99 |               0 |        5.09 |        9.99 |
|        306 |         2505 |              1 |             1 |         19041 |       20070701 |     20070707 |          20070709 | 2007-07-01 00:00:00.000 | 2007-07-07 00:00:00.000 | 2007-07-09 00:00:00.000 |          1 |         9.99 |               0 |        5.09 |        9.99 |


Table: Store
|   StoreKey |   GeographyKey |   Store Manager | Store Type   | Store Name                 | Status   | Open Date               | Close Date   |   Zip Code |   Zip Code Extension | Store Phone   | StoreFax     | Continent     | City       | State         | CountryRegion   | Address Line 1              | Address Line 2              | Close Reason   |   Employees |   Selling Area | Last Remodel Date       |
|-----------:|---------------:|----------------:|:-------------|:---------------------------|:---------|:------------------------|:-------------|-----------:|---------------------:|:--------------|:-------------|:--------------|:-----------|:--------------|:----------------|:----------------------------|:----------------------------|:---------------|------------:|---------------:|:------------------------|
|         17 |            551 |             135 | Store        | Contoso Spokane Store      | On       | 2004-03-26 00:00:00.000 |              |      97001 |                97017 | 984-555-0185  | 984-555-0185 | North America | Spokane    | Washington    | United States   | Logan Ave  Shopping mall    | Logan Ave  Shopping mall    |                |          25 |            700 | 2009-06-17 00:00:00.000 |
|          5 |            677 |              38 | Store        | Contoso Redmond Store      | On       | 2004-04-02 00:00:00.000 |              |      97001 |                97005 | 612-555-0100  | 612-555-0100 | North America | Redmond    | Washington    | United States   | Downtown shopping mall      | Downtown shopping mall      |                |          33 |            560 | 2009-06-17 00:00:00.000 |
|         15 |            678 |              48 | Store        | Contoso Renton Store       | On       | 2004-02-24 00:00:00.000 |              |      97001 |                97015 | 424-555-0189  | 424-555-0189 | North America | Renton     | Washington    | United States   | Renton,Citycenter           | Renton,Citycenter           |                |          22 |            500 | 2009-06-17 00:00:00.000 |
|          2 |            693 |              35 | Store        | Contoso Seattle No.2 Store | On       | 2004-02-14 00:00:00.000 |              |      97001 |                97002 | 150-555-0189  | 150-555-0189 | North America | Seattle    | Washington    | United States   | Mino shopping mall          | Mino shopping mall          |                |          25 |            700 | 2009-06-17 00:00:00.000 |
|        150 |            789 |             165 | Store        | Contoso Attleboro Store    | On       | 2004-02-20 00:00:00.000 |              |       2703 |                 2703 | 589-555-0147  | 589-555-0147 | North America | Attleboro  | Massachusetts | United States   | Thacher Downtown            | Thacher Downtown            |                |          19 |            455 | 2009-06-17 00:00:00.000 |
|         40 |            790 |              69 | Store        | Contoso Aurora Store       | On       | 2003-06-11 00:00:00.000 |              |      87001 |                87021 | 794-555-0159  | 794-555-0159 | North America | Aurora     | Colorado      | United States   | Willow Park Ave             | Willow Park Ave             |                |          25 |            700 | 2009-06-17 00:00:00.000 |
|        197 |            792 |             211 | Store        | Contoso Back River Store   | On       | 2004-07-23 00:00:00.000 |              |      21219 |                21219 | 955-555-0131  | 955-555-0131 | North America | Back River | Maryland      | United States   | Back River St Shopping mall | Back River St Shopping mall |                |          33 |            560 | 2009-06-17 00:00:00.000 |
|        192 |            794 |             206 | Store        | Contoso Baltimore Store    | On       | 2004-02-18 00:00:00.000 |              |      21201 |                21201 | 508-555-0129  | 508-555-0129 | North America | Baltimore  | Maryland      | United States   | Pleasant St                 | Pleasant St                 |                |          17 |            460 | 2009-06-17 00:00:00.000 |
|        167 |            796 |             182 | Store        | Contoso Bar Harbor Store   | On       | 2004-02-18 00:00:00.000 |              |       4609 |                 4609 | 746-555-0164  | 746-555-0164 | North America | Bar Harbor | Maine         | United States   | Ledgelawn Ave               | Ledgelawn Ave               |                |          47 |           1125 | 2009-06-17 00:00:00.000 |
|        137 |            797 |             153 | Store        | Contoso Bayonne Store      | On       | 2004-04-17 00:00:00.000 |              |       7002 |                 7002 | 500-555-0159  | 500-555-0159 | North America | Bayonne    | New Jersey    | United States   | E 31st St                   | E 31st St                   |                |          47 |           1125 | 2009-06-17 00:00:00.000 |

 


tables: name: Date
data: Date.csv
name: Product Category
data: Product Category.csv
name: Product Subcategory
data: Product Subcategory.csv
name: Product
data: Product.csv
name: Promotion
data: Promotion.csv
name: Sales
data: Sales.csv
name: Store
data: Store.csv
label: Product
ProductSubcategoryKey
Product Subcategory
ProductSubcategoryKey
Product Subcategory
ProductCategoryKey
Product Category
ProductCategoryKey
Sales
PromotionKey
Promotion
PromotionKey
Sales
ProductKey
Product
ProductKey
Sales
OrderDateKey
Date
DateKey
Sales
StoreKey
Store
StoreKey
output: {
    "joins": [
        {
            "from_table": "Product",
            "from_column": "ProductSubcategoryKey",
            "to_table": "Product Subcategory",
            "to_column": "ProductSubcategoryKey"
        },
        {
            "from_table": "Product Subcategory",
            "from_column": "ProductCategoryKey",
            "to_table": "Product Category",
            "to_column": "ProductCategoryKey"
        },
        {
            "from_table": "Sales",
            "from_column": "PromotionKey",
            "to_table": "Promotion",
            "to_column": "PromotionKey"
        },
        {
            "from_table": "Sales",
            "from_column": "ProductKey",
            "to_table": "Product",
            "to_column": "ProductKey"
        },
        {
            "from_table": "Sales",
            "from_column": "OrderDateKey",
            "to_table": "Date",
            "to_column": "DateKey"
        },
        {
            "from_table": "Sales",
            "from_column": "StoreKey",
            "to_table": "Store",
            "to_column": "StoreKey"
        }
    ]
}