question_id int64 0 1.53k | db_id stringclasses 11
values | question stringlengths 23 286 | gold_sql stringlengths 29 1.45k | gold_columns stringlengths 11 227 | n_gold_columns int64 1 11 | n_schema_columns int64 11 199 | label_source stringclasses 7
values |
|---|---|---|---|---|---|---|---|
900 | formula_1 | List circuits in USA which hosted f1 races in 2006. State the name and location of circuit and the name of the race it hosted. | SELECT T1.name, T1.location, T2.name FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.country = 'USA' AND T2.year = 2006 | circuits.circuitId; circuits.country; circuits.location; circuits.name; races.circuitId; races.name; races.year | 7 | 94 | joinkey_added |
901 | formula_1 | Name the races along with its circuit name and location for f1 races hosted in September 2005. | SELECT DISTINCT T2.name, T1.name, T1.location FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.year = 2005 AND STRFTIME('%m', T2.date) = '09' | circuits.circuitId; circuits.location; circuits.name; races.circuitId; races.date; races.name; races.year | 7 | 94 | joinkey_added |
902 | formula_1 | Which race was Alex Yoong in when he was in track number less than 20? | SELECT T1.name FROM races AS T1 INNER JOIN driverStandings AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T3.forename = 'Alex' AND T3.surname = 'Yoong' AND T2.position < 20 | driverStandings.driverId; driverStandings.position; driverStandings.raceId; drivers.driverId; drivers.forename; drivers.surname; races.name; races.raceId | 8 | 94 | unchanged |
903 | formula_1 | How many times did Michael Schumacher won from races hosted in Sepang International Circuit? | SELECT SUM(T2.wins) FROM drivers AS T1 INNER JOIN driverStandings AS T2 ON T2.driverId = T1.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId INNER JOIN circuits AS T4 ON T4.circuitId = T3.circuitId WHERE T1.forename = 'Michael' AND T1.surname = 'Schumacher' AND T4.name = 'Sepang International Circuit' | circuits.circuitId; circuits.name; driverStandings.driverId; driverStandings.raceId; driverStandings.wins; drivers.driverId; drivers.forename; drivers.surname; races.circuitId; races.raceId | 10 | 94 | unchanged |
904 | formula_1 | State the race and year of race in which Michael Schumacher had his fastest lap. | SELECT T1.name, T1.year FROM races AS T1 INNER JOIN lapTimes AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T3.forename = 'Michael' AND T3.surname = 'Schumacher' ORDER BY T2.milliseconds ASC LIMIT 1 | drivers.driverId; drivers.forename; drivers.surname; lapTimes.driverId; lapTimes.milliseconds; lapTimes.raceId; races.name; races.raceId; races.year | 9 | 94 | unchanged |
905 | formula_1 | What is Eddie Irvine's average points scored in year 2000? | SELECT AVG(T2.points) FROM drivers AS T1 INNER JOIN driverStandings AS T2 ON T2.driverId = T1.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T1.forename = 'Eddie' AND T1.surname = 'Irvine' AND T3.year = 2000 | driverStandings.driverId; driverStandings.points; driverStandings.raceId; drivers.driverId; drivers.forename; drivers.surname; races.raceId; races.year | 8 | 94 | unchanged |
906 | formula_1 | Which was Lewis Hamilton first race? What was his points recorded for his first race event? | SELECT T1.name, T2.points FROM races AS T1 INNER JOIN driverStandings AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T3.forename = 'Lewis' AND T3.surname = 'Hamilton' ORDER BY T1.year ASC LIMIT 1 | driverStandings.driverId; driverStandings.points; driverStandings.raceId; drivers.driverId; drivers.forename; drivers.surname; races.name; races.raceId; races.year | 9 | 94 | unchanged |
907 | formula_1 | List all races in 2017 and the hosting country order by date of the event. | SELECT DISTINCT T2.name, T1.country FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.year = 2017 ORDER BY T2.date ASC | circuits.circuitId; circuits.country; races.circuitId; races.date; races.name; races.year | 6 | 94 | joinkey_added |
908 | formula_1 | What is the most laps f1 races had? Name the race, year and circuit location where the races with most laps was hosted. | SELECT T3.lap, T2.name, T2.year, T1.location FROM circuits AS T1 INNER JOIN races AS T2 ON T1.circuitId = T2.circuitId INNER JOIN lapTimes AS T3 ON T3.raceId = T2.raceId ORDER BY T3.lap DESC LIMIT 1 | circuits.circuitId; circuits.location; lapTimes.lap; lapTimes.raceId; races.circuitId; races.name; races.raceId; races.year | 8 | 94 | joinkey_added |
909 | formula_1 | Among all European Grand Prix races, what is the percentage of the races were hosted in Germany? | SELECT CAST(COUNT(CASE WHEN T1.country = 'Germany' THEN T2.circuitID END) AS REAL) * 100 / COUNT(T2.circuitId) FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.name = 'European Grand Prix' | circuits.circuitId; circuits.country; races.circuitId; races.name | 4 | 94 | joinkey_added |
910 | formula_1 | What's the location coordinates of Silverstone Circuit? | SELECT lat, lng FROM circuits WHERE name = 'Silverstone Circuit' | circuits.lat; circuits.lng; circuits.name | 3 | 94 | joinkey_added |
911 | formula_1 | Which of these circuits is located at a higher latitude, Silverstone Circuit, Hockenheimring or Hungaroring? | SELECT name FROM circuits WHERE name IN ('Silverstone Circuit', 'Hockenheimring', 'Hungaroring') ORDER BY lat DESC LIMIT 1 | circuits.lat; circuits.name | 2 | 94 | unchanged |
912 | formula_1 | What's the reference name of Marina Bay Street Circuit? | SELECT circuitRef FROM circuits WHERE name = 'Marina Bay Street Circuit' | circuits.circuitRef; circuits.name | 2 | 94 | joinkey_added |
913 | formula_1 | In which country can I find the circuit with the highest altitude? | SELECT country FROM circuits ORDER BY alt DESC LIMIT 1 | circuits.alt; circuits.country | 2 | 94 | unchanged |
914 | formula_1 | How many drivers don't have a code? | SELECT COUNT(driverId) - COUNT(CASE WHEN code IS NOT NULL THEN code END) FROM drivers | drivers.code; drivers.driverId | 2 | 94 | unchanged |
915 | formula_1 | Which country is the oldest driver from? | SELECT nationality FROM drivers WHERE dob IS NOT NULL ORDER BY dob ASC LIMIT 1 | drivers.dob; drivers.nationality | 2 | 94 | unchanged |
916 | formula_1 | Please list the surnames of all the Italian drivers. | SELECT surname FROM drivers WHERE nationality = 'Italian' | drivers.nationality; drivers.surname | 2 | 94 | unchanged |
917 | formula_1 | Which website should I go to if I want to know more about Anthony Davidson? | SELECT url FROM drivers WHERE forename = 'Anthony' AND surname = 'Davidson' | drivers.forename; drivers.surname; drivers.url | 3 | 94 | unchanged |
918 | formula_1 | What's Lewis Hamilton's reference name? | SELECT driverRef FROM drivers WHERE forename = 'Lewis' AND surname = 'Hamilton' | drivers.driverRef; drivers.forename; drivers.surname | 3 | 94 | unchanged |
919 | formula_1 | Which circuit did the 2009 Spanish Grand Prix use? | SELECT T1.name FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.year = 2009 AND T2.name = 'Spanish Grand Prix' | circuits.circuitId; circuits.name; races.circuitId; races.name; races.year | 5 | 94 | joinkey_added |
920 | formula_1 | Please list all the years that Silverstone Circuit was used in a Formula_1 race. | SELECT DISTINCT T2.year FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.name = 'Silverstone Circuit' | circuits.circuitId; circuits.name; races.circuitId; races.year | 4 | 94 | joinkey_added |
921 | formula_1 | Please give more information about the Formula_1 races that used the Silverstone Circuit. | SELECT DISTINCT T1.url FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.name = 'Silverstone Circuit' | circuits.circuitId; circuits.name; circuits.url; races.circuitId | 4 | 94 | joinkey_added |
922 | formula_1 | What time did the the 2010's Formula_1 race took place on the Abu Dhabi Circuit? | SELECT T2.date, T2.time FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.year = 2010 AND T2.name = 'Abu Dhabi Grand Prix' | circuits.circuitId; races.circuitId; races.date; races.name; races.time; races.year | 6 | 94 | joinkey_added |
923 | formula_1 | How many Formula_1 races took place on the circuits in Italy? | SELECT COUNT(T2.circuitId) FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.country = 'Italy' | circuits.circuitId; circuits.country; races.circuitId | 3 | 94 | unchanged |
924 | formula_1 | Please list the exact dates on which a Formula_1 race took place on the Barcelona-Catalunya circuit. | SELECT T2.date FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T1.name = 'Circuit de Barcelona-Catalunya' | circuits.circuitId; circuits.name; races.circuitId; races.date | 4 | 94 | joinkey_added |
925 | formula_1 | Please give the link of the website that shows more information about the circuits the Spanish Grand Prix used in 2009. | SELECT T1.url FROM circuits AS T1 INNER JOIN races AS T2 ON T2.circuitID = T1.circuitId WHERE T2.year = 2009 AND T2.name = 'Spanish Grand Prix' | circuits.circuitId; circuits.url; races.circuitId; races.name; races.year | 5 | 94 | joinkey_added |
926 | formula_1 | What's the fastest lap time ever in a race for Lewis Hamilton? | SELECT T2.fastestLapTime FROM drivers AS T1 INNER JOIN results AS T2 ON T2.driverId = T1.driverId WHERE T1.forename = 'Lewis' AND T1.surname = 'Hamilton' AND T2.fastestLapTime IS NOT NULL ORDER BY T2.fastestLapTime ASC LIMIT 1 | drivers.driverId; drivers.forename; drivers.surname; results.driverId; results.fastestLapTime | 5 | 94 | unchanged |
927 | formula_1 | Which driver created the fastest lap speed in a Formula_1 race? Please give both his forename and surname. | SELECT T1.forename, T1.surname FROM drivers AS T1 INNER JOIN results AS T2 ON T2.driverId = T1.driverId WHERE T2.fastestLapTime IS NOT NULL ORDER BY T2.fastestLapSpeed DESC LIMIT 1 | drivers.driverId; drivers.forename; drivers.surname; results.driverId; results.fastestLapSpeed; results.fastestLapTime | 6 | 94 | joinkey_added |
928 | formula_1 | Which driver ranked the first in the Canadian Grand Prix in 2007? Please give his reference name. | SELECT T3.forename, T3.surname, T3.driverRef FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T1.name = 'Canadian Grand Prix' AND T2.rank = 1 AND T1.year = 2007 | drivers.driverId; drivers.driverRef; drivers.forename; drivers.surname; races.name; races.raceId; races.year; results.driverId; results.raceId; results.rank | 10 | 94 | unchanged |
929 | formula_1 | Please list the Formula_1 races that Lewis Hamilton participated. | SELECT T1.name FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T3.forename = 'Lewis' AND T3.surname = 'Hamilton' | drivers.driverId; drivers.forename; drivers.surname; races.name; races.raceId; results.driverId; results.raceId | 7 | 94 | unchanged |
930 | formula_1 | In which Formula_1 race did Lewis Hamilton rank the highest? | SELECT name FROM races WHERE raceId IN ( SELECT raceId FROM results WHERE rank = 1 AND driverId = ( SELECT driverId FROM drivers WHERE forename = 'Lewis' AND surname = 'Hamilton' ) ) | drivers.driverId; drivers.forename; drivers.surname; races.name; races.raceId; results.driverId; results.raceId; results.rank | 8 | 94 | unchanged |
931 | formula_1 | What was the fastest lap speed among all drivers in the 2009 Spanish Grand Prix? | SELECT T2.fastestLapSpeed FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId WHERE T1.name = 'Spanish Grand Prix' AND T1.year = 2009 AND T2.fastestLapSpeed IS NOT NULL ORDER BY T2.fastestLapSpeed DESC LIMIT 1 | races.name; races.raceId; races.year; results.fastestLapSpeed; results.raceId | 5 | 94 | unchanged |
932 | formula_1 | In which years did Lewis Hamilton participate in a Formula_1 race? | SELECT DISTINCT T1.year FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T3.forename = 'Lewis' AND T3.surname = 'Hamilton' | drivers.driverId; drivers.forename; drivers.surname; races.raceId; races.year; results.driverId; results.raceId | 7 | 94 | unchanged |
933 | formula_1 | What was Lewis Hamilton's final rank in the 2008 Chinese Grand Prix? | SELECT T2.positionOrder FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T3.forename = 'Lewis' AND T3.surname = 'Hamilton' AND T1.name = 'Chinese Grand Prix' AND T1.year = 2008 | drivers.driverId; drivers.forename; drivers.surname; races.name; races.raceId; races.year; results.driverId; results.positionOrder; results.raceId | 9 | 94 | unchanged |
934 | formula_1 | Which driver was in the no. 4 grid formation when starting the race in 1989's Australian Grand Prix? Please give his forename and surname. | SELECT T3.forename, T3.surname FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId INNER JOIN drivers AS T3 ON T3.driverId = T2.driverId WHERE T2.grid = 4 AND T1.name = 'Australian Grand Prix' AND T1.year = 1989 | drivers.driverId; drivers.forename; drivers.surname; races.name; races.raceId; races.year; results.driverId; results.grid; results.raceId | 9 | 94 | unchanged |
935 | formula_1 | How many drivers managed to finish the race in the 2008 Australian Grand Prix? | SELECT COUNT(T2.driverId) FROM races AS T1 INNER JOIN results AS T2 ON T2.raceId = T1.raceId WHERE T1.name = 'Australian Grand Prix' AND T1.year = 2008 AND T2.time IS NOT NULL | races.name; races.raceId; races.year; results.driverId; results.raceId; results.time | 6 | 94 | unchanged |
936 | formula_1 | Which was the fastest lap for Lewis Hamilton in the 2008 Australian Grand Prix? | SELECT T1.fastestLap FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN drivers AS T3 on T1.driverId = T3.driverId WHERE T2.name = 'Australian Grand Prix' AND T2.year = 2008 AND T3.forename = 'Lewis' AND T3.surname = 'Hamilton' | drivers.driverId; drivers.forename; drivers.surname; races.name; races.raceId; races.year; results.driverId; results.fastestLap; results.raceId | 9 | 94 | unchanged |
937 | formula_1 | What's the finish time for the driver who ranked second in 2008's AustChineseralian Grand Prix? | SELECT T1.time FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T1.rank = 2 AND T2.name = 'Chinese Grand Prix' AND T2.year = 2008 | races.name; races.raceId; races.year; results.raceId; results.rank; results.time | 6 | 94 | unchanged |
938 | formula_1 | Who was the champion of 2008's Australian Grand Prix and where can I know more about him? | SELECT T1.forename, T1.surname, T1.url FROM drivers AS T1 INNER JOIN results AS T2 ON T1.driverId = T2.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T3.name = 'Australian Grand Prix' AND T2.time LIKE '_:%:__.___' AND T3.year = 2008 | drivers.driverId; drivers.forename; drivers.surname; drivers.url; races.name; races.raceId; races.year; results.driverId; results.raceId; results.time | 10 | 94 | unchanged |
939 | formula_1 | How many drivers from the UN participated in the 2008 Australian Grand Prix? | SELECT COUNT(*) FROM drivers AS T1 INNER JOIN results AS T2 ON T1.driverId = T2.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T3.name = 'Australian Grand Prix' AND T1.nationality = 'British' AND T3.year = 2008 | drivers.driverId; drivers.nationality; races.name; races.raceId; races.year; results.driverId; results.raceId | 7 | 94 | unchanged |
940 | formula_1 | Among the drivers that finished the race in the 2008 Chinese Grand Prix, how many of them have participated in Formula_1 races? | SELECT COUNT(*) FROM ( SELECT T1.driverId FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.name = 'Chinese Grand Prix' AND T2.year = 2008 AND T1.time IS NOT NULL GROUP BY T1.driverId HAVING COUNT(T2.raceId) > 0 ) | races.name; races.raceId; races.year; results.driverId; results.raceId; results.time | 6 | 94 | unchanged |
941 | formula_1 | How many points did Lewis Hamilton get in total in all the Formula_1 races he participated? | SELECT SUM(T2.points) FROM drivers AS T1 INNER JOIN results AS T2 ON T1.driverId = T2.driverId WHERE T1.forename = 'Lewis' AND T1.surname = 'Hamilton' | drivers.driverId; drivers.forename; drivers.surname; results.driverId; results.points | 5 | 94 | joinkey_added |
942 | formula_1 | What is the average fastest lap time in seconds for Lewis Hamilton in all the Formula_1 races? | SELECT AVG(CAST(SUBSTR(T2.fastestLapTime, 1, INSTR(T2.fastestLapTime, ':') - 1) AS INTEGER) * 60 + CAST(SUBSTR(T2.fastestLapTime, INSTR(T2.fastestLapTime, ':') + 1) AS REAL)) FROM drivers AS T1 INNER JOIN results AS T2 ON T1.driverId = T2.driverId WHERE T1.surname = 'Hamilton' AND T1.forename = 'Lewis' | drivers.driverId; drivers.forename; drivers.surname; results.driverId; results.fastestLapTime | 5 | 94 | unchanged |
943 | formula_1 | What is the rate of drivers completing all the laps in the 2008 Australian Grand Prix? | SELECT CAST(SUM(IIF(T1.time IS NOT NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.resultId) FROM results AS T1 INNER JOIN races AS T2 ON T1.raceId = T2.raceId WHERE T2.name = 'Australian Grand Prix' AND T2.year = 2008 | races.name; races.raceId; races.year; results.raceId; results.resultId; results.time | 6 | 94 | unchanged |
944 | formula_1 | How much faster in percentage is the champion than the driver who finished the race last in the 2008 Australian Grand Prix? | WITH time_in_seconds AS ( SELECT T1.positionOrder, CASE WHEN T1.positionOrder = 1 THEN (CAST(SUBSTR(T1.time, 1, 1) AS REAL) * 3600) + (CAST(SUBSTR(T1.time, 3, 2) AS REAL) * 60) + CAST(SUBSTR(T1.time, 6) AS REAL) ELSE CAST(SUBSTR(T1.time, 2) AS REAL) END AS time_seconds FROM results AS T1 INNER JOIN races AS T2 ON T1.ra... | races.name; races.raceId; races.year; results.positionOrder; results.raceId; results.time | 6 | 94 | ambiguity_resolved |
945 | formula_1 | How many circuits are there in Adelaide, Australia? | SELECT COUNT(circuitId) FROM circuits WHERE location = 'Adelaide' AND country = 'Australia' | circuits.circuitId; circuits.country; circuits.location | 3 | 94 | unchanged |
946 | formula_1 | Please list the location coordinates of the US circuits. | SELECT lat, lng FROM circuits WHERE country = 'USA' | circuits.country; circuits.lat; circuits.lng | 3 | 94 | unchanged |
947 | formula_1 | How many British drivers were born after 1980? | SELECT COUNT(driverId) FROM drivers WHERE nationality = 'British' AND STRFTIME('%Y', dob) > '1980' | drivers.dob; drivers.driverId; drivers.nationality | 3 | 94 | unchanged |
948 | formula_1 | What are the maximum points of British constructors? | SELECT MAX(T1.points) FROM constructorStandings AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId WHERE T2.nationality = 'British' | constructorStandings.constructorId; constructorStandings.points; constructors.constructorId; constructors.nationality | 4 | 94 | unchanged |
949 | formula_1 | Which constructor has the highest point? | SELECT T2.name FROM constructorStandings AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId ORDER BY T1.points DESC LIMIT 1 | constructorStandings.constructorId; constructorStandings.points; constructors.constructorId; constructors.name | 4 | 94 | unchanged |
950 | formula_1 | Please list the constructor names with 0 points at race 291. | SELECT T2.name FROM constructorStandings AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId WHERE T1.points = 0 AND T1.raceId = 291 | constructorStandings.constructorId; constructorStandings.points; constructorStandings.raceId; constructors.constructorId; constructors.name | 5 | 94 | unchanged |
951 | formula_1 | How many Japanese constructors have 0 points in 2 races? | SELECT COUNT(T1.raceId) FROM constructorStandings AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId WHERE T1.points = 0 AND T2.nationality = 'Japanese' GROUP BY T1.constructorId HAVING COUNT(raceId) = 2 | constructorStandings.constructorId; constructorStandings.points; constructorStandings.raceId; constructors.constructorId; constructors.nationality | 5 | 94 | unchanged |
952 | formula_1 | Which constructors have been ranked 1? | SELECT DISTINCT T2.name FROM results AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId WHERE T1.rank = 1 | constructors.constructorId; constructors.name; results.constructorId; results.rank | 4 | 94 | unchanged |
953 | formula_1 | How many French constructors have a lap number of over 50? | SELECT COUNT(DISTINCT T2.constructorId) FROM results AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId WHERE T1.laps > 50 AND T2.nationality = 'French' | constructors.constructorId; constructors.nationality; results.constructorId; results.laps | 4 | 94 | unchanged |
954 | formula_1 | Please calculate the race completion percentage of Japanese drivers from 2007 to 2009. | SELECT CAST(SUM(IIF(T1.time IS NOT NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.raceId) FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN drivers AS T3 on T1.driverId = T3.driverId WHERE T3.nationality = 'Japanese' AND T2.year BETWEEN 2007 AND 2009 | drivers.driverId; drivers.nationality; races.raceId; races.year; results.driverId; results.raceId; results.time | 7 | 94 | joinkey_added |
955 | formula_1 | What is the average time in seconds of champion for each year, before year 1975? | WITH time_in_seconds AS ( SELECT T2.year, T2.raceId, T1.positionOrder, CASE WHEN T1.positionOrder = 1 THEN (CAST(SUBSTR(T1.time, 1, 1) AS REAL) * 3600) + (CAST(SUBSTR(T1.time, 3, 2) AS REAL) * 60) + CAST(SUBSTR(T1.time, 6,2) AS REAL ) + CAST(SUBSTR(T1.time, 9) AS REAL)/1000 ELSE 0 END AS time_seconds FROM results AS ... | races.raceId; races.year; results.positionOrder; results.raceId; results.time | 5 | 94 | empty_fixed,joinkey_added,ambiguity_resolved |
956 | formula_1 | Which drivers born after 1975 have been ranked 2? Please give their forenames and surnames. | SELECT T2.forename, T2.surname FROM results AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE STRFTIME('%Y', T2.dob) > '1975' AND T1.rank = 2 | drivers.dob; drivers.driverId; drivers.forename; drivers.surname; results.driverId; results.rank | 6 | 94 | unchanged |
957 | formula_1 | How many Italian drivers haven't finished the race? | SELECT COUNT(T1.driverId) FROM results AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T2.nationality = 'Italian' AND T1.time IS NULL | drivers.driverId; drivers.nationality; results.driverId; results.time | 4 | 94 | unchanged |
958 | formula_1 | Which driver has the fastest lap time? Please give their forenames and surnames. | SELECT T2.forename, T2.surname, T1.fastestLapTime FROM results AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T1.fastestLapTime IS NOT NULL ORDER BY T1.fastestLapTime ASC LIMIT 1 | drivers.driverId; drivers.forename; drivers.surname; results.driverId; results.fastestLapTime | 5 | 94 | unchanged |
959 | formula_1 | What is the fastest lap number of the champion in 2009? | SELECT T1.fastestLap FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.year = 2009 AND T1.time LIKE '_:%:__.___' | races.raceId; races.year; results.fastestLap; results.raceId; results.time | 5 | 94 | unchanged |
960 | formula_1 | What is the average of fastest lap speed in the 2009 Spanish Grand Prix race? | SELECT AVG(T1.fastestLapSpeed) FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.year = 2009 AND T2.name = 'Spanish Grand Prix' | races.name; races.raceId; races.year; results.fastestLapSpeed; results.raceId | 5 | 94 | unchanged |
961 | formula_1 | Which race has the shortest actual finishing time? Please give the name and year. | SELECT T1.name, T1.year FROM races AS T1 INNER JOIN results AS T2 on T1.raceId = T2.raceId WHERE T2.milliseconds IS NOT NULL ORDER BY T2.milliseconds LIMIT 1 | races.name; races.raceId; races.year; results.milliseconds; results.raceId | 5 | 94 | unchanged |
962 | formula_1 | From 2000 to 2005, what percentage of drivers who were born before 1985 and the lap numbers were over 50? | SELECT CAST(SUM(IIF(STRFTIME('%Y', T3.dob) < '1985' AND T1.laps > 50, 1, 0)) AS REAL) * 100 / COUNT(*) FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN drivers AS T3 on T1.driverId = T3.driverId WHERE T2.year BETWEEN 2000 AND 2005 | drivers.dob; drivers.driverId; races.raceId; races.year; results.driverId; results.laps; results.raceId | 7 | 94 | unchanged |
963 | formula_1 | How many French drivers who obtain the laptime less than 02:00.00? | SELECT COUNT(T1.driverId) FROM drivers AS T1 INNER JOIN lapTimes AS T2 on T1.driverId = T2.driverId WHERE T1.nationality = 'French' AND (CAST(SUBSTR(T2.time, 1, 2) AS INTEGER) * 60 + CAST(SUBSTR(T2.time, 4, 2) AS INTEGER) + CAST(SUBSTR(T2.time, 7, 2) AS REAL) / 1000) < 120 | drivers.driverId; drivers.nationality; lapTimes.driverId; lapTimes.time | 4 | 94 | unchanged |
964 | formula_1 | List out the code for drivers who have nationality in America. | SELECT code FROM drivers WHERE Nationality = 'American' | drivers.code; drivers.nationality | 2 | 94 | joinkey_added |
965 | formula_1 | List out the Id number of races which were hold in 2009. | SELECT raceId FROM races WHERE year = 2009 | races.raceId; races.year | 2 | 94 | unchanged |
966 | formula_1 | How many driver participated in race ID number 18? | SELECT COUNT(driverId) FROM driverStandings WHERE raceId = 18 | driverStandings.driverId; driverStandings.raceId | 2 | 94 | unchanged |
967 | formula_1 | State code numbers of top 3 yougest drivers. How many Netherlandic drivers among them? | SELECT COUNT(*) FROM ( SELECT T1.nationality FROM drivers AS T1 ORDER BY JULIANDAY(T1.dob) DESC LIMIT 3) AS T3 WHERE T3.nationality = 'Dutch' | drivers.dob; drivers.nationality | 2 | 94 | ambiguity_resolved |
968 | formula_1 | What is reference name of Robert Kubica? | SELECT driverRef FROM drivers WHERE forename = 'Robert' AND surname = 'Kubica' | drivers.driverRef; drivers.forename; drivers.surname | 3 | 94 | unchanged |
969 | formula_1 | How many British drivers who were born in 1980? | SELECT COUNT(driverId) FROM drivers WHERE nationality = 'British' AND STRFTIME('%Y', dob) = '1980' | drivers.dob; drivers.driverId; drivers.nationality | 3 | 94 | unchanged |
970 | formula_1 | List out top 3 German drivers who were born from 1980-1990 and have the earliest lap time. | SELECT T2.driverId FROM pitStops AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T2.nationality = 'German' AND STRFTIME('%Y', T2.dob) BETWEEN '1980' AND '1990' ORDER BY T1.time LIMIT 3 | drivers.dob; drivers.driverId; drivers.nationality; pitStops.driverId; pitStops.time | 5 | 94 | unchanged |
971 | formula_1 | Please state the reference name of the oldest German driver. | SELECT driverRef FROM drivers WHERE nationality = 'German' ORDER BY JULIANDAY(dob) ASC LIMIT 1 | drivers.dob; drivers.driverRef; drivers.nationality | 3 | 94 | unchanged |
972 | formula_1 | Which drivers who were born in 1971 and has the fastest lap time on the race? Give id and code of these drivers. | SELECT T2.driverId, T2.code FROM results AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE STRFTIME('%Y', T2.dob) = '1971' AND T1.fastestLapTime IS NOT NULL | drivers.code; drivers.dob; drivers.driverId; results.driverId; results.fastestLapTime | 5 | 94 | unchanged |
973 | formula_1 | List out top 10 Spanish drivers who were born before 1982 and have the latest lap time. | SELECT T2.driverId FROM pitStops AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T2.nationality = 'Spanish' AND STRFTIME('%Y', T2.dob) < '1982' ORDER BY T1.time DESC LIMIT 10 | drivers.dob; drivers.driverId; drivers.nationality; pitStops.driverId; pitStops.time | 5 | 94 | unchanged |
974 | formula_1 | State the racing year which has the fastest lap time? | SELECT T2.year FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T1.fastestLapTime IS NOT NULL | races.raceId; races.year; results.fastestLapTime; results.raceId | 4 | 94 | unchanged |
975 | formula_1 | Which year has the lowest speed of lap time? | SELECT T2.year FROM lapTimes AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId ORDER BY T1.time DESC LIMIT 1 | lapTimes.raceId; lapTimes.time; races.raceId; races.year | 4 | 94 | unchanged |
976 | formula_1 | List the driver's ID of the top five driver, by descending order, the fastest time during the first lap of the race. | SELECT driverId FROM lapTimes WHERE lap = 1 ORDER BY time LIMIT 5 | lapTimes.driverId; lapTimes.lap; lapTimes.time | 3 | 94 | unchanged |
977 | formula_1 | From race no. 50 to 100, how many finishers have been disqualified? | SELECT SUM(IIF(time IS NOT NULL, 1, 0)) FROM results WHERE statusId = 2 AND raceID < 100 AND raceId > 50 | results.raceId; results.statusId; results.time | 3 | 94 | unchanged |
978 | formula_1 | How many times the circuits were held in Austria? Please give their location and coordinates. | SELECT DISTINCT location, lat, lng FROM circuits WHERE country = 'Austria' | circuits.country; circuits.lat; circuits.lng; circuits.location | 4 | 94 | joinkey_added |
979 | formula_1 | What race number has the most finishers? | SELECT raceId FROM results GROUP BY raceId ORDER BY COUNT(time IS NOT NULL) DESC LIMIT 1 | results.raceId; results.time | 2 | 94 | unchanged |
980 | formula_1 | List the reference name of the drivers who passed the second qualifying lap during race no. 23. Indicate their nationality and birthday. | SELECT T2.driverRef, T2.nationality, T2.dob FROM qualifying AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T1.raceId = 23 AND T1.q2 IS NOT NULL | drivers.dob; drivers.driverId; drivers.driverRef; drivers.nationality; qualifying.driverId; qualifying.q2; qualifying.raceId | 7 | 94 | joinkey_added |
981 | formula_1 | On what year did the youngest driver had his first qualifying race? Also state the name, date and time of the race. | SELECT T3.year, T3.name, T3.date, T3.time FROM qualifying AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId INNER JOIN races AS T3 on T1.raceId = T3.raceId WHERE T1.driverId = ( SELECT driverId FROM drivers ORDER BY dob DESC LIMIT 1 ) ORDER BY T3.date ASC LIMIT 1 | drivers.dob; drivers.driverId; qualifying.driverId; qualifying.raceId; races.date; races.name; races.raceId; races.time; races.year | 9 | 94 | joinkey_added |
982 | formula_1 | How many American drivers have puncture status. | SELECT COUNT(T1.driverId) FROM drivers AS T1 INNER JOIN results AS T2 on T1.driverId = T2.driverId INNER JOIN status AS T3 on T2.statusId = T3.statusId WHERE T3.status = 'Puncture' AND T1.nationality = 'American' | drivers.driverId; drivers.nationality; results.driverId; results.statusId; status.status; status.statusId | 6 | 94 | unchanged |
983 | formula_1 | Which of the Italian constructor got the highest point to date? Give its introduction website? | SELECT T1.url FROM constructors AS T1 INNER JOIN constructorStandings AS T2 on T1.constructorId = T2.constructorId WHERE T1.nationality = 'Italian' ORDER BY T2.points DESC LIMIT 1 | constructorStandings.constructorId; constructorStandings.points; constructors.constructorId; constructors.nationality; constructors.url | 5 | 94 | unchanged |
984 | formula_1 | What is the website of the constructor who tallied the most total wins. | SELECT T1.url FROM constructors AS T1 INNER JOIN constructorStandings AS T2 on T1.constructorId = T2.constructorId ORDER BY T2.wins DESC LIMIT 1 | constructorStandings.constructorId; constructorStandings.wins; constructors.constructorId; constructors.url | 4 | 94 | unchanged |
985 | formula_1 | Among the drivers who participated in the French Grand Prix, who has the slowest time in the 3rd lap. | SELECT T1.driverId FROM lapTimes AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T2.name = 'French Grand Prix' AND T1.lap = 3 ORDER BY T1.time DESC LIMIT 1 | lapTimes.driverId; lapTimes.lap; lapTimes.raceId; lapTimes.time; races.name; races.raceId | 6 | 94 | unchanged |
986 | formula_1 | In which race did the fastest 1st lap time was recorded? Please indicate the time in milliseconds. | SELECT T1.milliseconds FROM lapTimes AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T1.lap = 1 ORDER BY T1.time LIMIT 1 | lapTimes.lap; lapTimes.milliseconds; lapTimes.raceId; lapTimes.time; races.raceId | 5 | 94 | unchanged |
987 | formula_1 | What is the average fastest lap time of the top 10 drivers in the 2006 United States Grand Prix? | SELECT AVG(T1.fastestLapTime) FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId WHERE T1.rank < 11 AND T2.year = 2006 AND T2.name = 'United States Grand Prix' | races.name; races.raceId; races.year; results.fastestLapTime; results.raceId; results.rank | 6 | 94 | unchanged |
988 | formula_1 | List down top 3 German drivers who has the shortest average pit stop duration and were born between 1980-1985. | SELECT T2.forename, T2.surname FROM pitStops AS T1 INNER JOIN drivers AS T2 on T1.driverId = T2.driverId WHERE T2.nationality = 'German' AND STRFTIME('%Y', T2.dob) BETWEEN '1980' AND '1985' GROUP BY T2.forename, T2.surname ORDER BY AVG(T1.duration) LIMIT 3 | drivers.dob; drivers.driverId; drivers.forename; drivers.nationality; drivers.surname; pitStops.driverId; pitStops.duration | 7 | 94 | unchanged |
989 | formula_1 | Who is the champion of the Canadian Grand Prix in 2008? Indicate his finish time. | SELECT T1.time FROM results AS T1 INNER JOIN races AS T2 ON T1.raceId = T2.raceId WHERE T2.name = 'Canadian Grand Prix' AND T2.year = 2008 AND T1.time LIKE '_:%:__.___' | races.name; races.raceId; races.year; results.raceId; results.time | 5 | 94 | unchanged |
990 | formula_1 | What is the constructor reference name of the champion in the 2009 Singapore Grand Prix? Please give its website. | SELECT T3.constructorRef, T3.url FROM results AS T1 INNER JOIN races AS T2 on T1.raceId = T2.raceId INNER JOIN constructors AS T3 on T1.constructorId = T3.constructorId WHERE T2.name = 'Singapore Grand Prix' AND T2.year = 2009 AND T1.time LIKE '_:%:__.___' | constructors.constructorId; constructors.constructorRef; constructors.url; races.name; races.raceId; races.year; results.constructorId; results.raceId; results.time | 9 | 94 | joinkey_added |
991 | formula_1 | What is the full name and date of birth of Austrian drivers born between 1981 and 1991? | SELECT forename, surname, dob FROM drivers WHERE nationality = 'Austrian' AND STRFTIME('%Y', dob) BETWEEN '1981' AND '1991' | drivers.dob; drivers.forename; drivers.nationality; drivers.surname | 4 | 94 | unchanged |
992 | formula_1 | Find the full name, Wiki Pedia page link, and date of birth of German drivers born between 1971 and 1985. List it in descending order of date of birth. | SELECT forename, surname, url, dob FROM drivers WHERE nationality = 'German' AND STRFTIME('%Y', dob) BETWEEN '1971' AND '1985' ORDER BY dob DESC | drivers.dob; drivers.forename; drivers.nationality; drivers.surname; drivers.url | 5 | 94 | unchanged |
993 | formula_1 | In which location does the Hungaroring circuit located? Also, find the country and coordinates of this circuit? | SELECT country, lat, lng FROM circuits WHERE name = 'Hungaroring' | circuits.country; circuits.lat; circuits.lng; circuits.name | 4 | 94 | joinkey_added |
994 | formula_1 | Which constructor scored most points from Monaco Grand Prix between 1980 and 2010? List the score, name and nationality of this team. | SELECT SUM(T1.points), T2.name, T2.nationality FROM constructorResults AS T1 INNER JOIN constructors AS T2 ON T1.constructorId = T2.constructorId INNER JOIN races AS T3 ON T3.raceid = T1.raceid WHERE T3.name = 'Monaco Grand Prix' AND T3.year BETWEEN 1980 AND 2010 GROUP BY T2.name ORDER BY SUM(T1.points) DESC LIMIT 1 | constructorResults.constructorId; constructorResults.points; constructorResults.raceId; constructors.constructorId; constructors.name; constructors.nationality; races.name; races.raceId; races.year | 9 | 94 | joinkey_added,ambiguity_resolved |
995 | formula_1 | What is the average score of Lewis Hamilton among all the Turkish Grand Prix? | SELECT AVG(T2.points) FROM drivers AS T1 INNER JOIN driverStandings AS T2 ON T1.driverId = T2.driverId INNER JOIN races AS T3 ON T3.raceId = T2.raceId WHERE T1.forename = 'Lewis' AND T1.surname = 'Hamilton' AND T3.name = 'Turkish Grand Prix' | driverStandings.driverId; driverStandings.points; driverStandings.raceId; drivers.driverId; drivers.forename; drivers.surname; races.name; races.raceId | 8 | 94 | unchanged |
996 | formula_1 | What is the annual average number of races held during the first 10 years of the 21st century? | SELECT CAST(SUM(CASE WHEN year BETWEEN 2000 AND 2010 THEN 1 ELSE 0 END) AS REAL) / 10 FROM races WHERE date BETWEEN '2000-01-01' AND '2010-12-31' | races.date; races.year | 2 | 94 | unchanged |
997 | formula_1 | Which citizenship do the vast majority of the drivers hold? | SELECT nationality FROM drivers GROUP BY nationality ORDER BY COUNT(driverId) DESC LIMIT 1 | drivers.driverId; drivers.nationality | 2 | 94 | unchanged |
998 | formula_1 | In terms of number of points acquired, how many victories did the driver who ranked 91st acquired? | SELECT SUM(CASE WHEN points = 91 THEN wins ELSE 0 END) FROM driverStandings | driverStandings.points; driverStandings.wins | 2 | 94 | unchanged |
999 | formula_1 | In terms of the fastest lap time, what is the name of the race which recorded the fastest lap speed by a racer? | SELECT T1.name FROM races AS T1 INNER JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T2.fastestLapTime IS NOT NULL ORDER BY T2.fastestLapTime ASC LIMIT 1 | races.name; races.raceId; results.fastestLapTime; results.raceId | 4 | 94 | unchanged |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.