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: Circuits
|   CircuitId | CircuitRef     | Name                           | Location     | Country   |   Latitude |   Longitude |   Alt |
|------------:|:---------------|:-------------------------------|:-------------|:----------|-----------:|------------:|------:|
|           1 | albert_park    | Albert Park Grand Prix Circuit | Melbourne    | Australia |  -37.8497  |   144.968   |    10 |
|           2 | sepang         | Sepang International Circuit   | Kuala Lumpur | Malaysia  |    2.76083 |   101.738   |    18 |
|           3 | bahrain        | Bahrain International Circuit  | Sakhir       | Bahrain   |   26.0325  |    50.5106  |     7 |
|           4 | catalunya      | Circuit de Barcelona-Catalunya | MontmelÃ³    | Spain     |   41.57    |     2.26111 |   109 |
|           5 | istanbul       | Istanbul Park                  | Istanbul     | Turkey    |   40.9517  |    29.405   |   130 |
|           6 | monaco         | Circuit de Monaco              | Monte-Carlo  | Monaco    |   43.7347  |     7.42056 |     7 |
|           7 | villeneuve     | Circuit Gilles Villeneuve      | Montreal     | Canada    |   45.5     |   -73.5228  |    13 |
|           8 | magny_cours    | Circuit de Nevers Magny-Cours  | Magny Cours  | France    |   46.8642  |     3.16361 |   228 |
|           9 | silverstone    | Silverstone Circuit            | Silverstone  | UK        |   52.0786  |    -1.01694 |   153 |
|          10 | hockenheimring | Hockenheimring                 | Hockenheim   | Germany   |   49.3278  |     8.56583 |   103 |


Table: Constructor Results
|   ConstructorResultsId |   RaceId |   ConstructorId |   Points | status   |
|-----------------------:|---------:|----------------:|---------:|:---------|
|                    579 |       71 |              18 |        0 | \N       |
|                    588 |       72 |              18 |        0 | \N       |
|                    598 |       73 |              18 |        0 | \N       |
|                    608 |       74 |              18 |        0 | \N       |
|                    618 |       75 |              18 |        0 | \N       |
|                    626 |       76 |              18 |        0 | \N       |
|                    637 |       77 |              18 |        0 | \N       |
|                    645 |       78 |              18 |        0 | \N       |
|                    667 |       80 |              18 |        0 | \N       |
|                    677 |       81 |              18 |        0 | \N       |


Table: Constructor Standings
|   ConstructorStandingsId |   RaceID |   ConstructorID |   Points |   Position |   PositionText |   Wins |
|-------------------------:|---------:|----------------:|---------:|-----------:|---------------:|-------:|
|                      629 |       77 |              18 |        0 |         10 |             10 |      0 |
|                     1826 |       78 |              18 |        0 |         10 |             10 |      0 |
|                     6156 |       91 |              18 |        0 |         10 |             10 |      0 |
|                     6166 |       92 |              18 |        0 |         10 |             10 |      0 |
|                     6176 |       93 |              18 |        0 |         10 |             10 |      0 |
|                     6186 |       94 |              18 |        0 |         10 |             10 |      0 |
|                     6196 |       95 |              18 |        0 |         10 |             10 |      0 |
|                     6206 |       96 |              18 |        0 |         10 |             10 |      0 |
|                     6216 |       97 |              18 |        0 |         10 |             10 |      0 |
|                     6004 |      110 |              18 |        0 |         10 |             10 |      0 |


Table: Constructors
|   ConstructorId | ConstructorRef   | ConstructorName   | Nationality   |
|----------------:|:-----------------|:------------------|:--------------|
|               1 | mclaren          | McLaren           | British       |
|               3 | williams         | Williams          | British       |
|              16 | bar              | BAR               | British       |
|              19 | jaguar           | Jaguar            | British       |
|              21 | arrows           | Arrows            | British       |
|              23 | brawn            | Brawn             | British       |
|              24 | stewart          | Stewart           | British       |
|              25 | tyrrell          | Tyrrell           | British       |
|              26 | lola             | Lola              | British       |
|              29 | footwork         | Footwork          | British       |


