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: avg_mileage
| truckid   |   avgmpg |
|:----------|---------:|
| A1        |  4.78582 |
| A10       |  5.40172 |
| A100      |  4.93904 |
| A11       |  5.50237 |
| A12       |  4.68616 |
| A13       |  5.82055 |
| A14       |  4.93991 |
| A15       |  5.00964 |
| A16       |  4.93337 |
| A17       |  4.90249 |


Table: drivermileage
| driverid   |   totmiles |
|:-----------|-----------:|
| A1         |     628507 |
| A10        |     675377 |
| A100       |     634338 |
| A11        |     652452 |
| A12        |     668241 |
| A13        |     654319 |
| A14        |     649645 |
| A15        |     651036 |
| A16        |     638086 |
| A17        |     663821 |


Table: geolocation
| truckid   | driverid   | event   |   latitude |   longitude | city       | state      |   velocity |   event_ind |   idling_ind |
|:----------|:-----------|:--------|-----------:|------------:|:-----------|:-----------|-----------:|------------:|-------------:|
| A22       | A22        | normal  |    38.4405 |    -122.714 | Santa Rosa | California |          0 |           0 |            1 |
| A12       | A12        | normal  |    38.4405 |    -122.714 | Santa Rosa | California |          0 |           0 |            1 |
| A100      | A100       | normal  |    38.4405 |    -122.714 | Santa Rosa | California |          0 |           0 |            1 |
| A57       | A57        | normal  |    38.4405 |    -122.714 | Santa Rosa | California |          0 |           0 |            1 |
| A57       | A57        | normal  |    38.4405 |    -122.714 | Santa Rosa | California |          0 |           0 |            1 |
| A65       | A65        | normal  |    38.4405 |    -122.714 | Santa Rosa | California |          0 |           0 |            1 |
| A21       | A21        | normal  |    38.4405 |    -122.714 | Santa Rosa | California |          0 |           0 |            1 |
| A76       | A76        | normal  |    38.4405 |    -122.714 | Santa Rosa | California |          0 |           0 |            1 |
| A41       | A41        | normal  |    38.4405 |    -122.714 | Santa Rosa | California |          0 |           0 |            1 |
| A57       | A57        | normal  |    38.4405 |    -122.714 | Santa Rosa | California |          0 |           0 |            1 |


Table: riskfactor
| driverid   |   events |   totmiles |   riskfactor | Riskfactor Bins   |
|:-----------|---------:|-----------:|-------------:|:------------------|
| A1         |        3 |     628507 |      4.77322 | Medium Risk       |
| A2         |        1 |     664543 |      1.50479 | Low Risk          |
| A3         |        6 |     639584 |      9.3811  | High Risk         |
| A4         |        6 |     663289 |      9.04583 | High Risk         |
| A5         |        9 |     676574 |     13.3023  | High Risk         |
| A6         |        1 |     648479 |      1.54207 | Low Risk          |
| A7         |        5 |     653787 |      7.64775 | High Risk         |
| A8         |        2 |     653991 |      3.05815 | Low Risk          |
| A9         |        6 |     665456 |      9.01637 | High Risk         |
| A10        |        6 |     675377 |      8.88393 | High Risk         |


