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: BaseMeasures (2)



Table: Profit Target
|   Profit Target |
|----------------:|
|    -0.05        |
|    -0.04        |
|    -0.03        |
|    -0.02        |
|    -0.01        |
|     3.46945e-18 |
|     0.01        |
|     0.02        |
|     0.03        |
|     0.04        |


Table: sales customers
| customer_code   | custmer_name            | customer_type   |
|:----------------|:------------------------|:----------------|
| Cus001          | Surge Stores            | Brick & Mortar  |
| Cus002          | Nomad Stores            | Brick & Mortar  |
| Cus003          | Excel Stores            | Brick & Mortar  |
| Cus004          | Surface Stores          | Brick & Mortar  |
| Cus005          | Premium Stores          | Brick & Mortar  |
| Cus006          | Electricalsara Stores   | Brick & Mortar  |
| Cus007          | Info Stores             | Brick & Mortar  |
| Cus008          | Acclaimed Stores        | Brick & Mortar  |
| Cus009          | Electricalsquipo Stores | Brick & Mortar  |
| Cus010          | Atlas Stores            | Brick & Mortar  |


Table: sales date
| date                    | cy_date                 |   year | month_name   | date_yy_mmm   |
|:------------------------|:------------------------|-------:|:-------------|:--------------|
| 2018-01-01 00:00:00.000 | 2018-01-01 00:00:00.000 |   2018 | January      | 18-Jan        |
| 2018-01-02 00:00:00.000 | 2018-01-01 00:00:00.000 |   2018 | January      | 18-Jan        |
| 2018-01-03 00:00:00.000 | 2018-01-01 00:00:00.000 |   2018 | January      | 18-Jan        |
| 2018-01-04 00:00:00.000 | 2018-01-01 00:00:00.000 |   2018 | January      | 18-Jan        |
| 2018-01-05 00:00:00.000 | 2018-01-01 00:00:00.000 |   2018 | January      | 18-Jan        |
| 2018-01-06 00:00:00.000 | 2018-01-01 00:00:00.000 |   2018 | January      | 18-Jan        |
| 2018-01-07 00:00:00.000 | 2018-01-01 00:00:00.000 |   2018 | January      | 18-Jan        |
| 2018-01-08 00:00:00.000 | 2018-01-01 00:00:00.000 |   2018 | January      | 18-Jan        |
| 2018-01-09 00:00:00.000 | 2018-01-01 00:00:00.000 |   2018 | January      | 18-Jan        |
| 2018-01-10 00:00:00.000 | 2018-01-01 00:00:00.000 |   2018 | January      | 18-Jan        |


Table: sales markets
| markets_code   | markets_name   | zone    |
|:---------------|:---------------|:--------|
| Mark001        | Chennai        | South   |
| Mark002        | Mumbai         | Central |
| Mark003        | Ahmedabad      | North   |
| Mark004        | Delhi NCR      | North   |
| Mark005        | Kanpur         | North   |
| Mark006        | Bengaluru      | South   |
| Mark007        | Bhopal         | Central |
| Mark008        | Lucknow        | North   |
| Mark009        | Patna          | North   |
| Mark010        | Kochi          | South   |


Table: sales products
| product_code   | product_type   |
|:---------------|:---------------|
| Prod001        | Own Brand      |
| Prod002        | Own Brand      |
| Prod003        | Own Brand      |
| Prod004        | Own Brand      |
| Prod005        | Own Brand      |
| Prod006        | Own Brand      |
| Prod007        | Own Brand      |
| Prod008        | Own Brand      |
| Prod009        | Own Brand      |
| Prod010        | Own Brand      |


Table: Sales transactions
| product_code   | customer_code   | market_code   |   order_date |   sales_qty |   sales_amount | currency   |   norm_sales_amount |   ProfitMargin% |   Profit_Margin |   Cost_Price |
|:---------------|:----------------|:--------------|-------------:|------------:|---------------:|:-----------|--------------------:|----------------:|----------------:|-------------:|
| Prod279        | Cus020          | Mark011       |        43019 |           1 |            102 | INR        |                 102 |            0.39 |           39.78 |        62.22 |
| Prod279        | Cus020          | Mark011       |        43026 |           1 |            102 | INR        |                 102 |           -0.12 |          -12.24 |       114.24 |
| Prod279        | Cus020          | Mark011       |        43027 |           1 |            102 | INR        |                 102 |            0.29 |           29.58 |        72.42 |
| Prod279        | Cus020          | Mark011       |        43047 |           1 |            102 | INR        |                 102 |            0.36 |           36.72 |        65.28 |
| Prod279        | Cus020          | Mark011       |        43168 |           1 |            102 | INR        |                 102 |           -0.35 |          -35.7  |       137.7  |
| Prod279        | Cus020          | Mark011       |        43179 |           1 |            102 | INR        |                 102 |            0.26 |           26.52 |        75.48 |
| Prod279        | Cus020          | Mark011       |        43181 |           1 |            102 | INR        |                 102 |           -0.35 |          -35.7  |       137.7  |
| Prod279        | Cus020          | Mark011       |        43182 |           1 |            102 | INR        |                 102 |           -0.35 |          -35.7  |       137.7  |
| Prod279        | Cus020          | Mark011       |        43188 |           1 |            102 | INR        |                 102 |            0.34 |           34.68 |        67.32 |
| Prod279        | Cus020          | Mark011       |        43206 |           1 |            102 | INR        |                 102 |           -0.06 |           -6.12 |       108.12 |

 


tables: name: BaseMeasures (2)
data: BaseMeasures (2).csv
name: Profit Target
data: Profit Target.csv
name: sales customers
data: sales customers.csv
name: sales date
data: sales date.csv
name: sales markets
data: sales markets.csv
name: sales products
data: sales products.csv
name: Sales transactions
data: Sales transactions.csv
label: Sales transactions
customer_code
sales customers
customer_code
Sales transactions
product_code
sales products
product_code
Sales transactions
order_date
sales date
date
Sales transactions
market_code
sales markets
markets_code
output: {
    "joins": [
        {
            "from_table": "Sales transactions",
            "from_column": "customer_code",
            "to_table": "sales customers",
            "to_column": "customer_code"
        },
        {
            "from_table": "Sales transactions",
            "from_column": "product_code",
            "to_table": "sales products",
            "to_column": "product_code"
        },
        {
            "from_table": "Sales transactions",
            "from_column": "order_date",
            "to_table": "sales date",
            "to_column": "date"
        },
        {
            "from_table": "Sales transactions",
            "from_column": "market_code",
            "to_table": "sales markets",
            "to_column": "markets_code"
        }
    ]
}