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: dim product
|   PRD_ID |
|---------:|
|     3222 |
|     3223 |
|     3224 |
|     3225 |
|     3226 |
|     3227 |
|     3228 |
|     3229 |
|     3230 |
|     3231 |


Table: dimCountry
| NETWORK_CD   |
|:-------------|
| 7E           |


Table: DimDate
|   MONTH_ID | MONTH_CD   | MONTH_LB   |   MONTH_DP |   QUARTER_ID |   SEMESTER_ID |   YEAR_ID |   MONTHOFYEAR_ID | MONTHDAY_DT             |   NB_DAYS |   QUARTEROFYEAR_ID |   SEMESTEROFYEAR_ID |   PREVMONTH_ID |   PREVQUARTER_ID |   PREVSEMESTER_ID |   PREVYEAR_ID |   LYMONTH_ID |   LYQUARTER_ID |   LYSEMESTER_ID |   LYYEAR_ID |   LQMONTH_ID |   DATE_KEY |
|-----------:|:-----------|:-----------|-----------:|-------------:|--------------:|----------:|-----------------:|:------------------------|----------:|-------------------:|--------------------:|---------------:|-----------------:|------------------:|--------------:|-------------:|---------------:|----------------:|------------:|-------------:|-----------:|
|     200701 | M01 07     | JAN 07     |     200701 |        20071 |         20071 |      2007 |                1 | 2007-01-01 00:00:00.000 |        31 |                  1 |                   1 |         200612 |            20064 |             20062 |          2006 |       200601 |          20061 |           20061 |        2006 |       200610 |   20070101 |
|     200703 | M03 07     | MAR 07     |     200703 |        20071 |         20071 |      2007 |                3 | 2007-03-01 00:00:00.000 |        31 |                  1 |                   1 |         200702 |            20064 |             20062 |          2006 |       200603 |          20061 |           20061 |        2006 |       200612 |   20070301 |
|     200705 | M05 07     | MAY 07     |     200705 |        20072 |         20071 |      2007 |                5 | 2007-05-01 00:00:00.000 |        31 |                  2 |                   1 |         200704 |            20071 |             20062 |          2006 |       200605 |          20062 |           20061 |        2006 |       200702 |   20070501 |
|     200707 | M07 07     | JUL 07     |     200707 |        20073 |         20072 |      2007 |                7 | 2007-07-01 00:00:00.000 |        31 |                  3 |                   2 |         200706 |            20072 |             20071 |          2006 |       200607 |          20063 |           20062 |        2006 |       200704 |   20070701 |
|     200708 | M08 07     | AUG 07     |     200708 |        20073 |         20072 |      2007 |                8 | 2007-08-01 00:00:00.000 |        31 |                  3 |                   2 |         200707 |            20072 |             20071 |          2006 |       200608 |          20063 |           20062 |        2006 |       200705 |   20070801 |
|     200710 | M10 07     | OCT 07     |     200710 |        20074 |         20072 |      2007 |               10 | 2007-10-01 00:00:00.000 |        31 |                  4 |                   2 |         200709 |            20073 |             20071 |          2006 |       200610 |          20064 |           20062 |        2006 |       200707 |   20071001 |
|     200712 | M12 07     | DEC 07     |     200712 |        20074 |         20072 |      2007 |               12 | 2007-12-01 00:00:00.000 |        31 |                  4 |                   2 |         200711 |            20073 |             20071 |          2006 |       200612 |          20064 |           20062 |        2006 |       200709 |   20071201 |
|     200801 | M01 08     | JAN 08     |     200801 |        20081 |         20081 |      2008 |                1 | 2008-01-01 00:00:00.000 |        31 |                  1 |                   1 |         200712 |            20074 |             20072 |          2007 |       200701 |          20071 |           20071 |        2007 |       200710 |   20080101 |
|     200803 | M03 08     | MAR 08     |     200803 |        20081 |         20081 |      2008 |                3 | 2008-03-01 00:00:00.000 |        31 |                  1 |                   1 |         200802 |            20074 |             20072 |          2007 |       200703 |          20071 |           20071 |        2007 |       200712 |   20080301 |
|     200805 | M05 08     | MAY 08     |     200805 |        20082 |         20081 |      2008 |                5 | 2008-05-01 00:00:00.000 |        31 |                  2 |                   1 |         200804 |            20081 |             20072 |          2007 |       200705 |          20072 |           20071 |        2007 |       200802 |   20080501 |


Table: DimPeriod
|   PERIOD_ID | PERIOD_LB   |
|------------:|:------------|
|           1 | Month       |
|           2 | Quarter     |
|           3 | Cycle       |
|           4 | Semester    |
|           5 | Year        |
|           6 | Rolling 3   |
|           7 | Rolling 4   |
|           8 | Rolling 6   |
|           9 | Rolling 12  |


