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: Customer Data
|   Customer Index | Customer Names   |
|-----------------:|:-----------------|
|                1 | Avon Corp        |
|                2 | WakeFern         |
|                3 | Elorac, Corp     |
|                4 | ETUDE Ltd        |
|                5 | Procter Corp     |
|                6 | PEDIFIX, Corp    |
|                7 | New Ltd          |
|                8 | Medsep Group     |
|                9 | Ei               |
|               10 | 21st Ltd         |


Table: DimTable
| Date                    |   Year |   QuarterOfYear |   MonthOfYear |   DayOfMonth |   DateInt | MonthName   | MonthInCalendar   | QuarterInCalendar   |   DayInWeek | DayOfWeekName   | WeekEnding              |   Week Number |   MonthnYear |   QuarternYear |   ShortYear | FY   | Quater   |
|:------------------------|-------:|----------------:|--------------:|-------------:|----------:|:------------|:------------------|:--------------------|------------:|:----------------|:------------------------|--------------:|-------------:|---------------:|------------:|:-----|:---------|
| 2014-07-01 00:00:00.000 |   2014 |               3 |             7 |            1 |  20140701 | July        | Jul 2014          | Q3 2014             |           1 | Tuesday         | 2014-07-06 00:00:00.000 |            27 |     20140700 |       20140300 |          14 | FY15 | Q3       |
| 2014-07-02 00:00:00.000 |   2014 |               3 |             7 |            2 |  20140702 | July        | Jul 2014          | Q3 2014             |           2 | Wednesday       | 2014-07-06 00:00:00.000 |            27 |     20140700 |       20140300 |          14 | FY15 | Q3       |
| 2014-07-03 00:00:00.000 |   2014 |               3 |             7 |            3 |  20140703 | July        | Jul 2014          | Q3 2014             |           3 | Thursday        | 2014-07-06 00:00:00.000 |            27 |     20140700 |       20140300 |          14 | FY15 | Q3       |
| 2014-07-04 00:00:00.000 |   2014 |               3 |             7 |            4 |  20140704 | July        | Jul 2014          | Q3 2014             |           4 | Friday          | 2014-07-06 00:00:00.000 |            27 |     20140700 |       20140300 |          14 | FY15 | Q3       |
| 2014-07-05 00:00:00.000 |   2014 |               3 |             7 |            5 |  20140705 | July        | Jul 2014          | Q3 2014             |           5 | Saturday        | 2014-07-06 00:00:00.000 |            27 |     20140700 |       20140300 |          14 | FY15 | Q3       |
| 2014-07-06 00:00:00.000 |   2014 |               3 |             7 |            6 |  20140706 | July        | Jul 2014          | Q3 2014             |           6 | Sunday          | 2014-07-06 00:00:00.000 |            27 |     20140700 |       20140300 |          14 | FY15 | Q3       |
| 2014-07-07 00:00:00.000 |   2014 |               3 |             7 |            7 |  20140707 | July        | Jul 2014          | Q3 2014             |           0 | Monday          | 2014-07-13 00:00:00.000 |            28 |     20140700 |       20140300 |          14 | FY15 | Q3       |
| 2014-07-08 00:00:00.000 |   2014 |               3 |             7 |            8 |  20140708 | July        | Jul 2014          | Q3 2014             |           1 | Tuesday         | 2014-07-13 00:00:00.000 |            28 |     20140700 |       20140300 |          14 | FY15 | Q3       |
| 2014-07-09 00:00:00.000 |   2014 |               3 |             7 |            9 |  20140709 | July        | Jul 2014          | Q3 2014             |           2 | Wednesday       | 2014-07-13 00:00:00.000 |            28 |     20140700 |       20140300 |          14 | FY15 | Q3       |
| 2014-07-10 00:00:00.000 |   2014 |               3 |             7 |           10 |  20140710 | July        | Jul 2014          | Q3 2014             |           3 | Thursday        | 2014-07-13 00:00:00.000 |            28 |     20140700 |       20140300 |          14 | FY15 | Q3       |


Table: Metric Selection
| Metric   |   Metric Index |
|:---------|---------------:|
| Revenue  |              1 |
| Costs    |              2 |
| Profits  |              3 |


Table: Product Data
|   Index | Product Name   |
|--------:|:---------------|
|       1 | Nicel          |
|       2 | Dimonies       |
|       3 | Channels       |
|       4 | Carvetures     |
|       5 | Linon          |
|       6 | Assitus        |
|       7 | Brimmer        |
|       8 | Denycons       |
|       9 | loader         |
|      10 | Unicoes        |


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


