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
|   Order | Account                    |   AccountType |
|--------:|:---------------------------|--------------:|
|       1 | Product revenue            |             1 |
|       2 | Service and other revenue  |             1 |
|       3 | Revenue                    |             1 |
|       4 | Product cost               |             2 |
|       5 | Service and other costs    |             2 |
|       6 | Gross margin               |             1 |
|       7 | Research and development   |             2 |
|       8 | Sales and marketing        |             2 |
|       9 | General and administrative |             2 |
|      10 | Restructuring              |             2 |


Table: AccountsHierarchy
|   AccountGroupID |   AccountID | Account group              | Account                    |
|-----------------:|------------:|:---------------------------|:---------------------------|
|                1 |           1 | Revenue                    | Product revenue            |
|                1 |           2 | Revenue                    | Service and other revenue  |
|                2 |           3 | Gross margin               | Product cost               |
|                2 |           4 | Gross margin               | Service and other costs    |
|                3 |           6 | Operating income           | Research and development   |
|                3 |           7 | Operating income           | Sales and marketing        |
|                3 |           8 | Operating income           | General and administrative |
|                3 |           9 | Operating income           | Restructuring              |
|                4 |          11 | Income before income taxes | Other income, net          |
|                5 |          12 | Net income                 | Provision for income taxes |


Table: BusinessUnits
|   BusinessUnitID | BusinessUnit   | Division      | Group     |
|-----------------:|:---------------|:--------------|:----------|
|                1 | Baby Care BU   | Personal care | Baby Care |
|                4 | Hair Care BU   | Personal care | Hair Care |
|                5 | Oral Care BU   | Personal care | Oral Care |
|                6 | Skin Care BU   | Personal care | Skin Care |
|                7 | Accessories    | Electronics   | Comp      |
|                8 | Desktop PC     | Electronics   | Comp      |
|                9 | Laptops        | Electronics   | Comp      |
|               10 | Monitors       | Electronics   | Comp      |
|               16 | Cameras        | Electronics   | Video     |
|               17 | TV             | Electronics   | Video     |


Table: Calendar
| Date                    |   Year |   MonthNo | Month   | Quarter   | YearMonth   |   WeekdayNo | Weekday   |
|:------------------------|-------:|----------:|:--------|:----------|:------------|------------:|:----------|
| 2016-01-01 00:00:00.000 |   2016 |         1 | Jan     | Q1        | 2016-01     |           5 | Fri       |
| 2016-01-02 00:00:00.000 |   2016 |         1 | Jan     | Q1        | 2016-01     |           6 | Sat       |
| 2016-01-03 00:00:00.000 |   2016 |         1 | Jan     | Q1        | 2016-01     |           7 | Sun       |
| 2016-01-04 00:00:00.000 |   2016 |         1 | Jan     | Q1        | 2016-01     |           1 | Mon       |
| 2016-01-05 00:00:00.000 |   2016 |         1 | Jan     | Q1        | 2016-01     |           2 | Tue       |
| 2016-01-06 00:00:00.000 |   2016 |         1 | Jan     | Q1        | 2016-01     |           3 | Wed       |
| 2016-01-07 00:00:00.000 |   2016 |         1 | Jan     | Q1        | 2016-01     |           4 | Thu       |
| 2016-01-08 00:00:00.000 |   2016 |         1 | Jan     | Q1        | 2016-01     |           5 | Fri       |
| 2016-01-09 00:00:00.000 |   2016 |         1 | Jan     | Q1        | 2016-01     |           6 | Sat       |
| 2016-01-10 00:00:00.000 |   2016 |         1 | Jan     | Q1        | 2016-01     |           7 | Sun       |


Table: Customers
|   CustomerID | Customer                       | Region        | CountryID     |   RegionID |
|-------------:|:-------------------------------|:--------------|:--------------|-----------:|
|          286 | Savoia Custom Classic Clothier | North America | United States |          1 |
|          302 | Automotive Asset Protection    | North America | United States |          1 |
|          306 | B & D Marketing                | North America | United States |          1 |
|          322 | Geekdeal.com                   | North America | United States |          1 |
|          330 | Battery Outfitters             | North America | United States |          1 |
|          340 | Mountain Expressions           | North America | United States |          1 |
|          345 | Catherine Malandrino           | North America | United States |          1 |
|          346 | Heritage Hosiery               | North America | United States |          1 |
|          347 | One Root Tea & Herbothecary    | North America | United States |          1 |
|          350 | Gifts Of Faith                 | North America | United States |          1 |


Table: IncomeStatementPeriodical
| Account       | Date                    |   Value |   BusinessUnitID |
|:--------------|:------------------------|--------:|-----------------:|
| Restructuring | 2016-01-01 00:00:00.000 |       0 |                1 |
| Restructuring | 2016-02-01 00:00:00.000 |       0 |                1 |
| Restructuring | 2016-03-01 00:00:00.000 |       0 |                1 |
| Restructuring | 2016-04-01 00:00:00.000 |       0 |                1 |
| Restructuring | 2016-05-01 00:00:00.000 |       0 |                1 |
| Restructuring | 2016-06-01 00:00:00.000 |       0 |                1 |
| Restructuring | 2016-07-01 00:00:00.000 |       0 |                1 |
| Restructuring | 2016-08-01 00:00:00.000 |       0 |                1 |
| Restructuring | 2016-09-01 00:00:00.000 |       0 |                1 |
| Restructuring | 2016-10-01 00:00:00.000 |       0 |                1 |


