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: Customer Details
|   Customer Index | Customer Names     |
|-----------------:|:-------------------|
|                1 | Christy  Olson     |
|                2 | Dan  Peterson      |
|                3 | Mable  Lindsey     |
|                4 | Kyle  Carr         |
|                5 | Rachel  Gomez      |
|                6 | Isabel  Cross      |
|                7 | Billie  Chandler   |
|                8 | Sylvester  Morales |
|                9 | Rachel  Gomez      |
|               10 | Beth  Tucker       |


Table: Date
| Date                    |   Year |   QuarterOfYear |   MonthOfYear |   DayOfMonth |   DateInt | MonthName   | MonthInCalendar   | QuarterInCalendar   |   DayInWeek | DayOfWeekName   | WeekEnding              |   Week Number |   MonthnYear |   QuarternYear |   ShortYear | FY   |
|:------------------------|-------:|----------------:|--------------:|-------------:|----------:|:------------|:------------------|:--------------------|------------:|:----------------|:------------------------|--------------:|-------------:|---------------:|------------:|:-----|
| 2019-07-01 00:00:00.000 |   2019 |               3 |             7 |            1 |  20190701 | July        | Jul 2019          | Q3 2019             |           0 | Monday          | 2019-07-07 00:00:00.000 |            27 |     20190700 |       20190300 |          19 | FY20 |
| 2019-07-02 00:00:00.000 |   2019 |               3 |             7 |            2 |  20190702 | July        | Jul 2019          | Q3 2019             |           1 | Tuesday         | 2019-07-07 00:00:00.000 |            27 |     20190700 |       20190300 |          19 | FY20 |
| 2019-07-03 00:00:00.000 |   2019 |               3 |             7 |            3 |  20190703 | July        | Jul 2019          | Q3 2019             |           2 | Wednesday       | 2019-07-07 00:00:00.000 |            27 |     20190700 |       20190300 |          19 | FY20 |
| 2019-07-04 00:00:00.000 |   2019 |               3 |             7 |            4 |  20190704 | July        | Jul 2019          | Q3 2019             |           3 | Thursday        | 2019-07-07 00:00:00.000 |            27 |     20190700 |       20190300 |          19 | FY20 |
| 2019-07-05 00:00:00.000 |   2019 |               3 |             7 |            5 |  20190705 | July        | Jul 2019          | Q3 2019             |           4 | Friday          | 2019-07-07 00:00:00.000 |            27 |     20190700 |       20190300 |          19 | FY20 |
| 2019-07-06 00:00:00.000 |   2019 |               3 |             7 |            6 |  20190706 | July        | Jul 2019          | Q3 2019             |           5 | Saturday        | 2019-07-07 00:00:00.000 |            27 |     20190700 |       20190300 |          19 | FY20 |
| 2019-07-07 00:00:00.000 |   2019 |               3 |             7 |            7 |  20190707 | July        | Jul 2019          | Q3 2019             |           6 | Sunday          | 2019-07-07 00:00:00.000 |            27 |     20190700 |       20190300 |          19 | FY20 |
| 2019-07-08 00:00:00.000 |   2019 |               3 |             7 |            8 |  20190708 | July        | Jul 2019          | Q3 2019             |           0 | Monday          | 2019-07-14 00:00:00.000 |            28 |     20190700 |       20190300 |          19 | FY20 |
| 2019-07-09 00:00:00.000 |   2019 |               3 |             7 |            9 |  20190709 | July        | Jul 2019          | Q3 2019             |           1 | Tuesday         | 2019-07-14 00:00:00.000 |            28 |     20190700 |       20190300 |          19 | FY20 |
| 2019-07-10 00:00:00.000 |   2019 |               3 |             7 |           10 |  20190710 | July        | Jul 2019          | Q3 2019             |           2 | Wednesday       | 2019-07-14 00:00:00.000 |            28 |     20190700 |       20190300 |          19 | FY20 |


