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: Categories
|   CategoryKey | Category   |
|--------------:|:-----------|
|             1 | Special    |
|             2 | General    |


Table: DimDate
| Date                    |   Year |   MonthNo | MonthName   |   Day | DayName   |   Qtr |   WeekNum |   WeekDay |   MonthOrder | QtrName   |
|:------------------------|-------:|----------:|:------------|------:|:----------|------:|----------:|----------:|-------------:|:----------|
| 2014-01-02 00:00:00.000 |   2014 |         1 | Jan         |     2 | Thu       |     1 |         1 |         5 |            1 | Qtr 1     |
| 2014-01-03 00:00:00.000 |   2014 |         1 | Jan         |     3 | Fri       |     1 |         1 |         6 |            1 | Qtr 1     |
| 2014-01-04 00:00:00.000 |   2014 |         1 | Jan         |     4 | Sat       |     1 |         1 |         7 |            1 | Qtr 1     |
| 2014-01-05 00:00:00.000 |   2014 |         1 | Jan         |     5 | Sun       |     1 |         2 |         1 |            1 | Qtr 1     |
| 2014-01-06 00:00:00.000 |   2014 |         1 | Jan         |     6 | Mon       |     1 |         2 |         2 |            1 | Qtr 1     |
| 2014-01-07 00:00:00.000 |   2014 |         1 | Jan         |     7 | Tue       |     1 |         2 |         3 |            1 | Qtr 1     |
| 2014-01-08 00:00:00.000 |   2014 |         1 | Jan         |     8 | Wed       |     1 |         2 |         4 |            1 | Qtr 1     |
| 2014-01-09 00:00:00.000 |   2014 |         1 | Jan         |     9 | Thu       |     1 |         2 |         5 |            1 | Qtr 1     |
| 2014-01-10 00:00:00.000 |   2014 |         1 | Jan         |    10 | Fri       |     1 |         2 |         6 |            1 | Qtr 1     |
| 2014-01-11 00:00:00.000 |   2014 |         1 | Jan         |    11 | Sat       |     1 |         2 |         7 |            1 | Qtr 1     |


Table: Geography
| Country        | City       | Wikipedia                                |   GeoKey |
|:---------------|:-----------|:-----------------------------------------|---------:|
| Czech republic | Prague     | https://en.wikipedia.org/wiki/Prague     |        1 |
| Denmark        | Copenhagen | https://en.wikipedia.org/wiki/Copenhagen |        2 |
| Germany        | Frankfurt  | https://en.wikipedia.org/wiki/Frankfurt  |        3 |
| Germany        | Berlin     | https://en.wikipedia.org/wiki/Berlin     |        4 |
| Germany        | Dresden    | https://en.wikipedia.org/wiki/Dresden    |        5 |
| Czech republic | Brno       | https://en.wikipedia.org/wiki/Brno       |        6 |
| Czech republic | Ostrava    | https://en.wikipedia.org/wiki/Ostrava    |        7 |


Table: Product
|   ProductID |   Sub Category Key | Color           | ProductName   |   RetailPrice |   StandardCost |
|------------:|-------------------:|:----------------|:--------------|--------------:|---------------:|
|           1 |                  3 | Red             | Alder         |         23.95 |           7.55 |
|           2 |                  2 | Blue            | Linder        |         23.95 |           7.55 |
|           3 |                  2 | Green           | Magnum        |         23.95 |           7.55 |
|           4 |                  1 | Red             | Quad          |         43.95 |          13.75 |
|           5 |                  1 | Blue            | Black Monk    |         43.95 |          13.75 |
|           6 |                  4 | Green           | Quad          |         43.95 |          13.75 |
|           7 |                  1 | Red             | Bing          |         26.95 |           8.25 |
|           8 |                  3 | Blue            | VanHelen      |         26.95 |           8.25 |
|           9 |                  1 | Green           | Magnum        |         26.95 |           8.25 |
|          10 |                  1 | Florescent Pink | Carlota       |         29.95 |           9.15 |


Table: Sales Measures
| Sales Measures   |
|:-----------------|
|                  |


