interaction_utterance
sequencelengths 0
6
| interaction_query
sequencelengths 0
6
| final_utterance
stringlengths 19
224
| final_query
stringlengths 22
577
| db_id
stringclasses 140
values |
---|---|---|---|---|
[
"What are all races held between 2014 and 2017?",
"Show the distinct names of them."
] | [
"SELECT * FROM races WHERE YEAR BETWEEN 2014 AND 2017",
"SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017"
] | Find the distinct names of all races held between 2014 and 2017? | SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017 | formula_1 |
[
"What are all the drivers?",
"What about those who once had laptime less than 93000 milliseconds?",
"Show the distinct forename and surname of them."
] | [
"SELECT * FROM drivers",
"SELECT * FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000",
"SELECT DISTINCT T1.forename , T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000"
] | 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 | formula_1 |
[
"What are all the drivers?",
"What about those who once had laptime more than 100000 milliseconds?",
"Show the distinct driver id and nationality of them."
] | [
"SELECT * FROM drivers",
"SELECT * FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000",
"SELECT DISTINCT T1.driverid , T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000"
] | 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 | formula_1 |
[
"What are all the drivers?",
"Show the forename and surname of the one with the smallest laptime."
] | [
"SELECT * FROM drivers",
"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 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 | formula_1 |
[
"What are all the drivers?",
"Show the id and family name of the one with the longest laptime."
] | [
"SELECT * FROM drivers",
"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 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 | formula_1 |
[
"What are all the drivers?",
"Which ones of them had the first position in terms of laptime at least twice?",
"Only show their id, forename and surname"
] | [
"SELECT * FROM drivers",
"SELECT * FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING count(*) >= 2",
"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"
] | What is the id, forename 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 | formula_1 |
[
"What are all the drivers?",
"Which ones of them participated in the race Australian Grand Prix held in 2009?"
] | [
"SELECT * FROM drivers",
"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 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 | formula_1 |
[
"What are all the drivers?",
"Which ones of them did not participate in the races held in 2009?"
] | [
"SELECT * FROM drivers",
"SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 )"
] | How many drivers did not participate in the races held in 2009? | SELECT count(DISTINCT driverId) FROM results WHERE raceId NOT IN( SELECT raceId FROM races WHERE YEAR != 2009 ) | formula_1 |
[
"What are all the drivers with forename Lewis?",
"Show the names and years of races that had any of them?"
] | [
"SELECT * FROM drivers WHERE forename = \"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\""
] | 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" | formula_1 |
[
"What are all the drivers?",
"Show the forename and surname of those whose nationality is German."
] | [
"SELECT * FROM drivers",
"SELECT forename , surname FROM drivers WHERE nationality = \"German\""
] | Find the forename and surname of drivers whose nationality is German? | SELECT forename , surname FROM drivers WHERE nationality = "German" | formula_1 |
[
"What are the ids and forenames of drivers that participated in races with name Australian Grand Prix?",
"Among them, show those who also participated 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\"",
"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\""
] | Find the ids 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" | formula_1 |
[
"What are the forenames and surnames of drivers that participated in races with name Australian Grand Prix?",
"Among them, show those who did not participate in 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\"",
"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\""
] | 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" | formula_1 |
[
"Who are all the drivers who was in position 1 as standing?",
"Among them, show the distinct forenames of those who also won?"
] | [
"SELECT * FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1",
"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 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 | formula_1 |
[
"Who are all the drivers who was in position 1 as standing?",
"Among them, show those who also won?",
"Furthermore, show the distinct forenames of those who had more than 20 points."
] | [
"SELECT * FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1",
"SELECT * FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1",
"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"
] | 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 | formula_1 |
[
"Who are all the constructors?",
"Show the number of them in terms of each nationality."
] | [
"SELECT * FROM constructors",
"SELECT count(*) , nationality FROM constructors GROUP BY nationality"
] | What are the numbers of constructors for different nationalities? | SELECT count(*) , nationality FROM constructors GROUP BY nationality | formula_1 |
[
"What are all the constructors?",
"How many races did each of them have?"
] | [
"SELECT * FROM constructors",
"SELECT count(*) , constructorid FROM constructorStandings GROUP BY constructorid"
] | What are the numbers of races for each constructor id? | SELECT count(*) , constructorid FROM constructorStandings GROUP BY constructorid | formula_1 |
[
"What are all the races?",
"What are the names of those that were held after 2017?",
"Among them, show those with their circuits in Spain."
] | [
"SELECT * FROM races",
"SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T1.year > 2017",
"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 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 | formula_1 |
[
"What are all the races?",
"What are the names of those that were held after 2000?",
"Among them, show the distinct name of those with their circuits in Spain."
] | [
"SELECT * FROM races",
"SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T1.year > 2000",
"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"
] | 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 | formula_1 |
[
"What is the maximum pit stop duration in the race with id 841?",
"Find distinct driver ids and stop numbers of all drivers that have a shorter pit stop duration that that one."
] | [
"SELECT max(duration) FROM pitstops WHERE raceid = 841",
"SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration < (SELECT max(duration) FROM pitstops WHERE raceid = 841)"
] | 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) | formula_1 |
[
"What is the minimum pit stop duration in the race with id 841?",
"Find distinct driver ids and stop numbers of all drivers that have a longer pit stop duration that that one."
] | [
"SELECT min(duration) FROM pitstops WHERE raceid = 841",
"SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration > (SELECT min(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? | SELECT DISTINCT driverid , STOP FROM pitstops WHERE duration > (SELECT min(duration) FROM pitstops WHERE raceid = 841) | formula_1 |
[
"What are the forenames of all the drivers?",
"Show the distinct of them in alphabetical order."
] | [
"SELECT forename FROM drivers",
"SELECT DISTINCT forename FROM drivers ORDER BY forename ASC"
] | List the forenames of all distinct drivers in alphabetical order? | SELECT DISTINCT forename FROM drivers ORDER BY forename ASC | formula_1 |
[
"What are the names of all the races?",
"Show their distinct names in reversed lexicographic order."
] | [
"SELECT name FROM races",
"SELECT DISTINCT name FROM races ORDER BY name DESC"
] | List the names of all distinct races in reversed lexicographic order? | SELECT DISTINCT name FROM races ORDER BY name DESC | formula_1 |
[
"What are all the races?",
"Which of them are held between 2009 and 2011?"
] | [
"SELECT * FROM races",
"SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011"
] | What are the names of races held between 2009 and 2011? | SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011 | formula_1 |
[
"What are the names of all the races?",
"Which of them are held after 12:00:00 or before 09:00:00?"
] | [
"SELECT name FROM races",
"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? | SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00" | formula_1 |
[
"What are the first, last names and ids of all the drivers?",
"Show those who had more than 8 pit stops.",
"Include drivers who participated in more than 5 races"
] | [
"SELECT forename, surname, driverid FROM drivers",
"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",
"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 races? | 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 | formula_1 |
[
"What are the last names and ids of all the drivers?",
"Show those who had 11 pit stops.",
"Among those, who also participated in more than 5 race results?"
] | [
"SELECT surname, driverid FROM drivers",
"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",
"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? | 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 | formula_1 |
[
"What are the ids and last names of all the drivers?",
"Who participated in the most races after 2010?"
] | [
"SELECT driverid, surname FROM drivers",
"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? | 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 | formula_1 |
[
"What are the names of all the circuits?",
"Which of them belong to UK or Malaysia?"
] | [
"SELECT name FROM circuits",
"SELECT name FROM circuits WHERE country = \"UK\" OR country = \"Malaysia\""
] | What are the names of circuits that belong to UK or Malaysia? | SELECT name FROM circuits WHERE country = "UK" OR country = "Malaysia" | formula_1 |
[
"What are the ids and locations of all the circuits?",
"Which of them belong to France or Belgium?"
] | [
"SELECT circuitid , LOCATION FROM circuits",
"SELECT circuitid , LOCATION FROM circuits WHERE country = \"France\" OR country = \"Belgium\""
] | Find the id and location of circuits that belong to France or Belgium? | SELECT circuitid , LOCATION FROM circuits WHERE country = "France" OR country = "Belgium" | formula_1 |
[
"What are the names of all the constructors?",
"Show the names of those who are Japanese.",
"Among those, who have once earned more than 5 points?"
] | [
"SELECT * FROM constructors",
"SELECT name FROM constructors WHERE nationality = \"Japanese\"",
"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? | SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5 | formula_1 |
[
"What is the race named 'Monaco Grand Prix' in 2008.",
"What are the fastest lap speed in that race?",
"Show the average of them."
] | [
"SELECT * FROM races WHERE year = 2008 AND name = \"Monaco Grand Prix\"",
"SELECT 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\"",
"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 ? | 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" | formula_1 |
[
"What is the race named 'Monaco Grand Prix' in 2008.",
"What are the fastest lap speed in that race?",
"Show the maximum of them."
] | [
"SELECT * FROM races WHERE year = 2008 AND name = \"Monaco Grand Prix\"",
"SELECT 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\"",
"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 ? | 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" | formula_1 |
[
"What are all the races held after 2014?",
"What are the maximum fastest lap speed in those races in term of each race?",
"Show them in order of year."
] | [
"SELECT * FROM races WHERE year > 2014",
"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",
"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 2014 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 | formula_1 |
[
"What are all the races held after 2014?",
"What are the average fastest lap speed in those races in term of each race?",
"Show them in order of year."
] | [
"SELECT * FROM races WHERE year > 2014",
"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",
"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? | 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 | formula_1 |
[
"What are all the drivers?",
"Show the id, forename and number of races of those who have at least participated in two races."
] | [
"SELECT * FROM drivers",
"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? | 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 | formula_1 |
[
"Who are all the drivers?",
"Show the id and number of races of those who have at most participated in 30 races."
] | [
"SELECT * FROM drivers",
"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? | 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 | formula_1 |
[
"tell me the Ram of the chip with model name X5.",
"How about the X3 Basic's?",
"Which model has the least amount of RAM? List the model name and the amount of RAM."
] | [
"SELECT RAM_MiB FROM chip_model WHERE Model_name = \"X5\"",
"SELECT RAM_MiB FROM chip_model WHERE Model_name = \"X3 Basic\"",
"SELECT Model_name , RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC LIMIT 1;"
] | Which model has the least amount of RAM? List the model name and the amount of RAM. | SELECT Model_name , RAM_MiB FROM chip_model ORDER BY RAM_MiB ASC LIMIT 1; | phone_1 |
[
"tell me the chip models produced by the company named \"Nokia Corporation\".",
"Okay, tell me the RAM size of those chip models.",
"So, what is maximum and minimum RAM size?"
] | [
"SELECT chip_model FROM phone WHERE Company_name = \"Nokia Corporation\"",
"SELECT T1.RAM_MiB FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = \"Nokia Corporation\";",
"SELECT max(T1.RAM_MiB) , min(T1.RAM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = \"Nokia Corporation\""
] | What is maximum and minimum RAM size of phone produced by company named "Nokia Corporation"? | SELECT max(T1.RAM_MiB) , min(T1.RAM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = "Nokia Corporation"; | phone_1 |
[
"tell me the chip model produced by the company named \"Nokia Corporation\".",
"Okay, tell me the ROM size of those chip models.",
"So, what is the average ROM size?"
] | [
"SELECT chip_model FROM phone WHERE Company_name = \"Nokia Corporation\"",
"SELECT T1.ROM_MiB FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = \"Nokia Corporation\";",
"SELECT avg(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = \"Nokia Corporation\""
] | What is the average ROM size of phones produced by the company named "Nokia Corporation"? | SELECT avg(T1.ROM_MiB) FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Company_name = "Nokia Corporation"; | phone_1 |
[
"Tell me the phones that were launched in the year 2002.",
"What companies were they produced by?",
"Give information about the company and hardware model name for phones that have RAM size greater than 32."
] | [
"SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002",
"SELECT T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002",
"SELECT T2.Hardware_Model_name , T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.RAM_MiB > 32;"
] | List the hardware model name and company name for all the phones that were launched in year 2002 or have RAM size greater than 32. | SELECT T2.Hardware_Model_name , T2.Company_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 OR T1.RAM_MiB > 32; | phone_1 |
[
"Tell me the phones that have the word 'Provisional' in their accreditation types.",
"How about their company names?",
"Okay, I want to know the same information of the phones that have word 'Full' in their accreditation types."
] | [
"SELECT Hardware_Model_name FROM phone WHERE Accreditation_type LIKE 'Provisional'",
"SELECT Company_name FROM phone WHERE Accreditation_type LIKE 'Provisional';",
"SELECT Hardware_Model_name , Company_name FROM phone WHERE Accreditation_type LIKE 'Full';"
] | Find all phones that have word 'Full' in their accreditation types. List the Hardware Model name and Company name. | SELECT Hardware_Model_name , Company_name FROM phone WHERE Accreditation_type LIKE 'Full'; | phone_1 |
[
"Tell me the chip model of the phone with hardware model name \"LG-P760\".",
"How about the Char cells, Pixels and Hardware colours for its screen?"
] | [
"SELECT chip_model FROM phone WHERE Hardware_Model_name = \"LG-P760\"",
"SELECT T1.Char_cells , T1.Pixels , T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = \"LG-P760\";"
] | Find the Char cells, Pixels and Hardware colours for the screen of the phone whose hardware model name is "LG-P760". | SELECT T1.Char_cells , T1.Pixels , T1.Hardware_colours FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T2.Hardware_Model_name = "LG-P760"; | phone_1 |
[
"List the hardware model name and company name for the phone whose screen mode type is \"Text\".",
"How about that with screen mode type \"Graphics\"."
] | [
"SELECT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = \"Text\";",
"SELECT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = \"Graphics\""
] | List the hardware model name and company name for the phone whose screen mode type is "Graphics" | SELECT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Graphics"; | phone_1 |
[
"Tell me the name of the company that has the largest number of phone models? Give the count as well.",
"How about the smallest one?"
] | [
"SELECT Company_name , count(*) FROM phone GROUP BY Company_name ORDER BY count(*) DESC LIMIT 1;",
"SELECT Company_name , count(*) FROM phone GROUP BY Company_name ORDER BY count(*) ASC LIMIT 1;"
] | Find the name of the company that has the least number of phone models. List the company name and the number of phone model produced by that company. | SELECT Company_name , count(*) FROM phone GROUP BY Company_name ORDER BY count(*) ASC LIMIT 1; | phone_1 |
[
"Tell the name of the company which produced the phone Nokia 700.",
"So what is the company which produced the phone LG-P760?",
"Tell me the name of the company that produced more than one phone model."
] | [
"SELECT Company_name FROM phone WHERE Hardware_Model_name = \"Nokia 700\"",
"SELECT Company_name FROM phone WHERE Hardware_Model_name = \"LG-P760\"",
"SELECT Company_name FROM phone GROUP BY Company_name HAVING count(*) > 1;"
] | List the name of the company that produced more than one phone model. | SELECT Company_name FROM phone GROUP BY Company_name HAVING count(*) > 1; | phone_1 |
[
"Tell me the distinct maps in screen mode.",
"How about the used kb values?",
"Okay, I want to know the maximum, minimum and average number of used kb in screen mode."
] | [
"SELECT DISTINCT map FROM screen_mode",
"SELECT DISTINCT used_kb FROM screen_mode",
"SELECT max(used_kb) , min(used_kb) , avg(used_kb) FROM screen_mode"
] | List the maximum, minimum and average number of used kb in screen mode. | SELECT max(used_kb) , min(used_kb) , avg(used_kb) FROM screen_mode; | phone_1 |
[
"Tell me the the name of the phone model launched in the year 2003.",
"How about that in the year 2002?",
"I want to know the one with highest RAM size."
] | [
"SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2003",
"SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002",
"SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC LIMIT 1;"
] | List the name of the phone model launched in year 2002 and with the highest RAM size. | SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T1.Launch_year = 2002 ORDER BY T1.RAM_MiB DESC LIMIT 1; | phone_1 |
[
"What are the wifi and screen mode type of the hardware model named \"GT-I9300\"?",
"How about that of the hardware model named \"Z520e\"?",
"Okay, I want to know that of the hardware model named \"LG-P760\"."
] | [
"SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = \"GT-I9300\"",
"SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = \"Z520e\"",
"SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = \"LG-P760\""
] | What are the wifi and screen mode type of the hardware model named "LG-P760"? | SELECT T1.WiFi , T3.Type FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T2.Hardware_Model_name = "LG-P760"; | phone_1 |
[
"Tell me the hardware model name for the phones that have screen mode type \"Graphics\".",
"So how about the phones that have screen model type \"Text\"?",
"Okay, I want to know the same for the phones that have RAM size greater than 32."
] | [
"SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = \"Graphics\"",
"SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = \"Text\"",
"SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T1.RAM_MiB > 32;"
] | List the hardware model name for the phones that have screen mode type "Text" or RAM size greater than 32. | SELECT T2.Hardware_Model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model JOIN screen_mode AS T3 ON T2.screen_mode = T3.Graphics_mode WHERE T3.Type = "Text" OR T1.RAM_MiB > 32; | phone_1 |
[
"Tell me the hardware model name for the phones that have screen mode type \"Graphics\".",
"So how about the phones that have screen model type \"Text\"?",
"Okay, for now I want to know the hardware model name for the phones that were produced by \"Nokia Corporation\" or whose screen mode type is \"Graphics.\""
] | [
"SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = \"Graphics\"",
"SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = \"Text\"",
"SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = \"Graphics\" OR t2.Company_name = \"Nokia Corporation\""
] | List the hardware model name for the phones that were produced by "Nokia Corporation" or whose screen mode type is "Graphics." | SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.Type = "Graphics" OR t2.Company_name = "Nokia Corporation" | phone_1 |
[
"List the hardware model name for the phones that were produced by \"Nokia Corporation\".",
"For these phones, which ones have screen model Text?",
"How about the ones that do not?"
] | [
"SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name = \"Nokia Corporation\"",
"SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name = \"Nokia Corporation\" AND T1.Type = \"Text\"",
"SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name = \"Nokia Corporation\" AND T1.Type != \"Text\""
] | List the hardware model name for the phones that were produced by "Nokia Corporation" but whose screen mode type is not Text. | SELECT DISTINCT T2.Hardware_Model_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE t2.Company_name = "Nokia Corporation" AND T1.Type != "Text"; | phone_1 |
[
"Tell me the phone hardware model and company name for the phones whose screen usage in kb is larger than 10.",
"Smaller than 15?",
"Okay, now I want to know the phones with screen usage within that range."
] | [
"SELECT DISTINCT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb > 10",
"SELECT DISTINCT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb < 15",
"SELECT DISTINCT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15"
] | List the phone hardware model and company name for the phones whose screen usage in kb is between 10 and 15. | SELECT DISTINCT T2.Hardware_Model_name , T2.Company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.Graphics_mode = T2.screen_mode WHERE T1.used_kb BETWEEN 10 AND 15; | phone_1 |
[
"Tell me the accreditation level of the hardware model with name Z520e.",
"How about that of Nokia 700?",
"Okay, I want to know the accreditation level that more than 3 phones use."
] | [
"SELECT Accreditation_level FROM phone WHERE Hardware_Model_name = \"Z520e\"",
"SELECT Accreditation_level FROM phone WHERE Hardware_Model_name = \"Nokia 700\"",
"SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING count(*) > 3"
] | Find the accreditation level that more than 3 phones use. | SELECT Accreditation_level FROM phone GROUP BY Accreditation_level HAVING count(*) > 3 | phone_1 |
[
"Tell me the ram size of the hardware model with name Nokia 700.",
"How about for the GT-I9300?",
"Tell me the average ram mib size of the chip models that are never used by any phone."
] | [
"SELECT T1.RAM_MiB FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Hardware_Model_name = \"Nokia 700\"",
"SELECT T1.RAM_MiB FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Hardware_Model_name = \"GT-I9300\"",
"SELECT avg(RAM_MiB) FROM chip_model WHERE model_name NOT IN (SELECT chip_model FROM phone)"
] | Find the average ram mib size of the chip models that are never used by any phone. | SELECT avg(RAM_MiB) FROM chip_model WHERE model_name NOT IN (SELECT chip_model FROM phone) | phone_1 |
[
"Tell me all the chip models.",
"Tell me all the chip models that are used by phones with full accreditation type.",
"How about not used by any phone with full accreditation type?"
] | [
"SELECT model_name FROM chip_model",
"SELECT T1.model_name FROM chip_model AS T1 JOIN phone AS T2 ON T1.Model_name = T2.chip_model WHERE T2.Accreditation_type = 'Full'",
"SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full'"
] | Find the names of the chip models that are not used by any phone with full accreditation type. | SELECT model_name FROM chip_model EXCEPT SELECT chip_model FROM phone WHERE Accreditation_type = 'Full' | phone_1 |
[
"Give the first and last names of the staff.",
"Also list the date of birth.",
"What is the birthday of the staff member with first name as Janessa and last name as Sawayn?"
] | [
"SELECT first_name, last_name from staff",
"SELECT first_name, last_name, date_of_birth from staff",
"SELECT date_of_birth FROM Staff WHERE first_name = \"Janessa\" AND last_name = \"Sawayn\";"
] | What is the birthday of the staff member with first name as Janessa and last name as Sawayn? | SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"; | driving_school |
[
"When did various staff join?",
"When did the staff member with first name as Janessa and last name as Sawayn join the company?"
] | [
"SELECT first_name, last_name, date_joined_staff from staff",
"SELECT date_joined_staff FROM Staff WHERE first_name = \"Janessa\" AND last_name = \"Sawayn\";"
] | When did the staff member with first name as Janessa and last name as Sawayn join the company? | SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"; | driving_school |
[
"What was the most recent leaving of the company for any staff member?",
"When did the staff member with first name as Janessa and last name as Sawayn leave the company?"
] | [
"SELECT max(date_left_staff) from staff",
"SELECT date_left_staff FROM Staff WHERE first_name = \"Janessa\" AND last_name = \"Sawayn\";"
] | When did the staff member with first name as Janessa and last name as Sawayn leave the company? | SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"; | driving_school |
[
"How many unique nicknames are there for the staff?",
"What is the nickname of staff with first name as Janessa and last name as Sawayn?"
] | [
"SELECT count(*) from (SELECT DISTINCT nickname from staff)",
"SELECT nickname FROM Staff WHERE first_name = \"Janessa\" AND last_name = \"Sawayn\";"
] | What is the nickname of staff with first name as Janessa and last name as Sawayn? | SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"; | driving_school |
[
"Sort the cities in which the staff live in by alphabetical order.",
"Which city does staff with first name as Janessa and last name as Sawayn live?"
] | [
"SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id ORDER by T1.city",
"SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = \"Janessa\" AND T2.last_name = \"Sawayn\";"
] | Which city does staff with first name as Janessa and last name as Sawayn live? | SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"; | driving_school |
[
"Where do the staff live? Give first and last name and also country and state.",
"Narrow that to Janessa Sawayn."
] | [
"SELECT T2.first_name, T2.last_name, T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id",
"SELECT T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = \"Janessa\" AND T2.last_name = \"Sawayn\";"
] | In which country and state does staff with first name as Janessa and last name as Sawayn live? | SELECT T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"; | driving_school |
[
"Which customer ids took lessons?",
"Sum over the lesson time for those groups. Also count the number of lessons take.",
"What is the customer id of Rylan Goodwin?",
"How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?"
] | [
"SELECT DISTINCT customer_id from lessons",
"SELECT customer_id, sum(lesson_time), count(*) from lessons GROUP by customer_id",
"SELECT customer_id from customers WHERE first_name = \"Rylan\" AND last_name = \"Goodwin\";",
"SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = \"Rylan\" AND T2.last_name = \"Goodwin\";"
] | How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin? | SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin"; | driving_school |
[
"What is the address id of Janessa Sawayn?",
"For that address id, give teh zip code."
] | [
"SELECT staff_address_id from staff where first_name = 'Janessa' and last_name = 'Sawayn'",
"SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = \"Janessa\" AND T2.last_name = \"Sawayn\";"
] | What is the zip code of staff with first name as Janessa and last name as Sawayn? | SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"; | driving_school |
[
"Which address ids correspond to the city Damianfort?",
"Join that with staff to find staff living there. Give first and last name."
] | [
"SELECT address_id from Addresses where city = 'Damianfort'",
"SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = \"Damianfort\";"
] | Find out the first name and last name of staff living in city Damianfort. | SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort"; | driving_school |
[
"What is the most common address_id for staff?",
"List the corresponding city name and number of staff living there."
] | [
"SELECT staff_address_id from staff ORDER by staff_address_id DESC LIMIT 1",
"SELECT T1.city , count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1;"
] | In which city live the most staff? List the city name and number of staff. | SELECT T1.city , count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1; | driving_school |
[
"List the states and counts of staff living there.",
"List the states which have between 2 to 4 staff living there."
] | [
"SELECT T1.state_province_county, count(*) from Addresses as T1 join staff as T2 on T1.address_id = T2.staff_address_id GROUP by T2.staff_id",
"SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4;"
] | List the states which have between 2 to 4 staff living there. | SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4; | driving_school |
[
"Give records on the customer with last name Kohler.",
"Also show records for first name 'Marina'",
"Just show the status code, mobile phone number and email address for the above."
] | [
"SELECT * from customers where last_name = 'Kohler'",
"SELECT * from customers where last_name = 'Kohler' OR first_name = 'Marina'",
"SELECT customer_status_code , cell_mobile_phone_number , email_address FROM Customers WHERE first_name = \"Marina\" OR last_name = \"Kohler\""
] | What is the status code, mobile phone number and email address of the customer with last name as Kohler or first name as Marina? | SELECT customer_status_code , cell_mobile_phone_number , email_address FROM Customers WHERE first_name = "Marina" OR last_name = "Kohler" | driving_school |
[
"List the names and date became customer for the customers.",
"Limit that to Carole Bernhard, and just show the relevant date."
] | [
"SELECT first_name, last_name, date_became_customer from customers",
"SELECT date_became_customer FROM Customers WHERE first_name = \"Carole\" AND last_name = \"Bernhard\";"
] | When did customer with first name as Carole and last name as Bernhard became a customer? | SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard"; | driving_school |
[
"List the customer status code with their respective counts.",
"Sort by ascending counts.",
"Which customer status code has least number of customers?"
] | [
"SELECT customer_status_code, count(*) from customers GROUP by customer_status_code",
"SELECT customer_status_code, count(*) from customers GROUP by customer_status_code ORDER by count(*) ASC",
"SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;"
] | Which customer status code has least number of customers? | SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1; | driving_school |
[
"List the lessons taken by each customer first and last name.",
"Just show that information for the completed status lessons.",
"How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed?"
] | [
"SELECT T2.first_name, T2.last_name, count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP by T2.customer_id",
"SELECT T2.first_name, T2.last_name, count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP by T2.customer_id where t1.lesson_status_code = 'Completed'",
"SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = \"Rylan\" AND T2.last_name = \"Goodwin\" AND T1.lesson_status_code = \"Completed\";"
] | How many lessons taken by customer with first name as Rylan and last name as Goodwin were completed? | SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" AND T1.lesson_status_code = "Completed"; | driving_school |
[
"List names of customers with their amount outstanding.",
"What is maximum, minimum and average amount of outstanding of customer?"
] | [
"SELECT first_name, last_name, amount_outstanding from customers",
"SELECT max(amount_outstanding) , min(amount_outstanding) , avg(amount_outstanding) FROM Customers;"
] | What is maximum, minimum and average amount of outstanding of customer? | SELECT max(amount_outstanding) , min(amount_outstanding) , avg(amount_outstanding) FROM Customers; | driving_school |
[
"List records of customers living in city Lockmanfurt.",
"Just show the first and last name."
] | [
"SELECT FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = \"Lockmanfurt\";",
"SELECT T1.first_name , T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = \"Lockmanfurt\";"
] | List first name and last name of customers living in city Lockmanfurt. | SELECT T1.first_name , T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = "Lockmanfurt"; | driving_school |
[
"Join customer names with their lived-in countries.",
"Which country does customer with first name as Carole and last name as Bernhard live in?"
] | [
"SELECT T1.first_name, T1.last_name, T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id",
"SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = \"Carole\" AND T1.last_name = \"Bernhard\""
] | Which country does customer with first name as Carole and last name as Bernhard live in? | SELECT T2.country FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard" | driving_school |
[
"What are the customers zip codes?",
"What is zip code of customer with first name as Carole and last name as Bernhard?"
] | [
"SELECT T1.first_name, T1.last_name, T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id",
"SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = \"Carole\" AND T1.last_name = \"Bernhard\""
] | What is zip code of customer with first name as Carole and last name as Bernhard? | SELECT T2.zip_postcode FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard" | driving_school |
[
"Give counts of cities customers live in.",
"Which city has most number of customers?"
] | [
"SELECT T2.city, count(*) FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city",
"SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY count(*) DESC LIMIT 1;"
] | Which city has most number of customers? | SELECT T2.city FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id GROUP BY T2.city ORDER BY count(*) DESC LIMIT 1; | driving_school |
[
"List a sum of all the payments for all the customers.",
"How much in total has customer with first name as Carole and last name as Bernhard paid?"
] | [
"SELECT T2.first_name, T2.last_name, sum(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP by T2.customer_id",
"SELECT sum(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = \"Carole\" AND T2.last_name = \"Bernhard\""
] | How much in total has customer with first name as Carole and last name as Bernhard paid? | SELECT sum(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Carole" AND T2.last_name = "Bernhard" | driving_school |
[
"Which customer ids have no payment history?",
"Count those."
] | [
"SELECT customer_id from customers EXCEPT SELECT customer_id from Customer_Payments",
"SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments );"
] | List the number of customers that did not have any payment history. | SELECT count(*) FROM Customers WHERE customer_id NOT IN ( SELECT customer_id FROM Customer_Payments ); | driving_school |
[
"Count the payments per customer.",
"Just for those with more than 2 payments."
] | [
"SELECT T2.first_name, T2.last_name, count(T1.amount_payment) FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP by T2.customer_id",
"SELECT T2.first_name , T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) > 2;"
] | List first name and last name of customers that have more than 2 payments. | SELECT T2.first_name , T2.last_name FROM Customer_Payments AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING count(*) > 2; | driving_school |
[
"List lesson id of all lessons taught by staff with first name as Janessa",
"Intersect that with last name Sawayn and nickname containing letter 's'."
] | [
"SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = \"Janessa\"",
"SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = \"Janessa\" AND T2.last_name = \"Sawayn\" AND nickname LIKE \"%s%\";"
] | List lesson id of all lessons taught by staff with first name as Janessa, last name as Sawayn and nickname containing letter 's'. | SELECT T1.lesson_id FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" AND nickname LIKE "%s%"; | driving_school |
[
"Count the lessons grouped by staff first name.",
"How many lessons taught by staff whose first name has letter 'a' in it?"
] | [
"SELECT T2.first_name, count(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id GROUP by T2.first_name",
"SELECT count(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE \"%a%\""
] | How many lessons taught by staff whose first name has letter 'a' in it? | SELECT count(*) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name LIKE "%a%" | driving_school |
[
"Count the lesson time grouped by staff id.",
"Join that sum on the staff with first name Janess and last name Sawayn."
] | [
"SELECT T2.staff_id, sum(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id GROUP by T2.staff_id",
"SELECT sum(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = \"Janessa\" AND T2.last_name = \"Sawayn\";"
] | How long is the total lesson time taught by staff with first name as Janessa and last name as Sawayn? | SELECT sum(lesson_time) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"; | driving_school |
[
"Show the sum of lesson prices per staff.",
"Give the average.",
"Just for first name as Janessa and last name as Sawayn?"
] | [
"SELECT T2.first_name, T2.last_name, sum(T1.price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id GROUP by T2.staff_id",
"SELECT T2.first_name, T2.last_name, avg(T1.price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id GROUP by T2.staff_id",
"SELECT avg(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = \"Janessa\" AND T2.last_name = \"Sawayn\";"
] | What is average lesson price taught by staff with first name as Janessa and last name as Sawayn? | SELECT avg(price) FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"; | driving_school |
[
"count the lessons taken per customer first name.",
"How many lessons did customer with first name Ray take?"
] | [
"SELECT T2.first_name, count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP by T2.first_name",
"SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = \"Ray\""
] | How many lessons did customer with first name Ray take? | SELECT count(*) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Ray" | driving_school |
[
"What are the distinct last names of staff?",
"Of customers?",
"Intersect that."
] | [
"SELECT DISTINCT last_name FROM Staff",
"SELECT DISTINCT last_name FROM Customers",
"SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff"
] | Which last names are both used by customers and by staff? | SELECT last_name FROM Customers INTERSECT SELECT last_name FROM Staff | driving_school |
[
"Which staff gave lessons? Give their first names.",
"Which staff first names did not?"
] | [
"SELECT DISTINCT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id",
"SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id"
] | What are the first names of staff who did not give any lesson? | SELECT first_name FROM Staff EXCEPT SELECT T2.first_name FROM Lessons AS T1 JOIN Staff AS T2 ON T1.staff_id = T2.staff_id | driving_school |
[
"List the distinct vehicle ids used in lessons.",
"For those, give the detail as well.",
"What is the id and detail of the vehicle used in lessons for most of the times?"
] | [
"SELECT DISTINCT vehicle_id from Lessons",
"SELECT T1.vehicle_id , T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id",
"SELECT T1.vehicle_id , T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY count(*) DESC LIMIT 1"
] | What is the id and detail of the vehicle used in lessons for most of the times? | SELECT T1.vehicle_id , T1.vehicle_details FROM Vehicles AS T1 JOIN Lessons AS T2 ON T1.vehicle_id = T2.vehicle_id GROUP BY T1.vehicle_id ORDER BY count(*) DESC LIMIT 1 | driving_school |
[
"Give the first and last names of the staff.",
"Also list the date of birth.",
"What is the birthday of the staff member with first name as Janessa and last name as Sawayn?"
] | [
"SELECT first_name, last_name from staff",
"SELECT first_name, last_name, date_of_birth from staff",
"SELECT date_of_birth FROM Staff WHERE first_name = \"Janessa\" AND last_name = \"Sawayn\";"
] | What is the birthday of the staff member with first name as Janessa and last name as Sawayn? | SELECT date_of_birth FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"; | driving_school |
[
"When did various staff join?",
"When did the staff member with first name as Janessa and last name as Sawayn join the company?"
] | [
"SELECT first_name, last_name, date_joined_staff from staff",
"SELECT date_joined_staff FROM Staff WHERE first_name = \"Janessa\" AND last_name = \"Sawayn\";"
] | When did the staff member with first name as Janessa and last name as Sawayn join the company? | SELECT date_joined_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"; | driving_school |
[
"What was the most recent leaving of the company for any staff member?",
"When did the staff member with first name as Janessa and last name as Sawayn leave the company?"
] | [
"SELECT max(date_left_staff) from staff",
"SELECT date_left_staff FROM Staff WHERE first_name = \"Janessa\" AND last_name = \"Sawayn\";"
] | When did the staff member with first name as Janessa and last name as Sawayn leave the company? | SELECT date_left_staff FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"; | driving_school |
[
"How many unique nicknames are there for the staff?",
"What is the nickname of staff with first name as Janessa and last name as Sawayn?"
] | [
"SELECT count(*) from (SELECT DISTINCT nickname from staff)",
"SELECT nickname FROM Staff WHERE first_name = \"Janessa\" AND last_name = \"Sawayn\";"
] | What is the nickname of staff with first name as Janessa and last name as Sawayn? | SELECT nickname FROM Staff WHERE first_name = "Janessa" AND last_name = "Sawayn"; | driving_school |
[
"Sort the cities in which the staff live in by alphabetical order.",
"Which city does staff with first name as Janessa and last name as Sawayn live?"
] | [
"SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id ORDER by T1.city",
"SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = \"Janessa\" AND T2.last_name = \"Sawayn\";"
] | Which city does staff with first name as Janessa and last name as Sawayn live? | SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"; | driving_school |
[
"Where do the staff live? Give first and last name and also country and state.",
"Narrow that to Janessa Sawayn."
] | [
"SELECT T2.first_name, T2.last_name, T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id",
"SELECT T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = \"Janessa\" AND T2.last_name = \"Sawayn\";"
] | In which country and state does staff with first name as Janessa and last name as Sawayn live? | SELECT T1.country , T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"; | driving_school |
[
"Which customer ids took lessons?",
"Sum over the lesson time for those groups. Also count the number of lessons take.",
"What is the customer id of Rylan Goodwin?",
"How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?"
] | [
"SELECT DISTINCT customer_id from lessons",
"SELECT customer_id, sum(lesson_time), count(*) from lessons GROUP by customer_id",
"SELECT customer_id from customers WHERE first_name = \"Rylan\" AND last_name = \"Goodwin\";",
"SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = \"Rylan\" AND T2.last_name = \"Goodwin\";"
] | How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin? | SELECT sum(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin"; | driving_school |
[
"What is the address id of Janessa Sawayn?",
"For that address id, give teh zip code."
] | [
"SELECT staff_address_id from staff where first_name = 'Janessa' and last_name = 'Sawayn'",
"SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = \"Janessa\" AND T2.last_name = \"Sawayn\";"
] | What is the zip code of staff with first name as Janessa and last name as Sawayn? | SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"; | driving_school |
[
"Which address ids correspond to the city Damianfort?",
"Join that with staff to find staff living there. Give first and last name."
] | [
"SELECT address_id from Addresses where city = 'Damianfort'",
"SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = \"Damianfort\";"
] | Find out the first name and last name of staff living in city Damianfort. | SELECT T2.first_name , T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = "Damianfort"; | driving_school |
[
"What is the most common address_id for staff?",
"List the corresponding city name and number of staff living there."
] | [
"SELECT staff_address_id from staff ORDER by staff_address_id DESC LIMIT 1",
"SELECT T1.city , count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1;"
] | In which city live the most staff? List the city name and number of staff. | SELECT T1.city , count(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY count(*) DESC LIMIT 1; | driving_school |
[
"List the states and counts of staff living there.",
"List the states which have between 2 to 4 staff living there."
] | [
"SELECT T1.state_province_county, count(*) from Addresses as T1 join staff as T2 on T1.address_id = T2.staff_address_id GROUP by T2.staff_id",
"SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4;"
] | List the states which have between 2 to 4 staff living there. | SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4; | driving_school |
[
"Give records on the customer with last name Kohler.",
"Also show records for first name 'Marina'",
"Just show the status code, mobile phone number and email address for the above."
] | [
"SELECT * from customers where last_name = 'Kohler'",
"SELECT * from customers where last_name = 'Kohler' OR first_name = 'Marina'",
"SELECT customer_status_code , cell_mobile_phone_number , email_address FROM Customers WHERE first_name = \"Marina\" OR last_name = \"Kohler\""
] | What is the status code, mobile phone number and email address of the customer with last name as Kohler or first name as Marina? | SELECT customer_status_code , cell_mobile_phone_number , email_address FROM Customers WHERE first_name = "Marina" OR last_name = "Kohler" | driving_school |
[
"List the names and date became customer for the customers.",
"Limit that to Carole Bernhard, and just show the relevant date."
] | [
"SELECT first_name, last_name, date_became_customer from customers",
"SELECT date_became_customer FROM Customers WHERE first_name = \"Carole\" AND last_name = \"Bernhard\";"
] | When did customer with first name as Carole and last name as Bernhard became a customer? | SELECT date_became_customer FROM Customers WHERE first_name = "Carole" AND last_name = "Bernhard"; | driving_school |
[
"List the customer status code with their respective counts.",
"Sort by ascending counts.",
"Which customer status code has least number of customers?"
] | [
"SELECT customer_status_code, count(*) from customers GROUP by customer_status_code",
"SELECT customer_status_code, count(*) from customers GROUP by customer_status_code ORDER by count(*) ASC",
"SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1;"
] | Which customer status code has least number of customers? | SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY count(*) ASC LIMIT 1; | driving_school |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.