aherntech/sparc huggingface dataset:
Database: gymnast
Question sequence:
What is the average height of all people?
How about the average height of gymnasts?
How old is the tallest among all people?
SQL query sequence:
SELECT AVG(Height) FROM people
SELECT AVG(T2.Height) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID
SELECT Age FROM people ORDER BY Height DESC LIMIT 1
Final question: What is the age of the tallest person?
Final SQL: SELECT Age FROM people ORDER BY Height DESC LIMIT 1
Database: gymnast
Question sequence:
Who is the tallest?
Who is the oldest gymnast?
Please show the top 5 oldest gymnasts.
How about the top 5 oldest people?
SQL query sequence:
SELECT name FROM people ORDER BY Height DESC LIMIT 1
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY Age DESC LIMIT 1
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY Age DESC LIMIT 5
SELECT Name FROM People ORDER BY Age DESC LIMIT 5
Final question: List the names of the top 5 oldest people.
Final SQL: SELECT Name FROM People ORDER BY Age DESC LIMIT 5
Database: gymnast
Question sequence:
What is the average age of all people?
How about the average age of all gymnasts?
Who is the youngest gymnast?
How many total points does he have?
SQL query sequence:
SELECT AVG(age) FROM people
SELECT AVG(age) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T2.Age ASC LIMIT 1
SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T2.Age ASC LIMIT 1
Final question: What is the total point count of the youngest gymnast?
Final SQL: SELECT T1.Total_Points FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T2.Age ASC LIMIT 1
Database: gymnast
Question sequence:
What is the average total points of gymnasts?
How many gymnasts are there that have total points more than 50?
How about the number of gymnasts with total points more than 57.5?
What are the distinct hometowns of these gymnasts?
SQL query sequence:
SELECT AVG(Total_Points) FROM gymnast
SELECT COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID WHERE T1.Total_Points  >  50
SELECT COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID WHERE T1.Total_Points  >  57.5
SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID WHERE T1.Total_Points  >  57.5
Final question: What are the distinct hometowns of gymnasts with total points more than 57.5?
Final SQL: SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID WHERE T1.Total_Points  >  57.5
Database: gymnast
Question sequence:
How many gymnasts are there?
How many gymnasts are there in each age group?
How many gymnasts are there in each hometown?
SQL query sequence:
SELECT COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID
SELECT T2.Age ,  COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Age
SELECT T2.Hometown ,  COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown
Final question: What are the hometowns of gymnasts and the corresponding number of gymnasts?
Final SQL: SELECT T2.Hometown ,  COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown
Database: gymnast
Question sequence:
How many distinct hometowns are there?
How many gymnasts are from each town?
What is the most common hometown?
SQL query sequence:
SELECT COUNT(DISTINCT Hometown) FROM people
SELECT T2.Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1
Final question: What is the most common hometown of gymnasts?
Final SQL: SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown ORDER BY COUNT(*) DESC LIMIT 1
Database: gymnast
Question sequence:
How many distinct hometowns are there?
How many gymnasts are there in each hometown?
Which hometown has more than 1 gymnast?
SQL query sequence:
SELECT COUNT(DISTINCT Hometown) FROM people
SELECT T2.Hometown, COUNT(*) FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*)  >=  2
Final question: What are the hometowns that are shared by at least two gymnasts?
Final SQL: SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID GROUP BY T2.Hometown HAVING COUNT(*)  >=  2
Database: gymnast
Question sequence:
Who is the tallest gymnast?
How about the shortest gymnast?
Please show the names of gymnasts in ascending order by their heights.
SQL query sequence:
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T2.Height DESC LIMIT 1
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T2.Height ASC LIMIT 1
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T2.Height ASC
Final question: List the names of gymnasts in ascending order by their heights.
Final SQL: SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID ORDER BY T2.Height ASC
Database: gymnast
Question sequence:
What is the average Floor Exercise Points of gymnasts?
Please show the hometowns of the gymnasts.
Please show the hometowns of all people.
What are the distinct hometowns that do not have any gymnasts?
SQL query sequence:
SELECT AVG(Floor_Exercise_Points) FROM gymnast
SELECT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID
SELECT Hometown FROM people
SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID
Final question: List the distinct hometowns that are not associated with any gymnast.
Final SQL: SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID  =  T2.People_ID
Database: gymnast
Question sequence:
How many people are older than 23?
How about the number of people younger than 20?
Please show their hometowns.
How about the hometowns shared by people older than 23 and younger than 20?
SQL query sequence:
SELECT COUNT(*) FROM people WHERE Age  >  23
SELECT COUNT(*) FROM people WHERE Age  < 20
SELECT Hometown FROM people WHERE Age  < 20
SELECT Hometown FROM people WHERE Age  >  23 INTERSECT SELECT Hometown FROM people WHERE Age  <  20
Final question: Show the hometowns shared by people older than 23 and younger than 20.
Final SQL: SELECT Hometown FROM people WHERE Age  >  23 INTERSECT SELECT Hometown FROM people WHERE Age  <  20
Database: phone_market
Question sequence:
What is the average price of phones?
What about their names?
Of those, only tell me the ones that are either "Sprint" or "TMobile" carriers.
SQL query sequence:
SELECT AVG(Price) FROM phone
SELECT Name FROM phone
SELECT Name FROM phone WHERE Carrier  =  "Sprint" OR Carrier  =  "TMobile"
Final question: Show the names of phones with carrier either "Sprint" or "TMobile".
Final SQL: SELECT Name FROM phone WHERE Carrier  =  "Sprint" OR Carrier  =  "TMobile"
Database: phone_market
Question sequence:
What is the memory of the cheapest phone?
Include the name as well please.
What about for the most expensive phone?
Which company carries this?
SQL query sequence:
SELECT Memory_in_G FROM phone ORDER BY Price ASC LIMIT 1
SELECT Name, Memory_in_G FROM phone ORDER BY Price ASC LIMIT 1
SELECT Name, Memory_in_G FROM phone ORDER BY Price DESC LIMIT 1
SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1
Final question: What is the carrier of the most expensive phone?
Final SQL: SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1
Database: phone_market
Question sequence:
What is the cheapest phone?
Which carrier has this?
Which one has the most phones instead?
SQL query sequence:
SELECT * FROM phone ORDER BY Price ASC LIMIT 1
SELECT Carrier FROM phone ORDER BY Price ASC LIMIT 1
SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1
Final question: Show the most frequently used carrier of the phones.
Final SQL: SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1
Database: phone_market
Question sequence:
Show me all the phone carriers.
The ones with a phones having a price range of 700 to 900?
How about the ones that have phones both price less than 700 and price more than 900.
What about phones with memory less than 32 and memory greater than 64?
SQL query sequence:
SELECT Carrier FROM phone
SELECT Carrier from phone WHERE Price > 700 AND Price < 900
SELECT Carrier FROM phone WHERE Price  <  700 INTERSECT SELECT Carrier FROM phone WHERE Price  >  900
SELECT Carrier FROM phone WHERE Memory_in_G  <  32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G  >  64
Final question: Show the carriers that have both phones with memory smaller than 32 and phones with memory bigger than 64.
Final SQL: SELECT Carrier FROM phone WHERE Memory_in_G  <  32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G  >  64
Database: phone_market
Question sequence:
What are the names of the phones available?
What about those available in Alberta?
Show the district as well.
Remove the restriction of those in Alberta only, show all instead.
SQL query sequence:
SELECT Name FROM phone
SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID WHERE T2.District = "Alberta"
SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID WHERE T2.District = "Alberta"
SELECT T3.Name ,  T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID
Final question: Show the names of phones and the districts of markets they are on.
Final SQL: SELECT T3.Name ,  T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID
Database: phone_market
Question sequence:
What are the names and districts of the phones I can find in Ontario?
What about for each of the market district?
Order those by increasing number of shops.
By ranking instead?
SQL query sequence:
SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID WHERE T2.District = "Ontario"
SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID
SELECT T3.Name, T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID ORDER BY T2.Num_of_shops
SELECT T3.Name ,  T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID ORDER BY T2.Ranking
Final question: Show the names of phones and the districts of markets they are on, in ascending order of the ranking of the market.
Final SQL: SELECT T3.Name ,  T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID ORDER BY T2.Ranking
Database: phone_market
Question sequence:
What are the markets with at least 30 shops?
50 shops?
What are their phones?
SQL query sequence:
SELECT * FROM market WHERE Num_of_shops > 30
SELECT * FROM market WHERE Num_of_shops > 50
SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID WHERE T2.Num_of_shops  >  50
Final question: Show the names of phones that are on market with number of shops greater than 50.
Final SQL: SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID  =  T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID  =  T3.Phone_ID WHERE T2.Num_of_shops  >  50
Database: phone_market
Question sequence:
What are the names of the phones?
Show me their memory as well.
Their total stocks?
SQL query sequence:
SELECT Name FROM phone
SELECT Name, Memory_in_G FROM phone
SELECT T2.Name ,  sum(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID  =  T2.Phone_ID GROUP BY T2.Name
Final question: For each phone, show its names and total number of stocks.
Final SQL: SELECT T2.Name ,  sum(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID  =  T2.Phone_ID GROUP BY T2.Name
Database: phone_market
Question sequence:
Show the names of phones and their stocks.
Of those, which have 64 GB memory?
How about the having total stocks at least 2000 instead?
Don't show their number of stocks.
Can you sort them in increasing order of total stocks?
Decreasing order instead.
SQL query sequence:
SELECT T2.Name, T1.Num_of_stock FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID
SELECT T2.Name, T1.Num_of_stock FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID WHERE T2.Memory_in_G = 64
SELECT T2.Name, T1.Num_of_stock FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock)  >=  2000
SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock)  >=  2000
SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock)  >=  2000 ORDER BY sum(T1.Num_of_stock)
SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock)  >=  2000 ORDER BY sum(T1.Num_of_stock) DESC
Final question: Show the names of phones that have total number of stocks bigger than 2000, in descending order of the total number of stocks.
Final SQL: SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID  =  T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock)  >=  2000 ORDER BY sum(T1.Num_of_stock) DESC
Database: election_representative
Question sequence:
Show me the vote percents of all the elections.
What are the minimum and maximum ones of them?
SQL query sequence:
SELECT Vote_Percent FROM election
SELECT min(Vote_Percent) ,  max(Vote_Percent) FROM election
Final question: What are the minimum and maximum vote percents of elections?
Final SQL: SELECT min(Vote_Percent) ,  max(Vote_Percent) FROM election
Database: election_representative
Question sequence:
Show me the the name of all the representatives.
Only show me those from New York or Indiana.
What about their life spans?
SQL query sequence:
SELECT Name FROM representative
SELECT Name FROM representative WHERE State  =  "New York" OR State  =  "Indiana"
SELECT Lifespan FROM representative WHERE State  =  "New York" OR State  =  "Indiana"
Final question: What are the life spans of representatives from New York state or Indiana state?
Final SQL: SELECT Lifespan FROM representative WHERE State  =  "New York" OR State  =  "Indiana"
Database: election_representative
Question sequence:
Show me the name of all the representatives.
What about their votes in their elections?
Only show me the name of those with more than 10000 votes.
SQL query sequence:
SELECT Name FROM representative
SELECT T2.Name,T1.votes FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID
SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE Votes  >  10000
Final question: What are the names of representatives with more than 10000 votes in election?
Final SQL: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE Votes  >  10000
Database: election_representative
Question sequence:
Show me the name of all the representatives.
What about their votes in their elections?
Show me their names in descending order of votes.
SQL query sequence:
SELECT Name FROM representative
SELECT T2.Name,T1.votes FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID
SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes DESC
Final question: What are the names of representatives in descending order of votes?
Final SQL: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes DESC
Database: election_representative
Question sequence:
Show me the names of all parties of the representative.
Show me the names of all the representatives.
What are their votes?
What is the party of the one with the smallest number of votes?
SQL query sequence:
SELECT DISTINCT Party FROM representative
SELECT Name FROM representative
SELECT T2.Name,T1.votes FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID
SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes ASC LIMIT 1
Final question: What is the party of the representative that has the smallest number of votes.
Final SQL: SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes ASC LIMIT 1
Database: election_representative
Question sequence:
Show me the names of all the representatives.
What about their lifespans?
Please list them in descending order of their vote percentage.
SQL query sequence:
SELECT Name FROM representative
SELECT Name, lifespan FROM representative
SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY Vote_Percent DESC
Final question: What are the lifespans of representatives in descending order of vote percent?
Final SQL: SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY Vote_Percent DESC
Database: election_representative
Question sequence:
Show me the name of representatives from Republican party.
What about their votes?
Show me the average of them.
SQL query sequence:
SELECT name FROM representative WHERE party = "Republican"
SELECT T2.name, T1.Votes FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE T2.Party  =  "Republican"
SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE T2.Party  =  "Republican"
Final question: What is the average number of votes of representatives from party "Republican"?
Final SQL: SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE T2.Party  =  "Republican"
Database: election_representative
Question sequence:
What are the name of parties of representatives?
Show me the number of representatives in each party.
Give me the party that has more.
SQL query sequence:
SELECT DISTINCT Party FROM representative
SELECT Party ,  COUNT(*) FROM representative GROUP BY Party
SELECT Party ,  COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
Final question: What is the party that has the largest number of representatives?
Final SQL: SELECT Party ,  COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
Database: election_representative
Question sequence:
What are the name of parties of representatives?
Show me the number of representatives in each party.
Give me the parties that have at least three of them.
SQL query sequence:
SELECT DISTINCT Party FROM representative
SELECT Party ,  COUNT(*) FROM representative GROUP BY Party
SELECT Party FROM representative GROUP BY Party HAVING COUNT(*)  >=  3
Final question: What parties have at least three representatives?
Final SQL: SELECT Party FROM representative GROUP BY Party HAVING COUNT(*)  >=  3
Database: election_representative
Question sequence:
Show me the name of the states of representative.
What about their number of representatives?
Show me the states that have at least of them.
SQL query sequence:
SELECT State FROM representative
SELECT State, COUNT(*) FROM representative GROUP BY State
SELECT State FROM representative GROUP BY State HAVING COUNT(*)  >=  2
Final question: What states have at least two representatives?
Final SQL: SELECT State FROM representative GROUP BY State HAVING COUNT(*)  >=  2
Database: election_representative
Question sequence:
Show me the names of all the representatives.
Who have not participated in elections listed here?
SQL query sequence:
SELECT Name FROM representative
SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)
Final question: List the names of representatives that have not participated in elections listed here.
Final SQL: SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)
Database: formula_1
Question sequence:
What are all the races?
Show the name of the one held most recently.
SQL query sequence:
SELECT * FROM races
SELECT name FROM races ORDER BY date DESC LIMIT 1
Final question: What is the name of the race held most recently?
Final SQL: SELECT name FROM races ORDER BY date DESC LIMIT 1
Database: formula_1
Question sequence:
What are all the races?
What is the most recent one?
Only show its name and date.
SQL query sequence:
SELECT * FROM races
SELECT * FROM races ORDER BY date DESC LIMIT 1
SELECT name ,  date FROM races ORDER BY date DESC LIMIT 1
Final question: What is the name and date of the most recent race?
Final SQL: SELECT name ,  date FROM races ORDER BY date DESC LIMIT 1
Database: formula_1
Question sequence:
What are all the races held in 2017?
Only show their names.
SQL query sequence:
SELECT * FROM races WHERE YEAR = 2017
SELECT name FROM races WHERE YEAR = 2017
Final question: Find the names of all races held in 2017.
Final SQL: SELECT name FROM races WHERE YEAR = 2017
Database: formula_1
Question sequence:
What are all races held between 2014 and 2017?
Show the distinct names of them.
SQL query sequence:
SELECT * FROM races WHERE YEAR BETWEEN 2014 AND 2017
SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
Final question: Find the distinct names of all races held between 2014 and 2017?
Final SQL: SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
Database: formula_1
Question sequence:
What are all the drivers?
What about those who once had laptime less than 93000 milliseconds?
Show the distinct forename and surname of them.
SQL query sequence:
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
Final question: List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?
Final SQL: SELECT DISTINCT T1.forename ,  T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
Database: formula_1
Question sequence:
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.
SQL query sequence:
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
Final question: Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?
Final SQL: SELECT DISTINCT T1.driverid ,  T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds >  100000