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: Calendar
| Date                    |   Year | Quarter   | Month    | MonthSort   | Month in Year   |   MonthInYearSort | Day of Week   |   DayOfWeekSort |
|:------------------------|-------:|:----------|:---------|:------------|:----------------|------------------:|:--------------|----------------:|
| 2012-01-01 00:00:00.000 |   2012 | 2012-Q1   | Jan 2012 | 2012-01     | Jan             |                 1 | Sun           |               7 |
| 2012-01-02 00:00:00.000 |   2012 | 2012-Q1   | Jan 2012 | 2012-01     | Jan             |                 1 | Mon           |               1 |
| 2012-01-03 00:00:00.000 |   2012 | 2012-Q1   | Jan 2012 | 2012-01     | Jan             |                 1 | Tue           |               2 |
| 2012-01-04 00:00:00.000 |   2012 | 2012-Q1   | Jan 2012 | 2012-01     | Jan             |                 1 | Wed           |               3 |
| 2012-01-05 00:00:00.000 |   2012 | 2012-Q1   | Jan 2012 | 2012-01     | Jan             |                 1 | Thu           |               4 |
| 2012-01-06 00:00:00.000 |   2012 | 2012-Q1   | Jan 2012 | 2012-01     | Jan             |                 1 | Fri           |               5 |
| 2012-01-07 00:00:00.000 |   2012 | 2012-Q1   | Jan 2012 | 2012-01     | Jan             |                 1 | Sat           |               6 |
| 2012-01-08 00:00:00.000 |   2012 | 2012-Q1   | Jan 2012 | 2012-01     | Jan             |                 1 | Sun           |               7 |
| 2012-01-09 00:00:00.000 |   2012 | 2012-Q1   | Jan 2012 | 2012-01     | Jan             |                 1 | Mon           |               1 |
| 2012-01-10 00:00:00.000 |   2012 | 2012-Q1   | Jan 2012 | 2012-01     | Jan             |                 1 | Tue           |               2 |


Table: Customers
|   CustomerId | City Name   | State   |   Zipcode | Gender   | BirthDate               | Customer         | Customer Type     |   Age | Age Group        | Sales Region   | State Name   |   SalesRegionSort | City         |
|-------------:|:------------|:--------|----------:|:---------|:------------------------|:-----------------|:------------------|------:|:-----------------|:---------------|:-------------|------------------:|:-------------|
|          760 | San Jose    | CA      |     95133 | Female   | 1968-03-16 00:00:00.000 | Lucile Blake     | One-time Customer |    54 | Ages 50 TO 65    | Western Region | California   |                 1 | San Jose, CA |
|          881 | San Jose    | CA      |     95133 | Female   | 1942-07-19 00:00:00.000 | Rochelle Owen    | One-time Customer |    80 | Ages 65 and over | Western Region | California   |                 1 | San Jose, CA |
|          940 | San Jose    | CA      |     95133 | Female   | 1943-03-07 00:00:00.000 | Corinne Finch    | One-time Customer |    79 | Ages 65 and over | Western Region | California   |                 1 | San Jose, CA |
|         1119 | San Jose    | CA      |     95133 | Female   | 1990-09-03 00:00:00.000 | Twila Massey     | One-time Customer |    31 | Ages 30 TO 39    | Western Region | California   |                 1 | San Jose, CA |
|         1548 | San Jose    | CA      |     95133 | Female   | 1955-07-14 00:00:00.000 | Kellie Yang      | One-time Customer |    67 | Ages 65 and over | Western Region | California   |                 1 | San Jose, CA |
|         2195 | San Jose    | CA      |     95133 | Female   | 1951-03-25 00:00:00.000 | Megan Martin     | One-time Customer |    71 | Ages 65 and over | Western Region | California   |                 1 | San Jose, CA |
|         2252 | San Jose    | CA      |     95133 | Female   | 1946-04-03 00:00:00.000 | Cynthia Blake    | One-time Customer |    76 | Ages 65 and over | Western Region | California   |                 1 | San Jose, CA |
|         2341 | San Jose    | CA      |     95133 | Female   | 1960-05-02 00:00:00.000 | Karyn Hodges     | One-time Customer |    62 | Ages 50 TO 65    | Western Region | California   |                 1 | San Jose, CA |
|         2368 | San Jose    | CA      |     95133 | Female   | 1948-05-26 00:00:00.000 | Priscilla Potter | One-time Customer |    74 | Ages 65 and over | Western Region | California   |                 1 | San Jose, CA |
|         2525 | San Jose    | CA      |     95133 | Female   | 1949-11-10 00:00:00.000 | Nadia Gray       | One-time Customer |    72 | Ages 65 and over | Western Region | California   |                 1 | San Jose, CA |