Table: Product Details
|   Product ID | Product Name          |
|-------------:|:----------------------|
|            1 | Adjustable Race       |
|            2 | Bearing Ball          |
|            3 | BB Ball Bearing       |
|            4 | Headset Ball Bearings |
|            5 | Blade                 |
|            6 | LL Crankarm           |
|            7 | ML Crankarm           |
|            8 | HL Crankarm           |
|            9 | Chainring Bolts       |
|           10 | Chainring Nut         |


Table: Region
|   Index | State      | City                  | Country   | Full Name                      |
|--------:|:-----------|:----------------------|:----------|:-------------------------------|
|       1 | Oregon     | LONDON                | UK        | LONDON, UK                     |
|       2 | California | BERLIN                | Germany   | BERLIN, Germany                |
|       3 | Wyoming    | MADRID                | Spain     | MADRID, Spain                  |
|       4 | California | ROMA                  | Italy     | ROMA, Italy                    |
|       5 | Wyoming    | KIEV                  | Ukraine   | KIEV, Ukraine                  |
|       6 | California | PARIS                 | France    | PARIS, France                  |
|       7 | Nevada     | BUCURESTI (Bucharest) | Romania   | BUCURESTI (Bucharest), Romania |
|       8 | Wyoming    | BUDAPEST              | Hungary   | BUDAPEST, Hungary              |
|       9 | California | Hamburg               | Germany   | Hamburg, Germany               |
|      10 | California | MINSK                 | Belarus   | MINSK, Belarus                 |


Table: Sales Details
|   OrderNumber | OrderDate               |   Customer Name Index | Channel    | Currency Code   | Code     |   Region ID |   Product ID |   Quantity |   Unit Price |   Line Total |   Total Unit Cost |
|--------------:|:------------------------|----------------------:|:-----------|:----------------|:---------|------------:|-------------:|-----------:|-------------:|-------------:|------------------:|
|         11004 | 2019-01-01 00:00:00.000 |                     8 | Industries | Euro            | INX005RT |          49 |           26 |          6 |        978.2 |       5869.2 |           684.74  |
|         11011 | 2019-01-02 00:00:00.000 |                   111 | Industries | Euro            | INX005RT |          33 |           26 |         12 |       3872.6 |      46471.2 |          2517.19  |
|         11088 | 2019-01-08 00:00:00.000 |                    93 | Industries | Euro            | INX005RT |          48 |           26 |          6 |       1105.5 |       6633   |           851.235 |
|         11102 | 2019-01-09 00:00:00.000 |                    15 | Industries | Euro            | INX005RT |          39 |           26 |          9 |       1072   |       9648   |           600.32  |
|         11117 | 2019-01-11 00:00:00.000 |                   100 | Industries | Euro            | INX005RT |          45 |           26 |          7 |       2345   |      16415   |          1219.4   |
|         11126 | 2019-01-12 00:00:00.000 |                    88 | Industries | Euro            | INX005RT |          43 |           26 |         10 |        201   |       2010   |           160.8   |
|         11192 | 2019-01-16 00:00:00.000 |                    13 | Industries | Euro            | INX005RT |          51 |           26 |          8 |       1862.6 |      14900.8 |           949.926 |
|         11206 | 2019-01-18 00:00:00.000 |                    91 | Industries | Euro            | INX005RT |          46 |           26 |          7 |        737   |       5159   |           626.45  |
|         11209 | 2019-01-18 00:00:00.000 |                    59 | Industries | Euro            | INX005RT |           2 |           26 |          8 |       2512.5 |      20100   |          1331.62  |
|         11241 | 2019-01-21 00:00:00.000 |                     4 | Industries | Euro            | INX005RT |          60 |           26 |         10 |        857.6 |       8576   |           497.408 |


