query_id
int64 0
1.53k
| database_id
stringclasses 11
values | table_id
listlengths 1
4
| query
stringlengths 23
286
| answer
stringlengths 29
1.45k
| difficulty
stringclasses 3
values | evidence
stringlengths 0
591
|
---|---|---|---|---|---|---|
900 |
formula_1
|
[
"races",
"circuits"
] |
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
|
simple
| |
901 |
formula_1
|
[
"races",
"circuits"
] |
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'
|
simple
|
in September 2005 refers to month(date) = 9 and year = 2005
|
902 |
formula_1
|
[
"driverStandings",
"drivers",
"races"
] |
Which race was Alex Yoong in when he was in track number less than 10?
|
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 < 10
|
simple
|
track number less than 10 refers to position < 10
|
903 |
formula_1
|
[
"circuits",
"driverStandings",
"drivers",
"races"
] |
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'
|
moderate
|
win from races refers to max(points)
|
904 |
formula_1
|
[
"drivers",
"lapTimes",
"races"
] |
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
|
moderate
|
fastest lap refers to min(milliseconds)
|
905 |
formula_1
|
[
"driverStandings",
"drivers",
"races"
] |
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
|
simple
|
average points = AVG(points where year = 2000)
|
906 |
formula_1
|
[
"driverStandings",
"drivers",
"races"
] |
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
|
moderate
|
first race refers to min(Year)
|
907 |
formula_1
|
[
"races",
"circuits"
] |
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
|
simple
| |
908 |
formula_1
|
[
"races",
"lapTimes",
"circuits"
] |
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
|
simple
| |
909 |
formula_1
|
[
"races",
"circuits"
] |
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'
|
moderate
|
percentage = divide(COUNT(races where country = Germany and name = 'Europearn Grand Prix'),COUNT(races where name = 'Europearn Grand Prix'))*100
|
910 |
formula_1
|
[
"circuits"
] |
What's the location coordinates of Silverstone Circuit?
|
SELECT lat, lng FROM circuits WHERE name = 'Silverstone Circuit'
|
simple
|
coordinates refers to (lat, lng)
|
911 |
formula_1
|
[
"circuits"
] |
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
|
simple
|
higher latitude refers to max(lat)
|
912 |
formula_1
|
[
"circuits"
] |
What's the reference name of Marina Bay Street Circuit?
|
SELECT circuitRef FROM circuits WHERE name = 'Marina Bay Street Circuit'
|
simple
|
reference name refers to circuitRef
|
913 |
formula_1
|
[
"circuits"
] |
In which country can I find the circuit with the highest altitude?
|
SELECT country FROM circuits ORDER BY alt DESC LIMIT 1
|
simple
|
highest altitude refers to max(alt)
|
914 |
formula_1
|
[
"drivers"
] |
How many drivers don't have a code?
|
SELECT COUNT(driverId) - COUNT(CASE WHEN code IS NOT NULL THEN code END) FROM drivers
|
simple
|
don't have a code refers to code is null
|
915 |
formula_1
|
[
"drivers"
] |
Which country is the oldest driver from?
|
SELECT nationality FROM drivers WHERE dob IS NOT NULL ORDER BY dob ASC LIMIT 1
|
simple
|
oldest driver refers to min(dob)
|
916 |
formula_1
|
[
"drivers"
] |
Please list the surnames of all the Italian drivers.
|
SELECT surname FROM drivers WHERE nationality = 'Italian'
|
simple
|
Italian refers to nationality = 'italian'
|
917 |
formula_1
|
[
"drivers"
] |
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'
|
simple
|
website refers to url
|
918 |
formula_1
|
[
"drivers"
] |
What's Lewis Hamilton's reference name?
|
SELECT driverRef FROM drivers WHERE forename = 'Lewis' AND surname = 'Hamilton'
|
simple
|
reference name refers to driverRef
|
919 |
formula_1
|
[
"races",
"circuits"
] |
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'
|
simple
| |
920 |
formula_1
|
[
"races",
"circuits"
] |
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'
|
simple
| |
921 |
formula_1
|
[
"races",
"circuits"
] |
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'
|
simple
|
more information refers to url
|
922 |
formula_1
|
[
"races",
"circuits"
] |
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'
|
simple
| |
923 |
formula_1
|
[
"races",
"circuits"
] |
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'
|
simple
| |
924 |
formula_1
|
[
"races",
"circuits"
] |
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'
|
simple
| |
925 |
formula_1
|
[
"races",
"circuits"
] |
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'
|
simple
|
link of the website refers to url
|
926 |
formula_1
|
[
"results",
"drivers"
] |
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
|
simple
|
fastest lap time ever refers to min(fastestLapTime)
|
927 |
formula_1
|
[
"results",
"drivers"
] |
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
|
simple
| |
928 |
formula_1
|
[
"results",
"drivers",
"races"
] |
Which driver ranked the first in the Australian Grand Prix in 2008? 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 = 'Australian Grand Prix' AND T2.rank = 1 AND T1.year = 2008
|
moderate
|
reference name refers to driverRef
|
929 |
formula_1
|
[
"results",
"drivers",
"races"
] |
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'
|
simple
| |
930 |
formula_1
|
[
"results",
"drivers",
"races"
] |
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' ) )
|
simple
|
rank the highest refers to min(rank)
|
931 |
formula_1
|
[
"results",
"races"
] |
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
|
moderate
|
the fastest lap speed among all refers to max(fastestLapSpeed)
|
932 |
formula_1
|
[
"results",
"drivers",
"races"
] |
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'
|
simple
| |
933 |
formula_1
|
[
"results",
"drivers",
"races"
] |
What was Lewis Hamilton's final rank in the 2008 Australian 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 = 'Australian Grand Prix' AND T1.year = 2008
|
moderate
|
final rank refers to positionOrder
|
934 |
formula_1
|
[
"results",
"drivers",
"races"
] |
Which driver was in the no. 4 grid formation when starting the race in 2008'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 = 2008
|
moderate
|
the no. 4 grid formation refers to grid = 4
|
935 |
formula_1
|
[
"results",
"races"
] |
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
|
simple
|
managed to finish the race refers to time is not null
|
936 |
formula_1
|
[
"results",
"drivers",
"races"
] |
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'
|
simple
| |
937 |
formula_1
|
[
"results",
"races"
] |
What's the finish time for the driver who ranked second in 2008's Australian 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 = 'Australian Grand Prix' AND T2.year = 2008
|
simple
|
finish time refers to time
|
938 |
formula_1
|
[
"results",
"drivers",
"races"
] |
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
|
moderate
|
only champion's finished time is represented by 'HH:MM:SS.mmm'; where can I know more refers to url
|
939 |
formula_1
|
[
"results",
"drivers",
"races"
] |
How many drivers from the USA 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 = 'American' AND T3.year = 2008
|
moderate
|
from the USA refers to nationality = 'American'
|
940 |
formula_1
|
[
"results",
"races"
] |
Among the drivers that finished the race in the 2008 Australian 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 = 'Australian Grand Prix' AND T2.year = 2008 AND T1.time IS NOT NULL GROUP BY T1.driverId HAVING COUNT(T2.raceId) > 0 )
|
moderate
|
COUNT(raceID) > 0 reveals that this driver participated in races; drivers who finished the race refers to time has value.
|
941 |
formula_1
|
[
"results",
"drivers"
] |
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'
|
simple
| |
942 |
formula_1
|
[
"results",
"drivers"
] |
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'
|
moderate
|
average fastest lap time = avg(fastestLapTime); The time is recorded on 'MM:SS.mmm'
|
943 |
formula_1
|
[
"results",
"races"
] |
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
|
moderate
|
completing all the laps refers to time is not null; rate = divide(COUNT(raceID where time is not null), COUNT(raceID))
|
944 |
formula_1
|
[
"results",
"races"
] |
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.raceId = T2.raceId WHERE T2.name = 'Australian Grand Prix' AND T1.time IS NOT NULL AND T2.year = 2008 ), champion_time AS ( SELECT time_seconds FROM time_in_seconds WHERE positionOrder = 1), last_driver_incremental AS ( SELECT time_seconds FROM time_in_seconds WHERE positionOrder = (SELECT MAX(positionOrder) FROM time_in_seconds) ) SELECT (CAST((SELECT time_seconds FROM last_driver_incremental) AS REAL) * 100) / (SELECT time_seconds + (SELECT time_seconds FROM last_driver_incremental) FROM champion_time)
|
challenging
|
how much faster in percentage = divide(subtract(incremental time, champion time), last_driver time) * 100%; last driver finished time = incremental time + champion time; only champion's finished time is represented by 'HH:MM:SS.mmm'; finished the game refers to time is not null
|
945 |
formula_1
|
[
"circuits"
] |
How many circuits are there in Melbourne, Australia?
|
SELECT COUNT(circuitId) FROM circuits WHERE location = 'Melbourne' AND country = 'Australia'
|
simple
|
Australia is the country; Melbourne is the location of circuit;
|
946 |
formula_1
|
[
"circuits"
] |
Please list the location coordinates of the US circuits.
|
SELECT lat, lng FROM circuits WHERE country = 'USA'
|
simple
|
location coordinates refers to (lat, lng); the US refers to country = 'USA';
|
947 |
formula_1
|
[
"drivers"
] |
How many British drivers were born after 1980?
|
SELECT COUNT(driverId) FROM drivers WHERE nationality = 'British' AND STRFTIME('%Y', dob) > '1980'
|
simple
|
born after 1980 refers to year (dob) >1980;
|
948 |
formula_1
|
[
"constructors",
"constructorStandings"
] |
What are the average points of British constructors?
|
SELECT AVG(T1.points) FROM constructorStandings AS T1 INNER JOIN constructors AS T2 on T1.constructorId = T2.constructorId WHERE T2.nationality = 'British'
|
simple
|
average points = AVG(points); British is a nationality
|
949 |
formula_1
|
[
"constructors",
"constructorStandings"
] |
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
|
simple
| |
950 |
formula_1
|
[
"constructors",
"constructorStandings"
] |
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
|
simple
|
race at 18 refers to raceID = 18;
|
951 |
formula_1
|
[
"constructors",
"constructorStandings"
] |
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
|
simple
|
2 races refers to COUNT(raceID) = 2;
|
952 |
formula_1
|
[
"results",
"constructors"
] |
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
|
simple
| |
953 |
formula_1
|
[
"results",
"constructors"
] |
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'
|
simple
|
lap numbers of over 50 refers to laps > 50;
|
954 |
formula_1
|
[
"results",
"drivers",
"races"
] |
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
|
challenging
|
from 2007 to 2009 refers to year between 2007 and 2009; race completion refers to time is not null; percentage = Divide(COUNT(DriverID where time is not null and year between 2007 and 2009),Count (DriverID where year between 2007 and 2009))*100;
|
955 |
formula_1
|
[
"results",
"races"
] |
What is the average time in seconds of champion for each year?
|
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) 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.raceId = T2.raceId WHERE T1.time IS NOT NULL ), champion_time AS ( SELECT year, raceId, time_seconds FROM time_in_seconds WHERE positionOrder = 1 ) SELECT year, AVG(time_seconds) FROM champion_time GROUP BY year HAVING AVG(time_seconds) IS NOT NULL
|
challenging
|
only champion's finished time is represented by 'HH:MM:SS.mmm'; finished the game refers to time is not null.
|
956 |
formula_1
|
[
"results",
"drivers"
] |
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
|
simple
|
born after 1975 refers to year(dob) >1975;
|
957 |
formula_1
|
[
"results",
"drivers"
] |
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
|
simple
|
haven't finished the race refers to time is null;
|
958 |
formula_1
|
[
"results",
"drivers"
] |
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
|
moderate
| |
959 |
formula_1
|
[
"results",
"races"
] |
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 '_:%:__.___'
|
simple
|
in 2009 refers to year = 2009; Only the time of the champion shows in the format of "hour: minutes: seconds.millionsecond"
|
960 |
formula_1
|
[
"results",
"races"
] |
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'
|
moderate
|
Spanish Grand Prix is the name of race refers to name = 'Spanish Grand Prix'; average fastest lap speed refers to avg(fastestLapSpeed);
|
961 |
formula_1
|
[
"results",
"races"
] |
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
|
simple
|
shortest actual finishing time refers to Min(milliseconds) except milliseconds = null;
|
962 |
formula_1
|
[
"results",
"drivers",
"races"
] |
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
|
challenging
|
born before 1985 refers to year(dob)<1985; in 2000 to 2005 refers to year between 2000 and 2005; percentage = Divide(COUNT(driverId where year (dob) <1985 and laps >50),COUNT(DriverID where year between 2000 and 2005) *100;
|
963 |
formula_1
|
[
"lapTimes",
"drivers"
] |
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
|
moderate
|
lap time less than 01:00.00 refers to seconds < 120;
|
964 |
formula_1
|
[
"drivers"
] |
List out the code for drivers who have nationality in America.
|
SELECT code FROM drivers WHERE Nationality = 'American'
|
simple
|
nationality = 'America'
|
965 |
formula_1
|
[
"races"
] |
List out the Id number of races which were hold in 2009.
|
SELECT raceId FROM races WHERE year = 2009
|
simple
| |
966 |
formula_1
|
[
"driverStandings"
] |
How many driver participated in race ID number 18?
|
SELECT COUNT(driverId) FROM driverStandings WHERE raceId = 18
|
simple
| |
967 |
formula_1
|
[
"drivers"
] |
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'
|
simple
|
youngest driver refers to Max (year(dob)); Netherlandic and Dutch refer to the same country
|
968 |
formula_1
|
[
"drivers"
] |
What is reference name of Robert Kubica?
|
SELECT driverRef FROM drivers WHERE forename = 'Robert' AND surname = 'Kubica'
|
simple
|
reference name refers to driverRef;
|
969 |
formula_1
|
[
"drivers"
] |
How many Australian drivers who were born in 1980?
|
SELECT COUNT(driverId) FROM drivers WHERE nationality = 'Australian' AND STRFTIME('%Y', dob) = '1980'
|
simple
|
born in 1980 refers to year(dob) = 1980;
|
970 |
formula_1
|
[
"pitStops",
"drivers"
] |
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
|
moderate
|
born from 1980-1990 refers to year(dob) between 1980 and 1990; earliest lap time refers to Min(time);
|
971 |
formula_1
|
[
"drivers"
] |
Please state the reference name of the oldest German driver.
|
SELECT driverRef FROM drivers WHERE nationality = 'German' ORDER BY JULIANDAY(dob) ASC LIMIT 1
|
simple
|
oldest refers to MIN(year(dob)); reference names appear in drverRef.
|
972 |
formula_1
|
[
"results",
"drivers"
] |
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
|
moderate
|
born in 1971 refers to year(dob) = 1971; has the fastest lap time refers to fastestLapTime has values
|
973 |
formula_1
|
[
"pitStops",
"drivers"
] |
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
|
moderate
|
born before 1982 refers to year(dob) < 1982; latest lap time refers to Max(time);
|
974 |
formula_1
|
[
"results",
"races"
] |
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
|
simple
|
'has the fastest lap time?' refers to fastestLapTime has values
|
975 |
formula_1
|
[
"lapTimes",
"races"
] |
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
|
simple
|
lowest speed of lap time refers to Max(time);
|
976 |
formula_1
|
[
"lapTimes"
] |
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
|
simple
|
fastest time refers to Min(time);
|
977 |
formula_1
|
[
"results"
] |
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
|
simple
|
disqualified refers to statusID = 2, finisher refers to time! = null; race no. refers to raceId; raceId > 50 and raceId < 100;
|
978 |
formula_1
|
[
"circuits"
] |
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'
|
simple
|
location coordinates refers to (lat,lng);
|
979 |
formula_1
|
[
"results"
] |
What race number has the most finishers?
|
SELECT raceId FROM results GROUP BY raceId ORDER BY COUNT(time IS NOT NULL) DESC LIMIT 1
|
simple
|
finisher refers to time is not null;
|
980 |
formula_1
|
[
"qualifying",
"drivers"
] |
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
|
moderate
|
passed the second qualifying lap refers to q2 is not null; birthday refers to dob; reference name of drivers refers to driverRef; race no. refers to raceId;
|
981 |
formula_1
|
[
"qualifying",
"drivers",
"races"
] |
On what year did the youngest driver had his first qualifying race? 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
|
moderate
|
youngest driver refers to Max (year(dob));
|
982 |
formula_1
|
[
"results",
"status",
"drivers"
] |
How many American drivers have been disqualified from the race.
|
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 = 2 AND T1.nationality = 'American'
|
simple
|
disqualified refers to statusID = 2;
|
983 |
formula_1
|
[
"constructors",
"constructorStandings"
] |
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
|
simple
|
introduction website refers to url; Italian is a nationality
|
984 |
formula_1
|
[
"constructors",
"constructorStandings"
] |
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
|
simple
|
introduction website refers to url;
|
985 |
formula_1
|
[
"lapTimes",
"races"
] |
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
|
simple
|
slowest time refers to Max(time);
|
986 |
formula_1
|
[
"lapTimes",
"races"
] |
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
|
simple
|
fastest refers to Min(time);
|
987 |
formula_1
|
[
"results",
"races"
] |
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'
|
simple
|
top 10 refers to rank <11; AVG(fastestLapTime);
|
988 |
formula_1
|
[
"pitStops",
"drivers"
] |
List down top 5 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 5
|
challenging
|
born between 1980-1985 refers to 1980< year(dob)>1985; Average pitstop duration refers to Divide(SUM(duration),COUNT(duration)); shortest average refers to Min(avg(duration));
|
989 |
formula_1
|
[
"results",
"races"
] |
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 '_:%:__.___'
|
moderate
|
Only the time of the champion shows in the format of "hour: minutes: seconds.millionsecond";
|
990 |
formula_1
|
[
"results",
"constructors",
"races"
] |
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 '_:%:__.___'
|
challenging
|
the time of the champion shows in the format of "minutes: seconds.millionsecond" in which Max(time); constructor reference name refers to constructorRef; website refers to url
|
991 |
formula_1
|
[
"drivers"
] |
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'
|
simple
|
Full name refers to forname, surname; Date of birth refers to dob; year(dob) BETWEEN '1981' AND '1991'; Austrian is a nationality
|
992 |
formula_1
|
[
"drivers"
] |
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
|
moderate
|
FFull name refers to forname+surname; Nationality refers to German; Date of birth refers to dob; year(dob) BETWEEN '1971' AND '1985'
|
993 |
formula_1
|
[
"circuits"
] |
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'
|
simple
|
coordinates expressed in latitude and longitude refers to (lat, lng)
|
994 |
formula_1
|
[
"constructorResults",
"constructors",
"races"
] |
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
|
challenging
|
Monaco Grand Priz refers to the race; race in year between 1980 and 2010
|
995 |
formula_1
|
[
"driverStandings",
"drivers",
"races"
] |
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'
|
moderate
|
Average score = AVG(points)
|
996 |
formula_1
|
[
"races"
] |
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'
|
simple
|
races in date between '2000-01-01' and '2010-12-31'
|
997 |
formula_1
|
[
"drivers"
] |
Which citizenship do the vast majority of the drivers hold?
|
SELECT nationality FROM drivers GROUP BY nationality ORDER BY COUNT(driverId) DESC LIMIT 1
|
simple
|
Citizenship of majority of drivers = MAX(nationality); citizenship and nationality are synonyms
|
998 |
formula_1
|
[
"driverStandings"
] |
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
|
simple
|
victories refer to wins; 91st refers to points
|
999 |
formula_1
|
[
"results",
"races"
] |
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
|
simple
|
Fastest lap speed refers to MIN(fastestLapTime)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.