Table: Fiscal Calendar
| Date                    |   Fiscal Month |   Fiscal Quarter | Fiscal Half   |   Fiscal Year | Fiscal Month-Year   |   Fiscal Month-Year Sort |   Calendar Month | Calendar Quarter   | Calendar Half   |   Calendar Year | Month-Year   | Month-Year-Sort   |
|:------------------------|---------------:|-----------------:|:--------------|--------------:|:--------------------|-------------------------:|-----------------:|:-------------------|:----------------|----------------:|:-------------|:------------------|
| 2011-11-01 00:00:00.000 |              1 |                1 | H1            |          2012 | 1 - 2012            |                   201201 |               11 | Q4                 | H2              |            2011 | Nov-2011     | 2011-11           |
| 2011-11-02 00:00:00.000 |              1 |                1 | H1            |          2012 | 1 - 2012            |                   201201 |               11 | Q4                 | H2              |            2011 | Nov-2011     | 2011-11           |
| 2011-11-03 00:00:00.000 |              1 |                1 | H1            |          2012 | 1 - 2012            |                   201201 |               11 | Q4                 | H2              |            2011 | Nov-2011     | 2011-11           |
| 2011-11-04 00:00:00.000 |              1 |                1 | H1            |          2012 | 1 - 2012            |                   201201 |               11 | Q4                 | H2              |            2011 | Nov-2011     | 2011-11           |
| 2011-11-05 00:00:00.000 |              1 |                1 | H1            |          2012 | 1 - 2012            |                   201201 |               11 | Q4                 | H2              |            2011 | Nov-2011     | 2011-11           |
| 2011-11-06 00:00:00.000 |              1 |                1 | H1            |          2012 | 1 - 2012            |                   201201 |               11 | Q4                 | H2              |            2011 | Nov-2011     | 2011-11           |
| 2011-11-07 00:00:00.000 |              1 |                1 | H1            |          2012 | 1 - 2012            |                   201201 |               11 | Q4                 | H2              |            2011 | Nov-2011     | 2011-11           |
| 2011-11-08 00:00:00.000 |              1 |                1 | H1            |          2012 | 1 - 2012            |                   201201 |               11 | Q4                 | H2              |            2011 | Nov-2011     | 2011-11           |
| 2011-11-09 00:00:00.000 |              1 |                1 | H1            |          2012 | 1 - 2012            |                   201201 |               11 | Q4                 | H2              |            2011 | Nov-2011     | 2011-11           |
| 2011-11-10 00:00:00.000 |              1 |                1 | H1            |          2012 | 1 - 2012            |                   201201 |               11 | Q4                 | H2              |            2011 | Nov-2011     | 2011-11           |


Table: Products
|   ProductId | Product                            |   UnitCost |   ListPrice | ProductImageUrl                                               | Category       | Subcategory       |
|------------:|:-----------------------------------|-----------:|------------:|:--------------------------------------------------------------|:---------------|:------------------|
|           1 | Batman Action Figure               |       6.85 |       14.95 | http://classresources.blob.core.windows.net/images/WP0001.jpg | Action Figures | Tough Guys        |
|           2 | Captain America Action Figure      |       7.05 |       12.95 | http://classresources.blob.core.windows.net/images/WP0002.jpg | Action Figures | Tough Guys        |
|           3 | GI Joe Action Figure               |       6.1  |       14.95 | http://classresources.blob.core.windows.net/images/WP0003.jpg | Action Figures | Tough Guys        |
|           4 | Green Hulk Action Figure           |       2.85 |        9.95 | http://classresources.blob.core.windows.net/images/WP0004.jpg | Action Figures | Tough Guys        |
|           5 | Red Hulk Alter Ego Action Figure   |       2.85 |        9.95 | http://classresources.blob.core.windows.net/images/WP0005.jpg | Action Figures | Tough Guys        |
|           6 | Godzilla Action Figure             |      14.25 |       19.95 | http://classresources.blob.core.windows.net/images/WP0006.jpg | Action Figures | Tough Guys        |
|           7 | Perry the Platypus Action Figure   |      12    |       21.95 | http://classresources.blob.core.windows.net/images/WP0007.jpg | Action Figures | Cute and Huggable |
|           8 | Green Angry Bird Action Figure     |       2.1  |        4.95 | http://classresources.blob.core.windows.net/images/WP0008.jpg | Action Figures | Cute and Huggable |
|           9 | Red Angry Bird Action Figure       |       2.1  |       14.95 | http://classresources.blob.core.windows.net/images/WP0009.jpg | Action Figures | Cute and Huggable |
|          10 | Phineas and Ferb Action Figure Set |      12.25 |       19.95 | http://classresources.blob.core.windows.net/images/WP0010.jpg | Action Figures | Cute and Huggable |