Table: Dates
| Date                    |   Year |   QuarterOfYear |   MonthOfYear |   DayOfMonth |   DateInt | MonthName   | MonthInCalendar   | QuarterInCalendar   |   DayInWeek | DayOfWeekName   | WeekEnding              |   Week Number |   MonthnYear |   QuarternYear |   ShortYear | FY   |
|:------------------------|-------:|----------------:|--------------:|-------------:|----------:|:------------|:------------------|:--------------------|------------:|:----------------|:------------------------|--------------:|-------------:|---------------:|------------:|:-----|
| 1988-07-04 00:00:00.000 |   1988 |               3 |             7 |            4 |  19880704 | July        | Jul 1988          | Q3 1988             |           0 | Monday          | 1988-07-10 00:00:00.000 |            28 |     19880700 |       19880300 |          88 | FY89 |
| 1988-07-05 00:00:00.000 |   1988 |               3 |             7 |            5 |  19880705 | July        | Jul 1988          | Q3 1988             |           1 | Tuesday         | 1988-07-10 00:00:00.000 |            28 |     19880700 |       19880300 |          88 | FY89 |
| 1988-07-06 00:00:00.000 |   1988 |               3 |             7 |            6 |  19880706 | July        | Jul 1988          | Q3 1988             |           2 | Wednesday       | 1988-07-10 00:00:00.000 |            28 |     19880700 |       19880300 |          88 | FY89 |
| 1988-07-07 00:00:00.000 |   1988 |               3 |             7 |            7 |  19880707 | July        | Jul 1988          | Q3 1988             |           3 | Thursday        | 1988-07-10 00:00:00.000 |            28 |     19880700 |       19880300 |          88 | FY89 |
| 1988-07-08 00:00:00.000 |   1988 |               3 |             7 |            8 |  19880708 | July        | Jul 1988          | Q3 1988             |           4 | Friday          | 1988-07-10 00:00:00.000 |            28 |     19880700 |       19880300 |          88 | FY89 |
| 1988-07-09 00:00:00.000 |   1988 |               3 |             7 |            9 |  19880709 | July        | Jul 1988          | Q3 1988             |           5 | Saturday        | 1988-07-10 00:00:00.000 |            28 |     19880700 |       19880300 |          88 | FY89 |
| 1988-07-10 00:00:00.000 |   1988 |               3 |             7 |           10 |  19880710 | July        | Jul 1988          | Q3 1988             |           6 | Sunday          | 1988-07-10 00:00:00.000 |            28 |     19880700 |       19880300 |          88 | FY89 |
| 1989-07-03 00:00:00.000 |   1989 |               3 |             7 |            3 |  19890703 | July        | Jul 1989          | Q3 1989             |           0 | Monday          | 1989-07-09 00:00:00.000 |            28 |     19890700 |       19890300 |          89 | FY90 |
| 1989-07-04 00:00:00.000 |   1989 |               3 |             7 |            4 |  19890704 | July        | Jul 1989          | Q3 1989             |           1 | Tuesday         | 1989-07-09 00:00:00.000 |            28 |     19890700 |       19890300 |          89 | FY90 |
| 1989-07-05 00:00:00.000 |   1989 |               3 |             7 |            5 |  19890705 | July        | Jul 1989          | Q3 1989             |           2 | Wednesday       | 1989-07-09 00:00:00.000 |            28 |     19890700 |       19890300 |          89 | FY90 |


