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: Aged Debtor Groups
| Groups           |   Sort Order |   Min |   Max |
|:-----------------|-------------:|------:|------:|
| Age 1 - 30 Days  |            1 |     1 |    30 |
| Age 31 - 60 Days |            2 |    31 |    60 |
| Age 61 - 90 Days |            3 |    61 |    90 |
| Age 90+ Days     |            4 |    90 |  1000 |


Table: Balance Sheet Data
| Balance Sheet Type   | Category       | Sub Category        |   Year |   Values |
|:---------------------|:---------------|:--------------------|-------:|---------:|
| Assets               | Current Assets | Cash                |   2014 |    11874 |
| Assets               | Current Assets | Cash                |   2015 |    11875 |
| Assets               | Current Assets | Cash                |   2016 |    11876 |
| Assets               | Current Assets | Cash                |   2017 |    11877 |
| Assets               | Current Assets | Cash                |   2018 |    11879 |
| Assets               | Current Assets | Accounts receivable |   2014 |     4215 |
| Assets               | Current Assets | Accounts receivable |   2015 |     4216 |
| Assets               | Current Assets | Accounts receivable |   2016 |     4217 |
| Assets               | Current Assets | Accounts receivable |   2017 |     4218 |
| Assets               | Current Assets | Accounts receivable |   2018 |     4220 |


Table: Balance Sheet Template
|   Row Index | Balance Sheet Items      | Summary Items        | Balance Sheet Normalized   | Summary Index   |
|------------:|:-------------------------|:---------------------|:---------------------------|:----------------|
|           1 | Assets                   |                      | Assets                     |                 |
|           2 | Current Assets           |                      | Current Assets             |                 |
|           3 | Cash                     |                      | Cash                       |                 |
|           4 | Accounts receivable      |                      | Accounts receivable        |                 |
|           5 | Inventory                |                      | Inventory                  |                 |
|           6 | Prepaid expenses         |                      | Prepaid expenses           |                 |
|           7 | Short-term investments   |                      | Short-term investments     |                 |
|           8 | Total current assets     | Total current assets | Total current assets       | 1               |
|           9 | Fixed (Long-Term) Assets |                      | Fixed (Long-Term) Assets   |                 |
|          10 | Long-term investments    |                      | Long-term investments      |                 |


Table: Cash Flow Data
| Cash Flow Type   | Cash Flow Category   | Cash Flow Sub Category       |   Years |           Values |
|:-----------------|:---------------------|:-----------------------------|--------:|-----------------:|
| Operations       | Cash receipts from   | Cash receipts from customers |    2014 | 693200           |
| Operations       | Cash receipts from   | Cash receipts from customers |    2015 | 797180           |
| Operations       | Cash receipts from   | Cash receipts from customers |    2016 | 916757           |
| Operations       | Cash receipts from   | Cash receipts from customers |    2017 |      1.05427e+06 |
| Operations       | Cash receipts from   | Cash receipts from customers |    2018 |      1.21241e+06 |
| Operations       | Cash paid for        | Inventory purchases          |    2014 | 264000           |
| Operations       | Cash paid for        | Inventory purchases          |    2015 | 303600           |
| Operations       | Cash paid for        | Inventory purchases          |    2016 | 349140           |
| Operations       | Cash paid for        | Inventory purchases          |    2017 | 401511           |
| Operations       | Cash paid for        | Inventory purchases          |    2018 | 461738           |


Table: Cash Flow Template
|   Row Index | Cash Flow Items               | Cash Flow Summary Items       | Cash Flow Normalized                          | Summary Index   |
|------------:|:------------------------------|:------------------------------|:----------------------------------------------|:----------------|
|           1 | Operations                    |                               | Operations                                    |                 |
|           2 | Cash receipts from customers  |                               | Cash receipts from customers                  |                 |
|           3 | Cash paid for                 |                               | Cash paid for                                 |                 |
|           4 | Inventory purchases           |                               | Inventory purchases                           |                 |
|           5 | General operating expenses    |                               | General operating and administrative expenses |                 |
|           6 | Wage expenses                 |                               | Wage expenses                                 |                 |
|           7 | Interest                      |                               | Interest                                      |                 |
|           8 | Income taxes                  |                               | Income taxes                                  |                 |
|           9 | Net Cash Flow from Operations | Net Cash Flow from Operations | Net Cash Flow from Operations                 | 1               |
|          10 |                               |                               |                                               |                 |


