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: Budgets
| City             |   Sales Budgets |   Year |
|:-----------------|----------------:|-------:|
| Hamilton         |     5.63018e+06 |   2020 |
| Waitakere        |     4.73398e+06 |   2020 |
| Auckland         |     4.58775e+06 |   2020 |
| Christchurch     |     3.17447e+06 |   2020 |
| Whangarei        |     2.88569e+06 |   2020 |
| Manukau          |     2.774e+06   |   2020 |
| Napier           |     2.51897e+06 |   2020 |
| Waitaki          |     2.25891e+06 |   2020 |
| Palmerston North |     2.05699e+06 |   2020 |
| Clutha           |     2.0417e+06  |   2020 |


Table: Budget_Weightings
| Month Name   |   Monthly Weighting |
|:-------------|--------------------:|
| January      |              0.0766 |
| February     |              0.0575 |
| March        |              0.0566 |
| April        |              0.0652 |
| May          |              0.0659 |
| June         |              0.0953 |
| July         |              0.0963 |
| August       |              0.1024 |
| September    |              0.0915 |
| October      |              0.0908 |


Table: Customers
|   Customer Index | Customer Names   |   Customer Sales | Client Groups   |
|-----------------:|:-----------------|-----------------:|:----------------|
|                1 | Avon Corp        |      2.69477e+06 | Bottom Clients  |
|                2 | WakeFern         |      2.36496e+06 | Bottom Clients  |
|                3 | Elorac, Corp     |      3.20996e+06 | Top Clients     |
|                4 | ETUDE Ltd        |      3.28802e+06 | Top Clients     |
|                5 | Procter Corp     |      2.97421e+06 | Bottom Clients  |
|                6 | PEDIFIX, Corp    |      2.79226e+06 | Bottom Clients  |
|                7 | New Ltd          |      2.86201e+06 | Bottom Clients  |
|                8 | Medsep Group     |      2.82581e+06 | Bottom Clients  |
|                9 | Ei               |      3.27365e+06 | Top Clients     |
|               10 | 21st Ltd         |      3.17011e+06 | Top Clients     |


Table: Dates
| Date                    |   Year |   Quarter Of Year |   Month Of Year |   Day Of Month |   Date Int | Month Name   | Month & Year   | Quarter & Year   |   Day In Week | Day Of Week Name   | Week Ending             |   Week Number |   Month n Year |   Quarter  nYear |   Short Year | FY   | Quarter   | Day Type   | Workday Number   | Weekend Number   | Is less Than Today   |   Week Number Adjusted |   IsWorkday |
|:------------------------|-------:|------------------:|----------------:|---------------:|-----------:|:-------------|:---------------|:-----------------|--------------:|:-------------------|:------------------------|--------------:|---------------:|-----------------:|-------------:|:-----|:----------|:-----------|:-----------------|:-----------------|:---------------------|-----------------------:|------------:|
| 2017-07-01 00:00:00.000 |   2017 |                 3 |               7 |              1 |   20170701 | July         | Jul 2017       | Q3 2017          |             6 | Saturday           | 2017-07-01 00:00:00.000 |            26 |       20170700 |         20170300 |           17 | FY18 | Q3        | Weekend    |                  | 1                | True                 |                     26 |           0 |
| 2017-07-02 00:00:00.000 |   2017 |                 3 |               7 |              2 |   20170702 | July         | Jul 2017       | Q3 2017          |             0 | Sunday             | 2017-07-08 00:00:00.000 |            27 |       20170700 |         20170300 |           17 | FY18 | Q3        | Workday    | 1                |                  | True                 |                     27 |           1 |
| 2017-07-03 00:00:00.000 |   2017 |                 3 |               7 |              3 |   20170703 | July         | Jul 2017       | Q3 2017          |             1 | Monday             | 2017-07-08 00:00:00.000 |            27 |       20170700 |         20170300 |           17 | FY18 | Q3        | Workday    | 2                |                  | True                 |                     27 |           1 |
| 2017-07-04 00:00:00.000 |   2017 |                 3 |               7 |              4 |   20170704 | July         | Jul 2017       | Q3 2017          |             2 | Tuesday            | 2017-07-08 00:00:00.000 |            27 |       20170700 |         20170300 |           17 | FY18 | Q3        | Workday    | 3                |                  | True                 |                     27 |           1 |
| 2017-07-05 00:00:00.000 |   2017 |                 3 |               7 |              5 |   20170705 | July         | Jul 2017       | Q3 2017          |             3 | Wednesday          | 2017-07-08 00:00:00.000 |            27 |       20170700 |         20170300 |           17 | FY18 | Q3        | Workday    | 4                |                  | True                 |                     27 |           1 |
| 2017-07-06 00:00:00.000 |   2017 |                 3 |               7 |              6 |   20170706 | July         | Jul 2017       | Q3 2017          |             4 | Thursday           | 2017-07-08 00:00:00.000 |            27 |       20170700 |         20170300 |           17 | FY18 | Q3        | Workday    | 5                |                  | True                 |                     27 |           1 |
| 2017-07-07 00:00:00.000 |   2017 |                 3 |               7 |              7 |   20170707 | July         | Jul 2017       | Q3 2017          |             5 | Friday             | 2017-07-08 00:00:00.000 |            27 |       20170700 |         20170300 |           17 | FY18 | Q3        | Weekend    |                  | 2                | True                 |                     27 |           0 |
| 2017-07-08 00:00:00.000 |   2017 |                 3 |               7 |              8 |   20170708 | July         | Jul 2017       | Q3 2017          |             6 | Saturday           | 2017-07-08 00:00:00.000 |            27 |       20170700 |         20170300 |           17 | FY18 | Q3        | Weekend    |                  | 3                | True                 |                     27 |           0 |
| 2017-07-09 00:00:00.000 |   2017 |                 3 |               7 |              9 |   20170709 | July         | Jul 2017       | Q3 2017          |             0 | Sunday             | 2017-07-15 00:00:00.000 |            28 |       20170700 |         20170300 |           17 | FY18 | Q3        | Workday    | 6                |                  | True                 |                     28 |           1 |
| 2017-07-10 00:00:00.000 |   2017 |                 3 |               7 |             10 |   20170710 | July         | Jul 2017       | Q3 2017          |             1 | Monday             | 2017-07-15 00:00:00.000 |            28 |       20170700 |         20170300 |           17 | FY18 | Q3        | Workday    | 7                |                  | True                 |                     28 |           1 |


