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: DimCustomer
|   Customer Key |   WWI Customer ID | Customer                           | Bill To Customer            | Category     | Buying Group   | Primary Contact    |   Postal Code |  Credit Limit    |   Lineage Key |
|---------------:|------------------:|:-----------------------------------|:----------------------------|:-------------|:---------------|:-------------------|--------------:|:-----------------|--------------:|
|              1 |                 1 | Tailspin Toys (Head Office)        | Tailspin Toys (Head Office) | Novelty Shop | Tailspin Toys  | Waldemar Fisar     |         90410 | ? 100,000.000000 |             2 |
|              2 |                 2 | Tailspin Toys (Sylvanite, MT)      | Tailspin Toys (Head Office) | Novelty Shop | Tailspin Toys  | Lorena Cindric     |         90216 | ? 100,000.000000 |             2 |
|              3 |                 3 | Tailspin Toys (Peeples Valley, AZ) | Tailspin Toys (Head Office) | Novelty Shop | Tailspin Toys  | Bhaargav Rambhatla |         90205 | ? 100,000.000000 |             2 |
|              4 |                 4 | Tailspin Toys (Medicine Lodge, KS) | Tailspin Toys (Head Office) | Novelty Shop | Tailspin Toys  | Daniel Roman       |         90152 | ? 100,000.000000 |             2 |
|              5 |                 5 | Tailspin Toys (Gasport, NY)        | Tailspin Toys (Head Office) | Novelty Shop | Tailspin Toys  | Johanna Huiting    |         90261 | ? 100,000.000000 |             2 |
|              7 |                 7 | Tailspin Toys (Frankewing, TN)     | Tailspin Toys (Head Office) | Novelty Shop | Tailspin Toys  | Kalidas Nadar      |         90761 | ? 100,000.000000 |             2 |
|              8 |                 8 | Tailspin Toys (Bow Mar, CO)        | Tailspin Toys (Head Office) | Novelty Shop | Tailspin Toys  | Kanti Kotadia      |         90484 | ? 100,000.000000 |             2 |
|              9 |                 9 | Tailspin Toys (Netcong, NJ)        | Tailspin Toys (Head Office) | Novelty Shop | Tailspin Toys  | Sointu Aalto       |         90129 | ? 100,000.000000 |             2 |
|             10 |                10 | Tailspin Toys (Wimbledon, ND)      | Tailspin Toys (Head Office) | Novelty Shop | Tailspin Toys  | Siddhartha Parkar  |         90061 | ? 100,000.000000 |             2 |
|             11 |                11 | Tailspin Toys (Devault, PA)        | Tailspin Toys (Head Office) | Novelty Shop | Tailspin Toys  | Elnaz Javan        |         90185 | ? 100,000.000000 |             2 |


Table: DimDate
| Date                    |   Day Number |   Day | Month   | Short Month   |   Calendar Month Number | Calendar Month Label   |   Calendar Year | Calendar Year Label   |   Fiscal Month Number | Fiscal Month Label   |   Fiscal Year | Fiscal Year Label   |   ISO Week Number |
|:------------------------|-------------:|------:|:--------|:--------------|------------------------:|:-----------------------|----------------:|:----------------------|----------------------:|:---------------------|--------------:|:--------------------|------------------:|
| 2016-01-01 00:00:00.000 |            1 |     1 | January | Jan           |                       1 | CY2016-Jan             |            2016 | CY2016                |                     3 | FY2016-Jan           |          2016 | FY2016              |                53 |
| 2016-01-02 00:00:00.000 |            2 |     2 | January | Jan           |                       1 | CY2016-Jan             |            2016 | CY2016                |                     3 | FY2016-Jan           |          2016 | FY2016              |                53 |
| 2016-01-03 00:00:00.000 |            3 |     3 | January | Jan           |                       1 | CY2016-Jan             |            2016 | CY2016                |                     3 | FY2016-Jan           |          2016 | FY2016              |                53 |
| 2016-01-04 00:00:00.000 |            4 |     4 | January | Jan           |                       1 | CY2016-Jan             |            2016 | CY2016                |                     3 | FY2016-Jan           |          2016 | FY2016              |                 1 |
| 2016-01-05 00:00:00.000 |            5 |     5 | January | Jan           |                       1 | CY2016-Jan             |            2016 | CY2016                |                     3 | FY2016-Jan           |          2016 | FY2016              |                 1 |
| 2016-01-06 00:00:00.000 |            6 |     6 | January | Jan           |                       1 | CY2016-Jan             |            2016 | CY2016                |                     3 | FY2016-Jan           |          2016 | FY2016              |                 1 |
| 2016-01-07 00:00:00.000 |            7 |     7 | January | Jan           |                       1 | CY2016-Jan             |            2016 | CY2016                |                     3 | FY2016-Jan           |          2016 | FY2016              |                 1 |
| 2016-01-08 00:00:00.000 |            8 |     8 | January | Jan           |                       1 | CY2016-Jan             |            2016 | CY2016                |                     3 | FY2016-Jan           |          2016 | FY2016              |                 1 |
| 2016-01-09 00:00:00.000 |            9 |     9 | January | Jan           |                       1 | CY2016-Jan             |            2016 | CY2016                |                     3 | FY2016-Jan           |          2016 | FY2016              |                 1 |
| 2016-01-10 00:00:00.000 |           10 |    10 | January | Jan           |                       1 | CY2016-Jan             |            2016 | CY2016                |                     3 | FY2016-Jan           |          2016 | FY2016              |                 1 |


