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: % Diff
|   % Diff |
|---------:|
|        0 |
|        5 |
|       10 |
|       15 |
|       20 |
|       25 |
|       30 |
|       35 |
|       40 |
|       45 |


Table: amounts
|   COST_CENTER_INDEX |   ACCOUNT_INDEX |   DATE_INDEX |   AMOUNT_CLASS_INDEX | DRILL_THRU_INDEX   |    AMOUNT |
|--------------------:|----------------:|-------------:|---------------------:|:-------------------|----------:|
|               14438 |            1938 |     20191231 |                    3 | 14438:1938         |  741.788  |
|               14426 |            1938 |     20191231 |                    3 | 14426:1938         | 1971.78   |
|               14454 |            1938 |     20191231 |                    3 | 14454:1938         |  894.007  |
|               14405 |            1938 |     20191231 |                    3 | 14405:1938         | 5528.02   |
|               14351 |            1938 |     20191231 |                    3 | 14351:1938         | 8246.67   |
|               14363 |            1938 |     20191231 |                    3 | 14363:1938         | 1714.31   |
|               14348 |            1938 |     20191231 |                    3 | 14348:1938         | 1855.3    |
|               14704 |            1938 |     20191231 |                    3 | 14704:1938         |   28.3765 |
|               14720 |            1938 |     20191130 |                    3 | 14720:1938         |  828.258  |
|               14354 |            1938 |     20191130 |                    3 | 14354:1938         | 2310.81   |


Table: amount_classes
| Amount Class   |   AMOUNT_CLASS_INDEX |
|:---------------|---------------------:|
| ACTUAL         |                    1 |
| BUDGET         |                    2 |
| SUBSYS         |                    3 |
| FORECAST       |                    4 |


Table: calendar
| Date                    | Past/Future   |   Current Year |   Current Period | Current End Date        |   Day of the Week | Day      | Day Abbr   |   Is Holiday? |   Is Work Day? |   Work Day |   Fiscal Year |   Fiscal Month | Month    | Month Abbr   |   Quarter |   Day of the Month |   Day of the Year |   Week of the Year | Month Year   |   Year Month Num |   Year Offset |   Month Offset |   Quarter Offset |   DATE_INDEX |
|:------------------------|:--------------|---------------:|-----------------:|:------------------------|------------------:|:---------|:-----------|--------------:|---------------:|-----------:|--------------:|---------------:|:---------|:-------------|----------:|-------------------:|------------------:|-------------------:|:-------------|-----------------:|--------------:|---------------:|-----------------:|-------------:|
| 2013-01-05 00:00:00.000 | Past          |           2022 |                4 | 2022-04-30 00:00:00.000 |                 7 | Saturday | Sat        |             0 |              0 |          0 |          2013 |              1 | January  | Jan          |         1 |                  5 |                 5 |                  1 | Jan 2013     |           201301 |            -9 |           -111 |              -37 |     20130105 |
| 2013-01-12 00:00:00.000 | Past          |           2022 |                4 | 2022-04-30 00:00:00.000 |                 7 | Saturday | Sat        |             0 |              0 |          0 |          2013 |              1 | January  | Jan          |         1 |                 12 |                12 |                  2 | Jan 2013     |           201301 |            -9 |           -111 |              -37 |     20130112 |
| 2013-01-19 00:00:00.000 | Past          |           2022 |                4 | 2022-04-30 00:00:00.000 |                 7 | Saturday | Sat        |             0 |              0 |          0 |          2013 |              1 | January  | Jan          |         1 |                 19 |                19 |                  3 | Jan 2013     |           201301 |            -9 |           -111 |              -37 |     20130119 |
| 2013-01-26 00:00:00.000 | Past          |           2022 |                4 | 2022-04-30 00:00:00.000 |                 7 | Saturday | Sat        |             0 |              0 |          0 |          2013 |              1 | January  | Jan          |         1 |                 26 |                26 |                  4 | Jan 2013     |           201301 |            -9 |           -111 |              -37 |     20130126 |
| 2013-02-02 00:00:00.000 | Past          |           2022 |                4 | 2022-04-30 00:00:00.000 |                 7 | Saturday | Sat        |             0 |              0 |          0 |          2013 |              2 | February | Feb          |         1 |                  2 |                33 |                  5 | Feb 2013     |           201302 |            -9 |           -110 |              -37 |     20130202 |
| 2013-02-09 00:00:00.000 | Past          |           2022 |                4 | 2022-04-30 00:00:00.000 |                 7 | Saturday | Sat        |             0 |              0 |          0 |          2013 |              2 | February | Feb          |         1 |                  9 |                40 |                  6 | Feb 2013     |           201302 |            -9 |           -110 |              -37 |     20130209 |
| 2013-02-16 00:00:00.000 | Past          |           2022 |                4 | 2022-04-30 00:00:00.000 |                 7 | Saturday | Sat        |             0 |              0 |          0 |          2013 |              2 | February | Feb          |         1 |                 16 |                47 |                  7 | Feb 2013     |           201302 |            -9 |           -110 |              -37 |     20130216 |
| 2013-02-23 00:00:00.000 | Past          |           2022 |                4 | 2022-04-30 00:00:00.000 |                 7 | Saturday | Sat        |             0 |              0 |          0 |          2013 |              2 | February | Feb          |         1 |                 23 |                54 |                  8 | Feb 2013     |           201302 |            -9 |           -110 |              -37 |     20130223 |
| 2013-03-02 00:00:00.000 | Past          |           2022 |                4 | 2022-04-30 00:00:00.000 |                 7 | Saturday | Sat        |             0 |              0 |          0 |          2013 |              3 | March    | Mar          |         1 |                  2 |                61 |                  9 | Mar 2013     |           201303 |            -9 |           -109 |              -37 |     20130302 |
| 2013-03-09 00:00:00.000 | Past          |           2022 |                4 | 2022-04-30 00:00:00.000 |                 7 | Saturday | Sat        |             0 |              0 |          0 |          2013 |              3 | March    | Mar          |         1 |                  9 |                68 |                 10 | Mar 2013     |           201303 |            -9 |           -109 |              -37 |     20130309 |


