aherntech/sparc huggingface dataset:
Database: car_1
Question sequence:
Show the years and weight of all the cars!
Show distinct years that the cars that weigh more than 3000 were produced!
How about the different years for those that weight less than 4000.
What are the distinct years, for the cars that are both?
SQL query sequence:
SELECT Year, weight FROM CARS_DATA;
SELECT DISTINCT Year FROM CARS_DATA AS T1 WHERE Weight  >  3000;
SELECT DISTINCT Year FROM CARS_DATA AS T1 WHERE Weight  <  4000;
SELECT DISTINCT Year FROM CARS_DATA WHERE Weight  >  3000 AND Weight  <  4000;
Final question: In which years cars were produced weighing no less than 3000 and no more than 4000?
Final SQL: SELECT DISTINCT T1.Year FROM CARS_DATA AS T1 WHERE T1.Weight  >  3000 AND T1.weight  <  4000;
Database: car_1
Question sequence:
What is the lowest accelerate for any car?
How about the highest?
What is the ID, Make and Model of this car?
Show just its horsepower.
SQL query sequence:
SELECT accelerate FROM CARS_DATA ORDER BY accelerate ASC LIMIT 1;
SELECT accelerate FROM CARS_DATA ORDER BY accelerate DESC LIMIT 1;
SELECT T1.ID, T2.Make, T2.Model FROM CARS_DATA as T1 JOIN CAR_NAMES as T2 ON T1.ID = T2.MakeID ORDER BY T1.accelerate DESC LIMIT 1;
SELECT horsepower FROM CARS_DATA ORDER BY accelerate DESC LIMIT 1;
Final question: What is the horsepower of the car with the largest accelerate?
Final SQL: SELECT T1.horsepower FROM CARS_DATA AS T1 ORDER BY T1.accelerate DESC LIMIT 1;
Database: car_1
Question sequence:
Show all the car information for any car of the model volvo!
What is the car with the least accelerate?
What is its horsepower?
What about its number of cylinders?
SQL query sequence:
SELECT * FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T2.Model  =  'volvo';
SELECT * FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T2.Model  =  'volvo' ORDER BY T1.accelerate ASC LIMIT 1;
SELECT T1.horsepower FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T2.Model  =  'volvo' ORDER BY T1.accelerate ASC LIMIT 1;
SELECT T1.cylinders FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T2.Model  =  'volvo' ORDER BY T1.accelerate ASC LIMIT 1;
Final question: For model volvo, how many cylinders does the car with the least accelerate have?
Final SQL: SELECT T1.cylinders FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T2.Model  =  'volvo' ORDER BY T1.accelerate ASC LIMIT 1;
Database: car_1
Question sequence:
What is largest horsepower of all cars?
What is the accelerate of the car with this horsepower?
What are the car ids of the cars with a greater accelerate than this?
How many are there?
SQL query sequence:
SELECT horsepower FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1
SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1
SELECT id FROM CARS_DATA WHERE Accelerate  >  ( SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1 );
SELECT COUNT(*) FROM CARS_DATA WHERE Accelerate  >  ( SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1 );
Final question: How many cars have a larger accelerate than the car with the largest horsepower?
Final SQL: SELECT COUNT(*) FROM CARS_DATA WHERE Accelerate  >  ( SELECT Accelerate FROM CARS_DATA ORDER BY Horsepower DESC LIMIT 1 );
Database: car_1
Question sequence:
What are the names of the countries that have no car makers?
Show me all the names of all the different countries outside of those!
How many of these have more than 1 car maker?
How about more than 2?
SQL query sequence:
SELECT CountryName FROM COUNTRIES where CountryId not in (SELECT T1.CountryId FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country);
SELECT distinct T1.CountryName FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country;
SELECT COUNT(*) FROM ( SELECT T1.CountryId ,  COUNT(*) FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country GROUP BY T1.CountryId HAVING count(*)  >  1 );
SELECT COUNT(*) FROM ( SELECT T1.CountryId ,  COUNT(*) FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country GROUP BY T1.CountryId HAVING count(*)  >  2 );
Final question: How many countries has more than 2 car makers?
Final SQL: SELECT COUNT(*) FROM ( SELECT T1.CountryId ,  COUNT(*) FROM COUNTRIES AS T1 JOIN CAR_MAKERS AS T2 ON T1.CountryId  =  T2.Country GROUP BY T1.CountryId HAVING count(*)  >  2 );
Database: car_1
Question sequence:
Show all models and horsepowers of all cars!
Now show just the ones with 4 cylinders.
What is the model of that with the lowest horsepower?
How about the greatest horsepower?
SQL query sequence:
SELECT T1.Model, T2.horsepower FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id;
SELECT T1.Model, T2.horsepower FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T2.Cylinders  =  4;
SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T2.Cylinders  =  4 ORDER BY T2.horsepower ASC LIMIT 1;
SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T2.Cylinders  =  4 ORDER BY T2.horsepower DESC LIMIT 1;
Final question: For the cars with 4 cylinders, which model has the largest horsepower?
Final SQL: SELECT T1.Model FROM CAR_NAMES AS T1 JOIN CARS_DATA AS T2 ON T1.MakeId  =  T2.Id WHERE T2.Cylinders  =  4 ORDER BY T2.horsepower DESC LIMIT 1;
Database: car_1
Question sequence:
What is the lowest horsepower of all cars?
Show all the ids and makes of those with a horsepower greater than this!
Which ones have 5 cylinders or less?
How about 3 or less?
SQL query sequence:
SELECT min(Horsepower) FROM CARS_DATA;
SELECT T2.MakeId ,  T2.Make FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T1.Horsepower  >  (SELECT min(Horsepower) FROM CARS_DATA);
SELECT T2.MakeId ,  T2.Make FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T1.Horsepower  >  (SELECT min(Horsepower) FROM CARS_DATA) AND T1.Cylinders  <= 5;
SELECT T2.MakeId ,  T2.Make FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T1.Horsepower  >  (SELECT min(Horsepower) FROM CARS_DATA) AND T1.Cylinders  <= 3;
Final question: Among the cars with more than lowest horsepower, which ones do not have more than 3 cylinders? List the car makeid and make name.
Final SQL: SELECT T2.MakeId ,  T2.Make FROM CARS_DATA AS T1 JOIN CAR_NAMES AS T2 ON T1.Id  =  T2.MakeId WHERE T1.Horsepower  >  (SELECT min(Horsepower) FROM CARS_DATA) AND T1.Cylinders  <=  3;
Database: car_1
Question sequence:
Show me the mpg, horsepower and accelerate for all the cars that were produced before 1980!
Also include the cars that have 8 cylinders!
What is the max horsepower for this group?
how about the max mpg?
SQL query sequence:
SELECT mpg, horsepower, accelerate FROM CARS_DATA WHERE YEAR  <  1980;
SELECT mpg, horsepower, accelerate FROM CARS_DATA WHERE Cylinders  =  8 OR YEAR  <  1980;
SELECT accelerate FROM CARS_DATA WHERE Cylinders  =  8 OR YEAR  <  1980 ORDER BY accelerate DESC LIMIT 1;
SELECT mpg FROM CARS_DATA WHERE Cylinders  =  8 OR YEAR  <  1980 ORDER BY mpg DESC LIMIT 1;
Final question: What is the maximum miles per gallon of the car with 8 cylinders or produced before 1980?
Final SQL: SELECT mpg FROM CARS_DATA WHERE Cylinders  =  8 OR YEAR  <  1980 ORDER BY mpg DESC LIMIT 1;
Database: car_1
Question sequence:
Show all the models that were built by the Ford Motor Company.
What are all the models except those!
Also provide the weights for all different makes for each of these models.
List all the different models from these that have makes that are lighter than 3500!
SQL query sequence:
SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker  =  T2.Id where T2.FullName = 'Ford Motor Company';
SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_MAKERS AS T2 ON T1.Maker  =  T2.Id where T2.FullName != 'Ford Motor Company';
SELECT T1.model, T2.Make, T3.weight FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.Model  =  T2.Model JOIN CARS_DATA AS T3 ON T2.MakeId  =  T3.Id JOIN CAR_MAKERS AS T4 ON T1.Maker  =  T4.Id WHERE T3.weight  <  3500 AND T4.FullName != 'Ford Motor Company'
SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.Model  =  T2.Model JOIN CARS_DATA AS T3 ON T2.MakeId  =  T3.Id JOIN CAR_MAKERS AS T4 ON T1.Maker  =  T4.Id WHERE T3.weight  <  3500 AND T4.FullName != 'Ford Motor Company';
Final question: Which models are lighter than 3500 but not built by the 'Ford Motor Company'?
Final SQL: SELECT DISTINCT T1.model FROM MODEL_LIST AS T1 JOIN CAR_NAMES AS T2 ON T1.Model  =  T2.Model JOIN CARS_DATA AS T3 ON T2.MakeId  =  T3.Id JOIN CAR_MAKERS AS T4 ON T1.Maker  =  T4.Id WHERE T3.weight  <  3500 AND T4.FullName != 'Ford Motor Company';
Database: car_1
Question sequence:
What are all the names of countries?
Which ones have at least one car maker?
Show me all of car names other than these!
SQL query sequence:
SELECT CountryName FROM countries;
SELECT distinct T1.CountryName FROM countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.countryId  =  T2.Country;
SELECT CountryName FROM countries EXCEPT SELECT T1.CountryName FROM countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.countryId  =  T2.Country;
Final question: What are the name of the countries where there is not a single car maker?
Final SQL: SELECT CountryName FROM countries EXCEPT SELECT T1.CountryName FROM countries AS T1 JOIN CAR_MAKERS AS T2 ON T1.countryId  =  T2.Country;
Database: car_1
Question sequence:
Show all the car maker id, names, the models and makes they produce!
How many model does each car maker produce? List the id and maker!
Show me those that produce at least 2!
For each of these, only show those that have more than 3 car makes!
SQL query sequence:
SELECT T1.Id ,  T1.Maker, T2.Model FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker;
SELECT T1.Id ,  T1.Maker, count(*) FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker GROUP BY T1.Id;
SELECT T1.Id ,  T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker GROUP BY T1.Id HAVING count(*)  >=  2;
SELECT T1.Id ,  T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker GROUP BY T1.Id HAVING count(*)  >=  2 INTERSECT SELECT T1.Id ,  T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker JOIN CAR_NAMES AS T3 ON T2.model  =  T3.model GROUP BY T1.Id HAVING count(*)  >  3;
Final question: Which are the car makers which produce at least 2 models and more than 3 car makes? List the id and the maker.
Final SQL: SELECT T1.Id ,  T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker GROUP BY T1.Id HAVING count(*)  >=  2 INTERSECT SELECT T1.Id ,  T1.Maker FROM CAR_MAKERS AS T1 JOIN MODEL_LIST AS T2 ON T1.Id  =  T2.Maker JOIN CAR_NAMES AS T3 ON T2.model  =  T3.model GROUP BY T1.Id HAVING count(*)  >  3;
Database: wta_1
Question sequence:
How many matches are there?
What was the maximum length in minutes for the matches?
Average?
How about for the age of losers and winners?
SQL query sequence:
SELECT count(*) FROM matches
SELECT max(minutes) FROM matches
SELECT avg(minutes) FROM matches
SELECT avg(loser_age) ,  avg(winner_age) FROM matches
Final question: Find the average age of losers and winners of all matches.
Final SQL: SELECT avg(loser_age) ,  avg(winner_age) FROM matches
Database: wta_1
Question sequence:
How many distinct tourney names are there?
Which ones have more than 20 matches?
More than 10?
SQL query sequence:
SELECT count(DISTINCT tourney_name) FROM matches
SELECT tourney_name FROM matches GROUP BY tourney_name HAVING count(*)  >  20
SELECT tourney_name FROM matches GROUP BY tourney_name HAVING count(*)  >  10
Final question: Find the name of tourney that has more than 10 matches.
Final SQL: SELECT tourney_name FROM matches GROUP BY tourney_name HAVING count(*)  >  10
Database: wta_1
Question sequence:
How many distinct winners played in 2013?
Of those, how many also played in 2016.
What are their names?
SQL query sequence:
SELECT count(DISTINCT winner_name) FROM matches WHERE year = 2013
SELECT count(*) FROM (SELECT winner_name FROM matches WHERE YEAR  =  2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR  =  2016)
SELECT winner_name FROM matches WHERE YEAR  =  2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR  =  2016
Final question: List the names of all winners who played in both 2013 and 2016.
Final SQL: SELECT winner_name FROM matches WHERE YEAR  =  2013 INTERSECT SELECT winner_name FROM matches WHERE YEAR  =  2016
Database: wta_1
Question sequence:
How many matches were played?
How many where the loser hand is L?
How many played in year 2013 or 2016?
SQL query sequence:
SELECT count(*) FROM matches
SELECT count(*) FROM matches WHERE loser_hand = "L"
SELECT count(*) FROM matches WHERE YEAR  =  2013 OR YEAR  =  2016
Final question: List the number of all matches who played in years of 2013 or 2016.
Final SQL: SELECT count(*) FROM matches WHERE YEAR  =  2013 OR YEAR  =  2016
Database: wta_1
Question sequence:
How many players are there?
Which ones won in the tourney WTA Championships? Give their last name and birth date.
Give first name and country code instead.
Which ones also won in the Australian Open?
SQL query sequence:
SELECT count(*) FROM players
SELECT T1.last_name, T1.birth_date FROM players AS T1 JOIN matches AS T2 ON T1.player_id = T2.winner_id WHERE T2.tourney_name = 'WTA Championships'
SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'WTA Championships'
SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'WTA Championships' INTERSECT SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'Australian Open'
Final question: What are the country code and first name of the players who won in both tourney WTA Championships and Australian Open?
Final SQL: SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'WTA Championships' INTERSECT SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN matches AS T2 ON T1.player_id  =  T2.winner_id WHERE T2.tourney_name  =  'Australian Open'
Database: wta_1
Question sequence:
What is the birth date of the oldest player?
Give the player id and last name instead.
Give the first name and country code instead.
SQL query sequence:
SELECT birth_date FROM players ORDER BY birth_date DESC LIMIT 1
SELECT player_id ,  last_name FROM players ORDER BY birth_date LIMIT 1
SELECT first_name ,  country_code FROM players ORDER BY birth_date LIMIT 1
Final question: Find the first name and country code of the oldest player.
Final SQL: SELECT first_name ,  country_code FROM players ORDER BY birth_date LIMIT 1
Database: wta_1
Question sequence:
How many players have right / R hand?
Left / L hand?
Give their country code and birth date.
Order by their birth date, and give the first and last name instead.
SQL query sequence:
SELECT count(*) FROM players WHERE hand = 'R'
SELECT count(*) FROM players WHERE hand = 'L'
SELECT country_code ,  birth_date FROM players WHERE hand  =  'L'
SELECT first_name ,  last_name FROM players WHERE hand  =  'L' ORDER BY birth_date
Final question: List the first and last name of all players who are left / L hand in the order of birth date.
Final SQL: SELECT first_name ,  last_name FROM players WHERE hand  =  'L' ORDER BY birth_date
Database: wta_1
Question sequence:
How many players are there?
How many tours did the player who did the least number of tours do?
Most number of tours?
Give the first name and country code instead.
SQL query sequence:
SELECT count(*) FROM players
SELECT T2.tours FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id ORDER BY T2.tours ASC LIMIT 1
SELECT T2.tours FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id ORDER BY T2.tours DESC LIMIT 1
SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id ORDER BY T2.tours DESC LIMIT 1
Final question: Find the first name and country code of the player who did the most number of tours.
Final SQL: SELECT T1.country_code ,  T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id ORDER BY T2.tours DESC LIMIT 1
Database: wta_1
Question sequence:
How many matches are there?
Find the surface that has the most number.
What about the year?
SQL query sequence:
SELECT count(*) FROM matches
SELECT surface FROM matches GROUP BY surface ORDER  BY count(*) DESC LIMIT 1
SELECT YEAR FROM matches GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
Final question: Find the year that has the most number of matches.
Final SQL: SELECT YEAR FROM matches GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
Database: wta_1
Question sequence:
Find the name of the loser who lost the most times.
Give the rank points as well.
Give the same, but for the winner who won the most times.
SQL query sequence:
SELECT loser_name FROM matches GROUP BY loser_name ORDER BY count(*) DESC LIMIT 1
SELECT loser_name, loser_rank_points FROM matches GROUP BY loser_name ORDER BY count(*) DESC LIMIT 1
SELECT winner_name ,  winner_rank_points FROM matches GROUP BY winner_name ORDER BY count(*) DESC LIMIT 1
Final question: Find the name and rank points of the winner who won the most times.
Final SQL: SELECT winner_name ,  winner_rank_points FROM matches GROUP BY winner_name ORDER BY count(*) DESC LIMIT 1
Database: wta_1
Question sequence:
Give the name of the loser who has the highest rank points.
Do the same but for the Australian Open tourney.
Give the winner name instead.
SQL query sequence:
SELECT loser_name FROM matches ORDER BY loser_rank_points DESC LIMIT 1
SELECT loser_name FROM matches WHERE tourney_name = 'Australian Open' ORDER BY loser_rank_points DESC LIMIT 1
SELECT winner_name FROM matches WHERE tourney_name  =  'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1
Final question: Find the name of the winner who has the highest rank points and participated in the Australian Open tourney.
Final SQL: SELECT winner_name FROM matches WHERE tourney_name  =  'Australian Open' ORDER BY winner_rank_points DESC LIMIT 1
Database: wta_1
Question sequence:
Give the length of the match in minutes of the shortest match.
Longest match?
Give the winner and loser name instead.
SQL query sequence:
SELECT minutes FROM matches ORDER BY minutes ASC LIMIT 1
SELECT minutes FROM matches ORDER BY minutes DESC LIMIT 1
SELECT winner_name ,  loser_name FROM matches ORDER BY minutes DESC LIMIT 1
Final question: find the names of loser and winner who played in the match with greatest number of minutes.
Final SQL: SELECT winner_name ,  loser_name FROM matches ORDER BY minutes DESC LIMIT 1
Database: wta_1
Question sequence:
Find the birth dates of each of the players.
Find tours and first name instead.
Give the average ranking instead of the tours.
SQL query sequence:
SELECT birth_date FROM players
SELECT T2.tours, T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id GROUP BY T1.first_name
SELECT avg(ranking) ,  T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id GROUP BY T1.first_name
Final question: Find the average ranking for each player and their first name.
Final SQL: SELECT avg(ranking) ,  T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id GROUP BY T1.first_name
Database: wta_1
Question sequence:
Give the number of tours for each player.
Give the average rank points and first name.
Find the total ranking points instead.
SQL query sequence:
SELECT tours FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id GROUP BY T1.first_name
SELECT avg(ranking) ,  T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id GROUP BY T1.first_name
SELECT sum(ranking_points) ,  T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id GROUP BY T1.first_name
Final question: Find the total ranking points for each player and their first name.
Final SQL: SELECT sum(ranking_points) ,  T1.first_name FROM players AS T1 JOIN rankings AS T2 ON T1.player_id  =  T2.player_id GROUP BY T1.first_name
Database: wta_1
Question sequence:
Find the number of players for each country.
Which country has the least number of players? Give the country code.
Greatest number?
SQL query sequence:
SELECT count(*) FROM players GROUP BY country_code
SELECT country_code FROM players GROUP BY country_code ORDER BY count(*) ASC LIMIT 1
SELECT country_code FROM players GROUP BY country_code ORDER BY count(*) DESC LIMIT 1
Final question: find the code of the country where has the greatest number of players.
Final SQL: SELECT country_code FROM players GROUP BY country_code ORDER BY count(*) DESC LIMIT 1
Database: wta_1
Question sequence:
What is the number of players for each hand type? Give the hand type as well.
For each country?
Give the ones that have more than 50 players.
Give the country code only.
SQL query sequence:
SELECT count(*), hand FROM players GROUP BY hand
SELECT count(*), country_code FROM players GROUP BY country_code
SELECT count(*), country_code FROM players GROUP BY country_code HAVING count(*) > 50
SELECT country_code FROM players GROUP BY country_code HAVING count(*)  >  50
Final question: Find the codes of countries that have more than 50 players.
Final SQL: SELECT country_code FROM players GROUP BY country_code HAVING count(*)  >  50
Database: wta_1
Question sequence:
Give the name of the 3 oldest losers across all matches.
How about the 3 oldest winners.
Youngest? Give the rank as well.
SQL query sequence:
SELECT DISTINCT loser_name FROM matches ORDER BY loser_age DESC LIMIT 3
SELECT DISTINCT winner_name FROM matches ORDER BY winner_age DESC LIMIT 3
SELECT DISTINCT winner_name ,  winner_rank FROM matches ORDER BY winner_age LIMIT 3
Final question: Find the name and rank of the 3 youngest winners across all matches.
Final SQL: SELECT DISTINCT winner_name ,  winner_rank FROM matches ORDER BY winner_age LIMIT 3
Database: wta_1
Question sequence:
How  many different losers participated in the Australian Open?
Winners?
How about in the WTA Championships, and were also left handed?
SQL query sequence:
SELECT count(DISTINCT loser_name) FROM matches WHERE tourney_name  =  'Australian Open'
SELECT count(DISTINCT winner_name) FROM matches WHERE tourney_name  =  'Australian Open'
SELECT count(DISTINCT winner_name) FROM matches WHERE tourney_name  =  'WTA Championships' AND winner_hand  =  'L'
Final question: How many different winners both participated in the WTA Championships and were left handed?
Final SQL: SELECT count(DISTINCT winner_name) FROM matches WHERE tourney_name  =  'WTA Championships' AND winner_hand  =  'L'
Database: orchestra
Question sequence:
List all conductor information.
How many conductors are there?
SQL query sequence:
SELECT * FROM conductor
SELECT count(*) FROM conductor
Final question: How many conductors are there?
Final SQL: SELECT count(*) FROM conductor
Database: orchestra
Question sequence:
What are the names of the conductors?
What are the ages of the conductors?
List the names of conductors in ascending order of age.
SQL query sequence:
SELECT Name FROM conductor
SELECT Age FROM conductor
SELECT Name FROM conductor ORDER BY Age ASC
Final question: List the names of conductors in ascending order of age.
Final SQL: SELECT Name FROM conductor ORDER BY Age ASC
Database: orchestra
Question sequence:
List the names of conductors
Among these conductors, which of them are not from the USA?
SQL query sequence:
SELECT Name FROM conductor
SELECT Name FROM conductor WHERE Nationality != 'USA'
Final question: What are the names of conductors whose nationalities are not "USA"?
Final SQL: SELECT Name FROM conductor WHERE Nationality != 'USA'