Table: DimEmployee
|   Employee Key |   WWI Employee ID | Employee           | Preferred Name   |   Is Salesperson | Photo   | Valid From              | Valid To             |   Lineage Key |
|---------------:|------------------:|:-------------------|:-----------------|-----------------:|:--------|:------------------------|:---------------------|--------------:|
|              1 |                14 | Lily Code          | Lily             |                1 | NULL    | 2013-01-01 00:00:00.000 | 1/1/2013 8:00:00 AM  |             3 |
|              2 |                 4 | Isabella Rupp      | Isabella         |                0 | NULL    | 2013-01-01 00:00:00.000 | 1/1/2013 8:00:00 AM  |             3 |
|              3 |                11 | Ethan Onslow       | Ethan            |                0 | NULL    | 2013-01-01 00:00:00.000 | 1/4/2013 8:00:00 AM  |             3 |
|              4 |                 7 | Amy Trefl          | Amy              |                1 | NULL    | 2013-01-01 00:00:00.000 | 1/5/2013 8:00:00 AM  |             3 |
|              5 |                19 | Jai Shand          | Jai              |                0 | NULL    | 2013-01-01 00:00:00.000 | 1/6/2013 8:00:00 AM  |             3 |
|              6 |                 8 | Anthony Grosse     | Anthony          |                1 | NULL    | 2013-01-01 00:00:00.000 | 1/9/2013 8:00:00 AM  |             3 |
|              7 |                15 | Taj Shand          | Taj              |                1 | NULL    | 2013-01-01 00:00:00.000 | 1/11/2013 8:00:00 AM |             3 |
|              8 |                13 | Hudson Hollinworth | Hudson           |                1 | NULL    | 2013-01-01 00:00:00.000 | 1/11/2013 8:00:00 AM |             3 |
|              9 |                20 | Jack Potter        | Jack             |                1 | NULL    | 2013-01-01 00:00:00.000 | 1/14/2013 8:00:00 AM |             3 |
|             10 |                17 | Piper Koch         | Piper            |                0 | NULL    | 2013-01-01 00:00:00.000 | 1/19/2013 8:00:00 AM |             3 |