Table: Sales rep
|   SalesRepID | Sales Rep Name   |
|-------------:|:-----------------|
|            6 | Jan Novotny      |
|            7 | John White       |
|            5 | Ellen Woody      |
|            3 | Mark Spancer     |
|            1 | Ellie Gill       |
|            2 | Bill Muray       |
|            4 | El Bob           |


Table: Sales
|   SalesKey |   ProductID |   SalesRepID | Date                    |   Units |   PercentOfStandardCost |   RevenueDiscount |   GeoKey |   TotalRevenue |   TotalCost |   GrossProfit |
|-----------:|------------:|-------------:|:------------------------|--------:|------------------------:|------------------:|---------:|---------------:|------------:|--------------:|
|        149 |           9 |            7 | 2014-01-07 00:00:00.000 |     130 |                   0.942 |              0.55 |        3 |        3503.5  |     1072.5  |        2431   |
|        158 |           9 |            7 | 2014-01-07 00:00:00.000 |     104 |                   0.942 |              0.55 |        3 |        2802.8  |      858    |        1944.8 |
|        287 |           9 |            7 | 2014-01-10 00:00:00.000 |     125 |                   0.953 |              0.55 |        3 |        3368.75 |     1031.25 |        2337.5 |
|        293 |           9 |            7 | 2014-01-10 00:00:00.000 |     113 |                   0.953 |              0.55 |        3 |        3045.35 |      932.25 |        2113.1 |
|        390 |           9 |            7 | 2014-01-13 00:00:00.000 |     108 |                   0.955 |              0.55 |        3 |        2910.6  |      891    |        2019.6 |
|        438 |           9 |            7 | 2014-01-14 00:00:00.000 |     145 |                   0.95  |              0.55 |        3 |        3907.75 |     1196.25 |        2711.5 |
|        545 |           9 |            7 | 2014-01-16 00:00:00.000 |     133 |                   0.952 |              0.55 |        3 |        3584.35 |     1097.25 |        2487.1 |
|        551 |           9 |            7 | 2014-01-16 00:00:00.000 |     121 |                   0.952 |              0.55 |        3 |        3260.95 |      998.25 |        2262.7 |
|        692 |           9 |            7 | 2014-01-22 00:00:00.000 |     109 |                   0.957 |              0.55 |        3 |        2937.55 |      899.25 |        2038.3 |
|       1038 |           9 |            7 | 2014-02-01 00:00:00.000 |     105 |                   0.96  |              0.55 |        3 |        2829.75 |      866.25 |        1963.5 |


Table: SubCategory
|   SubCategoryKey |   CategoryKey | SubCategory Name   |
|-----------------:|--------------:|:-------------------|
|                1 |             1 | Extra              |
|                2 |             2 | Regular            |
|                3 |             1 | Micro              |
|                4 |             2 | Super              |

 


tables: name: Categories
data: Categories.csv
name: DimDate
data: DimDate.csv
name: Geography
data: Geography.csv
name: Product
data: Product.csv
name: Sales Measures
data: Sales Measures.csv
name: Sales rep
data: Sales rep.csv
name: Sales
data: Sales.csv
name: SubCategory
data: SubCategory.csv
label: Product
Sub Category Key
SubCategory
SubCategoryKey
Sales
GeoKey
Geography
GeoKey
Sales
SalesRepID
Sales rep
SalesRepID
SubCategory
CategoryKey
Categories
CategoryKey
Sales
ProductID
Product
ProductID
output: {
    "joins": [
        {
            "from_table": "Product",
            "from_column": "Sub Category Key",
            "to_table": "SubCategory",
            "to_column": "SubCategoryKey"
        },
        {
            "from_table": "Sales",
            "from_column": "GeoKey",
            "to_table": "Geography",
            "to_column": "GeoKey"
        },
        {
            "from_table": "Sales",
            "from_column": "SalesRepID",
            "to_table": "Sales rep",
            "to_column": "SalesRepID"
        },
        {
            "from_table": "SubCategory",
            "from_column": "CategoryKey",
            "to_table": "Categories",
            "to_column": "CategoryKey"
        },
        {
            "from_table": "Sales",
            "from_column": "ProductID",
            "to_table": "Product",
            "to_column": "ProductID"
        }
    ]
}