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: Dates
| Date                    |   Year |   QuarterOfYear |   MonthOfYear |   DayOfMonth |   DateInt | Month Name   | Month & Year   | Quarter & Year   |   DayOfWeek | DayOfWeekName   | WeekEnding              | MonthEnding             |   ISO Weeknumber |   ISO Year |   ISO Day of Year | Week & Year   |   WeeknYear |   MonthnYear |   QuarternYear | Fiscal Year   | Fiscal Quarter   |   Fiscal Period | IsAfterToday   | IsWorkingDay   | IsHoliday   |   WeekOffset |   MonthOffset |   QuarterOffset |   YearOffset |   FiscalYearOffset | WeekCompleted   | MonthCompleted   | QuarterCompleted   | Short Month Name   |
|:------------------------|-------:|----------------:|--------------:|-------------:|----------:|:-------------|:---------------|:-----------------|------------:|:----------------|:------------------------|:------------------------|-----------------:|-----------:|------------------:|:--------------|------------:|-------------:|---------------:|:--------------|:-----------------|----------------:|:---------------|:---------------|:------------|-------------:|--------------:|----------------:|-------------:|-------------------:|:----------------|:-----------------|:-------------------|:-------------------|
| 2020-06-22 00:00:00.000 |   2020 |               2 |             6 |           22 |  20200622 | June         | Jun 2020       | Q2 2020          |           1 | Monday          | 2020-06-28 00:00:00.000 | 2020-06-30 00:00:00.000 |               26 |       2020 |               176 | 2020-26       |    20202600 |     20200600 |       20200200 | FY20          | FQ2              |               6 | True           | True           | Unknown     |            1 |             0 |               0 |            0 |                  0 | False           | False            | False              | Jun                |
| 2020-06-23 00:00:00.000 |   2020 |               2 |             6 |           23 |  20200623 | June         | Jun 2020       | Q2 2020          |           2 | Tuesday         | 2020-06-28 00:00:00.000 | 2020-06-30 00:00:00.000 |               26 |       2020 |               177 | 2020-26       |    20202600 |     20200600 |       20200200 | FY20          | FQ2              |               6 | True           | True           | Unknown     |            1 |             0 |               0 |            0 |                  0 | False           | False            | False              | Jun                |
| 2020-06-24 00:00:00.000 |   2020 |               2 |             6 |           24 |  20200624 | June         | Jun 2020       | Q2 2020          |           3 | Wednesday       | 2020-06-28 00:00:00.000 | 2020-06-30 00:00:00.000 |               26 |       2020 |               178 | 2020-26       |    20202600 |     20200600 |       20200200 | FY20          | FQ2              |               6 | True           | True           | Unknown     |            1 |             0 |               0 |            0 |                  0 | False           | False            | False              | Jun                |
| 2020-06-25 00:00:00.000 |   2020 |               2 |             6 |           25 |  20200625 | June         | Jun 2020       | Q2 2020          |           4 | Thursday        | 2020-06-28 00:00:00.000 | 2020-06-30 00:00:00.000 |               26 |       2020 |               179 | 2020-26       |    20202600 |     20200600 |       20200200 | FY20          | FQ2              |               6 | True           | True           | Unknown     |            1 |             0 |               0 |            0 |                  0 | False           | False            | False              | Jun                |
| 2020-06-28 00:00:00.000 |   2020 |               2 |             6 |           28 |  20200628 | June         | Jun 2020       | Q2 2020          |           0 | Sunday          | 2020-06-28 00:00:00.000 | 2020-06-30 00:00:00.000 |               26 |       2020 |               182 | 2020-26       |    20202600 |     20200600 |       20200200 | FY20          | FQ2              |               6 | True           | True           | Unknown     |            1 |             0 |               0 |            0 |                  0 | False           | False            | False              | Jun                |
| 2020-06-29 00:00:00.000 |   2020 |               2 |             6 |           29 |  20200629 | June         | Jun 2020       | Q2 2020          |           1 | Monday          | 2020-07-05 00:00:00.000 | 2020-06-30 00:00:00.000 |               27 |       2020 |               183 | 2020-27       |    20202700 |     20200600 |       20200200 | FY20          | FQ2              |               6 | True           | True           | Unknown     |            2 |             0 |               0 |            0 |                  0 | False           | False            | False              | Jun                |
| 2020-06-30 00:00:00.000 |   2020 |               2 |             6 |           30 |  20200630 | June         | Jun 2020       | Q2 2020          |           2 | Tuesday         | 2020-07-05 00:00:00.000 | 2020-06-30 00:00:00.000 |               27 |       2020 |               184 | 2020-27       |    20202700 |     20200600 |       20200200 | FY20          | FQ2              |               6 | True           | True           | Unknown     |            2 |             0 |               0 |            0 |                  0 | False           | False            | False              | Jun                |
| 2020-07-01 00:00:00.000 |   2020 |               3 |             7 |            1 |  20200701 | July         | Jul 2020       | Q3 2020          |           3 | Wednesday       | 2020-07-05 00:00:00.000 | 2020-07-31 00:00:00.000 |               27 |       2020 |               185 | 2020-27       |    20202700 |     20200700 |       20200300 | FY20          | FQ3              |               7 | True           | True           | Unknown     |            2 |             1 |               1 |            0 |                  0 | False           | False            | False              | Jul                |
| 2020-07-02 00:00:00.000 |   2020 |               3 |             7 |            2 |  20200702 | July         | Jul 2020       | Q3 2020          |           4 | Thursday        | 2020-07-05 00:00:00.000 | 2020-07-31 00:00:00.000 |               27 |       2020 |               186 | 2020-27       |    20202700 |     20200700 |       20200300 | FY20          | FQ3              |               7 | True           | True           | Unknown     |            2 |             1 |               1 |            0 |                  0 | False           | False            | False              | Jul                |
| 2020-07-05 00:00:00.000 |   2020 |               3 |             7 |            5 |  20200705 | July         | Jul 2020       | Q3 2020          |           0 | Sunday          | 2020-07-05 00:00:00.000 | 2020-07-31 00:00:00.000 |               27 |       2020 |               189 | 2020-27       |    20202700 |     20200700 |       20200300 | FY20          | FQ3              |               7 | True           | True           | Unknown     |            2 |             1 |               1 |            0 |                  0 | False           | False            | False              | Jul                |


