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: cluster
| final_cluster   |   index |
|:----------------|--------:|
| A               |       1 |
| B               |       2 |
| C               |       3 |
| Nei new         |       4 |
| Nei old         |       5 |


Table: cluster_oos
| code   | default_code   | supplier_odoo_name   | category_1         |   week_number |   stock |   sales |   write-offs |   oos | concat       |    % oos |
|:-------|:---------------|:---------------------|:-------------------|--------------:|--------:|--------:|-------------:|------:|:-------------|---------:|
| LBGRN  | JF01980        | MORR001              | Milk, Dairy & Eggs |            19 |       0 |       0 |            0 |     1 | LBGRNJF01980 | 0.142857 |
| LBGRN  | JF02101        | MORR001              | Milk, Dairy & Eggs |            19 |       0 |       0 |            0 |     1 | LBGRNJF02101 | 0.142857 |
| LBGRN  | JF03793        | MORR001              | Milk, Dairy & Eggs |            19 |       0 |       0 |            0 |     1 | LBGRNJF03793 | 0.142857 |
| LBGRN  | JF04286        | MORR001              | Milk, Dairy & Eggs |            19 |       0 |       0 |            0 |     1 | LBGRNJF04286 | 0.142857 |
| LBGRN  | JF04992        | MORR001              | Milk, Dairy & Eggs |            19 |       0 |       0 |            0 |     1 | LBGRNJF04992 | 0.142857 |
| LBGRN  | JF04998        | MORR001              | Milk, Dairy & Eggs |            19 |       0 |       0 |            0 |     1 | LBGRNJF04998 | 0.142857 |
| LBGRN  | JF04999        | MORR001              | Milk, Dairy & Eggs |            19 |       0 |       0 |            0 |     1 | LBGRNJF04999 | 0.142857 |
| LBGRN  | JF05000        | MORR001              | Milk, Dairy & Eggs |            19 |       0 |       0 |            0 |     1 | LBGRNJF05000 | 0.142857 |
| LBGRN  | JF05001        | MORR001              | Milk, Dairy & Eggs |            19 |       0 |       0 |            0 |     1 | LBGRNJF05001 | 0.142857 |
| LBGRN  | JF05115        | MORR001              | Milk, Dairy & Eggs |            19 |       0 |       0 |            0 |     1 | LBGRNJF05115 | 0.142857 |


Table: data
|   Column1 | code   | default_code   | product_brand_name   | name                                                          | supplier_odoo_name   | category_1         | category_2          |   week_number |   stock |   charity |   purchases_act |   sales |   write-offs |   oos |    % oos |
|----------:|:-------|:---------------|:---------------------|:--------------------------------------------------------------|:---------------------|:-------------------|:--------------------|--------------:|--------:|----------:|----------------:|--------:|-------------:|------:|---------:|
|      1564 | LBGRN  | JF02101        | B430                 | Muller Corner Vanilla and Chocolate balls                     | MORR001              | Milk, Dairy & Eggs | Yoghurts & Desserts |            19 |       0 |         0 |               0 |       0 |            0 |     1 | 0.142857 |
|      5439 | LBGRN  | JF04992        | B430                 | Muller Crunch Corner Strawberry Shortcake Yoghurt             | MORR001              | Milk, Dairy & Eggs | Yoghurts & Desserts |            19 |       0 |         0 |               0 |       0 |            0 |     1 | 0.142857 |
|      5454 | LBGRN  | JF04998        | B430                 | Muller Crunch Corner Banana Chocolate Flake Yoghurt           | MORR001              | Milk, Dairy & Eggs | Yoghurts & Desserts |            19 |       0 |         0 |               0 |       0 |            0 |     1 | 0.142857 |
|      5459 | LBGRN  | JF04999        | B430                 | Muller Crunch Corner Toffee Hoops Yoghurt                     | MORR001              | Milk, Dairy & Eggs | Yoghurts & Desserts |            19 |       0 |         0 |               0 |       0 |            0 |     1 | 0.142857 |
|      5464 | LBGRN  | JF05000        | B430                 | Muller Fruit Corner Peach & Apricot Yoghurt                   | MORR001              | Milk, Dairy & Eggs | Yoghurts & Desserts |            19 |       0 |         0 |               0 |       0 |            0 |     1 | 0.142857 |
|      5794 | LBGRN  | JF05115        | B4                   | Actimel Superfruits Mango, Goji Berry & Turmeric Yogurt Drink | MORR001              | Milk, Dairy & Eggs | Yoghurts & Desserts |            19 |       0 |         0 |               0 |       0 |            0 |     1 | 0.142857 |
|      5814 | LBGRN  | JF05119        | B5                   | Activia Intensely Creamy Strawberry                           | MORR001              | Milk, Dairy & Eggs | Yoghurts & Desserts |            19 |       0 |         0 |               0 |       0 |            0 |     1 | 0.142857 |
|      5834 | LBGRN  | JF05123        | B5                   | Activia Vanilla With Granola                                  | MORR001              | Milk, Dairy & Eggs | Yoghurts & Desserts |            19 |       0 |         0 |               0 |       0 |            0 |     1 | 0.142857 |
|      5854 | LBGRN  | JF05127        | B94                  | Cadbury Dairy Milk Buttons Twin Pot                           | MORR001              | Milk, Dairy & Eggs | Yoghurts & Desserts |            19 |       0 |         0 |               0 |       0 |            0 |     1 | 0.142857 |
|      5944 | LBGRN  | JF05151        | B464                 | Onken Fat Free Vanilla Yogurt                                 | MORR001              | Milk, Dairy & Eggs | Yoghurts & Desserts |            19 |       0 |         0 |               0 |       0 |            0 |     1 | 0.142857 |