Table: Sales Germany
|   OrderNumber | OrderDate               |   Customer Name Index | Channel    | Currency Code   | Code     |   Region ID |   Product ID |   Quantity |   Unit Price |   Line Total |   Total Unit Cost | Country   |
|--------------:|:------------------------|----------------------:|:-----------|:----------------|:---------|------------:|-------------:|-----------:|-------------:|-------------:|------------------:|:----------|
|         11663 | 2019-02-24 00:00:00.000 |                   156 | Industries | Euro            | INX005RT |          25 |           26 |         11 |       1862.6 |      20488.6 |           745.04  | Germany   |
|         11669 | 2019-02-25 00:00:00.000 |                    59 | Industries | Euro            | INX005RT |          63 |           26 |         11 |       1212.7 |      13339.7 |           715.493 | Germany   |
|         12747 | 2019-05-27 00:00:00.000 |                   125 | Industries | Euro            | INX005RT |          49 |           26 |         11 |       3162.4 |      34786.4 |          1676.07  | Germany   |
|         13214 | 2019-07-05 00:00:00.000 |                    94 | Industries | Euro            | INX005RT |          52 |           26 |         11 |       1051.9 |      11570.9 |           725.811 | Germany   |
|         15766 | 2019-01-26 00:00:00.000 |                   113 | Industries | Euro            | INX005RT |          45 |           26 |         11 |       1943   |      21373   |          1573.83  | Germany   |
|         20761 | 2020-03-20 00:00:00.000 |                   109 | Industries | Euro            | INX005RT |           2 |           26 |         11 |       6023.3 |      66256.3 |          3734.45  | Germany   |
|         11027 | 2019-01-03 00:00:00.000 |                    88 | Industries | Euro            | INX005RT |          62 |           25 |         11 |       1038.5 |      11423.5 |           633.485 | Germany   |
|         11197 | 2019-01-17 00:00:00.000 |                    60 | Industries | Euro            | INX005RT |          63 |           25 |         11 |       6358.3 |      69941.3 |          3942.15  | Germany   |
|         11274 | 2019-01-25 00:00:00.000 |                    39 | Industries | Euro            | INX005RT |          51 |           25 |         11 |        174.2 |       1916.2 |           127.166 | Germany   |
|         12608 | 2019-05-16 00:00:00.000 |                   173 | Industries | Euro            | INX005RT |          49 |           25 |         11 |       1031.8 |      11349.8 |           629.398 | Germany   |


Table: T_Date
| Date                    |
|:------------------------|
| 2018-01-01 00:00:00.000 |
| 2018-01-02 00:00:00.000 |
| 2018-01-03 00:00:00.000 |
| 2018-01-04 00:00:00.000 |
| 2018-01-05 00:00:00.000 |
| 2018-01-06 00:00:00.000 |
| 2018-01-07 00:00:00.000 |
| 2018-01-08 00:00:00.000 |
| 2018-01-09 00:00:00.000 |
| 2018-01-10 00:00:00.000 |

 


tables: name: Customer Details
data: Customer Details.csv
name: Date
data: Date.csv
name: Product Details
data: Product Details.csv
name: Region
data: Region.csv
name: Sales Details
data: Sales Details.csv
name: Sales Germany
data: Sales Germany.csv
name: T_Date
data: T_Date.csv
label: Sales Details
Customer Name Index
Customer Details
Customer Index
Sales Details
Product ID
Product Details
Product ID
Sales Details
Region ID
Region
Index
Sales Details
OrderDate
Date
Date
output: {
    "joins": [
        {
            "from_table": "Sales Details",
            "from_column": "Customer Name Index",
            "to_table": "Customer Details",
            "to_column": "Customer Index"
        },
        {
            "from_table": "Sales Details",
            "from_column": "Product ID",
            "to_table": "Product Details",
            "to_column": "Product ID"
        },
        {
            "from_table": "Sales Details",
            "from_column": "Region ID",
            "to_table": "Region",
            "to_column": "Index"
        },
        {
            "from_table": "Sales Details",
            "from_column": "OrderDate",
            "to_table": "Date",
            "to_column": "Date"
        }
    ]
}