Table: Income & Expenditure DB
| Income & Expenditure Category   |   Income & Expenditure Category ID |
|:--------------------------------|-----------------------------------:|
| Administrativos                 |                                  1 |
| Adquisicion de Activos          |                                  2 |
| Gastos de Venta                 |                                  3 |
| Ingreso de Venta                |                                  9 |
| Ingreso Extraordinario          |                                 10 |
| Promocion                       |                                  4 |
| Publicidad                      |                                  5 |
| Renta de local                  |                                  6 |
| Servicios Profesionales         |                                  7 |
| Transporte                      |                                  8 |


Table: Income & Expenditure
| Date                    |   Income & Expenditure ID |   Income & Expenditure | Comments   |
|:------------------------|--------------------------:|-----------------------:|:-----------|
| 2019-09-01 00:00:00.000 |                         7 |                 -25.54 |            |
| 2019-09-01 00:00:00.000 |                         1 |                  -0.9  |            |
| 2019-09-14 00:00:00.000 |                         4 |                 -40.36 |            |
| 2019-09-14 00:00:00.000 |                         8 |                  -9.69 |            |
| 2019-09-15 00:00:00.000 |                         3 |                 -11.95 |            |
| 2019-09-15 00:00:00.000 |                         3 |                 -23.82 |            |
| 2019-09-15 00:00:00.000 |                         3 |                -139.6  |            |
| 2019-09-25 00:00:00.000 |                         2 |                 -34.95 |            |
| 2019-09-25 00:00:00.000 |                         8 |                 -34.95 |            |
| 2019-09-28 00:00:00.000 |                         7 |                 -50    |            |


Table: Metric Selection
| Metric                   |   Metric ID |
|:-------------------------|------------:|
| Revenue                  |           1 |
| Cost                     |           2 |
| Net Income & Expenditure |           3 |
| Profit                   |           4 |


Table: Products
|   Product ID |
|-------------:|
|            1 |
|            2 |
|            3 |
|            4 |
|            5 |
|            6 |
|            7 |
|            8 |
|            9 |


