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: d_City
|   CityID | City        |
|---------:|:------------|
|        1 | Boulder     |
|        2 | Des Moines  |
|        3 | Provo       |
|        4 | Fontana     |
|        5 | Gainesville |
|        6 | Garland     |
|        7 | Rockford    |
|        8 | Naperville  |
|        9 | Minneapolis |
|       10 | Elk Grove   |


Table: d_Customer
|   CustomerID | Customer      | ServiceChannel   |   CityID |
|-------------:|:--------------|:-----------------|---------:|
|        50174 | Customer 1812 | GROCERY STORE    |       52 |
|        51678 | Customer 2792 | GROCERY STORE    |       52 |
|        52042 | Customer 4813 | GROCERY STORE    |       52 |
|        52360 | Customer 352  | GROCERY STORE    |       52 |
|        52435 | Customer 2212 | GROCERY STORE    |       52 |
|        53185 | Customer 1833 | GROCERY STORE    |       52 |
|        54971 | Customer 5301 | GROCERY STORE    |       52 |
|        57543 | Customer 8295 | GROCERY STORE    |       52 |
|        58663 | Customer 911  | GROCERY STORE    |       52 |
|        59794 | Customer 536  | GROCERY STORE    |       52 |


Table: d_date
| Date                    | Month   | MonthName   | Quarter   |   Year |
|:------------------------|:--------|:------------|:----------|-------:|
| 2019-01-01 00:00:00.000 | January | Jan         | QTR 1     |   2019 |
| 2019-01-02 00:00:00.000 | January | Jan         | QTR 1     |   2019 |
| 2019-01-03 00:00:00.000 | January | Jan         | QTR 1     |   2019 |
| 2019-01-04 00:00:00.000 | January | Jan         | QTR 1     |   2019 |
| 2019-01-05 00:00:00.000 | January | Jan         | QTR 1     |   2019 |
| 2019-01-06 00:00:00.000 | January | Jan         | QTR 1     |   2019 |
| 2019-01-07 00:00:00.000 | January | Jan         | QTR 1     |   2019 |
| 2019-01-08 00:00:00.000 | January | Jan         | QTR 1     |   2019 |
| 2019-01-09 00:00:00.000 | January | Jan         | QTR 1     |   2019 |
| 2019-01-10 00:00:00.000 | January | Jan         | QTR 1     |   2019 |


Table: d_Salesperson
|   SalespersonID | Salesperson   | Team          |
|----------------:|:--------------|:--------------|
|            3405 | ITP           | COAST         |
|            3630 | GSP           | COAST         |
|            3875 | ITP-CEN       | VALLEY        |
|            3523 | BCA-CMB       | COAST         |
|            3846 | ICR           | SOUTH         |
|            3522 | ITJ-CTR       | COAST         |
|            3491 | TLV-7         | TELESALES     |
|            3911 | JLE-CON       | NORTH         |
|            3876 | BCN           | SOUTH         |
|             224 | KA-CRC        | SOUTH MC / KA |


Table: f_Orders
| OrderDate               |   OrderID | ScheduledDeliveryDate   | e-BL_IssuedDate         | ActualDeliveryDate      |   SalespersonID |   CustomerID |   Returns | LateDelivery   |
|:------------------------|----------:|:------------------------|:------------------------|:------------------------|----------------:|-------------:|----------:|:---------------|
| 2020-08-07 00:00:00.000 |   5763782 | 2020-08-10 00:00:00.000 | 2020-08-07 00:00:00.000 | 2020-08-08 00:00:00.000 |             201 |       167104 |         0 | No             |
| 2020-08-06 00:00:00.000 |   5762983 | 2020-08-09 00:00:00.000 | 2020-08-06 00:00:00.000 | 2020-08-07 00:00:00.000 |             201 |       167104 |         0 | No             |
| 2020-08-03 00:00:00.000 |   5760040 | 2020-08-06 00:00:00.000 | 2020-08-03 00:00:00.000 | 2020-08-04 00:00:00.000 |             201 |       167104 |         0 | No             |
| 2020-07-24 00:00:00.000 |   5754858 | 2020-07-27 00:00:00.000 | 2020-07-24 00:00:00.000 | 2020-07-25 00:00:00.000 |             201 |       167104 |         0 | No             |
| 2020-07-20 00:00:00.000 |   5751107 | 2020-07-23 00:00:00.000 | 2020-07-20 00:00:00.000 | 2020-07-21 00:00:00.000 |             201 |       167104 |         0 | No             |
| 2020-07-15 00:00:00.000 |   5748616 | 2020-07-18 00:00:00.000 | 2020-07-15 00:00:00.000 | 2020-07-16 00:00:00.000 |             201 |       167104 |         0 | No             |
| 2020-07-07 00:00:00.000 |   5743684 | 2020-07-10 00:00:00.000 | 2020-07-08 00:00:00.000 | 2020-07-09 00:00:00.000 |             201 |       167104 |         0 | No             |
| 2020-07-03 00:00:00.000 |   5742382 | 2020-07-06 00:00:00.000 | 2020-07-06 00:00:00.000 | 2020-07-07 00:00:00.000 |             201 |       167104 |         0 | Yes            |
| 2020-07-03 00:00:00.000 |   5742383 | 2020-07-06 00:00:00.000 | 2020-07-06 00:00:00.000 | 2020-07-07 00:00:00.000 |             201 |       167104 |         0 | Yes            |
| 2020-06-29 00:00:00.000 |   5739394 | 2020-07-02 00:00:00.000 | 2020-06-29 00:00:00.000 | 2020-06-30 00:00:00.000 |             201 |       167104 |         0 | No             |

 


tables: name: d_City
data: d_City.csv
name: d_Customer
data: d_Customer.csv
name: d_date
data: d_date.csv
name: d_Salesperson
data: d_Salesperson.csv
name: f_Orders
data: f_Orders.csv
label: d_Customer
CityID
d_City
CityID
f_Orders
CustomerID
d_Customer
CustomerID
f_Orders
SalespersonID
d_Salesperson
SalespersonID
output: {
    "joins": [
        {
            "from_table": "d_Customer",
            "from_column": "CityID",
            "to_table": "d_City",
            "to_column": "CityID"
        },
        {
            "from_table": "f_Orders",
            "from_column": "CustomerID",
            "to_table": "d_Customer",
            "to_column": "CustomerID"
        },
        {
            "from_table": "f_Orders",
            "from_column": "SalespersonID",
            "to_table": "d_Salesperson",
            "to_column": "SalespersonID"
        }
    ]
}