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: Currency
|   Id | Code   |
|-----:|:-------|
|    1 | Eur    |
|    2 | Usd    |
|  110 | Ugx    |
|    7 | Idr    |
|   86 | Vnd    |


Table: FactTable
|   ReportingDateId |   CurrencyID |   ProductID |   TransActionTypeID |   Amount |
|------------------:|-------------:|------------:|--------------------:|---------:|
|       2.02011e+07 |          110 |           1 |                   1 |       50 |
|       2.02011e+07 |          110 |           1 |                   1 |      100 |
|       2.02011e+07 |           86 |           2 |                   1 |      150 |
|       2.02011e+07 |            7 |           3 |                   1 |      200 |
|       2.02011e+07 |            1 |           4 |                   1 |      250 |
|       2.02012e+07 |          110 |           1 |                   1 |      300 |
|       2.02012e+07 |            7 |           3 |                   2 |      350 |
|       2.02012e+07 |           86 |           2 |                   2 |      400 |
|       2.02012e+07 |            7 |           3 |                   1 |      450 |
|       2.02012e+07 |          110 |           1 |                   1 |      500 |


Table: Product
|   Id | Name      | Approval Date           |
|-----:|:----------|:------------------------|
|    1 | Product 1 | 2020-02-02 00:00:00.000 |
|    2 | Product 2 | 2020-12-01 00:00:00.000 |
|    3 | Product 3 | 2020-04-02 00:00:00.000 |
|    4 | Product 4 | 2020-06-01 00:00:00.000 |


Table: Rates
|   ReportingDateId |   CurrencyId |             Rate |
|------------------:|-------------:|-----------------:|
|       2.02012e+07 |            1 |  12275           |
|       2.02012e+07 |            7 | 172848           |
|       2.02012e+07 |           86 | 283528           |
|       2.02012e+07 |          110 | 448986           |
|       2.02011e+07 |            1 |  11996           |
|       2.02011e+07 |            7 |  16916           |
|       2.02011e+07 |           86 |      2.77492e+06 |
|       2.02011e+07 |          110 | 444279           |


Table: ReportingDate
| Date                    |   Year |   Month |       Id |   Month year |
|:------------------------|-------:|--------:|---------:|-------------:|
| 2020-01-01 00:00:00.000 |   2020 |       1 | 20200101 |       202001 |
| 2020-01-02 00:00:00.000 |   2020 |       1 | 20200102 |       202001 |
| 2020-01-03 00:00:00.000 |   2020 |       1 | 20200103 |       202001 |
| 2020-01-04 00:00:00.000 |   2020 |       1 | 20200104 |       202001 |
| 2020-01-05 00:00:00.000 |   2020 |       1 | 20200105 |       202001 |
| 2020-01-06 00:00:00.000 |   2020 |       1 | 20200106 |       202001 |
| 2020-01-07 00:00:00.000 |   2020 |       1 | 20200107 |       202001 |
| 2020-01-08 00:00:00.000 |   2020 |       1 | 20200108 |       202001 |
| 2020-01-09 00:00:00.000 |   2020 |       1 | 20200109 |       202001 |
| 2020-01-10 00:00:00.000 |   2020 |       1 | 20200110 |       202001 |


Table: TransactionType
|   Id | TransactionType   |
|-----:|:------------------|
|    1 | Type A            |
|    2 | Type B            |

 


tables: name: Currency
data: Currency.csv
name: FactTable
data: FactTable.csv
name: Product
data: Product.csv
name: Rates
data: Rates.csv
name: ReportingDate
data: ReportingDate.csv
name: TransactionType
data: TransactionType.csv
label: Rates
CurrencyId
Currency
Id
FactTable
TransActionTypeID
TransactionType
Id
FactTable
ProductID
Product
Id
Rates
ReportingDateId
ReportingDate
Id
FactTable
ReportingDateId
ReportingDate
Id
FactTable
CurrencyID
Currency
Id
output: {
    "joins": [
        {
            "from_table": "Rates",
            "from_column": "CurrencyId",
            "to_table": "Currency",
            "to_column": "Id"
        },
        {
            "from_table": "FactTable",
            "from_column": "TransActionTypeID",
            "to_table": "TransactionType",
            "to_column": "Id"
        },
        {
            "from_table": "FactTable",
            "from_column": "ProductID",
            "to_table": "Product",
            "to_column": "Id"
        },
        {
            "from_table": "Rates",
            "from_column": "ReportingDateId",
            "to_table": "ReportingDate",
            "to_column": "Id"
        },
        {
            "from_table": "FactTable",
            "from_column": "ReportingDateId",
            "to_table": "ReportingDate",
            "to_column": "Id"
        },
        {
            "from_table": "FactTable",
            "from_column": "CurrencyID",
            "to_table": "Currency",
            "to_column": "Id"
        }
    ]
}