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: Date table
| 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 |


Table: Defect Result
|   Defect Result ID | Defect Result   |
|-------------------:|:----------------|
|                  1 | No Impact       |
|                  2 | Impact          |
|                  3 | Rejected        |


Table: Defect Type
|   Defect Type ID | Defect Type                                    |
|-----------------:|:-----------------------------------------------|
|                1 | Dimensions - Bad Finishing                     |
|                2 | Bad Seams                                      |
|                5 | Gap Variation                                  |
|                6 | False scores                                   |
|                7 | Weak Walls                                     |
|                8 | Overlapping Seam                               |
|                9 | Material Handling/ Shipping Requirements Error |
|               10 | Corrugate Falling Apart                        |
|               11 | Warping                                        |
|               12 | Delamination                                   |


Table: Key Calculations
| Column   |
|----------|


Table: Key Measures
|   ID | Measure          |
|-----:|:-----------------|
|    1 | Defects Quantity |
|    2 | Downtime minutes |


Table: Material Type
|   Material Type ID | Material Type   |
|-------------------:|:----------------|
|                  1 | Corrugate       |
|                  2 | Film            |
|                  3 | Carton          |
|                  4 | Batteries       |
|                  5 | Composites      |
|                  6 | Controllers     |
|                  7 | Drives          |
|                  8 | Electrolytes    |
|                  9 | Raw Materials   |
|                 10 | Labels          |


Table: Plant
|   Plant ID | Plant         |
|-----------:|:--------------|
|          1 | Westside      |
|          2 | Frazer        |
|          3 | Jordan Valley |
|          4 | Barling       |
|          5 | Charles City  |
|          6 | De Ruyter     |
|          7 | Chatham       |
|          8 | Waldoboro     |
|          9 | Riverside     |
|         10 | Cottonwood    |


Table: Product Category
|   Product Category ID | Category               |
|----------------------:|:-----------------------|
|                     1 | Electrical             |
|                     6 | Goods & Services       |
|                     2 | Logistics              |
|                     3 | Materials & Components |
|                     4 | Mechanicals            |
|                     5 | Packaging              |


Table: Supplier Quality
| Date                    | Vendor     | Plant Location   | Product Category   | Material Type   | Defect Result   | Defect Type   |   Total Defect Qty |   Total Downtime Minutes | Plant(suppqlty)   |
|:------------------------|:-----------|:-----------------|:-------------------|:----------------|:----------------|:--------------|-------------------:|-------------------------:|:------------------|
| 2019-11-26 00:00:00.000 | Topiczoom  | Frazer           | Mechanicals        | Raw Materials   | No Impact       | Not Certified |             760509 |                     4749 |                   |
| 2019-08-05 00:00:00.000 | Devshare   | Chesaning        | Mechanicals        | Raw Materials   | No Impact       | Not Certified |             788715 |                      635 |                   |
| 2019-11-26 00:00:00.000 | Babbleopia | De Ruyter        | Mechanicals        | Raw Materials   | No Impact       | Not Certified |             731302 |                      496 |                   |
| 2019-10-15 00:00:00.000 | Agimba     | Frazer           | Mechanicals        | Raw Materials   | No Impact       | Not Certified |             846293 |                      686 |                   |
| 2019-11-25 00:00:00.000 | Gabvine    | Chesaning        | Mechanicals        | Raw Materials   | No Impact       | Not Certified |             121868 |                     4399 |                   |
| 2019-10-19 00:00:00.000 | Topiczoom  | Chatham          | Mechanicals        | Raw Materials   | No Impact       | Not Certified |             373208 |                     3085 |                   |
| 2019-09-18 00:00:00.000 | Jayo       | Westside         | Mechanicals        | Raw Materials   | No Impact       | Not Certified |             884120 |                     2977 |                   |
| 2019-09-02 00:00:00.000 | Vinder     | Twin Rocks       | Mechanicals        | Raw Materials   | No Impact       | Not Certified |             680860 |                     4962 |                   |
| 2019-10-16 00:00:00.000 | Latz       | Henning          | Mechanicals        | Raw Materials   | No Impact       | Not Certified |             404295 |                      890 |                   |
| 2019-10-15 00:00:00.000 | Realbridge | Frazer           | Mechanicals        | Raw Materials   | No Impact       | Not Certified |             338663 |                     3383 |                   |


Table: Time Period
|   ID | Time Period   |
|-----:|:--------------|
|    1 | Current Month |
|    2 | Last Quarter  |
|    3 | Last 6 Months |
|    4 | Current Year  |
|    5 | Last 90 Days  |

 


tables: name: Date table
data: Date table.csv
name: Defect Result
data: Defect Result.csv
name: Defect Type
data: Defect Type.csv
name: Key Calculations
data: Key Calculations.csv
name: Key Measures
data: Key Measures.csv
name: Material Type
data: Material Type.csv
name: Plant
data: Plant.csv
name: Product Category
data: Product Category.csv
name: Supplier Quality
data: Supplier Quality.csv
name: Time Period
data: Time Period.csv
label: Supplier Quality
Product Category
Product Category
Category
Supplier Quality
Defect Result
Defect Result
Defect Result
Supplier Quality
Material Type
Material Type
Material Type
Supplier Quality
Defect Type
Defect Type
Defect Type
Supplier Quality
Plant Location
Plant
Plant
Key Measures
ID
Time Period
ID
output: {
    "joins": [
        {
            "from_table": "Supplier Quality",
            "from_column": "Product Category",
            "to_table": "Product Category",
            "to_column": "Category"
        },
        {
            "from_table": "Supplier Quality",
            "from_column": "Defect Result",
            "to_table": "Defect Result",
            "to_column": "Defect Result"
        },
        {
            "from_table": "Supplier Quality",
            "from_column": "Material Type",
            "to_table": "Material Type",
            "to_column": "Material Type"
        },
        {
            "from_table": "Supplier Quality",
            "from_column": "Defect Type",
            "to_table": "Defect Type",
            "to_column": "Defect Type"
        },
        {
            "from_table": "Supplier Quality",
            "from_column": "Plant Location",
            "to_table": "Plant",
            "to_column": "Plant"
        },
        {
            "from_table": "Key Measures",
            "from_column": "ID",
            "to_table": "Time Period",
            "to_column": "ID"
        }
    ]
}