Table: Purchases
|   InvoiceId | Purchase Type   |
|------------:|:----------------|
|           1 | Store Purchase  |
|           2 | Store Purchase  |
|           3 | Store Purchase  |
|           4 | Store Purchase  |
|           5 | Store Purchase  |
|           6 | Store Purchase  |
|           7 | Store Purchase  |
|           8 | Store Purchase  |
|           9 | Store Purchase  |
|          10 | Store Purchase  |


Table: Sales
|   Id |   Quantity |   SalesAmount |   InvoiceId |   ProductId | PurchaseDate            |   CustomerId |   ProductCost |   SalesProfit |   PurchaseYear |
|-----:|-----------:|--------------:|------------:|------------:|:------------------------|-------------:|--------------:|--------------:|---------------:|
|   95 |          9 |        179.55 |          46 |           6 | 2012-02-04 00:00:00.000 |           46 |        128.25 |          51.3 |           2012 |
|   96 |          9 |        179.55 |          47 |           6 | 2012-02-04 00:00:00.000 |           47 |        128.25 |          51.3 |           2012 |
|  307 |          9 |        179.55 |         155 |           6 | 2012-02-23 00:00:00.000 |          142 |        128.25 |          51.3 |           2012 |
|  313 |          9 |        179.55 |         157 |           6 | 2012-02-23 00:00:00.000 |          114 |        128.25 |          51.3 |           2012 |
|  357 |          9 |        179.55 |         180 |           6 | 2012-02-25 00:00:00.000 |          116 |        128.25 |          51.3 |           2012 |
|  601 |          9 |        179.55 |         296 |           6 | 2012-03-10 00:00:00.000 |          240 |        128.25 |          51.3 |           2012 |
|  617 |          9 |        179.55 |         306 |           6 | 2012-03-10 00:00:00.000 |          130 |        128.25 |          51.3 |           2012 |
|  761 |          9 |        179.55 |         378 |           6 | 2012-03-19 00:00:00.000 |          297 |        128.25 |          51.3 |           2012 |
|  861 |          9 |        179.55 |         427 |           6 | 2012-03-24 00:00:00.000 |          325 |        128.25 |          51.3 |           2012 |
|  863 |          9 |        179.55 |         428 |           6 | 2012-03-24 00:00:00.000 |          326 |        128.25 |          51.3 |           2012 |


Table: SalesRegions
| State   | StateFullName   | SalesRegion    |   SalesRegionSortOrder |
|:--------|:----------------|:---------------|-----------------------:|
| AK      | Alaska          | Western Region |                      1 |
| AZ      | Arizona         | Western Region |                      1 |
| AL      | Alabama         | Central Region |                      2 |
| AR      | Arkansas        | Central Region |                      2 |
| CA      | California      | Western Region |                      1 |
| CO      | Colorado        | Western Region |                      1 |
| CT      | Connecticut     | Eastern Region |                      3 |
| DE      | Delaware        | Eastern Region |                      3 |
| FL      | Florida         | Eastern Region |                      3 |
| GA      | Georgia         | Eastern Region |                      3 |

 


tables: name: Calendar
data: Calendar.csv
name: Customers
data: Customers.csv
name: Fiscal Calendar
data: Fiscal Calendar.csv
name: Products
data: Products.csv
name: Purchases
data: Purchases.csv
name: Sales
data: Sales.csv
name: SalesRegions
data: SalesRegions.csv
label: Sales
InvoiceId
Purchases
InvoiceId
Sales
ProductId
Products
ProductId
Sales
CustomerId
Customers
CustomerId
Customers
State
SalesRegions
State
output: {
    "joins": [
        {
            "from_table": "Sales",
            "from_column": "InvoiceId",
            "to_table": "Purchases",
            "to_column": "InvoiceId"
        },
        {
            "from_table": "Sales",
            "from_column": "ProductId",
            "to_table": "Products",
            "to_column": "ProductId"
        },
        {
            "from_table": "Sales",
            "from_column": "CustomerId",
            "to_table": "Customers",
            "to_column": "CustomerId"
        },
        {
            "from_table": "Customers",
            "from_column": "State",
            "to_table": "SalesRegions",
            "to_column": "State"
        }
    ]
}