Table: Groups For Pricing
| Pricing Group   |   Min Price |   Max Price |
|:----------------|------------:|------------:|
| Low             |           0 |        1000 |
| Mid             |        1000 |        3000 |
| High            |        3000 |   100000000 |


Table: Products
|   Index | Product Name   |       Sales | Product Groups   |   Average Pricing |   Cumulative Product Sales (EARLIER) |   Cumulative Product Sales (VAR) |
|--------:|:---------------|------------:|:-----------------|------------------:|-------------------------------------:|---------------------------------:|
|       1 | Product 1      | 2.54893e+07 | Top              |           2304.64 |                          2.54893e+07 |                      2.54893e+07 |
|       2 | Product 2      | 2.28465e+07 | Top              |           2285.53 |                          9.00998e+07 |                      9.00998e+07 |
|       3 | Product 3      | 3.06628e+06 | Bottom           |           2194.27 |                          9.31661e+07 |                      9.31661e+07 |
|       4 | Product 4      | 2.85729e+06 | Bottom           |           2121.6  |                          9.60234e+07 |                      9.60234e+07 |
|       5 | Product 5      | 1.70212e+07 | Top              |           2349.16 |                          1.13045e+08 |                      1.13045e+08 |
|       6 | Product 6      | 3.34122e+06 | Bottom           |           2318.39 |                          1.16386e+08 |                      1.16386e+08 |
|       7 | Product 7      | 2.57101e+07 | Top              |           2313.74 |                          1.42096e+08 |                      1.42096e+08 |
|       8 | Product 8      | 3.2156e+06  | Bottom           |           2290.02 |                          1.45311e+08 |                      1.45311e+08 |
|       9 | Product 9      | 9.26164e+06 | Bottom           |           2171.29 |                          1.54573e+08 |                      1.54573e+08 |
|      10 | Product 10     | 3.11401e+06 | Bottom           |           2214.62 |                          2.86033e+07 |                      2.86033e+07 |


Table: Regions
|   Index | Suburb            | City              |   postcode |   Longitude | Latitude    | Full Address                              |
|--------:|:------------------|:------------------|-----------:|------------:|:------------|:------------------------------------------|
|       1 | Freemans Bay      | Auckland          |       1011 |     174.749 | - 36.855732 | Picton Street, Freemans Bay, Auckland     |
|       2 | Nightcaps         | Southland         |       9630 |     168.029 | - 45.9703   | Lyne Street, Nightcaps, Southland         |
|       3 | Northcote         | North Shore       |        627 |     174.756 | - 36.804712 | McBreen Avenue, Northcote, North Shore    |
|       4 | Bay View          | Napier            |       4104 |     176.872 | - 39.440389 | Ferguson Street South, Bay View, Napier   |
|       5 | Parklands         | Christchurch      |       8083 |     172.706 | - 43.472699 | Forest Drive, Parklands, Christchurch     |
|       6 | Hamilton East     | Hamilton          |       3216 |     175.305 | - 37.781657 | Rochford Court, Hamilton, Hamilton        |
|       7 | Te Kuiti          | Waitomo           |       3910 |     175.163 | - 38.330973 | Alexandra Street, Te Kuiti, Waitomo       |
|       8 | Opaheke           | Papakura          |       2113 |     174.948 | - 37.077401 | Rhonda Place, Opaheke, Papakura           |
|       9 | North East Valley | Dunedin           |       9010 |     170.527 | - 45.846837 | Selwyn Street, North East Valley, Dunedin |
|      10 | Whangamata        | Thames-Coromandel |       3620 |     175.883 | - 37.219172 | Pipi Road, Whangamata, Thames-Coromandel  |