Table: Purchase
| Date                    |   Shipping ID |   Subproduct ID |   Number of Boxes |
|:------------------------|--------------:|----------------:|------------------:|
| 2019-09-01 00:00:00.000 |             1 |              91 |                 2 |
| 2019-09-01 00:00:00.000 |             2 |              42 |                 4 |
| 2019-09-01 00:00:00.000 |             2 |              52 |                 3 |
| 2019-09-01 00:00:00.000 |             2 |              32 |                 4 |
| 2019-09-26 00:00:00.000 |             3 |              43 |                 8 |
| 2019-09-26 00:00:00.000 |             3 |              53 |                 7 |
| 2019-09-26 00:00:00.000 |             3 |              33 |                 4 |
| 2019-10-10 00:00:00.000 |             4 |              44 |                20 |
| 2019-10-10 00:00:00.000 |             4 |              74 |                 4 |
| 2019-10-10 00:00:00.000 |             4 |              84 |                 4 |


Table: Sales
| Date                    |   Subproduct ID |   Client ID |   Units Sold |   Sale Price | Type of Payment   | Payment Status   |   Status ID |   Order ID |
|:------------------------|----------------:|------------:|-------------:|-------------:|:------------------|:-----------------|------------:|-----------:|
| 2019-09-04 00:00:00.000 |              42 |           6 |            1 |         6.5  | Trans Bancaria    | Pagado           |           2 |          1 |
| 2019-09-18 00:00:00.000 |              42 |           6 |            1 |         6.13 | Trans Bancaria    | Pagado           |           2 |         12 |
| 2019-09-18 00:00:00.000 |              52 |           6 |            1 |         7.62 | Trans Bancaria    | Pagado           |           2 |         12 |
| 2019-09-18 00:00:00.000 |              32 |           6 |            1 |         3.13 | Trans Bancaria    | Pagado           |           2 |         12 |
| 2019-09-18 00:00:00.000 |              91 |           6 |            1 |         1.63 | Trans Bancaria    | Pagado           |           2 |         12 |
| 2019-09-28 00:00:00.000 |              43 |           6 |            1 |         6.17 | Trans Bancaria    | Pagado           |           2 |         21 |
| 2019-09-28 00:00:00.000 |              32 |           6 |            1 |         3.17 | Trans Bancaria    | Pagado           |           2 |         21 |
| 2019-09-28 00:00:00.000 |              91 |           6 |            1 |         1.67 | Trans Bancaria    | Pagado           |           2 |         21 |
| 2019-09-30 00:00:00.000 |              33 |           6 |            1 |         3.5  | Trans Bancaria    | Pagado           |           2 |         23 |
| 2019-09-30 00:00:00.000 |              43 |           6 |            1 |         6.5  | Trans Bancaria    | Pagado           |           2 |         23 |


Table: Shipping
|   Shipping ID | Date                    |   Shipping Cost |   Handling Fee |   Pallet Weight |   Nett Shipping Weight |
|--------------:|:------------------------|----------------:|---------------:|----------------:|-----------------------:|
|             1 | 2019-09-01 00:00:00.000 |            0    |            0   |               0 |                  16.8  |
|             2 | 2019-09-01 00:00:00.000 |           60    |            0   |               0 |                  38.96 |
|             3 | 2019-09-26 00:00:00.000 |           80    |            0   |               0 |                  75.12 |
|             4 | 2019-10-10 00:00:00.000 |           60    |            0   |              16 |                  88    |
|             5 | 2019-12-04 00:00:00.000 |          162.86 |            0   |              16 |                 149.6  |
|             6 | 2020-02-01 00:00:00.000 |          288.1  |            0   |              16 |                 409.86 |
|             7 | 2020-02-11 00:00:00.000 |          118.72 |            0   |              16 |                  83.9  |
|             8 | 2020-02-15 00:00:00.000 |            0    |            0   |               0 |                  28.8  |
|             9 | 2020-06-01 00:00:00.000 |          905.14 |           22.5 |              16 |                1213.28 |
|            10 | 2020-06-09 00:00:00.000 |            0    |            0   |               0 |                  28.8  |