Table: Channel Revenues
| Channel   | Month & Year   | Category   | First Date              |   Sales Values |
|:----------|:---------------|:-----------|:------------------------|---------------:|
| Wholesale | Jan 2015       | Revenue    | 2015-01-01 00:00:00.000 |    2.22854e+06 |
| Wholesale | Feb 2015       | Revenue    | 2015-02-01 00:00:00.000 |    2.16182e+06 |
| Wholesale | Mar 2015       | Revenue    | 2015-03-01 00:00:00.000 |    2.19925e+06 |
| Wholesale | Apr 2015       | Revenue    | 2015-04-01 00:00:00.000 |    3.08973e+06 |
| Wholesale | May 2015       | Revenue    | 2015-05-01 00:00:00.000 |    2.53182e+06 |
| Wholesale | Jun 2015       | Revenue    | 2015-06-01 00:00:00.000 |    2.48875e+06 |
| Wholesale | Jul 2015       | Revenue    | 2015-07-01 00:00:00.000 |    2.58599e+06 |
| Wholesale | Aug 2015       | Revenue    | 2015-08-01 00:00:00.000 |    2.55037e+06 |
| Wholesale | Sep 2015       | Revenue    | 2015-09-01 00:00:00.000 |    2.05137e+06 |
| Wholesale | Oct 2015       | Revenue    | 2015-10-01 00:00:00.000 |    3.40288e+06 |


Table: Company Expenses
| Expense Items      | Expense Category   | Expense Month           |   Value |
|:-------------------|:-------------------|:------------------------|--------:|
| COS - Labor Burden | COGS               | 2015-05-01 00:00:00.000 | 15340.5 |
| COS - Labor Burden | COGS               | 2015-06-01 00:00:00.000 | 15493.9 |
| COS - Labor Burden | COGS               | 2015-07-01 00:00:00.000 | 15339   |
| COS - Labor Burden | COGS               | 2015-08-01 00:00:00.000 | 15032.2 |
| COS - Labor Burden | COGS               | 2015-09-01 00:00:00.000 | 14280.6 |
| COS - Labor Burden | COGS               | 2015-10-01 00:00:00.000 | 14280.6 |
| COS - Labor Burden | COGS               | 2015-11-01 00:00:00.000 | 13709.4 |
| COS - Labor Burden | COGS               | 2015-12-01 00:00:00.000 | 13435.2 |
| COS - Labor Burden | COGS               | 2016-01-01 00:00:00.000 | 13569.5 |
| COS - Labor Burden | COGS               | 2016-02-01 00:00:00.000 | 13705.2 |


Table: Customers
|   Customer Index | Customer Names   |
|-----------------:|:-----------------|
|                1 | Geiss Company    |
|                2 | Jaxbean Group    |
|                3 | Ascend Ltd       |
|                4 | Eire Corp        |
|                5 | Blogtags Ltd     |
|                6 | Family Corp      |
|                7 | Skidoo Company   |
|                8 | Amerisourc Corp  |
|                9 | Walgreen Corp    |
|               10 | Unit Ltd         |