Table: Driver Standings
|   DriverStandingsId |   RaceId |   DriverId |   Points |   Position |   PositionText |   Wins |
|--------------------:|---------:|-----------:|---------:|-----------:|---------------:|-------:|
|                3174 |      163 |          2 |        0 |         21 |             21 |      0 |
|               11465 |      145 |          4 |        0 |         21 |             21 |      0 |
|               11487 |      146 |          4 |        0 |         21 |             21 |      0 |
|               11509 |      147 |          4 |        0 |         21 |             21 |      0 |
|               68106 |      948 |          4 |        0 |         21 |             21 |      0 |
|               64945 |      861 |          5 |        0 |         21 |             21 |      0 |
|               63780 |      338 |         10 |        0 |         21 |             21 |      0 |
|               64446 |      844 |         10 |        0 |         21 |             21 |      0 |
|               65109 |      867 |         10 |        0 |         21 |             21 |      0 |
|               65133 |      868 |         10 |        0 |         21 |             21 |      0 |


Table: Drivers
|   DriverID | DriverRef      | Number   | Code   | Forename   | Surname   | DOB                     | Nationality   | Full Name        |
|-----------:|:---------------|:---------|:-------|:-----------|:----------|:------------------------|:--------------|:-----------------|
|        121 | andretti       | \N       | \N     | Michael    | Andretti  | 1962-10-05 00:00:00.000 | American      | Michael Andretti |
|        158 | cheever        | \N       | \N     | Eddie      | Cheever   | 1958-01-10 00:00:00.000 | American      | Eddie Cheever    |
|        193 | sullivan       | \N       | \N     | Danny      | Sullivan  | 1950-03-09 00:00:00.000 | American      | Danny Sullivan   |
|        207 | mario_andretti | \N       | \N     | Mario      | Andretti  | 1940-02-28 00:00:00.000 | American      | Mario Andretti   |
|        214 | cogan          | \N       | \N     | Kevin      | Cogan     | 1956-03-31 00:00:00.000 | American      | Kevin Cogan      |
|        239 | lunger         | \N       | \N     | Brett      | Lunger    | 1945-11-14 00:00:00.000 | American      | Brett Lunger     |
|        240 | ongais         | \N       | \N     | Danny      | Ongais    | 1942-05-21 00:00:00.000 | American      | Danny Ongais     |
|        249 | rahal          | \N       | \N     | Bobby      | Rahal     | 1953-01-10 00:00:00.000 | American      | Bobby Rahal      |
|        288 | donohue        | \N       | \N     | Mark       | Donohue   | 1937-03-18 00:00:00.000 | American      | Mark Donohue     |
|        309 | revson         | \N       | \N     | Peter      | Revson    | 1939-02-27 00:00:00.000 | American      | Peter Revson     |


Table: Lap Times
|   RaceID |   DriverID |   Lap |   Position | Time                    |   Milliseconds |
|---------:|-----------:|------:|-----------:|:------------------------|---------------:|
|      905 |          1 |     1 |          2 | 1899-12-31 00:01:42.306 |         102306 |
|      905 |          1 |     2 |          2 | 1899-12-31 00:02:03.483 |         123482 |
|      905 |          1 |     3 |          2 | 1899-12-31 00:01:58.916 |         118916 |
|      905 |          1 |     4 |          2 | 1899-12-31 00:01:22.610 |          82609 |
|      905 |          1 |     5 |          2 | 1899-12-31 00:01:21.053 |          81053 |
|      905 |          1 |     6 |          2 | 1899-12-31 00:01:20.556 |          80556 |
|      905 |          1 |     7 |          2 | 1899-12-31 00:01:20.370 |          80370 |
|      905 |          1 |     8 |          2 | 1899-12-31 00:01:20.430 |          80430 |
|      905 |          1 |     9 |          2 | 1899-12-31 00:01:20.530 |          80531 |
|      905 |          1 |    10 |          2 | 1899-12-31 00:01:20.546 |          80546 |


Table: Metric
|   Index | Description        |
|--------:|:-------------------|
|       1 | Starts             |
|       2 | Wins               |
|       3 | Finishes           |
|       4 | Top3               |
|       5 | Top5               |
|       6 | Avg Points Awarded |
|       7 | Avg Lap Time       |
|       8 | Avg Laps Completed |


