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: CustomerFactTable
|   CustomerID |   InvoiceID |   InvoiceLineID |   StockItemID |   Orders |   SalesAmount |   Profit |   ExtendedPrice |   StateProvinceID |
|-------------:|------------:|----------------:|--------------:|---------:|--------------:|---------:|----------------:|------------------:|
|          990 |          97 |             207 |            18 |       10 |          19.5 |       85 |           149.5 |                45 |
|           40 |       11042 |           35791 |            36 |       10 |          19.5 |       85 |           149.5 |                45 |
|          940 |       11043 |           35795 |            35 |       10 |          19.5 |       85 |           149.5 |                45 |
|          940 |       11043 |           35796 |            50 |       10 |          19.5 |       85 |           149.5 |                45 |
|           32 |       33106 |          107504 |            53 |       10 |          19.5 |       85 |           149.5 |                45 |
|          556 |         375 |             967 |            23 |       10 |          19.5 |       85 |           149.5 |                45 |
|          408 |         473 |            1286 |            55 |       10 |          19.5 |       85 |           149.5 |                45 |
|          594 |       11358 |           36793 |            44 |       10 |          19.5 |       85 |           149.5 |                45 |
|          556 |       33532 |          108879 |            30 |       10 |          19.5 |       85 |           149.5 |                45 |
|          556 |       33532 |          108880 |            23 |       10 |          19.5 |       85 |           149.5 |                45 |


Table: CustomerNameDimensionTable
|   CustomerID | CustomerName                |
|-------------:|:----------------------------|
|            1 | Tailspin Toys (Head Office) |
|            1 | Tailspin Toys (Head Office) |
|            1 | Tailspin Toys (Head Office) |
|            1 | Tailspin Toys (Head Office) |
|            1 | Tailspin Toys (Head Office) |
|            1 | Tailspin Toys (Head Office) |
|            1 | Tailspin Toys (Head Office) |
|            1 | Tailspin Toys (Head Office) |
|            1 | Tailspin Toys (Head Office) |
|            1 | Tailspin Toys (Head Office) |


Table: CustomerStateDimensionTable
|   StateProvinceID | StateProvinceName    | SalesTerritory   |
|------------------:|:---------------------|:-----------------|
|                 1 | Alabama              | Southeast        |
|                 2 | Alaska               | Far West         |
|                 3 | Arizona              | Southwest        |
|                 4 | Arkansas             | Southeast        |
|                 5 | California           | Far West         |
|                 6 | Colorado             | Rocky Mountain   |
|                 7 | Connecticut          | New England      |
|                 8 | Delaware             | Mideast          |
|                 9 | District of Columbia | Mideast          |
|                10 | Florida              | Southeast        |


Table: InvoiceDimensionTable
|   InvoiceLineID |   InvoiceID |   YEAR |
|----------------:|------------:|-------:|
|          195473 |       60283 |   2015 |
|          195474 |       60284 |   2015 |
|          195475 |       60284 |   2015 |
|          195476 |       60284 |   2015 |
|          195477 |       60284 |   2015 |
|          195478 |       60284 |   2015 |
|          195479 |       60285 |   2015 |
|          195480 |       60285 |   2015 |
|          195481 |       60285 |   2015 |
|          195482 |       60285 |   2015 |


Table: stockitemsdimension_table
|   stockitemid | stockitemname                                  |   supplierID |
|--------------:|:-----------------------------------------------|-------------:|
|            76 | "The Gu" red shirt XML tag t-shirt (White) 3XS |            4 |
|            77 | "The Gu" red shirt XML tag t-shirt (White) XXS |            4 |
|            78 | "The Gu" red shirt XML tag t-shirt (White) XS  |            4 |
|            79 | "The Gu" red shirt XML tag t-shirt (White) S   |            4 |
|            80 | "The Gu" red shirt XML tag t-shirt (White) M   |            4 |
|            81 | "The Gu" red shirt XML tag t-shirt (White) L   |            4 |
|            82 | "The Gu" red shirt XML tag t-shirt (White) XL  |            4 |
|            83 | "The Gu" red shirt XML tag t-shirt (White) XXL |            4 |
|            84 | "The Gu" red shirt XML tag t-shirt (White) 3XL |            4 |
|            85 | "The Gu" red shirt XML tag t-shirt (White) 4XL |            4 |