Table: from_cd
| date                    | supplier_odoo_name   | store_code   | default_code   |   qnt |   qnt_fact |
|:------------------------|:---------------------|:-------------|:---------------|------:|-----------:|
| 2022-04-11 00:00:00.000 | CELT001              | LBGRN        | JF06033        |     1 |          1 |
| 2022-04-11 00:00:00.000 | CELT001              | LISLI        | JF06033        |     1 |          1 |
| 2022-04-12 00:00:00.000 | CELT001              | LBOUN        | JF06033        |     1 |          1 |
| 2022-04-13 00:00:00.000 | CELT001              | LROLT        | JF06033        |     1 |          1 |
| 2022-04-13 00:00:00.000 | CELT001              | LSTRH        | JF06033        |     1 |          1 |
| 2022-04-14 00:00:00.000 | CELT001              | LFULH        | JF06033        |     1 |          1 |
| 2022-04-14 00:00:00.000 | CELT001              | LWBDN        | JF06033        |     1 |          1 |
| 2022-04-15 00:00:00.000 | CELT001              | LIFRD        | JF06033        |     1 |          1 |
| 2022-04-15 00:00:00.000 | CELT001              | LROLT        | JF06033        |     1 |          1 |
| 2022-04-15 00:00:00.000 | CELT001              | LSTRA        | JF06033        |     1 |          1 |


Table: matrix
|   Column1 | sku     | final_cluster   | kvi   | store   |   matrix | supplier_odoo_name   | concat       |
|----------:|:--------|:----------------|:------|:--------|---------:|:---------------------|:-------------|
|      4126 | JF00681 | B               | False | LBGRN   |        1 | MORR001              | LBGRNJF00681 |
|      4127 | JF00682 | B               | False | LBGRN   |        1 | MORR001              | LBGRNJF00682 |
|      4128 | JF00683 | B               | False | LBGRN   |        1 | MORR001              | LBGRNJF00683 |
|      4129 | JF00684 | B               | False | LBGRN   |        1 | MORR001              | LBGRNJF00684 |
|      4255 | JF01856 | B               | False | LBGRN   |        1 | MORR001              | LBGRNJF01856 |
|      4264 | JF01868 | B               | False | LBGRN   |        1 | MORR001              | LBGRNJF01868 |
|      4270 | JF01886 | B               | False | LBGRN   |        1 | MORR001              | LBGRNJF01886 |
|      4274 | JF01892 | B               | False | LBGRN   |        1 | MORR001              | LBGRNJF01892 |
|      4281 | JF01901 | B               | False | LBGRN   |        1 | MORR001              | LBGRNJF01901 |
|      4285 | JF01908 | B               | False | LBGRN   |        1 | MORR001              | LBGRNJF01908 |