Table: DimRegion
|   REGION_ID | NETWORK_CD   | REGION_LB   |
|------------:|:-------------|:------------|
|           3 | 7E           | Region G    |
|           6 | 7E           | Region C    |
|          12 | 7E           | Region A    |
|          13 | 7E           | Region E    |
|          21 | 7E           | Corsica     |
|          25 | 7E           | Region B    |
|          26 | 7E           | Region D    |
|          27 | 7E           | Region F    |


Table: DimSector
|   SECTOR_ID |   REGION_ID | SECTOR_LB   |
|------------:|------------:|:------------|
|           3 |          27 | F0F07       |
|           4 |           6 | C0C01       |
|           5 |          13 | E0E08       |
|           6 |          25 | B0B08       |
|           8 |           3 | G0G08       |
|          10 |          12 | A0A08       |
|          13 |          26 | D0D08       |
|          16 |           3 | G0G03       |
|          18 |           6 | C0C06       |
|          20 |          12 | A0A03       |


Table: FACT_prdct_coutry
|   MONTH_ID |   PRD_ID | COUNTRY_ID   |   GSO_STD_CTY |   PERIOD_ID | TD_MONTH.MONTHDAY_DT    |
|-----------:|---------:|:-------------|--------------:|------------:|:------------------------|
|     201610 |     3246 | FR           |           843 |           9 | 2016-10-01 00:00:00.000 |
|     201704 |     3248 | FR           |          4044 |           9 | 2017-04-01 00:00:00.000 |
|     201508 |     3241 | FR           |           -85 |           9 | 2015-08-01 00:00:00.000 |
|     201602 |     3244 | FR           |          3389 |           9 | 2016-02-01 00:00:00.000 |
|     201608 |     3224 | FR           |       4625962 |           9 | 2016-08-01 00:00:00.000 |
|     201711 |     3224 | FR           |       2961745 |           9 | 2017-11-01 00:00:00.000 |
|     201712 |     3249 | FR           |          2582 |           9 | 2017-12-01 00:00:00.000 |
|     201805 |     3227 | FR           |         31788 |           9 | 2018-05-01 00:00:00.000 |
|     201808 |     3230 | FR           |            91 |           9 | 2018-08-01 00:00:00.000 |
|     201705 |     3244 | FR           |          8225 |           9 | 2017-05-01 00:00:00.000 |


Table: FACT_prdct_sector
|   MONTH_ID |   PRD_ID |   SECTOR_ID |   GSO_STD_SCT |   PERIOD_ID | TD_MONTH.MONTHDAY_DT    |
|-----------:|---------:|------------:|--------------:|------------:|:------------------------|
|     201704 |     3228 |          67 |             2 |           9 | 2017-04-01 00:00:00.000 |
|     201701 |     3228 |          18 |             2 |           9 | 2017-01-01 00:00:00.000 |
|     201612 |     3228 |         110 |             2 |           9 | 2016-12-01 00:00:00.000 |
|     201604 |     3228 |         104 |             2 |           9 | 2016-04-01 00:00:00.000 |
|     201509 |     3228 |         148 |             2 |           9 | 2015-09-01 00:00:00.000 |
|     201511 |     3228 |          83 |             2 |           9 | 2015-11-01 00:00:00.000 |
|     201508 |     3228 |         111 |             2 |           9 | 2015-08-01 00:00:00.000 |
|     201604 |     3228 |          13 |             2 |           9 | 2016-04-01 00:00:00.000 |
|     201705 |     3228 |          67 |             2 |           9 | 2017-05-01 00:00:00.000 |
|     201601 |     3228 |          25 |             2 |           9 | 2016-01-01 00:00:00.000 |


Table: FACT_prdt_region
|   MONTH_ID |   PRD_ID |   REGION_ID |   GSO_STD_REG |   PERIOD_ID | TD_MONTH.MONTHDAY_DT    |
|-----------:|---------:|------------:|--------------:|------------:|:------------------------|
|     201705 |     3241 |          26 |           159 |           9 | 2017-05-01 00:00:00.000 |
|     201508 |     3238 |          26 |            -3 |           9 | 2015-08-01 00:00:00.000 |
|     201705 |     3229 |          26 |          9992 |           9 | 2017-05-01 00:00:00.000 |
|     201709 |     3238 |          26 |          1109 |           9 | 2017-09-01 00:00:00.000 |
|     201701 |     3236 |          26 |           804 |           9 | 2017-01-01 00:00:00.000 |
|     201512 |     3235 |          26 |          2804 |           9 | 2015-12-01 00:00:00.000 |
|     201810 |     3222 |          26 |          8542 |           9 | 2018-10-01 00:00:00.000 |
|     201508 |     3226 |          26 |           630 |           9 | 2015-08-01 00:00:00.000 |
|     201709 |     3226 |          26 |           268 |           9 | 2017-09-01 00:00:00.000 |
|     201604 |     3250 |          26 |           535 |           9 | 2016-04-01 00:00:00.000 |