Table: captions
| RW10.2 Name   | Caption Type   | Caption Index   |   Caption ID | Caption                      |   Sub Total |   Calc Type | Measure Type   |   Show Detail |   Display | Detail Group   | ACCOUNT_LIST   |   Beginning Caption ID |   Ending Caption ID |   Sign Factor |
|:--------------|:---------------|:----------------|-------------:|:-----------------------------|------------:|------------:|:---------------|--------------:|----------:|:---------------|:---------------|-----------------------:|--------------------:|--------------:|
| PBIS01        | IS             | PBIS01_0010     |           10 | Inpatient Revenue            |           1 |           1 | $              |             1 |         1 | A              | PBIS01_0010    |                     10 |                  10 |            -1 |
| PBIS01        | IS             | PBIS01_0020     |           20 | Outpatient Revenue           |           1 |           1 | $              |             1 |         1 | A              | PBIS01_0020    |                     20 |                  20 |            -1 |
| PBIS01        | IS             | PBIS01_0030     |           30 | Gross Patient Revenue        |           2 |           2 | $              |             0 |         1 | A              | PBIS01_0030    |                     10 |                  30 |            -1 |
| PBIS01        | IS             | PBIS01_0040     |           40 | Core Deductions from Revenue |           1 |           1 | $              |             1 |         1 | A              | PBIS01_0040    |                     40 |                  40 |            -1 |
| PBIS01        | IS             | PBIS01_0050     |           50 | Core Net Patient Revenue     |           3 |           2 | $              |             0 |         1 | A              | PBIS01_0050    |                     10 |                  50 |            -1 |
| PBIS01        | IS             | PBIS01_0060     |           60 | CY DSH/Other                 |           1 |           1 | $              |             1 |         1 | A              | PBIS01_0060    |                     60 |                  60 |            -1 |
| PBIS01        | IS             | PBIS01_0070     |           70 | PY DSH/Other                 |           1 |           1 | $              |             1 |         1 | A              | PBIS01_0070    |                     70 |                  70 |            -1 |
| PBIS01        | IS             | PBIS01_0080     |           80 | Net Premium Revenue          |           4 |           2 | $              |             0 |         1 | A              | PBIS01_0080    |                     80 |                  80 |            -1 |
| PBIS01        | IS             | PBIS01_0090     |           90 | Total Net Revenue            |           5 |           2 | $              |             0 |         1 | A              | PBIS01_0090    |                     10 |                  90 |            -1 |
| PBIS01        | IS             | PBIS01_0100     |          100 | Mill Levy                    |           1 |           1 | $              |             1 |         1 | A              | PBIS01_0100    |                    100 |                 100 |            -1 |


