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: #Measures
| Value   |
|:--------|
|         |


Table: contracts
| start_date              | end_date                | customer_id   | location_id   | contract_id   |
|:------------------------|:------------------------|:--------------|:--------------|:--------------|
| 2021-04-15 00:00:00.000 | 2030-08-14 00:00:00.000 | C-4703        | L-67279       | A-48731       |
| 2022-12-15 00:00:00.000 | 2033-12-14 00:00:00.000 | C-67179       | L-65920       | A-79646       |
| 2014-05-01 00:00:00.000 | 2022-08-31 00:00:00.000 | C-67179       | L-18057       | A-95967       |
| 2022-09-01 00:00:00.000 | 2034-08-31 00:00:00.000 | C-67179       | L-18057       | A-89651       |
| 2016-10-01 00:00:00.000 | 2033-01-31 00:00:00.000 | C-60922       | L-10546       | A-89494       |
| 2008-02-01 00:00:00.000 | 2022-05-31 00:00:00.000 | C-87155       | L-33916       | A-82648       |
| 2022-06-01 00:00:00.000 | 2035-05-31 00:00:00.000 | C-99737       | L-33916       | A-56103       |
| 2018-10-01 00:00:00.000 | 2032-09-30 00:00:00.000 | C-15567       | L-51837       | A-13909       |
| 2023-06-01 00:00:00.000 | 2036-09-30 00:00:00.000 | C-58246       | L-40747       | A-20270       |
| 2015-09-15 00:00:00.000 | 2025-09-14 00:00:00.000 | C-96781       | L-18814       | A-24890       |


Table: customers
| name                         | customer_id   |
|:-----------------------------|:--------------|
| Stahr                        | C-9432        |
| Rogner AG                    | C-85916       |
| Walter Scholl GmbH           | C-16305       |
| Trommler                     | C-87155       |
| Atzler AG & Co. OHG          | C-65121       |
| Geißler                      | C-57049       |
| Pieper                       | C-46788       |
| Klotz                        | C-21868       |
| Wirth Trommler GmbH & Co. KG | C-10305       |
| Harloff Eberth AG            | C-91791       |


Table: locations
| location_id   | address                     | construction_date       |
|:--------------|:----------------------------|:------------------------|
| L-67279       | Hesergasse 735              | 2020-09-15 00:00:00.000 |
| L-65920       | Beerstr. 458                | 2022-04-15 00:00:00.000 |
| L-18057       | Misichergasse 5/0           | 2012-12-01 00:00:00.000 |
| L-10546       | Bienallee 34                | 2016-01-01 00:00:00.000 |
| L-33916       | Scheelgasse 1/8             | 2007-04-01 00:00:00.000 |
| L-51837       | Gutknechtgasse 2            | 2017-07-01 00:00:00.000 |
| L-40747       | Aleksandra-Dowerg-Ring 946  | 2022-10-01 00:00:00.000 |
| L-18814       | Theresa-Hornig-Ring 908     | 2015-01-15 00:00:00.000 |
| L-59990       | Lehmannweg 1/5              | 2024-11-15 00:00:00.000 |
| L-90231       | Hans-Rainer-Preiß-Platz 673 | 2018-08-01 00:00:00.000 |


Table: monthly_data
| term_id   | month                   |   sqm |    rent |   effective_days |   days_in_month |
|:----------|:------------------------|------:|--------:|-----------------:|----------------:|
| A-56325-0 | 2024-10-01 00:00:00.000 |   856 | 26150.8 |               31 |              31 |
| A-56325-0 | 2024-12-01 00:00:00.000 |   856 | 26150.8 |               31 |              31 |
| A-56325-0 | 2025-01-01 00:00:00.000 |   856 | 26150.8 |               31 |              31 |
| A-56325-0 | 2025-03-01 00:00:00.000 |   856 | 26150.8 |               31 |              31 |
| A-56325-0 | 2025-05-01 00:00:00.000 |   856 | 26150.8 |               31 |              31 |
| A-56325-0 | 2025-07-01 00:00:00.000 |   856 | 26150.8 |               31 |              31 |
| A-56325-0 | 2025-08-01 00:00:00.000 |   856 | 26150.8 |               31 |              31 |
| A-56325-0 | 2025-10-01 00:00:00.000 |   856 | 26150.8 |               31 |              31 |
| A-56325-0 | 2025-12-01 00:00:00.000 |   856 | 26150.8 |               31 |              31 |
| A-56325-0 | 2026-01-01 00:00:00.000 |   856 | 26150.8 |               31 |              31 |


Table: terms
| contract_id   |   extension | start                   | end                     |   sqm |   monthly_rent | term_id   |
|:--------------|------------:|:------------------------|:------------------------|------:|---------------:|:----------|
| A-10364       |           0 | 2028-08-15 00:00:00.000 | 2033-08-14 00:00:00.000 |  1106 |       29297.9  | A-10364-0 |
| A-1162        |           0 | 2025-06-15 00:00:00.000 | 2031-06-14 00:00:00.000 |   856 |       21785.2  | A-1162-0  |
| A-11944       |           0 | 2012-09-01 00:00:00.000 | 2019-08-31 00:00:00.000 |   308 |        8211.28 | A-11944-0 |
| A-12488       |           0 | 2028-03-15 00:00:00.000 | 2034-07-14 00:00:00.000 |   756 |       22543.9  | A-12488-0 |
| A-13199       |           0 | 2017-02-01 00:00:00.000 | 2026-01-31 00:00:00.000 |   826 |       25308.6  | A-13199-0 |
| A-1350        |           0 | 2022-12-01 00:00:00.000 | 2025-11-30 00:00:00.000 |   777 |       19922.3  | A-1350-0  |
| A-13671       |           0 | 2029-07-01 00:00:00.000 | 2040-10-31 00:00:00.000 |   367 |        8220.8  | A-13671-0 |
| A-13695       |           0 | 2017-10-01 00:00:00.000 | 2023-01-31 00:00:00.000 |   870 |       22776.6  | A-13695-0 |
| A-13829       |           0 | 2021-03-01 00:00:00.000 | 2027-10-31 00:00:00.000 |   334 |        8360.02 | A-13829-0 |
| A-13909       |           0 | 2018-10-01 00:00:00.000 | 2025-05-31 00:00:00.000 |   610 |       17299.6  | A-13909-0 |


Table: TopN
|   Value |
|--------:|
|       1 |
|       2 |
|       3 |
|       4 |
|       5 |
|       6 |
|       7 |
|       8 |
|       9 |
|      10 |

 


tables: name: #Measures
data: #Measures.csv
name: contracts
data: contracts.csv
name: customers
data: customers.csv
name: locations
data: locations.csv
name: monthly_data
data: monthly_data.csv
name: terms
data: terms.csv
name: TopN
data: TopN.csv
label: contracts
customer_id
customers
customer_id
contracts
location_id
locations
location_id
terms
contract_id
contracts
contract_id
monthly_data
term_id
terms
term_id
output: {
    "joins": [
        {
            "from_table": "contracts",
            "from_column": "customer_id",
            "to_table": "customers",
            "to_column": "customer_id"
        },
        {
            "from_table": "contracts",
            "from_column": "location_id",
            "to_table": "locations",
            "to_column": "location_id"
        },
        {
            "from_table": "terms",
            "from_column": "contract_id",
            "to_table": "contracts",
            "to_column": "contract_id"
        },
        {
            "from_table": "monthly_data",
            "from_column": "term_id",
            "to_table": "terms",
            "to_column": "term_id"
        }
    ]
}