Table: Sales
| OrderNumber   | OrderDate               | Ship Date               |   Customer Name Index | Channel   | Currency Code   | Warehouse Code   |   Delivery Region Index |   Product Description Index |   Order Quantity |   Total Unit Price |   Total Unit Cost |   Total Revenue | RELATED Example   |   Order To Ship | Pricing Groups   |
|:--------------|:------------------------|:------------------------|----------------------:|:----------|:----------------|:-----------------|------------------------:|----------------------------:|-----------------:|-------------------:|------------------:|----------------:|:------------------|----------------:|:-----------------|
| SO - 000153   | 2019-08-19 00:00:00.000 | 2019-10-24 00:00:00.000 |                     8 | Wholesale | NZD             | AXW291           |                      20 |                           7 |               11 |             3926.2 |          3062.44  |         43188.2 | Top               |              66 | High             |
| SO - 000175   | 2019-08-23 00:00:00.000 | 2019-09-24 00:00:00.000 |                     1 | Wholesale | NZD             | AXW291           |                      20 |                           7 |               11 |             2224.4 |          1579.32  |         24468.4 | Top               |              32 | Mid              |
| SO - 000192   | 2019-08-25 00:00:00.000 | 2019-10-30 00:00:00.000 |                    24 | Wholesale | NZD             | AXW291           |                      31 |                           7 |                8 |             1152.4 |           622.296 |          9219.2 | Top               |              66 | Mid              |
| SO - 000194   | 2019-08-26 00:00:00.000 | 2019-10-30 00:00:00.000 |                    11 | Wholesale | NZD             | AXW291           |                      27 |                           7 |                5 |             5031.7 |          4025.36  |         25158.5 | Top               |              65 | High             |
| SO - 000258   | 2019-09-01 00:00:00.000 | 2019-10-25 00:00:00.000 |                    28 | Wholesale | NZD             | AXW291           |                       6 |                           7 |               11 |             2385.2 |          1502.68  |         26237.2 | Top               |              54 | Mid              |
| SO - 000262   | 2019-09-01 00:00:00.000 | 2019-10-23 00:00:00.000 |                    31 | Wholesale | NZD             | AXW291           |                      20 |                           7 |                8 |             1105.5 |           652.245 |          8844   | Top               |              52 | Mid              |
| SO - 000269   | 2019-09-02 00:00:00.000 | 2019-11-09 00:00:00.000 |                     8 | Wholesale | NZD             | AXW291           |                      14 |                           7 |                5 |              844.2 |           540.288 |          4221   | Top               |              68 | Low              |
| SO - 000316   | 2019-09-10 00:00:00.000 | 2019-11-10 00:00:00.000 |                    14 | Wholesale | NZD             | AXW291           |                      25 |                           7 |                5 |             3939.6 |          1969.8   |         19698   | Top               |              61 | High             |
| SO - 000368   | 2019-09-15 00:00:00.000 | 2019-10-15 00:00:00.000 |                     1 | Wholesale | NZD             | AXW291           |                      29 |                           7 |               10 |             5098.7 |          3416.13  |         50987   | Top               |              30 | High             |
| SO - 000482   | 2019-09-29 00:00:00.000 | 2019-12-24 00:00:00.000 |                    42 | Wholesale | NZD             | AXW291           |                      25 |                           7 |                6 |              864.3 |           726.012 |          5185.8 | Top               |              86 | Low              |

 


tables: name: Budgets
data: Budgets.csv
name: Budget_Weightings
data: Budget_Weightings.csv
name: Customers
data: Customers.csv
name: Dates
data: Dates.csv
name: Groups For Pricing
data: Groups For Pricing.csv
name: Products
data: Products.csv
name: Regions
data: Regions.csv
name: Sales
data: Sales.csv
label: Sales
OrderDate
Dates
Date
Sales
Product Description Index
Products
Index
Sales
Customer Name Index
Customers
Customer Index
Sales
Delivery Region Index
Regions
Index
output: {
    "joins": [
        {
            "from_table": "Sales",
            "from_column": "OrderDate",
            "to_table": "Dates",
            "to_column": "Date"
        },
        {
            "from_table": "Sales",
            "from_column": "Product Description Index",
            "to_table": "Products",
            "to_column": "Index"
        },
        {
            "from_table": "Sales",
            "from_column": "Customer Name Index",
            "to_table": "Customers",
            "to_column": "Customer Index"
        },
        {
            "from_table": "Sales",
            "from_column": "Delivery Region Index",
            "to_table": "Regions",
            "to_column": "Index"
        }
    ]
}