aherntech/sparc huggingface dataset:
Database: wedding
Question sequence:
Which churches opened between 1830 and 1840?
Show their names and organizers.
SQL query sequence:
SELECT * FROM church WHERE open_date BETWEEN 1830 AND 1840
SELECT organized_by ,  name FROM church WHERE open_date BETWEEN 1830 AND 1840
Final question: Show the organizer and name for churches that opened between 1830 and 1840.
Final SQL: SELECT organized_by ,  name FROM church WHERE open_date BETWEEN 1830 AND 1840
Database: wedding
Question sequence:
What is the opening year of each church?
Show all opening years and the number of churches that opened in that year.
SQL query sequence:
SELECT open_date FROM church
SELECT open_date ,  count(*) FROM church GROUP BY open_date
Final question: Show all opening years and the number of churches that opened in that year.
Final SQL: SELECT open_date ,  count(*) FROM church GROUP BY open_date
Database: wedding
Question sequence:
What is the opening date of each church?
Which churches opened most recently?
Show the name and opening year for three churches that opened most recently.
SQL query sequence:
SELECT open_date FROM church
SELECT * FROM church ORDER BY open_date DESC LIMIT 1
SELECT name ,  open_date FROM church ORDER BY open_date DESC LIMIT 3
Final question: Show the name and opening year for three churches that opened most recently.
Final SQL: SELECT name ,  open_date FROM church ORDER BY open_date DESC LIMIT 3
Database: wedding
Question sequence:
Count the number of people in the record.
How many are female?
How many of them are older than 30?
SQL query sequence:
SELECT count(*) FROM people
SELECT count(*) FROM people WHERE is_male  =  'F'
SELECT count(*) FROM people WHERE is_male  =  'F' AND age  >  30
Final question: How many female people are older than 30 in our record?
Final SQL: SELECT count(*) FROM people WHERE is_male  =  'F' AND age  >  30
Database: wedding
Question sequence:
Show all people whose age is below 25.
What are their countries?
Which of these countries also have people older than 30?
SQL query sequence:
SELECT * FROM people WHERE age  <  25
SELECT country FROM people WHERE age  <  25
SELECT country FROM people WHERE age  <  25 INTERSECT SELECT country FROM people WHERE age  >  30
Final question: Show the country where people older than 30 and younger than 25 are from.
Final SQL: SELECT country FROM people WHERE age  <  25 INTERSECT SELECT country FROM people WHERE age  >  30
Database: wedding
Question sequence:
What is the age of each person?
What is the average age?
What are the minimum, maximum, and average age?
SQL query sequence:
SELECT age FROM people
SELECT min(age) FROM people
SELECT min(age) ,  max(age) ,  avg(age) FROM people
Final question: Show the minimum, maximum, and average age for all people.
Final SQL: SELECT min(age) ,  max(age) ,  avg(age) FROM people
Database: wedding
Question sequence:
What is the average age of people?
Show people whose age is smaller than the average.
What are their names and countries?
SQL query sequence:
SELECT min(age) FROM people
SELECT * FROM people WHERE age  <  (SELECT avg(age) FROM people)
SELECT name ,  country FROM people WHERE age  <  (SELECT avg(age) FROM people)
Final question: Show the name and country for all people whose age is smaller than the average.
Final SQL: SELECT name ,  country FROM people WHERE age  <  (SELECT avg(age) FROM people)
Database: wedding
Question sequence:
Show the information about weddings after year 2014.
Show the male names in all weddings after 2014.
Show the pair of male and female names in all weddings after year 2014.
SQL query sequence:
SELECT * FROM wedding WHERE year  >  2014
SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id  =  T2.people_id  WHERE T1.year  >  2014
SELECT T2.name ,  T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id  =  T2.people_id JOIN people AS T3 ON T1.female_id  =  T3.people_id WHERE T1.year  >  2014
Final question: Show the pair of male and female names in all weddings after year 2014
Final SQL: SELECT T2.name ,  T3.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id  =  T2.people_id JOIN people AS T3 ON T1.female_id  =  T3.people_id WHERE T1.year  >  2014
Database: wedding
Question sequence:
What are the ids of the males who had a wedding?
Show all the male people who have not had a wedding.
What are their names and ages?
SQL query sequence:
SELECT male_id FROM wedding
SELECT * FROM people WHERE is_male  =  'T' AND people_id NOT IN (SELECT male_id FROM wedding)
SELECT name ,  age FROM people WHERE is_male  =  'T' AND people_id NOT IN (SELECT male_id FROM wedding)
Final question: Show the name and age for all male people who don't have a wedding.
Final SQL: SELECT name ,  age FROM people WHERE is_male  =  'T' AND people_id NOT IN (SELECT male_id FROM wedding)
Database: wedding
Question sequence:
Which churches had a wedding in year 2015?
Show all names of the churches except for those.
SQL query sequence:
SELECT * FROM church AS T1 JOIN wedding AS T2 ON T1.church_id  =  T2.church_id WHERE T2.year  =  2015
SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id  =  T2.church_id WHERE T2.year  =  2015
Final question: Show all church names except for those that had a wedding in year 2015.
Final SQL: SELECT name FROM church EXCEPT SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id  =  T2.church_id WHERE T2.year  =  2015
Database: wedding
Question sequence:
How many weddings were hosted in each church?
Show all church names that have hosted least two weddings.
SQL query sequence:
SELECT count(*) FROM church AS T1 JOIN wedding AS T2 ON T1.church_id  =  T2.church_id GROUP BY T1.church_id
SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id  =  T2.church_id GROUP BY T1.church_id HAVING count(*)  >=  2
Final question: Show all church names that have hosted least two weddings.
Final SQL: SELECT T1.name FROM church AS T1 JOIN wedding AS T2 ON T1.church_id  =  T2.church_id GROUP BY T1.church_id HAVING count(*)  >=  2
Database: wedding
Question sequence:
Show all female people from Canada.
Show those that had a wedding in year 2016.
What are their names?
SQL query sequence:
SELECT * FROM people WHERE is_male  =  'F' AND country  =  'Canada'
SELECT * FROM wedding AS T1 JOIN people AS T2 ON T1.female_id  =  T2.people_id WHERE T1.year  =  2016 AND T2.is_male  =  'F' AND T2.country  =  'Canada'
SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id  =  T2.people_id WHERE T1.year  =  2016 AND T2.is_male  =  'F' AND T2.country  =  'Canada'
Final question: Show the names for all females from Canada having a wedding in year 2016.
Final SQL: SELECT T2.name FROM wedding AS T1 JOIN people AS T2 ON T1.female_id  =  T2.people_id WHERE T1.year  =  2016 AND T2.is_male  =  'F' AND T2.country  =  'Canada'
Database: wedding
Question sequence:
How many weddings are there in total?
What about in the year 2016?
SQL query sequence:
SELECT count(*) FROM wedding
SELECT count(*) FROM wedding WHERE YEAR  =  2016
Final question: How many weddings are there in year 2016?
Final SQL: SELECT count(*) FROM wedding WHERE YEAR  =  2016
Database: wedding
Question sequence:
Show all people older than 30.
Show all the weddings of people older than 30.
Show the church names for the weddings of all people older than 30.
SQL query sequence:
SELECT * FROM people WHERE age  >  30
SELECT * FROM wedding AS T1 JOIN people AS T2 ON T1.male_id  =  T2.people_id JOIN people AS T3 ON T1.female_id  =  T3.people_id WHERE T2.age  >  30 OR T3.age  >  30
SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id  =  T2.people_id JOIN people AS T3 ON T1.female_id  =  T3.people_id JOIN church AS T4 ON T4.church_id  =  T1.church_id WHERE T2.age  >  30 OR T3.age  >  30
Final question: Show the church names for the weddings of all people older than 30.
Final SQL: SELECT T4.name FROM wedding AS T1 JOIN people AS T2 ON T1.male_id  =  T2.people_id JOIN people AS T3 ON T1.female_id  =  T3.people_id JOIN church AS T4 ON T4.church_id  =  T1.church_id WHERE T2.age  >  30 OR T3.age  >  30
Database: wedding
Question sequence:
Show the country of each person.
Count the number of people from each country.
Also show the country name.
SQL query sequence:
SELECT country FROM people
SELECT count(*) FROM people GROUP BY country
SELECT country ,  count(*) FROM people GROUP BY country
Final question: Show all countries and the number of people from each country.
Final SQL: SELECT country ,  count(*) FROM people GROUP BY country
Database: debate
Question sequence:
How many people are there?
How many people aged 40?
How many people aged either 35 or 36?
Please show their names.
SQL query sequence:
SELECT COUNT(*) FROM people
SELECT COUNT(*) FROM  people WHERE Age  =  40
SELECT COUNT(*) FROM  people WHERE Age  =  35 OR Age  =  36
SELECT Name FROM  people WHERE Age  =  35 OR Age  =  36
Final question: Show the names of people aged either 35 or 36.
Final SQL: SELECT Name FROM  people WHERE Age  =  35 OR Age  =  36
Database: debate
Question sequence:
Who is the oldest person?
Who is the youngest person?
What is his party?
SQL query sequence:
SELECT name FROM people ORDER BY Age DESC LIMIT 1
SELECT name FROM people ORDER BY Age ASC LIMIT 1
SELECT Party FROM people ORDER BY Age ASC LIMIT 1
Final question: What is the party of the youngest people?
Final SQL: SELECT Party FROM people ORDER BY Age ASC LIMIT 1
Database: debate
Question sequence:
How many parties are there?
How many people are there in each party?
Which party has the most people?
SQL query sequence:
SELECT COUNT(DISTINCT Party) FROM people
SELECT Party, COUNT(*) FROM people GROUP BY Party
SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
Final question: Show the party that has the most people.
Final SQL: SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
Database: debate
Question sequence:
How many people have been on the negative side?
How about the affirmative side?
Please give their full names.
Please also show the dates and venues of debates.
SQL query sequence:
SELECT COUNT(*) FROM debate_people AS T1  JOIN people AS T2 ON T1.Negative  =  T2.People_ID
SELECT COUNT(*) FROM debate_people AS T1  JOIN people AS T2 ON T1.Affirmative  =  T2.People_ID
SELECT T2.Name FROM debate_people AS T1  JOIN people AS T2 ON T1.Affirmative  =  T2.People_ID
SELECT T3.Name ,  T2.Date ,  T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID  =  T2.Debate_ID JOIN people AS T3 ON T1.Affirmative  =  T3.People_ID
Final question: Show the names of people, and dates and venues of debates they are on the affirmative side.
Final SQL: SELECT T3.Name ,  T2.Date ,  T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID  =  T2.Debate_ID JOIN people AS T3 ON T1.Affirmative  =  T3.People_ID
Database: debate
Question sequence:
Show the names of people that won the debate on the nagative side.
Please list the names of people who have been on the negative side.
Please also show the dates and venues of debates
Could you please order the results in ascending alphabetical order of name?
SQL query sequence:
SELECT T2.Name FROM debate_people AS T1  JOIN people AS T2 ON T1.Negative  =  T2.People_ID WHERE If_Affirmative_Win = "F"
SELECT T2.Name FROM debate_people AS T1  JOIN people AS T2 ON T1.Negative  =  T2.People_ID
SELECT T3.Name ,  T2.Date ,  T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID  =  T2.Debate_ID JOIN people AS T3 ON T1.Negative  =  T3.People_ID
SELECT T3.Name ,  T2.Date ,  T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID  =  T2.Debate_ID JOIN people AS T3 ON T1.Negative  =  T3.People_ID ORDER BY T3.Name ASC
Final question: Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name.
Final SQL: SELECT T3.Name ,  T2.Date ,  T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID  =  T2.Debate_ID JOIN people AS T3 ON T1.Negative  =  T3.People_ID ORDER BY T3.Name ASC
Database: debate
Question sequence:
How many people have ever been on the affirmative side of debates?
What is the average size of the audience in a debate?
How many debates have an audience size bigger than 200?
Show the names of people that are on the affirmative side of these debates.
SQL query sequence:
SELECT COUNT(*) FROM people WHERE People_id IN (SELECT Affirmative FROM debate_people)
SELECT AVG(Num_of_Audience) FROM debate
SELECT COUNT(*) FROM debate WHERE Num_of_Audience > 200
SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID  =  T2.Debate_ID JOIN people AS T3 ON T1.Affirmative  =  T3.People_ID WHERE T2.Num_of_Audience  >  200
Final question: Show the names of people that are on affirmative side of debates with number of audience bigger than 200.
Final SQL: SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID  =  T2.Debate_ID JOIN people AS T3 ON T1.Affirmative  =  T3.People_ID WHERE T2.Num_of_Audience  >  200
Database: debate
Question sequence:
How many people have ever been on the affirmative side of debates?
Please show their names.
Please also show the number of times they have been on the affirmative side of debates.
SQL query sequence:
SELECT COUNT(*) FROM people WHERE People_id IN (SELECT Affirmative FROM debate_people)
SELECT name FROM people WHERE People_id IN (SELECT Affirmative FROM debate_people)
SELECT T2.Name ,  COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative  =  T2.People_ID GROUP BY T2.Name
Final question: Show the names of people and the number of times they have been on the affirmative side of debates.
Final SQL: SELECT T2.Name ,  COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative  =  T2.People_ID GROUP BY T2.Name
Database: debate
Question sequence:
How many people have ever been on the negative side of debates?
How many times have they been on the negative side of debates?
How many of them have been on the negative side of debates at least twice?
Show their names.
SQL query sequence:
SELECT COUNT(DISTINCT T2.People_ID) FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative  =  T2.People_ID
SELECT T2.Name, COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative  =  T2.People_ID GROUP BY T2.Name
SELECT COUNT(DISTINCT T2.Name) FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative  =  T2.People_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2
SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative  =  T2.People_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2
Final question: Show the names of people who have been on the negative side of debates at least twice.
Final SQL: SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative  =  T2.People_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2
Database: flight_company
Question sequence:
Show me all the companies.
Which of these companies operate flights?
Which companies operated flights with velocity less than 200?
What are the distinct types of these companies?
SQL query sequence:
SELECT name FROM operate_company
SELECT DISTINCT name FROM operate_company AS t1 JOIN flight AS t2 ON t1.id = t2.company_id
SELECT DISTINCT name FROM operate_company AS t1 JOIN flight AS t2 ON t1.id = t2.company_id WHERE t2.velocity < 200
SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T2.velocity  <  200
Final question: What are the distinct types of the companies that have operated any flights with velocity less than 200?
Final SQL: SELECT DISTINCT T1.type FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T2.velocity  <  200
Database: flight_company
Question sequence:
List the names of all the companies.
How many flights did each of these companies operate?
Show me only the companies that operated more than one flight.
Show me only the ids and the names of these companies.
SQL query sequence:
SELECT name FROM operate_company
SELECT t1.name, count(*) FROM operate_company AS t1 JOIN flight AS t2 ON t1.id = t2.company_id GROUP BY t1.id
SELECT t1.name, count(*) FROM operate_company AS t1 JOIN flight AS t2 ON t1.id = t2.company_id GROUP BY t1.id HAVING count(*) > 1
SELECT T1.id ,  T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id GROUP BY T1.id HAVING count(*)  >  1
Final question: What are the ids and names of the companies that operated more than one flight?
Final SQL: SELECT T1.id ,  T1.name FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id GROUP BY T1.id HAVING count(*)  >  1
Database: flight_company
Question sequence:
Show me the names of all the airports
What are the number of flights for each of these airports?
Which airport had the most number of flights?
Show me the id and IATA code of this airport as well.
SQL query sequence:
SELECT name FROM airport
SELECT name, count(*) FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id  GROUP BY t1.id
SELECT t1.name FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id  GROUP BY t1.id ORDER BY count(*) DESC LIMIT 1
SELECT T1.id, T1.name, T1.IATA FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id  GROUP BY t1.id ORDER BY count(*) DESC LIMIT 1
Final question: What is the id, name and IATA code of the airport that had most number of flights?
Final SQL: SELECT T1.id, T1.name, T1.IATA FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id  GROUP BY t1.id ORDER BY count(*) DESC LIMIT 1
Database: flight_company
Question sequence:
Show me the names of all the pilots.
Which of these pilots piloted a flight in the United States?
What about the pilots who did it at 'Billund Airport'?
Which pilots did either one of those?
SQL query sequence:
SELECT DISTINCT pilot FROM flight
SELECT DISTINCT t2.pilot FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id  WHERE t1.Country = "United States"
SELECT DISTINCT t2.pilot FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id  WHERE t1.name = "Billund Airport"
SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id  =  T2.airport_id WHERE T1.country  =  'United States' OR T1.name  =  'Billund Airport'
Final question: What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'?
Final SQL: SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id  =  T2.airport_id WHERE T1.country  =  'United States' OR T1.name  =  'Billund Airport'
Database: flight_company
Question sequence:
Show me all the company names.
What are the types of these companies?
How many companies have type 'Joint Venture'?
Tell me the most common company type.
SQL query sequence:
SELECT name FROM operate_company
SELECT name, type FROM operate_company
SELECT count(*) FROM operate_company GROUP BY type HAVING type = 'Joint Venture'
SELECT TYPE ,  count(*) FROM operate_company GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
Final question: What is the most common company type, and how many are there?
Final SQL: SELECT TYPE ,  count(*) FROM operate_company GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1
Database: flight_company
Question sequence:
List the names of all the pilots.
Which companies did Thompson fly for?
List all the airports where he drove an aircraft.
What is the total number of airports where he has not driven an aircraft?
SQL query sequence:
SELECT DISTINCT pilot FROM flight
SELECT DISTINCT t2.name FROM flight as t1 join operate_company AS t2 ON t1.company_id = t2.id AND t1.pilot  =  'Thompson'
SELECT DISTINCT t2.name FROM flight as t1 join airport AS t2 ON t1.airport_id = t2.id AND t1.pilot  =  'Thompson'
SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot  =  'Thompson' );
Final question: How many airports haven't the pilot 'Thompson' driven an aircraft?
Final SQL: SELECT count(*) FROM airport WHERE id NOT IN ( SELECT airport_id FROM flight WHERE pilot  =  'Thompson' );
Database: flight_company
Question sequence:
Show me the names of all the pilots
Which of these pilots flied for a company that runs 'Cargo' activities?
Which pilots flied for a company that runs 'Catering services' activities?
Which pilots flied for companies that ran both of those activities?
SQL query sequence:
SELECT pilot FROM flight
SELECT * FROM flight as t1 join operate_company AS t2 ON t1.company_id = t2.id WHERE principal_activities = 'Cargo'
SELECT * FROM flight as t1 join operate_company AS t2 ON t1.company_id = t2.id WHERE principal_activities = 'Catering services'
SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T1.principal_activities  =  'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T1.principal_activities  =  'Catering services'
Final question: List the name of the pilots who have flied for both a company that mainly provide 'Cargo' services and a company that runs 'Catering services' activities.
Final SQL: SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T1.principal_activities  =  'Cargo' INTERSECT SELECT T2.pilot FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id WHERE T1.principal_activities  =  'Catering services'
Database: flight_company
Question sequence:
Show me all the airports.
Show me the names of all airports.
Which of these airports start with the word 'international'?
What about the ones that contains the word "international"?
SQL query sequence:
SELECT * FROM airport
SELECT name FROM airport
SELECT name FROM airport WHERE name LIKE "international%"
SELECT name FROM airport WHERE name LIKE '%international%'
Final question: Which of the airport names contains the word 'international'?
Final SQL: SELECT name FROM airport WHERE name LIKE '%international%'
Database: flight_company
Question sequence:
Tell me about all the airports.
Tell me the names of these airports.
How many companies operate in "Akureyi airport"?
What about for each airport?
SQL query sequence:
SELECT * FROM airport
SELECT name FROM airport
SELECT count(t2.company_id) FROM airport as t1 JOIN flight AS t2 ON t1.id = t2.airport_id GROUP BY t1.id HAVING t1.name = "Akureyri Airport"
SELECT T3.id ,  count(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id JOIN airport AS T3 ON T2.airport_id  =  T3.id GROUP BY T3.id
Final question: How many companies operates airlines in each airport?
Final SQL: SELECT T3.id ,  count(*) FROM operate_company AS T1 JOIN flight AS t2 ON T1.id  =  T2.company_id JOIN airport AS T3 ON T2.airport_id  =  T3.id GROUP BY T3.id
Database: flight_company
Question sequence:
Show me everything about the airports.
What are the countries with these airports?
Which of these countries have more than 1 airport?
Which of them have more than 2?
SQL query sequence:
SELECT * FROM airport
SELECT distinct country FROM airport
SELECT country FROM airport GROUP BY country HAVING count(*) > 1
SELECT country FROM airport GROUP BY country HAVING count(*)  >  2
Final question: which countries have more than 2 airports?
Final SQL: SELECT country FROM airport GROUP BY country HAVING count(*)  >  2
Database: election
Question sequence:
What is all the information about the counties?
How many are there?
SQL query sequence:
SELECT * FROM county
SELECT count(*) FROM county
Final question: How many counties are there in total?
Final SQL: SELECT count(*) FROM county
Database: election
Question sequence:
Show me all the information about counties.
I want to now the names of these counties.
I also want to know their population.
SQL query sequence:
SELECT * FROM county
SELECT County_name FROM county
SELECT Population FROM county
Final question: Show the county name and population of all counties.
Final SQL: SELECT County_name ,  Population FROM county
Database: election
Question sequence:
Show me all the information about counties.
I also want to know their population.
Tell me the average number.
SQL query sequence:
SELECT * FROM county
SELECT Population FROM county
SELECT avg(Population) FROM county
Final question: Show the average population of all counties.
Final SQL: SELECT avg(Population) FROM county