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: AccountHierarchy
|   AccountHierKey | LEVEL05   | LEVEL06       | LEVEL07       |   LEVEL08 | LEVEL09   |   PathLevel |
|-----------------:|:----------|:--------------|:--------------|----------:|:----------|------------:|
|           129500 | Total_GP  | Total_Revenue | Other_Revenue |    410050 | NULL      |           4 |
|           129502 | Total_GP  | Total_Revenue | Other_Revenue |    410050 | NULL      |           4 |
|           129503 | Total_GP  | Total_Revenue | Other_Revenue |    410050 | NULL      |           4 |
|           129702 | Total_GP  | Total_Revenue | Other_Revenue |    410070 | NULL      |           4 |
|           129800 | Total_GP  | Total_Revenue | Other_Revenue |    410071 | NULL      |           4 |
|           129802 | Total_GP  | Total_Revenue | Other_Revenue |    410071 | NULL      |           4 |
|           129803 | Total_GP  | Total_Revenue | Other_Revenue |    410071 | NULL      |           4 |
|           129900 | Total_GP  | Total_Revenue | Other_Revenue |    410072 | NULL      |           4 |
|           129902 | Total_GP  | Total_Revenue | Other_Revenue |    410072 | NULL      |           4 |
|           129903 | Total_GP  | Total_Revenue | Other_Revenue |    410072 | NULL      |           4 |


Table: Calendar
|   CalKey |   DayOfMonthNum |   DayOfYearNum |   DayOfWeekNum | DayOfWeekName   |   WeekNum |   MonthNum | Month   | MonthAbbr   |   YYMM |   Year | Date                    |   IsEOM |   FiscalMonthNum |   FiscalPer |   FiscalYear | Fiscal Month   |
|---------:|----------------:|---------------:|---------------:|:----------------|----------:|-----------:|:--------|:------------|-------:|-------:|:------------------------|--------:|-----------------:|------------:|-------------:|:---------------|
|     9678 |               1 |            182 |              2 | Monday          |        27 |          7 | July    | Jul         | 201907 |   2019 | 2019-07-01 00:00:00.000 |       0 |                1 |     2020001 |         2020 | July           |
|     9679 |               2 |            183 |              3 | Tuesday         |        27 |          7 | July    | Jul         | 201907 |   2019 | 2019-07-02 00:00:00.000 |       0 |                1 |     2020001 |         2020 | July           |
|     9680 |               3 |            184 |              4 | Wednesday       |        27 |          7 | July    | Jul         | 201907 |   2019 | 2019-07-03 00:00:00.000 |       0 |                1 |     2020001 |         2020 | July           |
|     9681 |               4 |            185 |              5 | Thursday        |        27 |          7 | July    | Jul         | 201907 |   2019 | 2019-07-04 00:00:00.000 |       0 |                1 |     2020001 |         2020 | July           |
|     9682 |               5 |            186 |              6 | Friday          |        27 |          7 | July    | Jul         | 201907 |   2019 | 2019-07-05 00:00:00.000 |       0 |                1 |     2020001 |         2020 | July           |
|     9683 |               6 |            187 |              7 | Saturday        |        27 |          7 | July    | Jul         | 201907 |   2019 | 2019-07-06 00:00:00.000 |       0 |                1 |     2020001 |         2020 | July           |
|     9684 |               7 |            188 |              1 | Sunday          |        28 |          7 | July    | Jul         | 201907 |   2019 | 2019-07-07 00:00:00.000 |       0 |                1 |     2020001 |         2020 | July           |
|     9685 |               8 |            189 |              2 | Monday          |        28 |          7 | July    | Jul         | 201907 |   2019 | 2019-07-08 00:00:00.000 |       0 |                1 |     2020001 |         2020 | July           |
|     9686 |               9 |            190 |              3 | Tuesday         |        28 |          7 | July    | Jul         | 201907 |   2019 | 2019-07-09 00:00:00.000 |       0 |                1 |     2020001 |         2020 | July           |
|     9687 |              10 |            191 |              4 | Wednesday       |        28 |          7 | July    | Jul         | 201907 |   2019 | 2019-07-10 00:00:00.000 |       0 |                1 |     2020001 |         2020 | July           |


Table: GL
|   AccountHierKey |   ProjectKey |   ProjectEndCalKey |   GLAmtUSD |
|-----------------:|-------------:|-------------------:|-----------:|
|           128102 |        39603 |               9708 |        139 |
|           128102 |        39603 |               9708 |        139 |
|           128102 |        39603 |               9708 |        139 |
|           128102 |        39603 |               9708 |        139 |
|           128102 |        39603 |               9708 |        139 |
|           128102 |        39603 |               9708 |        139 |
|           128102 |        39603 |               9708 |        139 |
|           128102 |        39603 |               9708 |        139 |
|           128102 |        39603 |               9708 |        139 |
|           128102 |        39603 |               9708 |        139 |


Table: Project
|   ProjectKey | ProjectCode      |
|-------------:|:-----------------|
|         2950 | Project: 1206364 |
|         9369 | Project: 3960660 |
|        14856 | Project: 6373922 |
|        16359 | Project: 7046492 |
|        17726 | Project: 7662542 |
|        22781 | Project: 9987258 |
|        29375 | Project: 1311308 |
|        30308 | Project: 1356480 |
|        30440 | Project: 1362884 |
|        30732 | Project: 1377085 |


Table: RevenueSegmentBands
| segmentname   |    LowValue |   HighValue |   SortOrder | BandCategory   |
|:--------------|------------:|------------:|------------:|:---------------|
| $1-$50K       |           1 |   50000     |           1 | Smaller        |
| $50K - $100K  |       50000 |  100000     |           2 | Smaller        |
| $100K - $200K |      100000 |  200000     |           3 | Smaller        |
| $200K - $300K |      200000 |  300000     |           4 | Smaller        |
| $300K - $500K |      300000 |  500000     |           5 | Smaller        |
| $500K - $1M   |      500000 |       1e+06 |           6 | Smaller        |
| > $1M         |     1000000 |       1e+15 |           7 | Smaller        |
| < $1          | -9999999999 |       0.99  |          20 | Smaller        |
| $1-$10K       |           1 |    9999.99  |          11 | Main           |
| $10K - $100K  |       10000 |  100000     |          12 | Main           |


Table: Segment Calculation
| Name          |   Ordinal |
|:--------------|----------:|
| Segment Value |        -1 |

 


tables: name: AccountHierarchy
data: AccountHierarchy.csv
name: Calendar
data: Calendar.csv
name: GL
data: GL.csv
name: Project
data: Project.csv
name: RevenueSegmentBands
data: RevenueSegmentBands.csv
name: Segment Calculation
data: Segment Calculation.csv
label: GL
AccountHierKey
AccountHierarchy
AccountHierKey
GL
ProjectKey
Project
ProjectKey
GL
ProjectEndCalKey
Calendar
CalKey
output: {
    "joins": [
        {
            "from_table": "GL",
            "from_column": "AccountHierKey",
            "to_table": "AccountHierarchy",
            "to_column": "AccountHierKey"
        },
        {
            "from_table": "GL",
            "from_column": "ProjectKey",
            "to_table": "Project",
            "to_column": "ProjectKey"
        },
        {
            "from_table": "GL",
            "from_column": "ProjectEndCalKey",
            "to_table": "Calendar",
            "to_column": "CalKey"
        }
    ]
}