Table: SupplierDimension
|   supplierid | suppliername             |
|-------------:|:-------------------------|
|            1 | A Datum Corporation      |
|            2 | Contoso, Ltd.            |
|            3 | Consolidated Messenger   |
|            4 | Fabrikam, Inc.           |
|            5 | Graphic Design Institute |
|            6 | Humongous Insurance      |
|            7 | Litware, Inc.            |
|            8 | Lucerne Publishing       |
|            9 | Nod Publishers           |
|           10 | Northwind Electric Cars  |


Table: suppliertransactionfact_table
|   suppliertransactionid |   supplierid |   transactionamount |   Year |
|------------------------:|-------------:|--------------------:|-------:|
|                   89564 |            4 |    486588           |   2014 |
|                   90006 |            4 |    488437           |   2014 |
|                   90286 |            4 |    487844           |   2014 |
|                   90852 |            4 |    489824           |   2014 |
|                   90858 |            4 |      1449           |   2014 |
|                   90859 |            4 |        -2.43952e+06 |   2014 |
|                   91130 |            4 |    491273           |   2014 |
|                   91407 |            4 |    492350           |   2014 |
|                   91622 |            4 |    491108           |   2014 |
|                   91815 |            4 |    491246           |   2014 |

 


tables: name: CustomerFactTable
data: CustomerFactTable.csv
name: CustomerNameDimensionTable
data: CustomerNameDimensionTable.csv
name: CustomerStateDimensionTable
data: CustomerStateDimensionTable.csv
name: InvoiceDimensionTable
data: InvoiceDimensionTable.csv
name: stockitemsdimension_table
data: stockitemsdimension_table.csv
name: SupplierDimension
data: SupplierDimension.csv
name: suppliertransactionfact_table
data: suppliertransactionfact_table.csv
label: CustomerFactTable
InvoiceLineID
InvoiceDimensionTable
InvoiceLineID
stockitemsdimension_table
supplierID
SupplierDimension
supplierid
suppliertransactionfact_table
supplierid
SupplierDimension
supplierid
CustomerFactTable
StockItemID
stockitemsdimension_table
stockitemid
CustomerFactTable
StateProvinceID
CustomerStateDimensionTable
StateProvinceID
CustomerNameDimensionTable
CustomerID
CustomerFactTable
CustomerID
output: {
    "joins": [
        {
            "from_table": "CustomerFactTable",
            "from_column": "InvoiceLineID",
            "to_table": "InvoiceDimensionTable",
            "to_column": "InvoiceLineID"
        },
        {
            "from_table": "stockitemsdimension_table",
            "from_column": "supplierID",
            "to_table": "SupplierDimension",
            "to_column": "supplierid"
        },
        {
            "from_table": "suppliertransactionfact_table",
            "from_column": "supplierid",
            "to_table": "SupplierDimension",
            "to_column": "supplierid"
        },
        {
            "from_table": "CustomerFactTable",
            "from_column": "StockItemID",
            "to_table": "stockitemsdimension_table",
            "to_column": "stockitemid"
        },
        {
            "from_table": "CustomerFactTable",
            "from_column": "StateProvinceID",
            "to_table": "CustomerStateDimensionTable",
            "to_column": "StateProvinceID"
        },
        {
            "from_table": "CustomerNameDimensionTable",
            "from_column": "CustomerID",
            "to_table": "CustomerFactTable",
            "to_column": "CustomerID"
        }
    ]
}