Table: Pit Stops
|   RaceID |   DriverID |   Stop |   Lap | Time                    |   Duration |   Milliseconds |
|---------:|-----------:|-------:|------:|:------------------------|-----------:|---------------:|
|      895 |          1 |      1 |     1 | 1899-12-31 15:06:11.000 |   25.297   |          25297 |
|      950 |          1 |      1 |     1 | 1899-12-31 14:05:46.000 |   29.322   |          29322 |
|      962 |          1 |      1 |     1 | 1899-12-31 20:06:19.000 |   24.453   |          24453 |
|      982 |          1 |      1 |     1 | 1899-12-31 20:06:27.000 |   30.442   |          30442 |
|      986 |          1 |      1 |     1 | 1899-12-31 13:04:57.000 |   29.283   |          29283 |
|      987 |          1 |      1 |     1 | 1899-12-31 14:05:05.000 |   19.377   |          19377 |
|     1001 |          1 |      1 |     1 | 1899-12-31 15:16:01.000 |   19.372   |          19372 |
|     1045 |          1 |      1 |     1 | 1899-12-31 17:15:42.000 |    1.01347 |        1163979 |
|      877 |          3 |      1 |     1 | 1899-12-31 17:05:24.000 |   29.277   |          29277 |
|      915 |          3 |      1 |     1 | 1899-12-31 15:05:38.000 |   33.82    |          33820 |


Table: Qualifying
|   QualifyId |   RaceId |   DriverId |   ConstructorId |   Number |   Position | Q1                     | Q2   | Q3   |
|------------:|---------:|-----------:|----------------:|---------:|-----------:|:-----------------------|:-----|:-----|
|        1139 |       77 |          2 |               3 |        8 |          1 | 12/31/1899 12:01:30 AM | \N   | \N   |
|        1171 |       78 |          2 |               3 |        8 |         13 | 12/31/1899 12:01:17 AM | \N   | \N   |
|        1193 |       79 |          2 |               3 |        8 |         15 | 12/31/1899 12:01:12 AM | \N   | \N   |
|        1212 |       80 |          2 |               3 |        8 |         14 | 12/31/1899 12:01:16 AM | \N   | \N   |
|        1232 |       81 |          2 |               3 |        8 |         14 | 12/31/1899 12:01:22 AM | \N   | \N   |
|        1245 |       82 |          2 |               3 |        8 |          7 | 12/31/1899 12:01:15 AM | \N   | \N   |
|        1270 |       83 |          2 |               3 |        8 |         12 | 12/31/1899 12:01:22 AM | \N   | \N   |
|        1284 |       84 |          2 |               3 |        8 |          6 | 12/31/1899 12:01:28 AM | \N   | \N   |
|        4517 |       75 |          2 |               3 |        8 |         17 | 12/31/1899 12:01:15 AM | \N   | \N   |
|         186 |       26 |          3 |               3 |        7 |         18 | 12/31/1899 12:01:22 AM | \N   | \N   |


Table: Races
|   RaceID |   Year |   Round |   Circuit | Name                  | Date                    | Time   | Decade   |
|---------:|-------:|--------:|----------:|:----------------------|:------------------------|:-------|:---------|
|       90 |   2004 |       1 |         1 | Australian Grand Prix | 2004-03-07 00:00:00.000 | \N     | 2000s    |
|      108 |   2003 |       1 |         1 | Australian Grand Prix | 2003-03-09 00:00:00.000 | \N     | 2000s    |
|      124 |   2002 |       1 |         1 | Australian Grand Prix | 2002-03-03 00:00:00.000 | \N     | 2000s    |
|      141 |   2001 |       1 |         1 | Australian Grand Prix | 2001-03-04 00:00:00.000 | \N     | 2000s    |
|      158 |   2000 |       1 |         1 | Australian Grand Prix | 2000-03-12 00:00:00.000 | \N     | 2000s    |
|      175 |   1999 |       1 |         1 | Australian Grand Prix | 1999-03-07 00:00:00.000 | \N     | 1990s    |
|      191 |   1998 |       1 |         1 | Australian Grand Prix | 1998-03-08 00:00:00.000 | \N     | 1990s    |
|      207 |   1997 |       1 |         1 | Australian Grand Prix | 1997-03-09 00:00:00.000 | \N     | 1990s    |
|      224 |   1996 |       1 |         1 | Australian Grand Prix | 1996-03-10 00:00:00.000 | \N     | 1990s    |
|      240 |   1995 |       1 |        18 | Brazilian Grand Prix  | 1995-03-26 00:00:00.000 | \N     | 1990s    |


