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: Accounts
|   AccountID | AccountL   | Account    |
|------------:|:-----------|:-----------|
|           1 | Account 1  | ACCOUNT 1  |
|           2 | Account 2  | ACCOUNT 2  |
|           3 | Account 3  | ACCOUNT 3  |
|           4 | Account 4  | ACCOUNT 4  |
|           5 | Account 5  | ACCOUNT 5  |
|           6 | Account 6  | ACCOUNT 6  |
|           7 | Account 7  | ACCOUNT 7  |
|           8 | Account 8  | ACCOUNT 8  |
|           9 | Account 9  | ACCOUNT 9  |
|          10 | Account 10 | ACCOUNT 10 |


Table: Dates
| Date                    |   MonthNum | Month   | MonthLong   | Quarter   |   Year |   MonthYearNum | MonthYear   | MonthYearLong   | WeekDate                |   Week of Year |   Day of Year |   ProdFlagDates | ProdWkStarting          | ProdWkEnding            | ProdStartasCurrentWk    |   ProdRelativeWk# | Prod Week Number      |   ProdDay# | Prod Day Number   |   ProdWeekday | Week Ending             | Week       |
|:------------------------|-----------:|:--------|:------------|:----------|-------:|---------------:|:------------|:----------------|:------------------------|---------------:|--------------:|----------------:|:------------------------|:------------------------|:------------------------|------------------:|:----------------------|-----------:|:------------------|--------------:|:------------------------|:-----------|
| 2020-07-01 00:00:00.000 |          7 | Jul     | July        | Q3        |   2020 |         202007 | Jul-20      | Jul-2020        | 2020-06-28 00:00:00.000 |             27 |           183 |               1 | 2020-06-29 00:00:00.000 | 2020-07-05 00:00:00.000 | 1899-12-31 00:00:00.000 |           6288.14 | Week 6288.14285714286 |      44014 | Day 44014         |             3 | 2020-07-05 00:00:00.000 | 2020 Wk 27 |
| 2020-07-02 00:00:00.000 |          7 | Jul     | July        | Q3        |   2020 |         202007 | Jul-20      | Jul-2020        | 2020-06-28 00:00:00.000 |             27 |           184 |               1 | 2020-06-29 00:00:00.000 | 2020-07-05 00:00:00.000 | 1899-12-31 00:00:00.000 |           6288.14 | Week 6288.14285714286 |      44015 | Day 44015         |             4 | 2020-07-05 00:00:00.000 | 2020 Wk 27 |
| 2020-07-03 00:00:00.000 |          7 | Jul     | July        | Q3        |   2020 |         202007 | Jul-20      | Jul-2020        | 2020-06-28 00:00:00.000 |             27 |           185 |               1 | 2020-06-29 00:00:00.000 | 2020-07-05 00:00:00.000 | 1899-12-31 00:00:00.000 |           6288.14 | Week 6288.14285714286 |      44016 | Day 44016         |             5 | 2020-07-05 00:00:00.000 | 2020 Wk 27 |
| 2020-07-04 00:00:00.000 |          7 | Jul     | July        | Q3        |   2020 |         202007 | Jul-20      | Jul-2020        | 2020-06-28 00:00:00.000 |             27 |           186 |               1 | 2020-06-29 00:00:00.000 | 2020-07-05 00:00:00.000 | 1899-12-31 00:00:00.000 |           6288.14 | Week 6288.14285714286 |      44017 | Day 44017         |             6 | 2020-07-05 00:00:00.000 | 2020 Wk 27 |
| 2020-07-05 00:00:00.000 |          7 | Jul     | July        | Q3        |   2020 |         202007 | Jul-20      | Jul-2020        | 2020-07-05 00:00:00.000 |             28 |           187 |               1 | 2020-06-29 00:00:00.000 | 2020-07-05 00:00:00.000 | 1899-12-31 00:00:00.000 |           6288.14 | Week 6288.14285714286 |      44018 | Day 44018         |             7 | 2020-07-05 00:00:00.000 | 2020 Wk 28 |
| 2020-07-06 00:00:00.000 |          7 | Jul     | July        | Q3        |   2020 |         202007 | Jul-20      | Jul-2020        | 2020-07-05 00:00:00.000 |             28 |           188 |               1 | 2020-07-06 00:00:00.000 | 2020-07-12 00:00:00.000 | 1899-12-31 00:00:00.000 |           6289.14 | Week 6289.14285714286 |      44019 | Day 44019         |             1 | 2020-07-12 00:00:00.000 | 2020 Wk 28 |
| 2020-07-07 00:00:00.000 |          7 | Jul     | July        | Q3        |   2020 |         202007 | Jul-20      | Jul-2020        | 2020-07-05 00:00:00.000 |             28 |           189 |               1 | 2020-07-06 00:00:00.000 | 2020-07-12 00:00:00.000 | 1899-12-31 00:00:00.000 |           6289.14 | Week 6289.14285714286 |      44020 | Day 44020         |             2 | 2020-07-12 00:00:00.000 | 2020 Wk 28 |
| 2020-07-08 00:00:00.000 |          7 | Jul     | July        | Q3        |   2020 |         202007 | Jul-20      | Jul-2020        | 2020-07-05 00:00:00.000 |             28 |           190 |               1 | 2020-07-06 00:00:00.000 | 2020-07-12 00:00:00.000 | 1899-12-31 00:00:00.000 |           6289.14 | Week 6289.14285714286 |      44021 | Day 44021         |             3 | 2020-07-12 00:00:00.000 | 2020 Wk 28 |
| 2020-07-09 00:00:00.000 |          7 | Jul     | July        | Q3        |   2020 |         202007 | Jul-20      | Jul-2020        | 2020-07-05 00:00:00.000 |             28 |           191 |               1 | 2020-07-06 00:00:00.000 | 2020-07-12 00:00:00.000 | 1899-12-31 00:00:00.000 |           6289.14 | Week 6289.14285714286 |      44022 | Day 44022         |             4 | 2020-07-12 00:00:00.000 | 2020 Wk 28 |
| 2020-07-10 00:00:00.000 |          7 | Jul     | July        | Q3        |   2020 |         202007 | Jul-20      | Jul-2020        | 2020-07-05 00:00:00.000 |             28 |           192 |               1 | 2020-07-06 00:00:00.000 | 2020-07-12 00:00:00.000 | 1899-12-31 00:00:00.000 |           6289.14 | Week 6289.14285714286 |      44023 | Day 44023         |             5 | 2020-07-12 00:00:00.000 | 2020 Wk 28 |