Table: trucks
| driverid   | truckid   | model        | jun13_miles   | jun13_gas   | may13_miles   | may13_gas   | apr13_miles   | apr13_gas   | mar13_miles   | mar13_gas   | feb13_miles   | feb13_gas   | jan13_miles   | jan13_gas   | dec12_miles   | dec12_gas   | nov12_miles   | nov12_gas   | oct12_miles   | oct12_gas   | sep12_miles   | sep12_gas   | aug12_miles   | aug12_gas   | jul12_miles   | jul12_gas   | jun12_miles   | jun12_gas   | may12_miles   | may12_gas   | apr12_miles   | apr12_gas   | mar12_miles   | mar12_gas   | feb12_miles   | feb12_gas   | jan12_miles   | jan12_gas   | dec11_miles   | dec11_gas   | nov11_miles   | nov11_gas   | oct11_miles   | oct11_gas   | sep11_miles   | sep11_gas   | aug11_miles   | aug11_gas   | jul11_miles   | jul11_gas   | jun11_miles   | jun11_gas   | may11_miles   | may11_gas   | apr11_miles   | apr11_gas   | mar11_miles   | mar11_gas   | feb11_miles   | feb11_gas   | jan11_miles   | jan11_gas   | dec10_miles   | dec10_gas   | nov10_miles   | nov10_gas   | oct10_miles   | oct10_gas   | sep10_miles   | sep10_gas   | aug10_miles   | aug10_gas   | jul10_miles   | jul10_gas   | jun10_miles   | jun10_gas   | may10_miles   | may10_gas   | apr10_miles   | apr10_gas   | mar10_miles   | mar10_gas   | feb10_miles   | feb10_gas   | jan10_miles   | jan10_gas   | dec09_miles   | dec09_gas   | nov09_miles   | nov09_gas   | oct09_miles   | oct09_gas   | sep09_miles   | sep09_gas   | aug09_miles   | aug09_gas   | jul09_miles   | jul09_gas   | jun09_miles   | jun09_gas   | may09_miles   | may09_gas   | apr09_miles   | apr09_gas   | mar09_miles   | mar09_gas   | feb09_miles   | feb09_gas   | jan09_miles   | jan09_gas   |
|:-----------|:----------|:-------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|:--------------|:------------|
| driverid   | truckid   | model        |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |               |             |
| A1         | A1        | Freightliner | 9217          | 1914        | 8769          | 1892        | 14234         | 3008        | 11519         | 2262        | 8676          | 1596        | 10025         | 1878        | 12647         | 2331        | 10214         | 2054        | 10807         | 2134        | 11127         | 2191        | 9754          | 1967        | 12925         | 2578        | 15792         | 3313        | 9052          | 1878        | 11062         | 2150        | 13594         | 2824        | 11019         | 2324        | 9222          | 1902        | 8565          | 1745        | 10410         | 1943        | 13450         | 3047        | 10446         | 2112        | 10378         | 2201        | 9014          | 1598        | 9466          | 2642        | 14175         | 2642        | 11573         | 2642        | 13055         | 2642        | 14614         | 2642        | 14099         | 2642        | 15174         | 2642        | 10635         | 2642        | 12105         | 2642        | 10130         | 2642        | 11344         | 2642        | 10622         | 2642        | 10747         | 2642        | 12976         | 2642        | 13221         | 2642        | 10435         | 2642        | 12839         | 2642        | 8969          | 2642        | 8795          | 2642        | 13668         | 2642        | 12414         | 2642        | 13300         | 2642        | 11698         | 2642        | 14207         | 2642        | 14062         | 2642        | 12073         | 2642        | 15276         | 2642        | 9880          | 2642        | 13861         | 2642        | 11176         | 2642        |
| A2         | A2        | Ford         | 12058         | 2335        | 14314         | 2648        | 11050         | 2323        | 14114         | 3157        | 13583         | 2346        | 15362         | 3353        | 13608         | 2607        | 11236         | 2597        | 11380         | 1939        | 12934         | 2324        | 11848         | 2301        | 13206         | 3114        | 15316         | 3344        | 13838         | 2718        | 12024         | 2800        | 12693         | 2329        | 14392         | 2929        | 11134         | 2290        | 13911         | 2953        | 11542         | 2650        | 11296         | 2135        | 10224         | 2027        | 14595         | 3013        | 13769         | 2980        | 10377         | 1827        | 12786         | 1827        | 14364         | 1827        | 8978          | 1827        | 9259          | 1827        | 9545          | 1827        | 13100         | 1827        | 8529          | 1827        | 9667          | 1827        | 13264         | 1827        | 12070         | 1827        | 10367         | 1827        | 13829         | 1827        | 10942         | 1827        | 10463         | 1827        | 9406          | 1827        | 14755         | 1827        | 14043         | 1827        | 11656         | 1827        | 14744         | 1827        | 13797         | 1827        | 9660          | 1827        | 10283         | 1827        | 12034         | 1827        | 11719         | 1827        | 13912         | 1827        | 11892         | 1827        | 15158         | 1827        | 12774         | 1827        | 11743         | 1827        |
| A3         | A3        | Ford         | 13652         | 2899        | 12075         | 2603        | 12277         | 2792        | 9642          | 1864        | 8606          | 1796        | 13089         | 2796        | 10762         | 2099        | 10250         | 1857        | 9312          | 2046        | 8437          | 1728        | 13905         | 2789        | 14079         | 2965        | 12761         | 2708        | 13264         | 2754        | 12957         | 2529        | 12598         | 2581        | 13291         | 2644        | 9433          | 1881        | 13980         | 2503        | 8592          | 1909        | 11978         | 2572        | 10921         | 2299        | 13774         | 2956        | 9451          | 1940        | 13420         | 3064        | 11378         | 3064        | 13573         | 3064        | 11635         | 3064        | 9577          | 3064        | 10780         | 3064        | 12490         | 3064        | 15127         | 3064        | 11524         | 3064        | 14234         | 3064        | 14551         | 3064        | 12213         | 3064        | 14079         | 3064        | 11040         | 3064        | 10460         | 3064        | 15435         | 3064        | 12811         | 3064        | 12616         | 3064        | 10743         | 3064        | 11732         | 3064        | 9429          | 3064        | 9025          | 3064        | 9547          | 3064        | 11267         | 3064        | 11205         | 3064        | 9821          | 3064        | 15224         | 3064        | 11209         | 3064        | 14203         | 3064        | 10150         | 3064        |
| A4         | A4        | Kenworth     | 12687         | 2439        | 10680         | 2083        | 11071         | 2599        | 12302         | 2361        | 8845          | 1816        | 14130         | 2929        | 12316         | 2702        | 11999         | 2377        | 14679         | 3455        | 13835         | 3232        | 13385         | 2966        | 11443         | 2582        | 9290          | 2092        | 11702         | 2129        | 15261         | 3560        | 11947         | 2155        | 9782          | 2048        | 11507         | 2639        | 12157         | 2582        | 10861         | 2021        | 13122         | 2981        | 11069         | 1971        | 12312         | 2363        | 10386         | 1897        | 8714          | 2965        | 10235         | 2965        | 10090         | 2965        | 14085         | 2965        | 14434         | 2965        | 14256         | 2965        | 9737          | 2965        | 13118         | 2965        | 9862          | 2965        | 13570         | 2965        | 14179         | 2965        | 13989         | 2965        | 12950         | 2965        | 11157         | 2965        | 8673          | 2965        | 15177         | 2965        | 9579          | 2965        | 14282         | 2965        | 14325         | 2965        | 12724         | 2965        | 12773         | 2965        | 8998          | 2965        | 11910         | 2965        | 12707         | 2965        | 13465         | 2965        | 14419         | 2965        | 14684         | 2965        | 13090         | 2965        | 15090         | 2965        | 14249         | 2965        |
| A5         | A5        | Hino         | 10233         | 1825        | 14634         | 3450        | 9281          | 2028        | 13547         | 2790        | 12990         | 3056        | 13769         | 2713        | 11423         | 2083        | 12570         | 2547        | 14204         | 2770        | 15279         | 3122        | 14473         | 2745        | 11312         | 2453        | 13969         | 2943        | 13422         | 2520        | 14092         | 2619        | 10749         | 2289        | 10649         | 2410        | 12587         | 2269        | 8498          | 1736        | 15339         | 2612        | 10502         | 2099        | 13867         | 3133        | 11594         | 2613        | 10571         | 2044        | 13508         | 2310        | 15678         | 2310        | 14318         | 2310        | 14088         | 2310        | 13217         | 2310        | 12969         | 2310        | 14377         | 2310        | 11064         | 2310        | 12704         | 2310        | 10887         | 2310        | 13956         | 2310        | 14447         | 2310        | 12146         | 2310        | 10212         | 2310        | 10402         | 2310        | 13295         | 2310        | 15016         | 2310        | 10200         | 2310        | 9269          | 2310        | 10744         | 2310        | 10467         | 2310        | 11495         | 2310        | 15537         | 2310        | 14058         | 2310        | 13265         | 2310        | 12275         | 2310        | 14289         | 2310        | 13046         | 2310        | 9582          | 2310        | 10509         | 2310        |
| A6         | A6        | Caterpillar  | 14488         | 2883        | 13317         | 3091        | 10927         | 2161        | 10972         | 1866        | 14322         | 2983        | 12956         | 2435        | 14293         | 2596        | 12593         | 2384        | 11899         | 2690        | 8693          | 1540        | 13617         | 3045        | 10513         | 2583        | 11623         | 2164        | 13088         | 2274        | 11661         | 2373        | 11573         | 2232        | 10744         | 2292        | 13503         | 2849        | 9839          | 1828        | 9902          | 1996        | 13531         | 2893        | 13636         | 2322        | 9734          | 1923        | 11385         | 2767        | 13574         | 1915        | 9115          | 1915        | 9261          | 1915        | 10725         | 1915        | 13198         | 1915        | 15596         | 1915        | 13735         | 1915        | 10332         | 1915        | 12365         | 1915        | 12739         | 1915        | 13941         | 1915        | 14539         | 1915        | 9379          | 1915        | 8992          | 1915        | 12684         | 1915        | 10226         | 1915        | 13618         | 1915        | 12659         | 1915        | 14266         | 1915        | 14728         | 1915        | 10162         | 1915        | 11256         | 1915        | 11260         | 1915        | 12715         | 1915        | 9193          | 1915        | 13367         | 1915        | 11053         | 1915        | 12388         | 1915        | 9924          | 1915        | 12680         | 1915        |
| A7         | A7        | Ford         | 10938         | 2231        | 12080         | 2142        | 13539         | 2346        | 13453         | 2413        | 12754         | 2444        | 11147         | 2083        | 11749         | 2442        | 15816         | 2728        | 13330         | 2369        | 10803         | 2134        | 9275          | 1863        | 11223         | 2307        | 13215         | 2367        | 8849          | 1812        | 10577         | 2343        | 13126         | 2614        | 11993         | 2153        | 12873         | 2623        | 14063         | 2799        | 9100          | 1611        | 13889         | 2768        | 10944         | 2152        | 12789         | 2490        | 14445         | 3161        | 11350         | 2407        | 14389         | 2407        | 14091         | 2407        | 12740         | 2407        | 9969          | 2407        | 10815         | 2407        | 11890         | 2407        | 14014         | 2407        | 12011         | 2407        | 10561         | 2407        | 10518         | 2407        | 10741         | 2407        | 10007         | 2407        | 13537         | 2407        | 15374         | 2407        | 14594         | 2407        | 14774         | 2407        | 14656         | 2407        | 8060          | 2407        | 12866         | 2407        | 10530         | 2407        | 9826          | 2407        | 9790          | 2407        | 10223         | 2407        | 13132         | 2407        | 14683         | 2407        | 12253         | 2407        | 12422         | 2407        | 9853          | 2407        | 12148         | 2407        |
| A8         | A8        | Navistar     | 11392         | 2280        | 8922          | 1834        | 11422         | 2202        | 13142         | 2478        | 14133         | 2813        | 10184         | 1819        | 9660          | 1690        | 12201         | 2359        | 10650         | 2155        | 14691         | 2952        | 12366         | 2235        | 13869         | 2759        | 13025         | 2686        | 10661         | 1967        | 9916          | 2125        | 13638         | 2768        | 13326         | 2402        | 11289         | 2129        | 13562         | 2859        | 11060         | 1992        | 11088         | 2446        | 13408         | 2699        | 10579         | 2308        | 12385         | 2239        | 11363         | 2501        | 12901         | 2501        | 13806         | 2501        | 13871         | 2501        | 12250         | 2501        | 12457         | 2501        | 11351         | 2501        | 13023         | 2501        | 9836          | 2501        | 13387         | 2501        | 11932         | 2501        | 9773          | 2501        | 14765         | 2501        | 12951         | 2501        | 13626         | 2501        | 13724         | 2501        | 12001         | 2501        | 10313         | 2501        | 10837         | 2501        | 12641         | 2501        | 10699         | 2501        | 10444         | 2501        | 12712         | 2501        | 11768         | 2501        | 12787         | 2501        | 11397         | 2501        | 14780         | 2501        | 10938         | 2501        | 9773          | 2501        | 15316         | 2501        |
| A9         | A9        | Volvo        | 12601         | 2515        | 9707          | 1869        | 11914         | 2479        | 11531         | 2207        | 12913         | 2342        | 9648          | 1663        | 12035         | 2497        | 8453          | 1746        | 13856         | 3082        | 9692          | 1843        | 13051         | 2720        | 14617         | 2788        | 14482         | 2755        | 10494         | 2314        | 11086         | 2309        | 15225         | 2887        | 13531         | 2934        | 12320         | 2384        | 13974         | 2903        | 15563         | 2861        | 10620         | 2366        | 12734         | 2258        | 13800         | 3091        | 14059         | 3227        | 12302         | 2132        | 12309         | 2132        | 13391         | 2132        | 12058         | 2132        | 14120         | 2132        | 9893          | 2132        | 14365         | 2132        | 13410         | 2132        | 10675         | 2132        | 10776         | 2132        | 10894         | 2132        | 10624         | 2132        | 10498         | 2132        | 8565          | 2132        | 14132         | 2132        | 13023         | 2132        | 12539         | 2132        | 13137         | 2132        | 9953          | 2132        | 13285         | 2132        | 11823         | 2132        | 12052         | 2132        | 11633         | 2132        | 11316         | 2132        | 14756         | 2132        | 11811         | 2132        | 14841         | 2132        | 12615         | 2132        | 13636         | 2132        | 13118         | 2132        |