Table: orders
| date                    | store_code   | default_code   | supplier_odoo_name   |   qnt |   qnt_fact |   week_number |
|:------------------------|:-------------|:---------------|:---------------------|------:|-----------:|--------------:|
| 2022-05-07 18:36:27.000 | LSTRH        | JF00139        | WAFA001              |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | LSTRH        | JF04174        | WAFA001              |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | LSTRH        | JF04180        | WAFA001              |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | LSTRH        | JF04861        | WAFA001              |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | LSTRH        | JF04864        | WAFA001              |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | LSTRH        | JF04868        | WAFA001              |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | LSTRH        | JF04883        | WAFA001              |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | LSTRH        | JF04888        | WAFA001              |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | LSTRH        | JF04891        | WAFA001              |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | LSTRH        | JF04894        | WAFA001              |     1 |          1 |            18 |


Table: orders_cd
| date                    | supplier_odoo_name   | store_code   | default_code   |   qnt |   qnt_fact |   week_number |
|:------------------------|:---------------------|:-------------|:---------------|------:|-----------:|--------------:|
| 2022-05-07 18:36:27.000 | WAFA001              | LSTRH        | JF00139        |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | WAFA001              | LSTRH        | JF04174        |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | WAFA001              | LSTRH        | JF04180        |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | WAFA001              | LSTRH        | JF04861        |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | WAFA001              | LSTRH        | JF04864        |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | WAFA001              | LSTRH        | JF04868        |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | WAFA001              | LSTRH        | JF04883        |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | WAFA001              | LSTRH        | JF04888        |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | WAFA001              | LSTRH        | JF04891        |     1 |          1 |            18 |
| 2022-05-07 18:36:27.000 | WAFA001              | LSTRH        | JF04894        |     1 |          1 |            18 |


Table: products
| name                                       | category_1      | category_2        |   pack | default_code   | chilling   | freezing   |   cost |   sales_price |   exp_days | can_be_purchased   | category_3   |
|:-------------------------------------------|:----------------|:------------------|-------:|:---------------|:-----------|:-----------|-------:|--------------:|-----------:|:-------------------|:-------------|
| Alberto Balsam Conditioner Coconut 350ml   | Health & Beauty | Hair, Body & Bath |      6 | JF04034        | False      | False      |      8 |          12   |        365 | True               | Hair Care    |
| Alberto Balsam Conditioner Raspberry 350ml | Health & Beauty | Hair, Body & Bath |      6 | JF04035        | False      | False      |      3 |           4.5 |        365 | True               | Hair Care    |
| Alberto Balsam Gel Ultra Strong 200ml      | Health & Beauty | Hair, Body & Bath |      6 | JF04036        | False      | False      |      5 |           7.5 |        365 | True               | Hair Care    |
| Alberto Balsam Shampoo Coconut 350ml       | Health & Beauty | Hair, Body & Bath |      6 | JF04038        | False      | False      |      5 |           7.5 |        365 | True               | Hair Care    |
| Alberto Balsam Shampoo Raspberry 350ml     | Health & Beauty | Hair, Body & Bath |      6 | JF04039        | False      | False      |      5 |           7.5 |        365 | True               | Hair Care    |
| Alberto Balsam Tea Tree Tingle Conditioner | Health & Beauty | Hair, Body & Bath |      6 | JF04631        | False      | False      |      3 |           4.5 |        365 | True               | Hair Care    |
| Alberto Balsam Tea Tree Tingle Shampoo     | Health & Beauty | Hair, Body & Bath |      6 | JF04632        | False      | False      |      5 |           7.5 |        365 | True               | Hair Care    |
| Always Dailies Liner Normal 20s            | Health & Beauty | Healthcare        |      6 | JF04027        | False      | False      |      6 |           9   |        365 | True               | Fem Care     |
| Aussie Miracle Moist Shampoo               | Health & Beauty | Hair, Body & Bath |      6 | JF05300        | False      | False      |      9 |          13.5 |        365 | True               | Hair Care    |
| Aussie Shampoo Mega                        | Health & Beauty | Hair, Body & Bath |      6 | JF05299        | False      | False      |      8 |          12   |        365 | True               | Hair Care    |


