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: 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   |   normalizes sales_amount |
|:---------------|:----------------|:--------------|:------------------------|------------:|---------------:|:-----------|--------------------------:|
| Prod279        | Cus020          | Mark011       | 2017-10-11 00:00:00.000 |           1 |            102 | INR        |                       102 |
| Prod279        | Cus020          | Mark011       | 2017-10-18 00:00:00.000 |           1 |            102 | INR        |                       102 |
| Prod279        | Cus020          | Mark011       | 2017-10-19 00:00:00.000 |           1 |            102 | INR        |                       102 |
| Prod279        | Cus020          | Mark011       | 2017-11-08 00:00:00.000 |           1 |            102 | INR        |                       102 |
| Prod279        | Cus020          | Mark011       | 2018-03-09 00:00:00.000 |           1 |            102 | INR        |                       102 |
| Prod279        | Cus020          | Mark011       | 2018-03-20 00:00:00.000 |           1 |            102 | INR        |                       102 |
| Prod279        | Cus020          | Mark011       | 2018-03-22 00:00:00.000 |           1 |            102 | INR        |                       102 |
| Prod279        | Cus020          | Mark011       | 2018-03-23 00:00:00.000 |           1 |            102 | INR        |                       102 |
| Prod279        | Cus020          | Mark011       | 2018-03-29 00:00:00.000 |           1 |            102 | INR        |                       102 |
| Prod279        | Cus020          | Mark011       | 2018-04-16 00:00:00.000 |           1 |            102 | INR        |                       102 |

 


tables: 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"
        }
    ]
}