Table: KPIs
| KPI          |   KPI_ID |
|:-------------|---------:|
| Revenue      |        1 |
| Cost         |        2 |
| Gross Profit |        3 |


Table: Period Calculation
| Period Calculation   |   CalcID |
|:---------------------|---------:|
| Monthly              |        1 |
| YTD                  |        2 |


Table: Products
|   ProductID | Product      | ProductCategoryID   | ProductGroupID   |
|------------:|:-------------|:--------------------|:-----------------|
|        2449 | Product 2449 | Llysstai            | Product Group 36 |
|        2453 | Product 2453 | Llysstai            | Product Group 36 |
|        2454 | Product 2454 | Llysstai            | Product Group 36 |
|        2459 | Product 2459 | Llysstai            | Product Group 36 |
|        2462 | Product 2462 | Llysstai            | Product Group 36 |
|        2463 | Product 2463 | Llysstai            | Product Group 36 |
|        2464 | Product 2464 | Llysstai            | Product Group 36 |
|        2465 | Product 2465 | Llysstai            | Product Group 36 |
|        2468 | Product 2468 | Llysstai            | Product Group 36 |
|        2471 | Product 2471 | Llysstai            | Product Group 36 |


Table: Sales
| Date                    |   ProductID |   CustomerID |   SalespersonID |   BusinessUnitID |   Revenue |   Cost |   Gross Profit | Scenario   |
|:------------------------|------------:|-------------:|----------------:|-----------------:|----------:|-------:|---------------:|:-----------|
| 2018-10-25 00:00:00.000 |        2892 |          346 |             117 |               27 |  698.828  |      0 |      1014.49   | PL         |
| 2018-10-25 00:00:00.000 |        2892 |          356 |             117 |               27 |   66.5712 |      0 |        58.883  | PL         |
| 2018-10-25 00:00:00.000 |        2892 |          405 |             117 |               27 |  240.732  |      0 |       248.038  | PL         |
| 2018-10-25 00:00:00.000 |        2892 |          420 |             117 |               27 |   60.8441 |      0 |        48.8256 | PL         |
| 2018-10-25 00:00:00.000 |        2892 |          434 |             117 |               27 |   77.2845 |      0 |        83.2978 | PL         |
| 2018-10-25 00:00:00.000 |        2892 |          435 |             117 |               27 |  119.067  |      0 |       270.448  | PL         |
| 2018-10-25 00:00:00.000 |        2892 |          444 |             117 |               27 |   98.1031 |      0 |       156.083  | PL         |
| 2018-10-25 00:00:00.000 |        2892 |          469 |             117 |               27 |  109.61   |      0 |       160.034  | PL         |
| 2018-10-25 00:00:00.000 |        2892 |          536 |             117 |               27 |  223.689  |      0 |       385.875  | PL         |
| 2018-10-25 00:00:00.000 |        2892 |          638 |             117 |               27 |  361.211  |      0 |       288.349  | PL         |


Table: Salespersons
|   SalespersonID | Salesperson      |
|----------------:|:-----------------|
|               1 | Carmina Craft    |
|               2 | Keri Kung        |
|               3 | Maddie Mckinsey  |
|               4 | Alanna Ambler    |
|               5 | Jimmie Jarrett   |
|               7 | Gonzalo Gundlach |
|               8 | Noella Newman    |
|               9 | Almeta Ashman    |
|              10 | Maurita Mcmanis  |
|              11 | Mee Mallon       |

 


tables: name: Accounts
data: Accounts.csv
name: AccountsHierarchy
data: AccountsHierarchy.csv
name: BusinessUnits
data: BusinessUnits.csv
name: Calendar
data: Calendar.csv
name: Customers
data: Customers.csv
name: IncomeStatementPeriodical
data: IncomeStatementPeriodical.csv
name: KPIs
data: KPIs.csv
name: Period Calculation
data: Period Calculation.csv
name: Products
data: Products.csv
name: Sales
data: Sales.csv
name: Salespersons
data: Salespersons.csv
label: Sales
ProductID
Products
ProductID
Sales
CustomerID
Customers
CustomerID
Sales
BusinessUnitID
BusinessUnits
BusinessUnitID
Sales
SalespersonID
Salespersons
SalespersonID
IncomeStatementPeriodical
Account
Accounts
Account
IncomeStatementPeriodical
Account
AccountsHierarchy
Account
IncomeStatementPeriodical
BusinessUnitID
BusinessUnits
BusinessUnitID
output: {
    "joins": [
        {
            "from_table": "Sales",
            "from_column": "ProductID",
            "to_table": "Products",
            "to_column": "ProductID"
        },
        {
            "from_table": "Sales",
            "from_column": "CustomerID",
            "to_table": "Customers",
            "to_column": "CustomerID"
        },
        {
            "from_table": "Sales",
            "from_column": "BusinessUnitID",
            "to_table": "BusinessUnits",
            "to_column": "BusinessUnitID"
        },
        {
            "from_table": "Sales",
            "from_column": "SalespersonID",
            "to_table": "Salespersons",
            "to_column": "SalespersonID"
        },
        {
            "from_table": "IncomeStatementPeriodical",
            "from_column": "Account",
            "to_table": "Accounts",
            "to_column": "Account"
        },
        {
            "from_table": "IncomeStatementPeriodical",
            "from_column": "Account",
            "to_table": "AccountsHierarchy",
            "to_column": "Account"
        },
        {
            "from_table": "IncomeStatementPeriodical",
            "from_column": "BusinessUnitID",
            "to_table": "BusinessUnits",
            "to_column": "BusinessUnitID"
        }
    ]
}