Table: Dates
| Date                    |   Year |   QuarterOfYear |   MonthOfYear |   DayOfMonth |   DateInt | MonthName   | Month & Year   | Quarter & Year   |   DayInWeek | DayOfWeekName   | WeekEnding              |   Week Number |   MonthnYear |   QuarternYear |   ShortYear | FY   | Short Month   | Quarter   |
|:------------------------|-------:|----------------:|--------------:|-------------:|----------:|:------------|:---------------|:-----------------|------------:|:----------------|:------------------------|--------------:|-------------:|---------------:|------------:|:-----|:--------------|:----------|
| 2014-01-01 00:00:00.000 |   2014 |               1 |             1 |            1 |  20140101 | January     | Jan 2014       | Q1 2014          |           2 | Wednesday       | 2014-01-05 00:00:00.000 |             1 |     20140100 |       20140100 |          14 | FY14 | Jan           | Q1        |
| 2014-01-02 00:00:00.000 |   2014 |               1 |             1 |            2 |  20140102 | January     | Jan 2014       | Q1 2014          |           3 | Thursday        | 2014-01-05 00:00:00.000 |             1 |     20140100 |       20140100 |          14 | FY14 | Jan           | Q1        |
| 2014-01-03 00:00:00.000 |   2014 |               1 |             1 |            3 |  20140103 | January     | Jan 2014       | Q1 2014          |           4 | Friday          | 2014-01-05 00:00:00.000 |             1 |     20140100 |       20140100 |          14 | FY14 | Jan           | Q1        |
| 2014-01-04 00:00:00.000 |   2014 |               1 |             1 |            4 |  20140104 | January     | Jan 2014       | Q1 2014          |           5 | Saturday        | 2014-01-05 00:00:00.000 |             1 |     20140100 |       20140100 |          14 | FY14 | Jan           | Q1        |
| 2014-01-05 00:00:00.000 |   2014 |               1 |             1 |            5 |  20140105 | January     | Jan 2014       | Q1 2014          |           6 | Sunday          | 2014-01-05 00:00:00.000 |             1 |     20140100 |       20140100 |          14 | FY14 | Jan           | Q1        |
| 2014-01-06 00:00:00.000 |   2014 |               1 |             1 |            6 |  20140106 | January     | Jan 2014       | Q1 2014          |           0 | Monday          | 2014-01-12 00:00:00.000 |             2 |     20140100 |       20140100 |          14 | FY14 | Jan           | Q1        |
| 2014-01-07 00:00:00.000 |   2014 |               1 |             1 |            7 |  20140107 | January     | Jan 2014       | Q1 2014          |           1 | Tuesday         | 2014-01-12 00:00:00.000 |             2 |     20140100 |       20140100 |          14 | FY14 | Jan           | Q1        |
| 2014-01-08 00:00:00.000 |   2014 |               1 |             1 |            8 |  20140108 | January     | Jan 2014       | Q1 2014          |           2 | Wednesday       | 2014-01-12 00:00:00.000 |             2 |     20140100 |       20140100 |          14 | FY14 | Jan           | Q1        |
| 2014-01-09 00:00:00.000 |   2014 |               1 |             1 |            9 |  20140109 | January     | Jan 2014       | Q1 2014          |           3 | Thursday        | 2014-01-12 00:00:00.000 |             2 |     20140100 |       20140100 |          14 | FY14 | Jan           | Q1        |
| 2014-01-10 00:00:00.000 |   2014 |               1 |             1 |           10 |  20140110 | January     | Jan 2014       | Q1 2014          |           4 | Friday          | 2014-01-12 00:00:00.000 |             2 |     20140100 |       20140100 |          14 | FY14 | Jan           | Q1        |


Table: Income Statement Template
|   Row Index | Summary 1   | Summary Index   | Summary            | Items - Normalized   |
|------------:|:------------|:----------------|:-------------------|:---------------------|
|           1 |             |                 | Distributor        | Distributor          |
|           2 |             |                 | Export             | Export               |
|           3 |             |                 | Wholesale          | Wholesale            |
|           5 |             |                 |                    |                      |
|           6 |             |                 | COS - Commissions  | COS - Commissions    |
|           7 |             |                 | COS - Equipment    | COS - Equipment      |
|           8 |             |                 | COS - Labor Burden | COS - Labor Burden   |
|           9 |             |                 | COS - Materials    | COS - Materials      |
|          10 |             |                 | COS - Other Costs  | COS - Other Costs    |
|          11 |             |                 | COS - Prize Fund   | COS - Prize Fund     |


Table: Income Statement Visual
| Table Detail   |   Index |
|:---------------|--------:|
| Actuals        |       1 |
| vs Last Year   |       2 |
| % to Revenue   |       3 |


Table: Income Statement
| Items              | Category   | Months                  |   Value | Type     |   Type Index |
|:-------------------|:-----------|:------------------------|--------:|:---------|-------------:|
| COS - Labor Burden | COGS       | 2015-05-01 00:00:00.000 |   15341 | Expenses |            2 |
| COS - Labor Burden | COGS       | 2015-06-01 00:00:00.000 |   15494 | Expenses |            2 |
| COS - Labor Burden | COGS       | 2015-07-01 00:00:00.000 |   15339 | Expenses |            2 |
| COS - Labor Burden | COGS       | 2015-08-01 00:00:00.000 |   15032 | Expenses |            2 |
| COS - Labor Burden | COGS       | 2015-09-01 00:00:00.000 |   14281 | Expenses |            2 |
| COS - Labor Burden | COGS       | 2015-10-01 00:00:00.000 |   14281 | Expenses |            2 |
| COS - Labor Burden | COGS       | 2015-11-01 00:00:00.000 |   13709 | Expenses |            2 |
| COS - Labor Burden | COGS       | 2015-12-01 00:00:00.000 |   13435 | Expenses |            2 |
| COS - Labor Burden | COGS       | 2016-01-01 00:00:00.000 |   13570 | Expenses |            2 |
| COS - Labor Burden | COGS       | 2016-02-01 00:00:00.000 |   13705 | Expenses |            2 |