Table: Table
|   REGION_ID |         DDD |
|------------:|------------:|
|           3 | 2.69464e+08 |
|           6 | 3.76585e+08 |
|          12 | 3.46221e+08 |
|          13 | 3.17721e+08 |
|          21 | 1.01468e+07 |
|          25 | 4.21238e+08 |
|          26 | 3.911e+08   |
|          27 | 2.84169e+08 |

 


tables: name: dim product
data: dim product.csv
name: dimCountry
data: dimCountry.csv
name: DimDate
data: DimDate.csv
name: DimPeriod
data: DimPeriod.csv
name: DimRegion
data: DimRegion.csv
name: DimSector
data: DimSector.csv
name: FACT_prdct_coutry
data: FACT_prdct_coutry.csv
name: FACT_prdct_sector
data: FACT_prdct_sector.csv
name: FACT_prdt_region
data: FACT_prdt_region.csv
name: Table
data: Table.csv
label: FACT_prdt_region
PRD_ID
dim product
PRD_ID
FACT_prdct_sector
PRD_ID
dim product
PRD_ID
DimSector
REGION_ID
DimRegion
REGION_ID
FACT_prdct_coutry
PRD_ID
dim product
PRD_ID
FACT_prdt_region
REGION_ID
DimRegion
REGION_ID
FACT_prdct_sector
SECTOR_ID
DimSector
SECTOR_ID
FACT_prdct_coutry
PERIOD_ID
DimPeriod
PERIOD_ID
FACT_prdt_region
PERIOD_ID
DimPeriod
PERIOD_ID
FACT_prdct_sector
PERIOD_ID
DimPeriod
PERIOD_ID
FACT_prdct_coutry
TD_MONTH.MONTHDAY_DT
DimDate
MONTHDAY_DT
FACT_prdct_sector
TD_MONTH.MONTHDAY_DT
DimDate
MONTHDAY_DT
FACT_prdt_region
TD_MONTH.MONTHDAY_DT
DimDate
MONTHDAY_DT
DimRegion
NETWORK_CD
dimCountry
NETWORK_CD
output: {
    "joins": [
        {
            "from_table": "FACT_prdt_region",
            "from_column": "PRD_ID",
            "to_table": "dim product",
            "to_column": "PRD_ID"
        },
        {
            "from_table": "FACT_prdct_sector",
            "from_column": "PRD_ID",
            "to_table": "dim product",
            "to_column": "PRD_ID"
        },
        {
            "from_table": "DimSector",
            "from_column": "REGION_ID",
            "to_table": "DimRegion",
            "to_column": "REGION_ID"
        },
        {
            "from_table": "FACT_prdct_coutry",
            "from_column": "PRD_ID",
            "to_table": "dim product",
            "to_column": "PRD_ID"
        },
        {
            "from_table": "FACT_prdt_region",
            "from_column": "REGION_ID",
            "to_table": "DimRegion",
            "to_column": "REGION_ID"
        },
        {
            "from_table": "FACT_prdct_sector",
            "from_column": "SECTOR_ID",
            "to_table": "DimSector",
            "to_column": "SECTOR_ID"
        },
        {
            "from_table": "FACT_prdct_coutry",
            "from_column": "PERIOD_ID",
            "to_table": "DimPeriod",
            "to_column": "PERIOD_ID"
        },
        {
            "from_table": "FACT_prdt_region",
            "from_column": "PERIOD_ID",
            "to_table": "DimPeriod",
            "to_column": "PERIOD_ID"
        },
        {
            "from_table": "FACT_prdct_sector",
            "from_column": "PERIOD_ID",
            "to_table": "DimPeriod",
            "to_column": "PERIOD_ID"
        },
        {
            "from_table": "FACT_prdct_coutry",
            "from_column": "TD_MONTH.MONTHDAY_DT",
            "to_table": "DimDate",
            "to_column": "MONTHDAY_DT"
        },
        {
            "from_table": "FACT_prdct_sector",
            "from_column": "TD_MONTH.MONTHDAY_DT",
            "to_table": "DimDate",
            "to_column": "MONTHDAY_DT"
        },
        {
            "from_table": "FACT_prdt_region",
            "from_column": "TD_MONTH.MONTHDAY_DT",
            "to_table": "DimDate",
            "to_column": "MONTHDAY_DT"
        },
        {
            "from_table": "DimRegion",
            "from_column": "NETWORK_CD",
            "to_table": "dimCountry",
            "to_column": "NETWORK_CD"
        }
    ]
}