Table: truck_mileage
| truckid   | driverid   | rdate   |   miles |   gas |     mpg |
|:----------|:-----------|:--------|--------:|------:|--------:|
| A1        | A1         | jun13   |    9217 |  1914 | 4.81557 |
| A1        | A1         | may13   |    8769 |  1892 | 4.63478 |
| A1        | A1         | apr13   |   14234 |  3008 | 4.73205 |
| A1        | A1         | mar13   |   11519 |  2262 | 5.0924  |
| A1        | A1         | feb13   |    8676 |  1596 | 5.43609 |
| A1        | A1         | jan13   |   10025 |  1878 | 5.33813 |
| A1        | A1         | dec12   |   12647 |  2331 | 5.42557 |
| A1        | A1         | nov12   |   10214 |  2054 | 4.97274 |
| A1        | A1         | oct12   |   10807 |  2134 | 5.0642  |
| A1        | A1         | sep12   |   11127 |  2191 | 5.0785  |

 


tables: name: avg_mileage
data: avg_mileage.csv
name: drivermileage
data: drivermileage.csv
name: geolocation
data: geolocation.csv
name: riskfactor
data: riskfactor.csv
name: trucks
data: trucks.csv
name: truck_mileage
data: truck_mileage.csv
label: avg_mileage
truckid
trucks
truckid
geolocation
truckid
trucks
truckid
truck_mileage
truckid
trucks
truckid
drivermileage
driverid
trucks
driverid
riskfactor
driverid
trucks
driverid
output: {
    "joins": [
        {
            "from_table": "avg_mileage",
            "from_column": "truckid",
            "to_table": "trucks",
            "to_column": "truckid"
        },
        {
            "from_table": "geolocation",
            "from_column": "truckid",
            "to_table": "trucks",
            "to_column": "truckid"
        },
        {
            "from_table": "truck_mileage",
            "from_column": "truckid",
            "to_table": "trucks",
            "to_column": "truckid"
        },
        {
            "from_table": "drivermileage",
            "from_column": "driverid",
            "to_table": "trucks",
            "to_column": "driverid"
        },
        {
            "from_table": "riskfactor",
            "from_column": "driverid",
            "to_table": "trucks",
            "to_column": "driverid"
        }
    ]
}