Table: caption_calcs
|   Caption ID |   Calc ID | RW10.2 Name   | Caption Type   | Caption Calc Index   | Caption Index   | Operand   |
|-------------:|----------:|:--------------|:---------------|:---------------------|:----------------|:----------|
|          360 |        10 | PBIS01        | IS             | PBIS01_0430_0010     | PBIS01_0430     | /         |
|          140 |        20 | PBIS01        | IS             | PBIS01_0430_0020     | PBIS01_0430     |           |
|          140 |        30 | PBIS01        | IS             | PBIS01_0440_0030     | PBIS01_0440     | +         |
|          410 |        40 | PBIS01        | IS             | PBIS01_0440_0040     | PBIS01_0440     |           |
|          420 |        50 | PBIS01        | IS             | PBIS01_0450_0050     | PBIS01_0450     | /         |
|          440 |        60 | PBIS01        | IS             | PBIS01_0450_0060     | PBIS01_0450     |           |


Table: chart_of_accounts
|   ACCOUNT |   SUB_ACCOUNT | Account ID   | Account Name             | Caption Index   |   Caption ID |   Display Sign |   Summing Sign | Account ID + Name                     |   ACCOUNT_INDEX | Patient Acct Class   | Summary Account   |
|----------:|--------------:|:-------------|:-------------------------|:----------------|-------------:|---------------:|---------------:|:--------------------------------------|----------------:|:---------------------|:------------------|
|     60601 |             0 | 60601-0000   | Purchased Services       | PBIS01_0260     |          260 |              1 |             -1 | Purchased Services-[60601-0000]       |             992 |                      | PURCHSVC          |
|     60602 |             0 | 60602-0000   | Purchased Services-Other | PBIS01_0260     |          260 |              1 |             -1 | Purchased Services-Other-[60602-0000] |             993 |                      | PURCHSVC          |
|     60603 |             0 | 60603-0000   | Consulting               | PBIS01_0260     |          260 |              1 |             -1 | Consulting-[60603-0000]               |             994 |                      | PURCHSVC          |
|     60604 |             0 | 60604-0000   | Postage/Shipping         | PBIS01_0260     |          260 |              1 |             -1 | Postage/Shipping-[60604-0000]         |             995 |                      | PURCHSVC          |
|     60605 |             0 | 60605-0000   | Marketing/Advertising    | PBIS01_0260     |          260 |              1 |             -1 | Marketing/Advertising-[60605-0000]    |             996 |                      | PURCHSVC          |
|     60606 |             0 | 60606-0000   | Legal/Audit              | PBIS01_0260     |          260 |              1 |             -1 | Legal/Audit-[60606-0000]              |             997 |                      | PURCHSVC          |
|     60607 |             0 | 60607-0000   | Contracts-Equip          | PBIS01_0260     |          260 |              1 |             -1 | Contracts-Equip-[60607-0000]          |             998 |                      | PURCHSVC          |
|     60608 |             0 | 60608-0000   | Contracts-Other          | PBIS01_0260     |          260 |              1 |             -1 | Contracts-Other-[60608-0000]          |             999 |                      | PURCHSVC          |
|     60609 |             0 | 60609-0000   | Repairs-Equip            | PBIS01_0260     |          260 |              1 |             -1 | Repairs-Equip-[60609-0000]            |            1000 |                      | PURCHSVC          |
|     60610 |             0 | 60610-0000   | Repairs-Other            | PBIS01_0260     |          260 |              1 |             -1 | Repairs-Other-[60610-0000]            |            1001 |                      | PURCHSVC          |


Table: companies
|   Company | Company Name                             |
|----------:|:-----------------------------------------|
|         1 | Presbyterian Hospital Medical Center     |
|         2 | Presbyterian Kaseman Hospital            |
|         3 | PDS Ventures                             |
|         4 | Pickard Presbyterian Convalescent Center |
|         5 | Presbyterian Northside Hospital          |
|         6 | Rust Medical Center                      |
|         7 | Specialty Pharmacy and Other             |
|         8 | Presbyterian Santa Fe Medctr             |
|         9 | CDS Home Health Care & Hospice           |
|        20 | Albuquerque Ambulance Services           |