Table: Invoices
| Clearing Date           | Due Date                |   Customer Index |   Value | Invoice Number   |
|:------------------------|:------------------------|-----------------:|--------:|:-----------------|
| 2019-03-26 00:00:00.000 | 2019-11-30 00:00:00.000 |              129 |    7913 | Inv00001         |
| 2018-12-06 00:00:00.000 | 2019-03-05 00:00:00.000 |                2 |    8738 | Inv00002         |
| 2019-01-05 00:00:00.000 | 2019-09-05 00:00:00.000 |              142 |    6521 | Inv00003         |
| 2018-07-04 00:00:00.000 | 2019-02-28 00:00:00.000 |               88 |    9532 | Inv00004         |
| 2018-07-12 00:00:00.000 | 2019-04-17 00:00:00.000 |               65 |    1666 | Inv00005         |
| 2019-05-09 00:00:00.000 | 2019-08-08 00:00:00.000 |               68 |    5128 | Inv00006         |
| 2018-01-09 00:00:00.000 | 2018-05-27 00:00:00.000 |               26 |    4097 | Inv00007         |
| 2019-04-30 00:00:00.000 | 2020-03-20 00:00:00.000 |               63 |    3790 | Inv00008         |
| 2019-06-03 00:00:00.000 | 2020-01-26 00:00:00.000 |               77 |    5154 | Inv00009         |
| 2019-03-28 00:00:00.000 | 2019-10-16 00:00:00.000 |               82 |   10639 | Inv00010         |


Table: Products
|   Index | Product Name   |   Overall Sales | Product Groups   |   Product Groups Index |
|--------:|:---------------|----------------:|:-----------------|-----------------------:|
|       1 | Product 1      |     9.32538e+06 | Ok Products      |                      2 |
|       2 | Product 2      |     9.56685e+06 | Ok Products      |                      2 |
|       3 | Product 3      |     8.62747e+06 | Ok Products      |                      2 |
|       4 | Product 4      |     9.45026e+06 | Ok Products      |                      2 |
|       5 | Product 5      |     1.18007e+07 | Ok Products      |                      2 |
|       6 | Product 6      |     6.69152e+06 | Ok Products      |                      2 |
|       7 | Product 7      |     2.84304e+06 | Poor Products    |                      3 |
|       8 | Product 8      |     3.30845e+06 | Poor Products    |                      3 |
|       9 | Product 9      |     2.4331e+06  | Poor Products    |                      3 |
|      10 | Product 10     |     2.94343e+06 | Poor Products    |                      3 |


Table: Regions
|   Index | City          | Country   | Full Name                                 | Territory       | Regional Short Code   |
|--------:|:--------------|:----------|:------------------------------------------|:----------------|:----------------------|
|       1 | Sydney        | Australia | Sydney, New South Wales, Australia        | New South Wales | NSW                   |
|       2 | Albury        | Australia | Albury, New South Wales, Australia        | New South Wales | NSW                   |
|       3 | Armidale      | Australia | Armidale, New South Wales, Australia      | New South Wales | NSW                   |
|       4 | Bathurst      | Australia | Bathurst, New South Wales, Australia      | New South Wales | NSW                   |
|       5 | Broken Hill   | Australia | Broken Hill, New South Wales, Australia   | New South Wales | NSW                   |
|       6 | Cessnock      | Australia | Cessnock, New South Wales, Australia      | New South Wales | NSW                   |
|       7 | Coffs Harbour | Australia | Coffs Harbour, New South Wales, Australia | New South Wales | NSW                   |
|       8 | Dubbo         | Australia | Dubbo, New South Wales, Australia         | New South Wales | NSW                   |
|       9 | Gosford       | Australia | Gosford, New South Wales, Australia       | New South Wales | NSW                   |
|      10 | Goulburn      | Australia | Goulburn, New South Wales, Australia      | New South Wales | NSW                   |


