output
stringlengths
18
577
instruction
stringlengths
16
224
input
stringclasses
160 values
SELECT DISTINCT forename FROM drivers ORDER BY forename ASC
What are the first names of all the different drivers in alphabetical order?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT DISTINCT name FROM races ORDER BY name DESC
List the names of all distinct races in reversed lexicographic order?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT DISTINCT name FROM races ORDER BY name DESC
What are the different names of all the races in reverse alphabetical order?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011
What are the names of races held between 2009 and 2011?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011
What are the names of all races held between 2009 and 2011?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00"
What are the names of races held after 12:00:00 or before 09:00:00?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00"
What are the names of all races that occurred after 12:00:00 or before 09:00:00?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 8 UNION SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5
What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 8 UNION SELECT T1.forename , T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5
What are the drivers' first names,last names, and ids for all those that had more than 8 stops or participated in more than 5 races?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) = 11 INTERSECT SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5
What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) = 11 INTERSECT SELECT T1.surname , T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING count(*) > 5
What are the last names and ids of all drivers who had 11 pit stops and participated in more than 5 races?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1
What is the id and last name of the driver who participated in the most races after 2010?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1
What is the id and last name of the driver who participated in the most races after 2010?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT name FROM circuits WHERE country = "UK" OR country = "Malaysia"
What are the names of circuits that belong to UK or Malaysia?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT name FROM circuits WHERE country = "UK" OR country = "Malaysia"
What are the names of all the circuits that are in the UK or Malaysia?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT circuitid , LOCATION FROM circuits WHERE country = "France" OR country = "Belgium"
Find the id and location of circuits that belong to France or Belgium?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT circuitid , LOCATION FROM circuits WHERE country = "France" OR country = "Belgium"
What are the ids and locations of all circuits in France or Belgium?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5
Find the names of Japanese constructors that have once earned more than 5 points?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5
What are the names of all the Japanese constructors that have earned more than 5 points?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT avg(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT avg(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
What is the average fastest lap speed for the Monaco Grand Prix in 2008?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT max(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT max(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
What is the maximum fastest lap speed in the Monaco Grand Prix in 2008?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT max(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year
What are the maximum fastest lap speed in races held after 2004 grouped by race name and ordered by year?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT max(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year
For each race name, What is the maximum fastest lap speed for races after 2004 ordered by year?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT avg(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year
What are the average fastest lap speed in races held after 2004 grouped by race name and ordered by year?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT avg(T2.fastestlapspeed) , T1.name , T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year
What is the average fastest lap speed for races held after 2004, for each race, ordered by year?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.driverid , T1.forename , count(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING count(*) >= 2
Find the id, forename and number of races of all drivers who have at least participated in two races?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.driverid , T1.forename , count(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING count(*) >= 2
What is the id, forename, and number of races for all drivers that have participated in at least 2 races?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.driverid , count(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING count(*) <= 30
Find the driver id and number of races of all drivers who have at most participated in 30 races?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.driverid , count(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING count(*) <= 30
For each id of a driver who participated in at most 30 races, how many races did they participate in?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1
Find the id and surname of the driver who participated the most number of races?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT T1.driverid , T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY count(*) DESC LIMIT 1
What are the ids and last names of all drivers who participated in the most races?
"Schema (values (type))": circuits : circuitId (number) , circuitRef (text) , name (text) , location (text) , country (text) , lat (number) , lng (number) , alt (number) , url (text) | races : raceId (number) , year (number) , round (number) , circuitId (number) , name (text) , date (text) , time (text) , url (text) | drivers : driverId (number) , driverRef (text) , number (number) , code (text) , forename (text) , surname (text) , dob (text) , nationality (text) , url (text) | status : statusId (number) , status (text) | seasons : year (number) , url (text) | constructors : constructorId (number) , constructorRef (text) , name (text) , nationality (text) , url (text) | constructorStandings : constructorStandingsId (number) , raceId (number) , constructorId (number) , points (number) , position (number) , positionText (text) , wins (number) | results : resultId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , grid (number) , position (number) , positionText (text) , positionOrder (number) , points (number) , laps (number) , time (text) , milliseconds (number) , fastestLap (number) , rank (number) , fastestLapTime (text) , fastestLapSpeed (text) , statusId (number) | driverStandings : driverStandingsId (number) , raceId (number) , driverId (number) , points (number) , position (number) , positionText (text) , wins (number) | constructorResults : constructorResultsId (number) , raceId (number) , constructorId (number) , points (number) , status (number) | qualifying : qualifyId (number) , raceId (number) , driverId (number) , constructorId (number) , number (number) , position (number) , q1 (text) , q2 (text) , q3 (text) | pitStops : raceId (number) , driverId (number) , stop (number) , lap (number) , time (text) , duration (text) , milliseconds (number) | lapTimes : raceId (number) , driverId (number) , lap (number) , position (number) , time (text) , milliseconds (number) "Primary Keys": circuits : circuitId | races : raceId | drivers : driverId | status : statusId | seasons : year | constructors : constructorId | constructorStandings : constructorStandingsId | results : resultId | driverStandings : driverStandingsId | constructorResults : constructorResultsId | qualifying : qualifyId | pitStops : raceId | lapTimes : raceId "Foreign Keys": races : circuitId equals circuits : circuitId | constructorStandings : raceId equals races : raceId | constructorStandings : constructorId equals constructors : constructorId | results : driverId equals drivers : driverId | results : raceId equals races : raceId | results : constructorId equals constructors : constructorId | driverStandings : driverId equals drivers : driverId | driverStandings : raceId equals races : raceId | constructorResults : raceId equals races : raceId | constructorResults : constructorId equals constructors : constructorId | qualifying : driverId equals drivers : driverId | qualifying : raceId equals races : raceId | qualifying : constructorId equals constructors : constructorId | pitStops : driverId equals drivers : driverId | pitStops : raceId equals races : raceId | lapTimes : driverId equals drivers : driverId | lapTimes : raceId equals races : raceId
SELECT count(*) FROM technician
How many technicians are there?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT count(*) FROM technician
What is the number of technicians?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Name FROM technician ORDER BY Age ASC
List the names of technicians in ascending order of age.
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Name FROM technician ORDER BY Age ASC
What are the names of the technicians by ascending order of age?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Team , Starting_Year FROM technician
What are the team and starting year of technicians?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Team , Starting_Year FROM technician
What is the team and starting year for each technician?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Name FROM technician WHERE Team != "NYY"
List the name of technicians whose team is not "NYY".
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Name FROM technician WHERE Team != "NYY"
What is the name of the technician whose team is not 'NYY'?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Name FROM technician WHERE Age = 36 OR Age = 37
Show the name of technicians aged either 36 or 37
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Name FROM technician WHERE Age = 36 OR Age = 37
What are the names of the technicians aged either 36 or 37?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1
What is the starting year of the oldest technicians?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1
What is the starting year for the oldest technician?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Team , COUNT(*) FROM technician GROUP BY Team
Show different teams of technicians and the number of technicians in each team.
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Team , COUNT(*) FROM technician GROUP BY Team
For each team, how many technicians are there?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1
Please show the team that has the most number of technicians.
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1
What are the teams with the most technicians?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2
Show the team that have at least two technicians.
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2
What is the team with at least 2 technicians?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT T3.Name , T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID
Show names of technicians and series of machines they are assigned to repair.
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT T3.Name , T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID
What are the names of technicians and the machine series that they repair?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank
Show names of technicians in ascending order of quality rank of the machine they are assigned.
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank
What are the names of the technicians by ascending order of quality rank for the machine they are assigned?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70
Show names of technicians who are assigned to repair machines with value point more than 70.
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70
What are the names of the technicians that are assigned to repair machines with more point values than 70?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT T2.Name , COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name
Show names of technicians and the number of machines they are assigned to repair.
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT T2.Name , COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name
What are the names of the technicians and how many machines are they assigned to repair?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Name FROM technician WHERE technician_id NOT IN (SELECT technician_id FROM repair_assignment)
List the names of technicians who have not been assigned to repair machines.
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Name FROM technician WHERE technician_id NOT IN (SELECT technician_id FROM repair_assignment)
What are the names of the technicians that have not been assigned to repair machines?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Starting_Year FROM technician WHERE Team = "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team = "CWS"
Show the starting years shared by technicians from team "CLE" and "CWS".
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT Starting_Year FROM technician WHERE Team = "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team = "CWS"
What are the starting years shared by the technicians from the team "CLE" or "CWS"?
"Schema (values (type))": repair : repair_ID (number) , name (text) , Launch_Date (text) , Notes (text) | machine : Machine_ID (number) , Making_Year (number) , Class (text) , Team (text) , Machine_series (text) , value_points (number) , quality_rank (number) | technician : technician_id (number) , Name (text) , Team (text) , Starting_Year (number) , Age (number) | repair_assignment : technician_id (number) , repair_ID (number) , Machine_ID (number) "Primary Keys": repair : repair_ID | machine : Machine_ID | technician : technician_id | repair_assignment : technician_id "Foreign Keys": repair_assignment : Machine_ID equals machine : Machine_ID | repair_assignment : repair_ID equals repair : repair_ID | repair_assignment : technician_id equals technician : technician_id
SELECT count(*) FROM entrepreneur
How many entrepreneurs are there?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT count(*) FROM entrepreneur
Count the number of entrepreneurs.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC
List the companies of entrepreneurs in descending order of money requested.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC
What are the companies of entrepreneurs, ordered descending by amount of money requested?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Company , Investor FROM entrepreneur
List the companies and the investors of entrepreneurs.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Company , Investor FROM entrepreneur
What are the companies and investors that correspond to each entrepreneur?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT avg(Money_Requested) FROM entrepreneur
What is the average money requested by all entrepreneurs?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT avg(Money_Requested) FROM entrepreneur
Return the average money requested across all entrepreneurs.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Name FROM People ORDER BY Weight ASC
What are the names of people in ascending order of weight?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Name FROM People ORDER BY Weight ASC
Return the names of people, ordered by weight ascending.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
What are the names of entrepreneurs?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
Return the names of entrepreneurs.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor != "Rachel Elnaugh"
What are the names of entrepreneurs whose investor is not "Rachel Elnaugh"?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor != "Rachel Elnaugh"
Return the names of entrepreneurs do no not have the investor Rachel Elnaugh.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Weight FROM people ORDER BY Height ASC LIMIT 1
What is the weight of the shortest person?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Weight FROM people ORDER BY Height ASC LIMIT 1
Return the weight of the shortest person.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1
What is the name of the entrepreneur with the greatest weight?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1
Return the name of the heaviest entrepreneur.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT sum(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85
What is the total money requested by entrepreneurs with height more than 1.85?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT sum(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85
Give the total money requested by entrepreneurs who are taller than 1.85.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones"
What are the dates of birth of entrepreneurs with investor "Simon Woodroffe" or "Peter Jones"?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones"
Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC
What are the weights of entrepreneurs in descending order of money requested?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC
Return the weights of entrepreneurs, ordered descending by amount of money requested.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Investor , COUNT(*) FROM entrepreneur GROUP BY Investor
What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Investor , COUNT(*) FROM entrepreneur GROUP BY Investor
How many entrepreneurs correspond to each investor?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1
What is the investor that has invested in the most number of entrepreneurs?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1
Return the investor who have invested in the greatest number of entrepreneurs.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2
What are the investors that have invested in at least two entrepreneurs?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2
Return the investors who have invested in two or more entrepreneurs.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Name , T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested
List the names of entrepreneurs and their companies in descending order of money requested?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT T2.Name , T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested
What are the names of entrepreneurs and their corresponding investors, ordered descending by the amount of money requested?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM entrepreneur)
List the names of people that are not entrepreneurs.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM entrepreneur)
What are the names of people who are not entrepreneurs?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000
Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000.
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000
What are the investors who have invested in both entrepreneurs who requested more than 140000 and entrepreneurs who requested less than 120000?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID
SELECT count(DISTINCT Company) FROM entrepreneur
How many distinct companies are there?
"Schema (values (type))": entrepreneur : Entrepreneur_ID (number) , People_ID (number) , Company (text) , Money_Requested (number) , Investor (text) | people : People_ID (number) , Name (text) , Height (number) , Weight (number) , Date_of_Birth (text) "Primary Keys": entrepreneur : Entrepreneur_ID | people : People_ID "Foreign Keys": entrepreneur : People_ID equals people : People_ID