Table: scarp
| scarp_doc   | code   | default_code   | name                             |   qnt | reason   | date                    | time                    |   week_number | supplier_odoo_name   |
|:------------|:-------|:---------------|:---------------------------------|------:|:---------|:------------------------|:------------------------|--------------:|:---------------------|
| SP/87084    | LTEDD  | JF04902        | [JF04902] Radish                 |     1 | Expired  | 2022-05-07 00:00:00.000 | 1899-12-30 23:06:42.000 |            18 | WAFA001              |
| SP/87083    | LTEDD  | JF04902        | [JF04902] Radish                 |     1 | Expired  | 2022-05-07 00:00:00.000 | 1899-12-30 23:06:28.000 |            18 | WAFA001              |
| SP/87082    | LTEDD  | JF04896        | [JF04896] Wild Rocket            |     1 | Expired  | 2022-05-07 00:00:00.000 | 1899-12-30 23:06:10.000 |            18 | WAFA001              |
| SP/87081    | LTEDD  | JF04869        | [JF04869] Raspberries 125g       |     1 | Expired  | 2022-05-07 00:00:00.000 | 1899-12-30 23:05:56.000 |            18 | WAFA001              |
| SP/87077    | LTEDD  | JF00131        | [JF00131] Little Gem             |     1 | Expired  | 2022-05-07 00:00:00.000 | 1899-12-30 23:04:28.000 |            18 | WAFA001              |
| SP/87076    | LTEDD  | JF00124        | [JF00124] Grapes Black Seedless  |     1 | Expired  | 2022-05-07 00:00:00.000 | 1899-12-30 23:04:13.000 |            18 | WAFA001              |
| SP/87075    | LTEDD  | JF00113        | [JF00113] Carrot Medium          |     1 | Expired  | 2022-05-07 00:00:00.000 | 1899-12-30 23:03:58.000 |            18 | WAFA001              |
| SP/86893    | LTEDD  | JF04880        | [JF04880] Courgette              |     1 | Expired  | 2022-05-07 00:00:00.000 | 1899-12-30 00:53:32.000 |            18 | WAFA001              |
| SP/86892    | LTEDD  | JF04873        | [JF04873] Washed Baby Leaf Salad |     1 | Expired  | 2022-05-07 00:00:00.000 | 1899-12-30 00:53:16.000 |            18 | WAFA001              |
| SP/86887    | LTEDD  | JF04008        | [JF04008] Fresh Mint             |     1 | Expired  | 2022-05-07 00:00:00.000 | 1899-12-30 00:51:55.000 |            18 | WAFA001              |


Table: stores
| code   | name   | address    |   sort |
|:-------|:-------|:-----------|-------:|
| LWLOO  | L1     | Address 1  |     15 |
| LBSEA  | L2     | Address 2  |      3 |
| LBGRN  | L3     | Address 3  |      1 |
| LPRKR  | L4     | Address 4  |      8 |
| LROLT  | L5     | Address 5  |      9 |
| LTEDD  | L6     | Address 6  |     12 |
| LSTRA  | L7     | Address 7  |     10 |
| LISLI  | L8     | Address 8  |      7 |
| LWEMB  | L9     | Address 9  |     14 |
| LFULH  | L10    | Address 10 |      4 |