Table: Subproducts
|   Product ID |   Shipping ID |   Subproduct ID |   Supplier Price |   Nett Weight |   Nett + Tare Weight |   Units per Box |   Product Weight | Expiration Date         |   Shipping Cost per Product |   Purchase Cost per Product |
|-------------:|--------------:|----------------:|-----------------:|--------------:|---------------------:|----------------:|-----------------:|:------------------------|----------------------------:|----------------------------:|
|            9 |             1 |              91 |             0.5  |         0.35  |                0.42  |              24 |           10.18  | 2020-09-30 00:00:00.000 |                      0      |                      0.5    |
|            4 |             2 |              42 |             3.99 |         0.38  |                0.582 |               8 |            4.768 | 2020-09-30 00:00:00.000 |                      0.5852 |                      4.5752 |
|            5 |             2 |              52 |             4.99 |         0.5   |                0.568 |              12 |            6.966 | 2021-03-31 00:00:00.000 |                      0.77   |                      5.76   |
|            3 |             2 |              32 |             1.79 |         0.1   |                0.11  |              22 |            2.485 | 2020-09-26 00:00:00.000 |                      0.154  |                      1.944  |
|            4 |             3 |              43 |             3.99 |         0.38  |                0.582 |               8 |            4.768 | 2020-09-30 00:00:00.000 |                      0.4047 |                      4.3947 |
|            5 |             3 |              53 |             4.99 |         0.5   |                0.568 |              12 |            6.966 | 2021-03-31 00:00:00.000 |                      0.5325 |                      5.5225 |
|            3 |             3 |              33 |             1.79 |         0.1   |                0.11  |              22 |            2.485 | 2020-09-26 00:00:00.000 |                      0.1065 |                      1.8965 |
|            4 |             4 |              44 |             3.99 |         0.38  |                0.582 |               8 |            4.768 | 2020-09-30 00:00:00.000 |                      0.2591 |                      4.2491 |
|            7 |             4 |              74 |             4.99 |         0.5   |                0.512 |              10 |            5.44  | 2021-03-31 00:00:00.000 |                      0.3409 |                      5.3309 |
|            8 |             4 |              84 |             0.35 |         0.018 |                0.02  |             100 |            2.13  | 2021-03-31 00:00:00.000 |                      0.0123 |                      0.3623 |

 


tables: name: Dates
data: Dates.csv
name: Income & Expenditure DB
data: Income & Expenditure DB.csv
name: Income & Expenditure
data: Income & Expenditure.csv
name: Metric Selection
data: Metric Selection.csv
name: Products
data: Products.csv
name: Purchase
data: Purchase.csv
name: Sales
data: Sales.csv
name: Shipping
data: Shipping.csv
name: Subproducts
data: Subproducts.csv
label: Subproducts
Product ID
Products
Product ID
Purchase
Date
Dates
Date
Purchase
Subproduct ID
Subproducts
Subproduct ID
Subproducts
Shipping ID
Shipping
Shipping ID
Sales
Date
Dates
Date
Sales
Subproduct ID
Subproducts
Subproduct ID
Income & Expenditure
Income & Expenditure ID
Income & Expenditure DB
Income & Expenditure Category ID
Income & Expenditure
Date
Dates
Date
output: {
    "joins": [
        {
            "from_table": "Subproducts",
            "from_column": "Product ID",
            "to_table": "Products",
            "to_column": "Product ID"
        },
        {
            "from_table": "Purchase",
            "from_column": "Date",
            "to_table": "Dates",
            "to_column": "Date"
        },
        {
            "from_table": "Purchase",
            "from_column": "Subproduct ID",
            "to_table": "Subproducts",
            "to_column": "Subproduct ID"
        },
        {
            "from_table": "Subproducts",
            "from_column": "Shipping ID",
            "to_table": "Shipping",
            "to_column": "Shipping ID"
        },
        {
            "from_table": "Sales",
            "from_column": "Date",
            "to_table": "Dates",
            "to_column": "Date"
        },
        {
            "from_table": "Sales",
            "from_column": "Subproduct ID",
            "to_table": "Subproducts",
            "to_column": "Subproduct ID"
        },
        {
            "from_table": "Income & Expenditure",
            "from_column": "Income & Expenditure ID",
            "to_table": "Income & Expenditure DB",
            "to_column": "Income & Expenditure Category ID"
        },
        {
            "from_table": "Income & Expenditure",
            "from_column": "Date",
            "to_table": "Dates",
            "to_column": "Date"
        }
    ]
}