Table: Plan
|   TitleID | Wk Ending               |   WeekNum | Week #   |   Plan |
|----------:|:------------------------|----------:|:---------|-------:|
|         1 | 2020-02-16 00:00:00.000 |         1 | Week 1   | 741069 |
|         1 | 2020-02-23 00:00:00.000 |         2 | Week 2   | 426676 |
|         1 | 2020-03-01 00:00:00.000 |         3 | Week 3   | 294770 |
|         1 | 2020-03-08 00:00:00.000 |         4 | Week 4   | 190881 |
|         1 | 2020-03-15 00:00:00.000 |         5 | Week 5   | 134740 |
|         1 | 2020-03-22 00:00:00.000 |         6 | Week 6   | 107792 |
|         1 | 2020-03-29 00:00:00.000 |         7 | Week 7   |  78598 |
|         1 | 2020-04-05 00:00:00.000 |         8 | Week 8   |  67370 |
|         1 | 2020-04-12 00:00:00.000 |         9 | Week 9   |  69616 |
|         1 | 2020-04-19 00:00:00.000 |        10 | Week 10  |  56142 |


Table: Product
|   TitleID | Title     | Release Date            |   Ultimate Rev |   Ultimate Txns |   Ultimate Contribution |
|----------:|:----------|:------------------------|---------------:|----------------:|------------------------:|
|         1 | Product 1 | 2020-02-11 00:00:00.000 |    1.07526e+07 |     2.66643e+06 |             9.93794e+06 |
|         2 | Product 2 | 2020-03-10 00:00:00.000 |    6.8554e+06  |     1.7e+06     |             6.3343e+06  |


Table: Sales
|   TitleID | Title/Season   |   Release Date | Territory     | Account   | SalesDate               | Metrics   |   Values |
|----------:|:---------------|---------------:|:--------------|:----------|:------------------------|:----------|---------:|
|         1 | Product 1      |          43872 | United States | Account 7 | 2020-02-11 00:00:00.000 | Buys      |      156 |
|         1 | Product 1      |          43872 | United States | Account 7 | 2020-02-11 00:00:00.000 | Buys      |     2786 |
|         1 | Product 1      |          43872 | United States | Account 7 | 2020-02-12 00:00:00.000 | Buys      |      287 |
|         1 | Product 1      |          43872 | United States | Account 7 | 2020-02-12 00:00:00.000 | Buys      |     6681 |
|         1 | Product 1      |          43872 | United States | Account 7 | 2020-02-13 00:00:00.000 | Buys      |      375 |
|         1 | Product 1      |          43872 | United States | Account 7 | 2020-02-13 00:00:00.000 | Buys      |     4857 |
|         1 | Product 1      |          43872 | United States | Account 7 | 2020-02-14 00:00:00.000 | Buys      |      494 |
|         1 | Product 1      |          43872 | United States | Account 7 | 2020-02-14 00:00:00.000 | Buys      |     5602 |
|         1 | Product 1      |          43872 | United States | Account 7 | 2020-02-15 00:00:00.000 | Buys      |     1573 |
|         1 | Product 1      |          43872 | United States | Account 7 | 2020-02-15 00:00:00.000 | Buys      |    14985 |


Table: Territory
|   TerritoryID | Territory     | TerrAbbrev   |
|--------------:|:--------------|:-------------|
|             1 | United States | US           |
|             2 | Canada        | CA           |

 


tables: name: Accounts
data: Accounts.csv
name: Dates
data: Dates.csv
name: Plan
data: Plan.csv
name: Product
data: Product.csv
name: Sales
data: Sales.csv
name: Territory
data: Territory.csv
label: Sales
SalesDate
Dates
Date
Plan
Wk Ending
Dates
Date
Sales
Territory
Territory
Territory
Sales
Account
Accounts
Account
Sales
TitleID
Product
TitleID
Plan
TitleID
Product
TitleID
output: {
    "joins": [
        {
            "from_table": "Sales",
            "from_column": "SalesDate",
            "to_table": "Dates",
            "to_column": "Date"
        },
        {
            "from_table": "Plan",
            "from_column": "Wk Ending",
            "to_table": "Dates",
            "to_column": "Date"
        },
        {
            "from_table": "Sales",
            "from_column": "Territory",
            "to_table": "Territory",
            "to_column": "Territory"
        },
        {
            "from_table": "Sales",
            "from_column": "Account",
            "to_table": "Accounts",
            "to_column": "Account"
        },
        {
            "from_table": "Sales",
            "from_column": "TitleID",
            "to_table": "Product",
            "to_column": "TitleID"
        },
        {
            "from_table": "Plan",
            "from_column": "TitleID",
            "to_table": "Product",
            "to_column": "TitleID"
        }
    ]
}