Table: cost_centers
|   COMPANY |   ACCT_UNIT |   Cost Center | Cost Center Name                   | Cost Center + Name                 | VAT                         | Service Line   |   Reporting Company |   COST_CENTER_INDEX |
|----------:|------------:|--------------:|:-----------------------------------|:-----------------------------------|:----------------------------|:---------------|--------------------:|--------------------:|
|         8 |      812962 |         12962 | 12962Inventory Clearing Accounts   | 12962Inventory Clearing Accounts   | INTEGRATED SUPPORT SERVICES | UNDEFINED      |                   8 |               12962 |
|         8 |      813010 |         13010 | 13010Utilities                     | 13010Utilities                     | INTEGRATED SUPPORT SERVICES | UNDEFINED      |                   8 |               13010 |
|         8 |      814347 |         14347 | 14347St Michaels Radiology         | 14347St Michaels Radiology         | PT CARE/PMG                 | UNDEFINED      |                   8 |               14347 |
|         8 |      814348 |         14348 | 14348St Michaels Uc Walk In Clinic | 14348St Michaels Uc Walk In Clinic | PT CARE/PMG                 | UNDEFINED      |                   8 |               14348 |
|         8 |      814349 |         14349 | 14349SFMC POB Cardiology           | 14349SFMC POB Cardiology           | PT CARE/PMG                 | UNDEFINED      |                   8 |               14349 |
|         8 |      814350 |         14350 | 14350St Michaels Podiatry          | 14350St Michaels Podiatry          | PT CARE/PMG                 | UNDEFINED      |                   8 |               14350 |
|         8 |      814351 |         14351 | 14351POB Ob/Gyn                    | 14351POB Ob/Gyn                    | PT CARE/PMG                 | UNDEFINED      |                   8 |               14351 |
|         8 |      814352 |         14352 | 14352St Michaels Rheuma            | 14352St Michaels Rheuma            | PT CARE/PMG                 | UNDEFINED      |                   8 |               14352 |
|         8 |      814353 |         14353 | 14353St Michaels Beh Hlth          | 14353St Michaels Beh Hlth          | PT CARE/PMG                 | UNDEFINED      |                   8 |               14353 |
|         8 |      814354 |         14354 | 14354POB Gen Surgery               | 14354POB Gen Surgery               | PT CARE/PMG                 | UNDEFINED      |                   8 |               14354 |


Table: soi
|   Company | Level 03   | Level 02   | Level 01   |
|----------:|:-----------|:-----------|:-----------|
|         8 | RDS        | PDS        | PHS        |


Table: Statistical Measures



Table: structure
|   Report ID | Reports To   | Report Name     | Reporting Company   |   Display Level | ReportingPath   |   Depth | Level 01       |   Level 01 Sort | Level 02       | Level 02 Sort   | Level 03       | Level 03 Sort   | Level 04        | Level 04 Sort   | Level 05   | Level 05 Sort   | Level 06   | Level 06 Sort   |
|------------:|:-------------|:----------------|:--------------------|----------------:|:----------------|--------:|:---------------|----------------:|:---------------|:----------------|:---------------|:----------------|:----------------|:----------------|:-----------|:----------------|:-----------|:----------------|
|          10 |              | 10 Report Name  |                     |               1 | 10              |       1 | 10 Report Name |              10 |                |                 |                |                 |                 |                 |            |                 |            |                 |
|          20 | 10           | 20 Report Name  |                     |               1 | 10|20           |       2 | 10 Report Name |              10 | 20 Report Name | 20              |                |                 |                 |                 |            |                 |            |                 |
|          30 | 10           | 30 Report Name  |                     |               1 | 10|30           |       2 | 10 Report Name |              10 | 30 Report Name | 30              |                |                 |                 |                 |            |                 |            |                 |
|          40 | 10           | 40 Report Name  |                     |               1 | 10|40           |       2 | 10 Report Name |              10 | 40 Report Name | 40              |                |                 |                 |                 |            |                 |            |                 |
|          50 | 10           | 50 Report Name  | 95                  |               1 | 10|50           |       2 | 10 Report Name |              10 | 50 Report Name | 50              |                |                 |                 |                 |            |                 |            |                 |
|          60 | 10           | 60 Report Name  | 97                  |               1 | 10|60           |       2 | 10 Report Name |              10 | 60 Report Name | 60              |                |                 |                 |                 |            |                 |            |                 |
|          70 | 20           | 70 Report Name  |                     |               1 | 10|20|70        |       3 | 10 Report Name |              10 | 20 Report Name | 20              | 70 Report Name | 70              |                 |                 |            |                 |            |                 |
|          80 | 20           | 80 Report Name  |                     |               1 | 10|20|80        |       3 | 10 Report Name |              10 | 20 Report Name | 20              | 80 Report Name | 80              |                 |                 |            |                 |            |                 |
|          90 | 20           | 90 Report Name  | 20                  |               1 | 10|20|90        |       3 | 10 Report Name |              10 | 20 Report Name | 20              | 90 Report Name | 90              |                 |                 |            |                 |            |                 |
|         100 | 70           | 100 Report Name |                     |               1 | 10|20|70|100    |       4 | 10 Report Name |              10 | 20 Report Name | 20              | 70 Report Name | 70              | 100 Report Name | 100             |            |                 |            |                 |


