question
stringlengths
19
224
context
stringlengths
30
355
answer
stringlengths
20
557
input
stringlengths
138
630
output
stringlengths
20
557
What is the id of the event with the most participants?
CREATE TABLE Participants_in_Events (Event_ID VARCHAR)
SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY COUNT(*) DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Participants_in_Events (Event_ID VARCHAR) ### question:What is the id of the event with the most participants?
SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY COUNT(*) DESC LIMIT 1
Which events id does not have any participant with detail 'Kenyatta Kuhn'?
CREATE TABLE Participants (Participant_ID VARCHAR); CREATE TABLE EVENTS (event_id VARCHAR, Participant_Details VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR, Participant_ID VARCHAR)
SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn'
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE Participants (Participant_ID VARCHAR); CREATE TABLE EVENTS (event_id VARCHAR, Participant_Details VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR, Participant_ID VARCHAR) ### question:Which events id does not have any participant with detail 'Kenyatta Kuhn'?
SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn'
Which services type had both successful and failure event details?
CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR); CREATE TABLE services (service_type_code VARCHAR, service_id VARCHAR)
SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail'
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR); CREATE TABLE services (service_type_code VARCHAR, service_id VARCHAR) ### question:Which services type had both successful and failure event details?
SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail'
How many events did not have any participants?
CREATE TABLE EVENTS (event_id VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR)
SELECT COUNT(*) FROM EVENTS WHERE NOT event_id IN (SELECT event_id FROM Participants_in_Events)
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE EVENTS (event_id VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR) ### question:How many events did not have any participants?
SELECT COUNT(*) FROM EVENTS WHERE NOT event_id IN (SELECT event_id FROM Participants_in_Events)
What are all the distinct participant ids who attended any events?
CREATE TABLE participants_in_Events (participant_id VARCHAR)
SELECT COUNT(DISTINCT participant_id) FROM participants_in_Events
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE participants_in_Events (participant_id VARCHAR) ### question:What are all the distinct participant ids who attended any events?
SELECT COUNT(DISTINCT participant_id) FROM participants_in_Events
What is the name of the race held most recently?
CREATE TABLE races (name VARCHAR, date VARCHAR)
SELECT name FROM races ORDER BY date DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, date VARCHAR) ### question:What is the name of the race held most recently?
SELECT name FROM races ORDER BY date DESC LIMIT 1
What is the name and date of the most recent race?
CREATE TABLE races (name VARCHAR, date VARCHAR)
SELECT name, date FROM races ORDER BY date DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, date VARCHAR) ### question:What is the name and date of the most recent race?
SELECT name, date FROM races ORDER BY date DESC LIMIT 1
Find the names of all races held in 2017.
CREATE TABLE races (name VARCHAR, YEAR VARCHAR)
SELECT name FROM races WHERE YEAR = 2017
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, YEAR VARCHAR) ### question:Find the names of all races held in 2017.
SELECT name FROM races WHERE YEAR = 2017
Find the distinct names of all races held between 2014 and 2017?
CREATE TABLE races (name VARCHAR, YEAR INTEGER)
SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, YEAR INTEGER) ### question:Find the distinct names of all races held between 2014 and 2017?
SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?
CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER)
SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER) ### question:List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?
SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?
CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER); CREATE TABLE drivers (driverid VARCHAR, nationality VARCHAR)
SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER); CREATE TABLE drivers (driverid VARCHAR, nationality VARCHAR) ### question:Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?
SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000
What are the forename and surname of the driver who has the smallest laptime?
CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR)
SELECT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR) ### question:What are the forename and surname of the driver who has the smallest laptime?
SELECT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1
What is the id and family name of the driver who has the longest laptime?
CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR)
SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR) ### question:What is the id and family name of the driver who has the longest laptime?
SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1
What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?
CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR)
SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR) ### question:What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?
SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2
How many drivers participated in the race Australian Grand Prix held in 2009?
CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (raceid VARCHAR)
SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (raceid VARCHAR) ### question:How many drivers participated in the race Australian Grand Prix held in 2009?
SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009
How many drivers did not participate in the races held in 2009?
CREATE TABLE races (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR); CREATE TABLE results (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR)
SELECT COUNT(DISTINCT driverId) FROM results WHERE NOT raceId IN (SELECT raceId FROM races WHERE YEAR <> 2009)
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR); CREATE TABLE results (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR) ### question:How many drivers did not participate in the races held in 2009?
SELECT COUNT(DISTINCT driverId) FROM results WHERE NOT raceId IN (SELECT raceId FROM races WHERE YEAR <> 2009)
Give me a list of names and years of races that had any driver whose forename is Lewis?
CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (name VARCHAR, year VARCHAR, raceid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR)
SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (name VARCHAR, year VARCHAR, raceid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR) ### question:Give me a list of names and years of races that had any driver whose forename is Lewis?
SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis"
Find the forename and surname of drivers whose nationality is German?
CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, nationality VARCHAR)
SELECT forename, surname FROM drivers WHERE nationality = "German"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, nationality VARCHAR) ### question:Find the forename and surname of drivers whose nationality is German?
SELECT forename, surname FROM drivers WHERE nationality = "German"
Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?
CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR)
SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR) ### question:Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?
SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?
CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR)
SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR) ### question:What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?
SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
Find all the forenames of distinct drivers who was in position 1 as standing and won?
CREATE TABLE driverstandings (driverid VARCHAR, position VARCHAR, wins VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR)
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE driverstandings (driverid VARCHAR, position VARCHAR, wins VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR) ### question:Find all the forenames of distinct drivers who was in position 1 as standing and won?
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1
Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points?
CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR); CREATE TABLE driverstandings (driverid VARCHAR, points VARCHAR, position VARCHAR, wins VARCHAR)
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR); CREATE TABLE driverstandings (driverid VARCHAR, points VARCHAR, position VARCHAR, wins VARCHAR) ### question:Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points?
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20
What are the numbers of constructors for different nationalities?
CREATE TABLE constructors (nationality VARCHAR)
SELECT COUNT(*), nationality FROM constructors GROUP BY nationality
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE constructors (nationality VARCHAR) ### question:What are the numbers of constructors for different nationalities?
SELECT COUNT(*), nationality FROM constructors GROUP BY nationality
What are the numbers of races for each constructor id?
CREATE TABLE constructorStandings (constructorid VARCHAR)
SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE constructorStandings (constructorid VARCHAR) ### question:What are the numbers of races for each constructor id?
SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid
What are the names of races that were held after 2017 and the circuits were in the country of Spain?
CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR)
SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR) ### question:What are the names of races that were held after 2017 and the circuits were in the country of Spain?
SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017
What are the unique names of races that held after 2000 and the circuits were in Spain?
CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR)
SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR) ### question:What are the unique names of races that held after 2000 and the circuits were in Spain?
SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000
Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841.
CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR)
SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841)
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR) ### question:Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841.
SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841)
Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841?
CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR)
SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841)
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR) ### question:Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841?
SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841)
List the forenames of all distinct drivers in alphabetical order?
CREATE TABLE drivers (forename VARCHAR)
SELECT DISTINCT forename FROM drivers ORDER BY forename
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (forename VARCHAR) ### question:List the forenames of all distinct drivers in alphabetical order?
SELECT DISTINCT forename FROM drivers ORDER BY forename
List the names of all distinct races in reversed lexicographic order?
CREATE TABLE races (name VARCHAR)
SELECT DISTINCT name FROM races ORDER BY name DESC
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR) ### question:List the names of all distinct races in reversed lexicographic order?
SELECT DISTINCT name FROM races ORDER BY name DESC
What are the names of races held between 2009 and 2011?
CREATE TABLE races (name VARCHAR, YEAR INTEGER)
SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, YEAR INTEGER) ### question:What are the names of races held between 2009 and 2011?
SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011
What are the names of races held after 12:00:00 or before 09:00:00?
CREATE TABLE races (name VARCHAR, TIME VARCHAR)
SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (name VARCHAR, TIME VARCHAR) ### question:What are the names of races held after 12:00:00 or before 09:00:00?
SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00"
What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?
CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR) ### question:What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?
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' last names and id who had 11 pit stops and participated in more than 5 race results?
CREATE TABLE drivers (surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR) ### question:What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results?
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 is the id and last name of the driver who participated in the most races after 2010?
CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR, year INTEGER); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR, year INTEGER); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR) ### question:What is the id and last name of the driver who participated in the most races after 2010?
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 are the names of circuits that belong to UK or Malaysia?
CREATE TABLE circuits (name VARCHAR, country VARCHAR)
SELECT name FROM circuits WHERE country = "UK" OR country = "Malaysia"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE circuits (name VARCHAR, country VARCHAR) ### question:What are the names of circuits that belong to UK or Malaysia?
SELECT name FROM circuits WHERE country = "UK" OR country = "Malaysia"
Find the id and location of circuits that belong to France or Belgium?
CREATE TABLE circuits (circuitid VARCHAR, LOCATION VARCHAR, country VARCHAR)
SELECT circuitid, LOCATION FROM circuits WHERE country = "France" OR country = "Belgium"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE circuits (circuitid VARCHAR, LOCATION VARCHAR, country VARCHAR) ### question:Find the id and location of circuits that belong to France or Belgium?
SELECT circuitid, LOCATION FROM circuits WHERE country = "France" OR country = "Belgium"
Find the names of Japanese constructors that have once earned more than 5 points?
CREATE TABLE constructorstandings (constructorid VARCHAR, points VARCHAR); CREATE TABLE constructors (name VARCHAR, constructorid VARCHAR, nationality VARCHAR)
SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE constructorstandings (constructorid VARCHAR, points VARCHAR); CREATE TABLE constructors (name VARCHAR, constructorid VARCHAR, nationality VARCHAR) ### question:Find the names of Japanese constructors that have once earned more than 5 points?
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 is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR)
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"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR) ### question:What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
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 maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR)
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"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR) ### question:What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
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 are the maximum fastest lap speed in races held after 2004 grouped by race name and ordered by year?
CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR) ### question:What are the maximum fastest lap speed in races held after 2004 grouped by race name and ordered by year?
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 average fastest lap speed in races held after 2004 grouped by race name and ordered by year?
CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR) ### question:What are the average fastest lap speed in races held after 2004 grouped by race name and ordered by year?
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
Find the id, forename and number of races of all drivers who have at least participated in two races?
CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR) ### question:Find the id, forename and number of races of all drivers who have at least participated in two races?
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 driver id and number of races of all drivers who have at most participated in 30 races?
CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (driverid VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (driverid VARCHAR) ### question:Find the driver id and number of races of all drivers who have at most participated in 30 races?
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 id and surname of the driver who participated the most number of races?
CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR) ### question:Find the id and surname of the driver who participated the most number of races?
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
How many technicians are there?
CREATE TABLE technician (Id VARCHAR)
SELECT COUNT(*) FROM technician
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Id VARCHAR) ### question:How many technicians are there?
SELECT COUNT(*) FROM technician
List the names of technicians in ascending order of age.
CREATE TABLE technician (Name VARCHAR, Age VARCHAR)
SELECT Name FROM technician ORDER BY Age
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Name VARCHAR, Age VARCHAR) ### question:List the names of technicians in ascending order of age.
SELECT Name FROM technician ORDER BY Age
What are the team and starting year of technicians?
CREATE TABLE technician (Team VARCHAR, Starting_Year VARCHAR)
SELECT Team, Starting_Year FROM technician
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Team VARCHAR, Starting_Year VARCHAR) ### question:What are the team and starting year of technicians?
SELECT Team, Starting_Year FROM technician
List the name of technicians whose team is not "NYY".
CREATE TABLE technician (Name VARCHAR, Team VARCHAR)
SELECT Name FROM technician WHERE Team <> "NYY"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Name VARCHAR, Team VARCHAR) ### question:List the name of technicians whose team is not "NYY".
SELECT Name FROM technician WHERE Team <> "NYY"
Show the name of technicians aged either 36 or 37
CREATE TABLE technician (Name VARCHAR, Age VARCHAR)
SELECT Name FROM technician WHERE Age = 36 OR Age = 37
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Name VARCHAR, Age VARCHAR) ### question:Show the name of technicians aged either 36 or 37
SELECT Name FROM technician WHERE Age = 36 OR Age = 37
What is the starting year of the oldest technicians?
CREATE TABLE technician (Starting_Year VARCHAR, Age VARCHAR)
SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Starting_Year VARCHAR, Age VARCHAR) ### question:What is the starting year of the oldest technicians?
SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1
Show different teams of technicians and the number of technicians in each team.
CREATE TABLE technician (Team VARCHAR)
SELECT Team, COUNT(*) FROM technician GROUP BY Team
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Team VARCHAR) ### question:Show different teams of technicians and the number of technicians in each team.
SELECT Team, COUNT(*) FROM technician GROUP BY Team
Please show the team that has the most number of technicians.
CREATE TABLE technician (Team VARCHAR)
SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Team VARCHAR) ### question:Please show the team that has the most number of technicians.
SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1
Show the team that have at least two technicians.
CREATE TABLE technician (Team VARCHAR)
SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Team VARCHAR) ### question:Show the team that have at least two technicians.
SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2
Show names of technicians and series of machines they are assigned to repair.
CREATE TABLE machine (Machine_series VARCHAR, machine_id VARCHAR); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE machine (Machine_series VARCHAR, machine_id VARCHAR); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) ### question:Show names of technicians and series of machines they are assigned to repair.
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 in ascending order of quality rank of the machine they are assigned.
CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE machine (machine_id VARCHAR, quality_rank VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE machine (machine_id VARCHAR, quality_rank VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) ### question:Show names of technicians in ascending order of quality rank of the machine they are assigned.
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 who are assigned to repair machines with value point more than 70.
CREATE TABLE machine (machine_id VARCHAR, value_points INTEGER); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE machine (machine_id VARCHAR, value_points INTEGER); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) ### question:Show names of technicians who are assigned to repair machines with value point more than 70.
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 and the number of machines they are assigned to repair.
CREATE TABLE repair_assignment (technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)
SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE repair_assignment (technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) ### question:Show names of technicians and the number of machines they are assigned to repair.
SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name
List the names of technicians who have not been assigned to repair machines.
CREATE TABLE technician (Name VARCHAR, technician_id VARCHAR); CREATE TABLE repair_assignment (Name VARCHAR, technician_id VARCHAR)
SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment)
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Name VARCHAR, technician_id VARCHAR); CREATE TABLE repair_assignment (Name VARCHAR, technician_id VARCHAR) ### question:List the names of technicians who have not been assigned to repair machines.
SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment)
Show the starting years shared by technicians from team "CLE" and "CWS".
CREATE TABLE technician (Starting_Year VARCHAR, Team VARCHAR)
SELECT Starting_Year FROM technician WHERE Team = "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team = "CWS"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE technician (Starting_Year VARCHAR, Team VARCHAR) ### question:Show the starting years shared by technicians from team "CLE" and "CWS".
SELECT Starting_Year FROM technician WHERE Team = "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team = "CWS"
How many entrepreneurs are there?
CREATE TABLE entrepreneur (Id VARCHAR)
SELECT COUNT(*) FROM entrepreneur
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Id VARCHAR) ### question:How many entrepreneurs are there?
SELECT COUNT(*) FROM entrepreneur
List the companies of entrepreneurs in descending order of money requested.
CREATE TABLE entrepreneur (Company VARCHAR, Money_Requested VARCHAR)
SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Company VARCHAR, Money_Requested VARCHAR) ### question:List the companies of entrepreneurs in descending order of money requested.
SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC
List the companies and the investors of entrepreneurs.
CREATE TABLE entrepreneur (Company VARCHAR, Investor VARCHAR)
SELECT Company, Investor FROM entrepreneur
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Company VARCHAR, Investor VARCHAR) ### question:List the companies and the investors of entrepreneurs.
SELECT Company, Investor FROM entrepreneur
What is the average money requested by all entrepreneurs?
CREATE TABLE entrepreneur (Money_Requested INTEGER)
SELECT AVG(Money_Requested) FROM entrepreneur
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Money_Requested INTEGER) ### question:What is the average money requested by all entrepreneurs?
SELECT AVG(Money_Requested) FROM entrepreneur
What are the names of people in ascending order of weight?
CREATE TABLE People (Name VARCHAR, Weight VARCHAR)
SELECT Name FROM People ORDER BY Weight
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE People (Name VARCHAR, Weight VARCHAR) ### question:What are the names of people in ascending order of weight?
SELECT Name FROM People ORDER BY Weight
What are the names of entrepreneurs?
CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR)
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR) ### question:What are the names of entrepreneurs?
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
What are the names of entrepreneurs whose investor is not "Rachel Elnaugh"?
CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor <> "Rachel Elnaugh"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:What are the names of entrepreneurs whose investor is not "Rachel Elnaugh"?
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor <> "Rachel Elnaugh"
What is the weight of the shortest person?
CREATE TABLE people (Weight VARCHAR, Height VARCHAR)
SELECT Weight FROM people ORDER BY Height LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Weight VARCHAR, Height VARCHAR) ### question:What is the weight of the shortest person?
SELECT Weight FROM people ORDER BY Height LIMIT 1
What is the name of the entrepreneur with the greatest weight?
CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR) ### question:What is the name of the entrepreneur with the greatest weight?
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 total money requested by entrepreneurs with height more than 1.85?
CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE entrepreneur (Money_Requested INTEGER, People_ID VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE entrepreneur (Money_Requested INTEGER, People_ID VARCHAR) ### question:What is the total money requested by entrepreneurs with height more than 1.85?
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 are the dates of birth of entrepreneurs with investor "Simon Woodroffe" or "Peter Jones"?
CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Date_of_Birth VARCHAR, People_ID VARCHAR)
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"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Date_of_Birth VARCHAR, People_ID VARCHAR) ### question:What are the dates of birth of entrepreneurs with investor "Simon Woodroffe" or "Peter Jones"?
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 weights of entrepreneurs in descending order of money requested?
CREATE TABLE entrepreneur (People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Weight VARCHAR, People_ID VARCHAR)
SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Weight VARCHAR, People_ID VARCHAR) ### question:What are the weights of entrepreneurs in descending order of money requested?
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 investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?
CREATE TABLE entrepreneur (Investor VARCHAR)
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Investor VARCHAR) ### question:What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor
What is the investor that has invested in the most number of entrepreneurs?
CREATE TABLE entrepreneur (Investor VARCHAR)
SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Investor VARCHAR) ### question:What is the investor that has invested in the most number of entrepreneurs?
SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1
What are the investors that have invested in at least two entrepreneurs?
CREATE TABLE entrepreneur (Investor VARCHAR)
SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Investor VARCHAR) ### question:What are the investors that have invested in at least two entrepreneurs?
SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2
List the names of entrepreneurs and their companies in descending order of money requested?
CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
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
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:List the names of entrepreneurs and their companies in descending order of money requested?
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 people that are not entrepreneurs.
CREATE TABLE entrepreneur (Name VARCHAR, People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur)
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Name VARCHAR, People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:List the names of people that are not entrepreneurs.
SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur)
Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000.
CREATE TABLE entrepreneur (Investor VARCHAR, Money_Requested INTEGER)
SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Investor VARCHAR, Money_Requested INTEGER) ### question:Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000.
SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000
How many distinct companies are there?
CREATE TABLE entrepreneur (Company VARCHAR)
SELECT COUNT(DISTINCT Company) FROM entrepreneur
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Company VARCHAR) ### question:How many distinct companies are there?
SELECT COUNT(DISTINCT Company) FROM entrepreneur
Show the company of the tallest entrepreneur.
CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR)
SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR) ### question:Show the company of the tallest entrepreneur.
SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1
How many perpetrators are there?
CREATE TABLE perpetrator (Id VARCHAR)
SELECT COUNT(*) FROM perpetrator
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Id VARCHAR) ### question:How many perpetrators are there?
SELECT COUNT(*) FROM perpetrator
List the date of perpetrators in descending order of the number of people killed.
CREATE TABLE perpetrator (Date VARCHAR, Killed VARCHAR)
SELECT Date FROM perpetrator ORDER BY Killed DESC
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Date VARCHAR, Killed VARCHAR) ### question:List the date of perpetrators in descending order of the number of people killed.
SELECT Date FROM perpetrator ORDER BY Killed DESC
List the number of people injured by perpetrators in ascending order.
CREATE TABLE perpetrator (Injured VARCHAR)
SELECT Injured FROM perpetrator ORDER BY Injured
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Injured VARCHAR) ### question:List the number of people injured by perpetrators in ascending order.
SELECT Injured FROM perpetrator ORDER BY Injured
What is the average number of people injured by all perpetrators?
CREATE TABLE perpetrator (Injured INTEGER)
SELECT AVG(Injured) FROM perpetrator
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Injured INTEGER) ### question:What is the average number of people injured by all perpetrators?
SELECT AVG(Injured) FROM perpetrator
What is the location of the perpetrator with the largest kills.
CREATE TABLE perpetrator (LOCATION VARCHAR, Killed VARCHAR)
SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (LOCATION VARCHAR, Killed VARCHAR) ### question:What is the location of the perpetrator with the largest kills.
SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1
What are the names of people in ascending order of height?
CREATE TABLE People (Name VARCHAR, Height VARCHAR)
SELECT Name FROM People ORDER BY Height
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE People (Name VARCHAR, Height VARCHAR) ### question:What are the names of people in ascending order of height?
SELECT Name FROM People ORDER BY Height
What are the names of perpetrators?
CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:What are the names of perpetrators?
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID
What are the names of perpetrators whose country is not "China"?
CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country <> "China"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:What are the names of perpetrators whose country is not "China"?
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country <> "China"
What is the name of the perpetrator with the biggest weight.
CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR)
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR) ### question:What is the name of the perpetrator with the biggest weight.
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC LIMIT 1
What is the total kills of the perpetrators with height more than 1.84.
CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE perpetrator (Killed INTEGER, People_ID VARCHAR)
SELECT SUM(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE perpetrator (Killed INTEGER, People_ID VARCHAR) ### question:What is the total kills of the perpetrators with height more than 1.84.
SELECT SUM(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84
What are the names of perpetrators in country "China" or "Japan"?
CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = "China" OR T2.Country = "Japan"
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:What are the names of perpetrators in country "China" or "Japan"?
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = "China" OR T2.Country = "Japan"
What are the heights of perpetrators in descending order of the number of people they injured?
CREATE TABLE perpetrator (People_ID VARCHAR, Injured VARCHAR); CREATE TABLE people (Height VARCHAR, People_ID VARCHAR)
SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR, Injured VARCHAR); CREATE TABLE people (Height VARCHAR, People_ID VARCHAR) ### question:What are the heights of perpetrators in descending order of the number of people they injured?
SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC
What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.
CREATE TABLE perpetrator (Country VARCHAR)
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Country VARCHAR) ### question:What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country
What is the country that has the most perpetrators?
CREATE TABLE perpetrator (Country VARCHAR)
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Country VARCHAR) ### question:What is the country that has the most perpetrators?
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1
What are the countries that have at least two perpetrators?
CREATE TABLE perpetrator (Country VARCHAR)
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Country VARCHAR) ### question:What are the countries that have at least two perpetrators?
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2
List the names of perpetrators in descending order of the year.
CREATE TABLE perpetrator (People_ID VARCHAR, Year VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (People_ID VARCHAR, Year VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) ### question:List the names of perpetrators in descending order of the year.
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC
List the names of people that are not perpetrators.
CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE perpetrator (Name VARCHAR, People_ID VARCHAR)
SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM perpetrator)
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE perpetrator (Name VARCHAR, People_ID VARCHAR) ### question:List the names of people that are not perpetrators.
SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM perpetrator)
Show the countries that have both perpetrators with injures more than 50 and perpetrators with injures smaller than 20.
CREATE TABLE perpetrator (Country VARCHAR, Injured INTEGER)
SELECT Country FROM perpetrator WHERE Injured > 50 INTERSECT SELECT Country FROM perpetrator WHERE Injured < 20
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Country VARCHAR, Injured INTEGER) ### question:Show the countries that have both perpetrators with injures more than 50 and perpetrators with injures smaller than 20.
SELECT Country FROM perpetrator WHERE Injured > 50 INTERSECT SELECT Country FROM perpetrator WHERE Injured < 20
How many distinct locations of perpetrators are there?
CREATE TABLE perpetrator (LOCATION VARCHAR)
SELECT COUNT(DISTINCT LOCATION) FROM perpetrator
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (LOCATION VARCHAR) ### question:How many distinct locations of perpetrators are there?
SELECT COUNT(DISTINCT LOCATION) FROM perpetrator
Show the date of the tallest perpetrator.
CREATE TABLE perpetrator (Date VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR)
SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1
Translate the question into SQL query by using the schema. ### schema:CREATE TABLE perpetrator (Date VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR) ### question:Show the date of the tallest perpetrator.
SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1