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



Table: Old_data_sales transactions
| product_code   | customer_code   | market_code   | order_date              |   sales_qty |   sales_amount | currency   |
|:---------------|:----------------|:--------------|:------------------------|------------:|---------------:|:-----------|
| Prod279        | Cus020          | Mark011       | 2017-10-11 00:00:00.000 |           1 |            102 | INR        |
| Prod279        | Cus020          | Mark011       | 2017-10-18 00:00:00.000 |           1 |            102 | INR        |
| Prod279        | Cus020          | Mark011       | 2017-10-19 00:00:00.000 |           1 |            102 | INR        |
| Prod279        | Cus020          | Mark011       | 2017-11-08 00:00:00.000 |           1 |            102 | INR        |
| Prod279        | Cus020          | Mark011       | 2018-03-09 00:00:00.000 |           1 |            102 | INR        |
| Prod279        | Cus020          | Mark011       | 2018-03-20 00:00:00.000 |           1 |            102 | INR        |
| Prod279        | Cus020          | Mark011       | 2018-03-22 00:00:00.000 |           1 |            102 | INR        |
| Prod279        | Cus020          | Mark011       | 2018-03-23 00:00:00.000 |           1 |            102 | INR        |
| Prod279        | Cus020          | Mark011       | 2018-03-29 00:00:00.000 |           1 |            102 | INR        |
| Prod279        | Cus020          | Mark011       | 2018-04-16 00:00:00.000 |           1 |            102 | INR        |


Table: ProfitMargin% 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 |   Net_profit |   Cost_Price |
|:---------------|:----------------|:--------------|:------------------------|------------:|---------------:|:-----------|--------------------:|---------------:|-------------:|-------------:|
| Prod279        | Cus020          | Mark011       | 2017-10-11 00:00:00.000 |           1 |            102 | INR        |                 102 |           0.39 |        39.78 |        62.22 |
| Prod279        | Cus020          | Mark011       | 2017-10-18 00:00:00.000 |           1 |            102 | INR        |                 102 |          -0.12 |       -12.24 |       114.24 |
| Prod279        | Cus020          | Mark011       | 2017-10-19 00:00:00.000 |           1 |            102 | INR        |                 102 |           0.29 |        29.58 |        72.42 |
| Prod279        | Cus020          | Mark011       | 2017-11-08 00:00:00.000 |           1 |            102 | INR        |                 102 |           0.36 |        36.72 |        65.28 |
| Prod279        | Cus020          | Mark011       | 2018-03-09 00:00:00.000 |           1 |            102 | INR        |                 102 |          -0.35 |       -35.7  |       137.7  |
| Prod279        | Cus020          | Mark011       | 2018-03-20 00:00:00.000 |           1 |            102 | INR        |                 102 |           0.26 |        26.52 |        75.48 |
| Prod279        | Cus020          | Mark011       | 2018-03-22 00:00:00.000 |           1 |            102 | INR        |                 102 |          -0.35 |       -35.7  |       137.7  |
| Prod279        | Cus020          | Mark011       | 2018-03-23 00:00:00.000 |           1 |            102 | INR        |                 102 |          -0.35 |       -35.7  |       137.7  |
| Prod279        | Cus020          | Mark011       | 2018-03-29 00:00:00.000 |           1 |            102 | INR        |                 102 |           0.34 |        34.68 |        67.32 |
| Prod279        | Cus020          | Mark011       | 2018-04-16 00:00:00.000 |           1 |            102 | INR        |                 102 |          -0.06 |        -6.12 |       108.12 |

 


tables: name: BaseMeasures
data: BaseMeasures.csv
name: Old_data_sales transactions
data: Old_data_sales transactions.csv
name: ProfitMargin% Target
data: ProfitMargin% 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
product_code
sales products
product_code
sales_transactions
customer_code
sales customers
customer_code
sales_transactions
order_date
sales date
date
sales_transactions
market_code
sales markets
markets_code
output: {
    "joins": [
        {
            "from_table": "sales_transactions",
            "from_column": "product_code",
            "to_table": "sales products",
            "to_column": "product_code"
        },
        {
            "from_table": "sales_transactions",
            "from_column": "customer_code",
            "to_table": "sales customers",
            "to_column": "customer_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"
        }
    ]
}