Table: FactSale
|   Sale Key |   City Key |   Customer Key |   Bill To Customer Key |   Stock Item Key | Invoice Date Key        | Delivery Date Key       |   Salesperson Key |   WWI Invoice ID | Description                                                                           | Package   |   Quantity |   Unit Price |   Tax Rate |   Total Excluding Tax |   Tax Amount |   Profit |   Total Including Tax |   Total Dry Items |   Total Chiller Items |   Lineage Key |
|-----------:|-----------:|---------------:|-----------------------:|-----------------:|:------------------------|:------------------------|------------------:|-----------------:|:--------------------------------------------------------------------------------------|:----------|-----------:|-------------:|-----------:|----------------------:|-------------:|---------:|----------------------:|------------------:|----------------------:|--------------:|
|      49374 |      69332 |              0 |                      0 |              186 | 2013-10-22 00:00:00.000 | 2013-10-23 00:00:00.000 |                19 |            15219 | Developer joke mug - fun was unexpected at this time (White)                          | Each      |          1 |           13 |         15 |                    13 |         1.95 |      8.5 |                 14.95 |                 1 |                     0 |            11 |
|      56882 |      56111 |              0 |                      0 |              198 | 2013-12-05 00:00:00.000 | 2013-12-06 00:00:00.000 |                19 |            17512 | DBA joke mug - it depends (White)                                                     | Each      |          1 |           13 |         15 |                    13 |         1.95 |      8.5 |                 14.95 |                 1 |                     0 |            11 |
|      57068 |      82826 |              0 |                      0 |              167 | 2013-12-06 00:00:00.000 | 2013-12-07 00:00:00.000 |                19 |            17572 | IT joke mug - keyboard not found … press F1 to continue (Black)                       | Each      |          1 |           13 |         15 |                    13 |         1.95 |      8.5 |                 14.95 |                 1 |                     0 |            11 |
|      57429 |      42598 |              0 |                      0 |              172 | 2013-12-09 00:00:00.000 | 2013-12-10 00:00:00.000 |                19 |            17684 | Developer joke mug - this code was generated by a tool (White)                        | Each      |          1 |           13 |         15 |                    13 |         1.95 |      8.5 |                 14.95 |                 1 |                     0 |            11 |
|      57669 |      84888 |              0 |                      0 |              173 | 2013-12-10 00:00:00.000 | 2013-12-11 00:00:00.000 |                19 |            17757 | Developer joke mug - a foo walks into a bar (Black)                                   | Each      |          1 |           13 |         15 |                    13 |         1.95 |      8.5 |                 14.95 |                 1 |                     0 |            11 |
|      58705 |      42573 |              0 |                      0 |              201 | 2013-12-18 00:00:00.000 | 2013-12-19 00:00:00.000 |                19 |            18085 | DBA joke mug - daaaaaa-ta (Black)                                                     | Each      |          1 |           13 |         15 |                    13 |         1.95 |      8.5 |                 14.95 |                 1 |                     0 |            11 |
|      59359 |      43854 |              0 |                      0 |              165 | 2013-12-23 00:00:00.000 | 2013-12-24 00:00:00.000 |                19 |            18288 | IT joke mug - that behavior is by design (Black)                                      | Each      |          1 |           13 |         15 |                    13 |         1.95 |      8.5 |                 14.95 |                 1 |                     0 |            11 |
|       1022 |      50625 |              0 |                      0 |              178 | 2013-01-07 00:00:00.000 | 2013-01-08 00:00:00.000 |                19 |              394 | Developer joke mug - understanding recursion requires understanding recursion (White) | Each      |          1 |           13 |         15 |                    13 |         1.95 |      8.5 |                 14.95 |                 1 |                     0 |            11 |
|       2974 |      43529 |              0 |                      0 |              177 | 2013-01-18 00:00:00.000 | 2013-01-19 00:00:00.000 |                19 |              971 | Developer joke mug - understanding recursion requires understanding recursion (Black) | Each      |          1 |           13 |         15 |                    13 |         1.95 |      8.5 |                 14.95 |                 1 |                     0 |            11 |
|       3661 |      49849 |              0 |                      0 |              177 | 2013-01-23 00:00:00.000 | 2013-01-24 00:00:00.000 |                19 |             1178 | Developer joke mug - understanding recursion requires understanding recursion (Black) | Each      |          1 |           13 |         15 |                    13 |         1.95 |      8.5 |                 14.95 |                 1 |                     0 |            11 |

 


tables: name: DimCustomer
data: DimCustomer.csv
name: DimDate
data: DimDate.csv
name: DimEmployee
data: DimEmployee.csv
name: FactSale
data: FactSale.csv
label: FactSale
Invoice Date Key
DimDate
Date
FactSale
Salesperson Key
DimEmployee
Employee Key
FactSale
Customer Key
DimCustomer
Customer Key
output: {
    "joins": [
        {
            "from_table": "FactSale",
            "from_column": "Invoice Date Key",
            "to_table": "DimDate",
            "to_column": "Date"
        },
        {
            "from_table": "FactSale",
            "from_column": "Salesperson Key",
            "to_table": "DimEmployee",
            "to_column": "Employee Key"
        },
        {
            "from_table": "FactSale",
            "from_column": "Customer Key",
            "to_table": "DimCustomer",
            "to_column": "Customer Key"
        }
    ]
}