Table: systems
| System   | System Name                    |
|:---------|:-------------------------------|
| AC       | Project and Activity Accountin |
| AM       | Asset Management               |
| AP       | Accounts Payable               |
| CA       | Cost Allocations               |
| CB       | Cash Ledger                    |
| GL       | General Ledger                 |
| HB       | EPIC Resolute Hospital Billing |
| HF       | HRP / Facets                   |
| IC       | Inventory Control              |
| IT       | Image Trend                    |


Table: UIF Comparisons
| Comparison               |   Order |
|:-------------------------|--------:|
| Total Operating Revenue  |       1 |
| Total Operating Expenses |       2 |
| Operating Income         |       3 |
| Inpatient Discharges     |       4 |
| Inpatient Days           |       5 |
| WRVUs                    |       6 |

 


tables: name: % Diff
data: % Diff.csv
name: amounts
data: amounts.csv
name: amount_classes
data: amount_classes.csv
name: calendar
data: calendar.csv
name: captions
data: captions.csv
name: caption_calcs
data: caption_calcs.csv
name: chart_of_accounts
data: chart_of_accounts.csv
name: companies
data: companies.csv
name: cost_centers
data: cost_centers.csv
name: soi
data: soi.csv
name: Statistical Measures
data: Statistical Measures.csv
name: structure
data: structure.csv
name: systems
data: systems.csv
name: UIF Comparisons
data: UIF Comparisons.csv
label: amounts
AMOUNT_CLASS_INDEX
amount_classes
AMOUNT_CLASS_INDEX
amounts
DATE_INDEX
calendar
DATE_INDEX
amounts
ACCOUNT_INDEX
chart_of_accounts
ACCOUNT_INDEX
cost_centers
Reporting Company
companies
Company
chart_of_accounts
Caption Index
captions
Caption Index
caption_calcs
Caption Index
captions
Caption Index
structure
Reporting Company
companies
Company
amounts
COST_CENTER_INDEX
cost_centers
COST_CENTER_INDEX
soi
Company
companies
Company
output: {
    "joins": [
        {
            "from_table": "amounts",
            "from_column": "AMOUNT_CLASS_INDEX",
            "to_table": "amount_classes",
            "to_column": "AMOUNT_CLASS_INDEX"
        },
        {
            "from_table": "amounts",
            "from_column": "DATE_INDEX",
            "to_table": "calendar",
            "to_column": "DATE_INDEX"
        },
        {
            "from_table": "amounts",
            "from_column": "ACCOUNT_INDEX",
            "to_table": "chart_of_accounts",
            "to_column": "ACCOUNT_INDEX"
        },
        {
            "from_table": "cost_centers",
            "from_column": "Reporting Company",
            "to_table": "companies",
            "to_column": "Company"
        },
        {
            "from_table": "chart_of_accounts",
            "from_column": "Caption Index",
            "to_table": "captions",
            "to_column": "Caption Index"
        },
        {
            "from_table": "caption_calcs",
            "from_column": "Caption Index",
            "to_table": "captions",
            "to_column": "Caption Index"
        },
        {
            "from_table": "structure",
            "from_column": "Reporting Company",
            "to_table": "companies",
            "to_column": "Company"
        },
        {
            "from_table": "amounts",
            "from_column": "COST_CENTER_INDEX",
            "to_table": "cost_centers",
            "to_column": "COST_CENTER_INDEX"
        },
        {
            "from_table": "soi",
            "from_column": "Company",
            "to_table": "companies",
            "to_column": "Company"
        }
    ]
}