Table: Sales
| OrderNumber   | OrderDate               | Channel   | Currency Code   | Warehouse Code   |   Delivery Region Index |   Product Description Index |   Order Quantity |   Unit Price |   Line Total |   Total Unit Cost |   Customer Name Index |
|:--------------|:------------------------|:----------|:----------------|:-----------------|------------------------:|----------------------------:|-----------------:|-------------:|-------------:|------------------:|----------------------:|
| SO - 0005126  | 2015-01-01 00:00:00.000 | Wholesale | EUR             | AXW291           |                       7 |                          26 |                6 |        978.2 |       5869.2 |           684.74  |                     8 |
| SO - 0002795  | 2015-01-03 00:00:00.000 | Wholesale | EUR             | AXW291           |                       1 |                          26 |               12 |       3872.6 |      46471.2 |          2517.19  |                   111 |
| SO - 0003918  | 2015-01-11 00:00:00.000 | Wholesale | EUR             | AXW291           |                      49 |                          26 |                6 |       1105.5 |       6633   |           851.235 |                    93 |
| SO - 0005857  | 2015-01-13 00:00:00.000 | Wholesale | EUR             | AXW291           |                      72 |                          26 |                9 |       1072   |       9648   |           600.32  |                    15 |
| SO - 0007086  | 2015-01-16 00:00:00.000 | Wholesale | EUR             | AXW291           |                      62 |                          26 |                7 |       2345   |      16415   |          1219.4   |                   100 |
| SO - 0003190  | 2015-01-17 00:00:00.000 | Wholesale | EUR             | AXW291           |                      12 |                          26 |               10 |        201   |       2010   |           160.8   |                    88 |
| SO - 0008463  | 2015-01-24 00:00:00.000 | Wholesale | EUR             | AXW291           |                      68 |                          26 |                8 |       1862.6 |      14900.8 |           949.926 |                    13 |
| SO - 0001310  | 2015-01-26 00:00:00.000 | Wholesale | EUR             | AXW291           |                       3 |                          26 |                7 |        737   |       5159   |           626.45  |                    91 |
| SO - 0003868  | 2015-01-26 00:00:00.000 | Wholesale | EUR             | AXW291           |                      27 |                          26 |                8 |       2512.5 |      20100   |          1331.62  |                    59 |
| SO - 0006229  | 2015-01-31 00:00:00.000 | Wholesale | EUR             | AXW291           |                      46 |                          26 |                9 |       2278   |      20502   |          1161.78  |                    91 |

 


tables: name: Aged Debtor Groups
data: Aged Debtor Groups.csv
name: Balance Sheet Data
data: Balance Sheet Data.csv
name: Balance Sheet Template
data: Balance Sheet Template.csv
name: Cash Flow Data
data: Cash Flow Data.csv
name: Cash Flow Template
data: Cash Flow Template.csv
name: Channel Revenues
data: Channel Revenues.csv
name: Company Expenses
data: Company Expenses.csv
name: Customers
data: Customers.csv
name: Dates
data: Dates.csv
name: Income Statement Template
data: Income Statement Template.csv
name: Income Statement Visual
data: Income Statement Visual.csv
name: Income Statement
data: Income Statement.csv
name: Invoices
data: Invoices.csv
name: Products
data: Products.csv
name: Regions
data: Regions.csv
name: Sales
data: Sales.csv
label: Sales
OrderDate
Dates
Date
Sales
Delivery Region Index
Regions
Index
Sales
Product Description Index
Products
Index
Sales
Customer Name Index
Customers
Customer Index
Income Statement
Months
Dates
Date
Invoices
Customer Index
Customers
Customer Index
output: {
    "joins": [
        {
            "from_table": "Sales",
            "from_column": "OrderDate",
            "to_table": "Dates",
            "to_column": "Date"
        },
        {
            "from_table": "Sales",
            "from_column": "Delivery Region Index",
            "to_table": "Regions",
            "to_column": "Index"
        },
        {
            "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": "Income Statement",
            "from_column": "Months",
            "to_table": "Dates",
            "to_column": "Date"
        },
        {
            "from_table": "Invoices",
            "from_column": "Customer Index",
            "to_table": "Customers",
            "to_column": "Customer Index"
        }
    ]
}