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: Category
|   Category ID | Category               |
|--------------:|:-----------------------|
|             1 | Electrical             |
|             6 | Goods & Services       |
|             2 | Logistics              |
|             3 | Materials & Components |
|             4 | Mechanicals            |
|             5 | Packaging              |


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


Table: Defect
|   Def_ID | Defect                                         |
|---------:|:-----------------------------------------------|
|        1 | Dimensions - Bad Finishing                     |
|        2 | Bad Seams                                      |
|        3 | Bad Seams                                      |
|        4 | Bad Seams                                      |
|        5 | Gap Variation                                  |
|        6 | False scores                                   |
|        7 | Weak Walls                                     |
|        8 | Overlapping Seam                               |
|        9 | Material Handling/ Shipping Requirements Error |
|       10 | Corrugate Falling Apart                        |


Table: MaterialType
|   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: Parameter
|   Parameter |
|------------:|
|           0 |
|           1 |
|           2 |
|           3 |
|           4 |
|           5 |
|           6 |
|           7 |
|           8 |
|           9 |


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: SupplierQuality
| Date                    | Vendor     | Plant Location   | Category    | Material Type   | Defect Type   |   Def_Id | Defect        |   Total Defect Qty |   Total Downtime Minutes |   Def_ID_NI |   Def_ID_IM |   Def_ID_Rej |   Cat_Id_Log |   Cat_Id_Comp |   Cat_Id_Mec |   Cat_Id_Pac |   Cat_Id_Gs |
|:------------------------|:-----------|:-----------------|:------------|:----------------|:--------------|---------:|:--------------|-------------------:|-------------------------:|------------:|------------:|-------------:|-------------:|--------------:|-------------:|-------------:|------------:|
| 2019-11-26 00:00:00.000 | Topiczoom  | Frazer           | Mechanicals | Raw Materials   | No Impact     |        1 | Not Certified |             760509 |                     4749 |           1 |           0 |            0 |            0 |             0 |            1 |            0 |           0 |
| 2019-08-05 00:00:00.000 | Devshare   | Chesaning        | Mechanicals | Raw Materials   | No Impact     |        1 | Not Certified |             788715 |                      635 |           1 |           0 |            0 |            0 |             0 |            1 |            0 |           0 |
| 2019-11-26 00:00:00.000 | Babbleopia | De Ruyter        | Mechanicals | Raw Materials   | No Impact     |        1 | Not Certified |             731302 |                      496 |           1 |           0 |            0 |            0 |             0 |            1 |            0 |           0 |
| 2019-10-15 00:00:00.000 | Agimba     | Frazer           | Mechanicals | Raw Materials   | No Impact     |        1 | Not Certified |             846293 |                      686 |           1 |           0 |            0 |            0 |             0 |            1 |            0 |           0 |
| 2019-11-25 00:00:00.000 | Gabvine    | Chesaning        | Mechanicals | Raw Materials   | No Impact     |        1 | Not Certified |             121868 |                     4399 |           1 |           0 |            0 |            0 |             0 |            1 |            0 |           0 |
| 2019-10-19 00:00:00.000 | Topiczoom  | Chatham          | Mechanicals | Raw Materials   | No Impact     |        1 | Not Certified |             373208 |                     3085 |           1 |           0 |            0 |            0 |             0 |            1 |            0 |           0 |
| 2019-09-18 00:00:00.000 | Jayo       | Westside         | Mechanicals | Raw Materials   | No Impact     |        1 | Not Certified |             884120 |                     2977 |           1 |           0 |            0 |            0 |             0 |            1 |            0 |           0 |
| 2019-09-02 00:00:00.000 | Vinder     | Twin Rocks       | Mechanicals | Raw Materials   | No Impact     |        1 | Not Certified |             680860 |                     4962 |           1 |           0 |            0 |            0 |             0 |            1 |            0 |           0 |
| 2019-10-16 00:00:00.000 | Latz       | Henning          | Mechanicals | Raw Materials   | No Impact     |        1 | Not Certified |             404295 |                      890 |           1 |           0 |            0 |            0 |             0 |            1 |            0 |           0 |
| 2019-10-15 00:00:00.000 | Realbridge | Frazer           | Mechanicals | Raw Materials   | No Impact     |        1 | Not Certified |             338663 |                     3383 |           1 |           0 |            0 |            0 |             0 |            1 |            0 |           0 |

 


tables: name: Category
data: Category.csv
name: Defect Type
data: Defect Type.csv
name: Defect
data: Defect.csv
name: MaterialType
data: MaterialType.csv
name: Parameter
data: Parameter.csv
name: Plant
data: Plant.csv
name: SupplierQuality
data: SupplierQuality.csv
label: SupplierQuality
Plant Location
Plant
Plant
SupplierQuality
Material Type
MaterialType
Material Type ID
SupplierQuality
Defect
Defect
Def_ID
SupplierQuality
Defect Type
Defect Type
Defect Type ID
SupplierQuality
Category
Category
Category ID
output: {
    "joins": [
        {
            "from_table": "SupplierQuality",
            "from_column": "Plant Location",
            "to_table": "Plant",
            "to_column": "Plant"
        },
        {
            "from_table": "SupplierQuality",
            "from_column": "Material Type",
            "to_table": "MaterialType",
            "to_column": "Material Type ID"
        },
        {
            "from_table": "SupplierQuality",
            "from_column": "Defect",
            "to_table": "Defect",
            "to_column": "Def_ID"
        },
        {
            "from_table": "SupplierQuality",
            "from_column": "Defect Type",
            "to_table": "Defect Type",
            "to_column": "Defect Type ID"
        },
        {
            "from_table": "SupplierQuality",
            "from_column": "Category",
            "to_table": "Category",
            "to_column": "Category ID"
        }
    ]
}