Table: Sales
| OrderNumber   | OrderDate               | Ship Date               |   Customer Name Index | Channel   | Currency Code   | Warehouse Code   |   Delivery Region Index |   Product Description Index |   Order Quantity |   Unit Price |   Total Unit Cost |   Total Revenue | Region City   | Region Territory   |
|:--------------|:------------------------|:------------------------|----------------------:|:----------|:----------------|:-----------------|------------------------:|----------------------------:|-----------------:|-------------:|------------------:|----------------:|:--------------|:-------------------|
| SO - 000153   | 2014-06-06 00:00:00.000 | 2014-08-11 00:00:00.000 |                     8 | Wholesale | NZD             | AXW291           |                      15 |                           7 |               11 |       3926.2 |          3062.44  |         43188.2 | Coffs Harbour | New South Wales    |
| SO - 000175   | 2014-06-10 00:00:00.000 | 2014-07-12 00:00:00.000 |                     1 | Wholesale | NZD             | AXW291           |                       5 |                           7 |               11 |       2224.4 |          1579.32  |         24468.4 | Coffs Harbour | New South Wales    |
| SO - 000192   | 2014-06-12 00:00:00.000 | 2014-08-17 00:00:00.000 |                    24 | Wholesale | NZD             | AXW291           |                      12 |                           7 |                8 |       1152.4 |           622.296 |          9219.2 | Coffs Harbour | New South Wales    |
| SO - 000194   | 2014-06-13 00:00:00.000 | 2014-08-17 00:00:00.000 |                    11 | Wholesale | NZD             | AXW291           |                      36 |                           7 |                5 |       5031.7 |          4025.36  |         25158.5 | Coffs Harbour | New South Wales    |
| SO - 000258   | 2014-06-19 00:00:00.000 | 2014-08-12 00:00:00.000 |                    28 | Wholesale | NZD             | AXW291           |                      15 |                           7 |               11 |       2385.2 |          1502.68  |         26237.2 | Coffs Harbour | New South Wales    |
| SO - 000262   | 2014-06-19 00:00:00.000 | 2014-08-10 00:00:00.000 |                    31 | Wholesale | NZD             | AXW291           |                      23 |                           7 |                8 |       1105.5 |           652.245 |          8844   | Coffs Harbour | New South Wales    |
| SO - 000269   | 2014-06-20 00:00:00.000 | 2014-08-27 00:00:00.000 |                     8 | Wholesale | NZD             | AXW291           |                      82 |                           7 |                5 |        844.2 |           540.288 |          4221   | Coffs Harbour | New South Wales    |
| SO - 000316   | 2014-06-28 00:00:00.000 | 2014-08-28 00:00:00.000 |                    14 | Wholesale | NZD             | AXW291           |                       7 |                           7 |                5 |       3939.6 |          1969.8   |         19698   | Coffs Harbour | New South Wales    |
| SO - 000368   | 2014-07-03 00:00:00.000 | 2014-08-02 00:00:00.000 |                     1 | Wholesale | NZD             | AXW291           |                       4 |                           7 |               10 |       5098.7 |          3416.13  |         50987   | Coffs Harbour | New South Wales    |
| SO - 000482   | 2014-07-17 00:00:00.000 | 2014-10-11 00:00:00.000 |                    42 | Wholesale | NZD             | AXW291           |                       3 |                           7 |                6 |        864.3 |           726.012 |          5185.8 | Coffs Harbour | New South Wales    |


Table: Specific Scenarios


 


tables: name: Customer Data
data: Customer Data.csv
name: DimTable
data: DimTable.csv
name: Metric Selection
data: Metric Selection.csv
name: Product Data
data: Product Data.csv
name: Regions
data: Regions.csv
name: Sales
data: Sales.csv
name: Specific Scenarios
data: Specific Scenarios.csv
label: Product Data
Index
Regions
Index
Sales
Customer Name Index
Customer Data
Customer Index
Sales
Product Description Index
Product Data
Index
Sales
OrderDate
DimTable
Date
output: {
    "joins": [
        {
            "from_table": "Product Data",
            "from_column": "Index",
            "to_table": "Regions",
            "to_column": "Index"
        },
        {
            "from_table": "Sales",
            "from_column": "Customer Name Index",
            "to_table": "Customer Data",
            "to_column": "Customer Index"
        },
        {
            "from_table": "Sales",
            "from_column": "Product Description Index",
            "to_table": "Product Data",
            "to_column": "Index"
        },
        {
            "from_table": "Sales",
            "from_column": "OrderDate",
            "to_table": "DimTable",
            "to_column": "Date"
        }
    ]
}