Table: Results
|   ResultID |   RaceID |   DriverID |   ConstructorID |   Number |   Grid | Position   | PositionText   |   PositionOrder |   Points |   Laps | Time   | Milliseconds   | FastestLap   | Rank   | FastestLapTime   | FastestLapSpeed   |   StatusID |
|-----------:|---------:|-----------:|----------------:|---------:|-------:|:-----------|:---------------|----------------:|---------:|-------:|:-------|:---------------|:-------------|:-------|:-----------------|:------------------|-----------:|
|       2230 |      125 |         22 |               6 |        2 |      3 | \N         | R              |              14 |        0 |     39 | \N     | \N             | \N           | \N     | \N               |                   |          5 |
|       3121 |      166 |         30 |               6 |        3 |      1 | \N         | R              |              16 |        0 |     58 | \N     | \N             | \N           | \N     | \N               |                   |          5 |
|       3672 |      191 |         30 |               6 |        3 |      3 | \N         | R              |              17 |        0 |      5 | \N     | \N             | \N           | \N     | \N               |                   |          5 |
|       4820 |      243 |         55 |               6 |       27 |      2 | \N         | R              |              22 |        0 |     25 | \N     | \N             | \N           | \N     | \N               |                   |          5 |
|       4940 |      248 |         55 |               6 |       27 |     10 | \N         | R              |              18 |        0 |     12 | \N     | \N             | \N           | \N     | \N               |                   |          5 |
|       5106 |      255 |         55 |               6 |       27 |      2 | \N         | R              |              16 |        0 |     24 | \N     | \N             | \N           | \N     | \N               |                   |          5 |
|       5440 |      267 |         55 |               6 |       27 |      5 | \N         | R              |              26 |        0 |      2 | \N     | \N             | \N           | \N     | \N               |                   |          5 |
|       5706 |      277 |         55 |               6 |       27 |      8 | \N         | R              |              20 |        0 |     40 | \N     | \N             | \N           | \N     | \N               |                   |          5 |
|       5760 |      279 |         55 |               6 |       27 |      6 | \N         | R              |              22 |        0 |     33 | \N     | \N             | \N           | \N     | \N               |                   |          5 |
|       5781 |      280 |         55 |               6 |       27 |      6 | \N         | R              |              17 |        0 |     47 | \N     | \N             | \N           | \N     | \N               |                   |          5 |


Table: Seasons
|   Year |
|-------:|
|   2009 |
|   2008 |
|   2007 |
|   2006 |
|   2005 |
|   2004 |
|   2003 |
|   2002 |
|   2001 |
|   2000 |


Table: Status
|   StatusID | Status       |
|-----------:|:-------------|
|          1 | Finished     |
|          2 | Disqualified |
|          3 | Accident     |
|          4 | Collision    |
|          5 | Engine       |
|          6 | Gearbox      |
|          7 | Transmission |
|          8 | Clutch       |
|          9 | Hydraulics   |
|         10 | Electrical   |

 