Table: vendors
| supplier_odoo_name   | supplier_code   | buyer         | replen     |
|:---------------------|:----------------|:--------------|:-----------|
| BLAK001              | BLAK001         | Ming          | Nadine     |
| ABRA001              | ABRA001         | Jelena        |            |
| AMAZON               | AMAZON          | Administrator |            |
| BANG001              | BANG001         | Ming          | Nadine     |
| BARI001              | BARI001         |               |            |
| BELA001              | BELA001         | Ming          | Anastasiya |
| BEST001              | BEST001         |               |            |
| BN0001               | BN0001          |               |            |
| BRBI001              | BRBI001         | Minal         | Nadine     |
| BRAK001              | BRAK001         | Ming          | Ann        |


Table: weeks
|   week_number |
|--------------:|
|            15 |
|            16 |
|            17 |
|            18 |
|            19 |

 


tables: name: cluster
data: cluster.csv
name: cluster_oos
data: cluster_oos.csv
name: data
data: data.csv
name: from_cd
data: from_cd.csv
name: matrix
data: matrix.csv
name: orders
data: orders.csv
name: orders_cd
data: orders_cd.csv
name: products
data: products.csv
name: scarp
data: scarp.csv
name: stores
data: stores.csv
name: vendors
data: vendors.csv
name: weeks
data: weeks.csv
label: scarp
code
stores
name
scarp
supplier_odoo_name
vendors
supplier_odoo_name
scarp
default_code
products
default_code
matrix
sku
products
default_code
orders
store_code
stores
code
orders
default_code
products
default_code
orders
supplier_odoo_name
vendors
supplier_odoo_name
matrix
supplier_odoo_name
vendors
supplier_odoo_name
data
default_code
products
default_code
data
supplier_odoo_name
vendors
supplier_odoo_name
matrix
final_cluster
cluster
final_cluster
data
code
stores
code
cluster_oos
concat
matrix
concat
orders_cd
supplier_odoo_name
vendors
supplier_odoo_name
orders_cd
default_code
products
default_code
orders_cd
store_code
stores
code
output: {
    "joins": [
        {
            "from_table": "scarp",
            "from_column": "code",
            "to_table": "stores",
            "to_column": "name"
        },
        {
            "from_table": "scarp",
            "from_column": "supplier_odoo_name",
            "to_table": "vendors",
            "to_column": "supplier_odoo_name"
        },
        {
            "from_table": "scarp",
            "from_column": "default_code",
            "to_table": "products",
            "to_column": "default_code"
        },
        {
            "from_table": "matrix",
            "from_column": "sku",
            "to_table": "products",
            "to_column": "default_code"
        },
        {
            "from_table": "orders",
            "from_column": "store_code",
            "to_table": "stores",
            "to_column": "code"
        },
        {
            "from_table": "orders",
            "from_column": "default_code",
            "to_table": "products",
            "to_column": "default_code"
        },
        {
            "from_table": "orders",
            "from_column": "supplier_odoo_name",
            "to_table": "vendors",
            "to_column": "supplier_odoo_name"
        },
        {
            "from_table": "matrix",
            "from_column": "supplier_odoo_name",
            "to_table": "vendors",
            "to_column": "supplier_odoo_name"
        },
        {
            "from_table": "data",
            "from_column": "default_code",
            "to_table": "products",
            "to_column": "default_code"
        },
        {
            "from_table": "data",
            "from_column": "supplier_odoo_name",
            "to_table": "vendors",
            "to_column": "supplier_odoo_name"
        },
        {
            "from_table": "matrix",
            "from_column": "final_cluster",
            "to_table": "cluster",
            "to_column": "final_cluster"
        },
        {
            "from_table": "data",
            "from_column": "code",
            "to_table": "stores",
            "to_column": "code"
        },
        {
            "from_table": "cluster_oos",
            "from_column": "concat",
            "to_table": "matrix",
            "to_column": "concat"
        },
        {
            "from_table": "orders_cd",
            "from_column": "supplier_odoo_name",
            "to_table": "vendors",
            "to_column": "supplier_odoo_name"
        },
        {
            "from_table": "orders_cd",
            "from_column": "default_code",
            "to_table": "products",
            "to_column": "default_code"
        },
        {
            "from_table": "orders_cd",
            "from_column": "store_code",
            "to_table": "stores",
            "to_column": "code"
        }
    ]
}