tables: name: Circuits
data: Circuits.csv
name: Constructor Results
data: Constructor Results.csv
name: Constructor Standings
data: Constructor Standings.csv
name: Constructors
data: Constructors.csv
name: Dates
data: Dates.csv
name: Driver Standings
data: Driver Standings.csv
name: Drivers
data: Drivers.csv
name: Lap Times
data: Lap Times.csv
name: Metric
data: Metric.csv
name: Pit Stops
data: Pit Stops.csv
name: Qualifying
data: Qualifying.csv
name: Races
data: Races.csv
name: Results
data: Results.csv
name: Seasons
data: Seasons.csv
name: Status
data: Status.csv
label: Constructor Results
ConstructorId
Constructors
ConstructorId
Constructor Standings
ConstructorID
Constructors
ConstructorId
Results
ConstructorID
Constructors
ConstructorId
Qualifying
ConstructorId
Constructors
ConstructorId
Driver Standings
DriverId
Drivers
DriverID
Results
DriverID
Drivers
DriverID
Lap Times
DriverID
Drivers
DriverID
Pit Stops
DriverID
Drivers
DriverID
Qualifying
DriverId
Drivers
DriverID
Constructor Results
RaceId
Races
RaceID
Constructor Standings
RaceID
Races
RaceID
Driver Standings
RaceId
Races
RaceID
Results
RaceID
Races
RaceID
Lap Times
RaceID
Races
RaceID
Pit Stops
RaceID
Races
RaceID
Qualifying
RaceId
Races
RaceID
Results
StatusID
Status
StatusID
output: {
    "joins": [
        {
            "from_table": "Constructor Results",
            "from_column": "ConstructorId",
            "to_table": "Constructors",
            "to_column": "ConstructorId"
        },
        {
            "from_table": "Constructor Standings",
            "from_column": "ConstructorID",
            "to_table": "Constructors",
            "to_column": "ConstructorId"
        },
        {
            "from_table": "Results",
            "from_column": "ConstructorID",
            "to_table": "Constructors",
            "to_column": "ConstructorId"
        },
        {
            "from_table": "Qualifying",
            "from_column": "ConstructorId",
            "to_table": "Constructors",
            "to_column": "ConstructorId"
        },
        {
            "from_table": "Driver Standings",
            "from_column": "DriverId",
            "to_table": "Drivers",
            "to_column": "DriverID"
        },
        {
            "from_table": "Results",
            "from_column": "DriverID",
            "to_table": "Drivers",
            "to_column": "DriverID"
        },
        {
            "from_table": "Lap Times",
            "from_column": "DriverID",
            "to_table": "Drivers",
            "to_column": "DriverID"
        },
        {
            "from_table": "Pit Stops",
            "from_column": "DriverID",
            "to_table": "Drivers",
            "to_column": "DriverID"
        },
        {
            "from_table": "Qualifying",
            "from_column": "DriverId",
            "to_table": "Drivers",
            "to_column": "DriverID"
        },
        {
            "from_table": "Constructor Results",
            "from_column": "RaceId",
            "to_table": "Races",
            "to_column": "RaceID"
        },
        {
            "from_table": "Constructor Standings",
            "from_column": "RaceID",
            "to_table": "Races",
            "to_column": "RaceID"
        },
        {
            "from_table": "Driver Standings",
            "from_column": "RaceId",
            "to_table": "Races",
            "to_column": "RaceID"
        },
        {
            "from_table": "Results",
            "from_column": "RaceID",
            "to_table": "Races",
            "to_column": "RaceID"
        },
        {
            "from_table": "Lap Times",
            "from_column": "RaceID",
            "to_table": "Races",
            "to_column": "RaceID"
        },
        {
            "from_table": "Pit Stops",
            "from_column": "RaceID",
            "to_table": "Races",
            "to_column": "RaceID"
        },
        {
            "from_table": "Qualifying",
            "from_column": "RaceId",
            "to_table": "Races",
            "to_column": "RaceID"
        },
        {
            "from_table": "Results",
            "from_column": "StatusID",
            "to_table": "Status",
            "to_column": "StatusID"
        }
    ]
}