aherntech/sparc huggingface dataset:
Database: cre_Theme_park
Question sequence:
How many visitors are there?
What is the Tourist_ID of the visitor whose detail is 'Vincent'?
Please show his visit date and detail.
SQL query sequence:
SELECT COUNT(*) FROM VISITORS
SELECT Tourist_ID FROM VISITORS WHERE Tourist_Details  =  "Vincent"
SELECT T2.Visit_Date ,  T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID  =  T2.Tourist_ID WHERE T1.Tourist_Details  =  "Vincent"
Final question: What are the visit date and details of the visitor whose detail is 'Vincent'?
Final SQL: SELECT T2.Visit_Date ,  T2.Visit_Details FROM VISITORS AS T1 JOIN VISITS AS T2 ON T1.Tourist_ID  =  T2.Tourist_ID WHERE T1.Tourist_Details  =  "Vincent"
Database: cre_Theme_park
Question sequence:
What is the Tourist_ID of the visitor whose detail is 'Vivian'?
Which tourist attractions does she visit?
How about Vincent?
SQL query sequence:
SELECT Tourist_ID FROM VISITORS WHERE Tourist_Details  =  "Vivian"
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID  =  T3.Tourist_ID WHERE T3.Tourist_Details  =  "Vivian"
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID  =  T3.Tourist_ID WHERE T3.Tourist_Details  =  "Vincent"
Final question: Which tourist attractions does the visitor with detail 'Vincent' visit?
Final SQL: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID JOIN VISITORS AS T3 ON T2.Tourist_ID  =  T3.Tourist_ID WHERE T3.Tourist_Details  =  "Vincent"
Database: cre_Theme_park
Question sequence:
How many tourist attractions has Vincent visited?
How about Vivian?
Among these attractions, please show the names and dates of the ones that Vincent or Vivian has visited.
SQL query sequence:
SELECT COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Vincent"
SELECT COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Vivian"
SELECT T1.Name ,  T3.Visit_Date FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Vincent" OR T2.Tourist_Details  =  "Vivian"
Final question: What are the names of the tourist attractions and the dates when the tourists named Vincent or Vivian visited there?
Final SQL: SELECT T1.Name ,  T3.Visit_Date FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Vincent" OR T2.Tourist_Details  =  "Vivian"
Database: cre_Theme_park
Question sequence:
What is the price range of the most expensive hotel?
How about the top 3?
Please show the details.
SQL query sequence:
SELECT price_range FROM HOTELS ORDER BY price_range DESC LIMIT 1
SELECT price_range FROM HOTELS ORDER BY price_range DESC LIMIT 3
SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3
Final question: Show the details of the top 3 most expensive hotels.
Final SQL: SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3
Database: cre_Theme_park
Question sequence:
What is the lowest price range of the hotels?
How about the last 3?
Please show the details and star ratings of these three hotels.
SQL query sequence:
SELECT price_range FROM HOTELS ORDER BY price_range LIMIT 1
SELECT price_range FROM HOTELS ORDER BY price_range LIMIT 3
SELECT other_hotel_details ,  star_rating_code FROM HOTELS ORDER BY price_range ASC LIMIT 3
Final question: Show the details and star ratings of the 3 least expensive hotels.
Final SQL: SELECT other_hotel_details ,  star_rating_code FROM HOTELS ORDER BY price_range ASC LIMIT 3
Database: cre_Theme_park
Question sequence:
How many people choose to get to the tourist attractions by walking?
How about by bus?
Then, which transportation method is the most popular?
SQL query sequence:
SELECT count(*) FROM Tourist_Attractions WHERE How_to_Get_There = "walk"
SELECT count(*) FROM Tourist_Attractions WHERE How_to_Get_There = "bus"
SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1
Final question: Show the transportation method most people choose to get to tourist attractions.
Final SQL: SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1
Database: cre_Theme_park
Question sequence:
How many attraction types are there?
What is the description of the attraction with attraction type code being 2?
For each attraction type, how many attractions are there?
Please show the description and code of the attraction type that includes the most tourist attractions.
SQL query sequence:
SELECT COUNT(*) FROM Ref_Attraction_Types
SELECT Attraction_Type_Description FROM Ref_Attraction_Types WHERE Attraction_Type_Code = 2
SELECT T2.Attraction_Type_Code, COUNT(*) FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code  =  T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code
SELECT T1.Attraction_Type_Description ,  T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code  =  T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
Final question: Show the description and code of the attraction type most tourist attractions belong to.
Final SQL: SELECT T1.Attraction_Type_Description ,  T2.Attraction_Type_Code FROM Ref_Attraction_Types AS T1 JOIN Tourist_Attractions AS T2 ON T1.Attraction_Type_Code  =  T2.Attraction_Type_Code GROUP BY T2.Attraction_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
Database: cre_Theme_park
Question sequence:
How many tourist attractions are there?
For each attraction, how many visits does it have?
Please also show the ids of these attractions.
SQL query sequence:
SELECT COUNT(*) FROM Tourist_Attractions
SELECT T1.Name, COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID
SELECT T1.Name ,  T2.Tourist_Attraction_ID ,   COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID
Final question: Show different tourist attractions' names, ids, and the corresponding number of visits.
Final SQL: SELECT T1.Name ,  T2.Tourist_Attraction_ID ,   COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID
Database: cre_Theme_park
Question sequence:
How many tourist attractions have been visited at least once?
How about the number of those that have been visited at least two times?
Please show their names and ids.
SQL query sequence:
SELECT COUNT(*) FROM (SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  >=  1)
SELECT COUNT(*) FROM (SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  >=  2)
SELECT T1.Name ,  T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  >=  2
Final question: Show the names and ids of tourist attractions that are visited at least two times.
Final SQL: SELECT T1.Name ,  T2.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN VISITS AS T2 ON T1.Tourist_Attraction_ID  =  T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID HAVING count(*)  >=  2
Database: cre_Theme_park
Question sequence:
How many tourist attractions are there at address 660 Shea Crescent?
How many tourist attractions can be reached by walking?
Please show the names of these tourist attractions or those that are at address 660 Shea Crescent.
SQL query sequence:
SELECT COUNT(*) FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "660 Shea Crescent"
SELECT COUNT(*) FROM Tourist_Attractions WHERE How_to_Get_There  =  "walk"
SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "660 Shea Crescent" OR T2.How_to_Get_There  =  "walk"
Final question: What are the names of tourist attractions that can be reached by walk or is at address 660 Shea Crescent?
Final SQL: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "660 Shea Crescent" OR T2.How_to_Get_There  =  "walk"
Database: cre_Theme_park
Question sequence:
How many features could be provided by tourist attractions?
Please show their details.
How many tourist attractions have parking as their feature details?
How about the number of those that have either parking or shopping as their feature details?
Please show the names of these attractions.
SQL query sequence:
SELECT COUNT(*) FROM Features
SELECT Feature_Details FROM Features
SELECT COUNT(*) FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'park'
SELECT COUNT(*) FROM (SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'shopping')
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'shopping'
Final question: What are the names of the tourist attractions that have parking or shopping as their feature details?
Final SQL: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'park' UNION SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN Tourist_Attraction_Features AS T2 ON T1.tourist_attraction_id  =  T2.tourist_attraction_id JOIN Features AS T3 ON T2.Feature_ID  =  T3.Feature_ID WHERE T3.feature_Details  =  'shopping'
Database: cre_Theme_park
Question sequence:
How many tourist attractions can be reached by bus?
How about the number of tourist attractions that can be reached by bus or are at address 254 Ottilie Junction?
Please show the names of these tourist attractions.
SQL query sequence:
SELECT COUNT(*) FROM Tourist_Attractions WHERE How_to_Get_There = "bus"
SELECT COUNT(*) FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "254 Ottilie Junction" OR T2.How_to_Get_There  =  "bus"
SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "254 Ottilie Junction" OR T2.How_to_Get_There  =  "bus"
Final question: What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction?
Final SQL: SELECT T2.Name FROM Locations AS T1 JOIN Tourist_Attractions AS T2 ON T1.Location_ID  =  T2.Location_ID WHERE T1.Address  =  "254 Ottilie Junction" OR T2.How_to_Get_There  =  "bus"
Database: cre_Theme_park
Question sequence:
How many tourist attractions are there that Alison has visited?
Please show their names.
What are the names of tourist attractions that Rosalind has visited?
How about the names of tourist attractions that Alison visited but Rosalind did not visit?
SQL query sequence:
SELECT COUNT(*) FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Alison"
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Alison"
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Rosalind"
SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Alison" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Rosalind"
Final question: What are the names of tourist attraction that Alison visited but Rosalind did not visit?
Final SQL: SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Alison" EXCEPT SELECT T1.Name FROM Tourist_Attractions AS T1 JOIN VISITORS AS T2 JOIN VISITS AS T3 ON T1.Tourist_Attraction_ID  =  T3.Tourist_Attraction_ID AND T2.Tourist_ID  =  T3.Tourist_ID WHERE T2.Tourist_Details  =  "Rosalind"
Database: candidate_poll
Question sequence:
what different poll resources exist?
how many are there?
which one provides the greatest amount of candidate information?
SQL query sequence:
SELECT distinct poll_source FROM candidate
SELECT count(distinct poll_source) FROM candidate
SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY count(*) DESC LIMIT 1
Final question: Which poll resource provided the most number of candidate information?
Final SQL: SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY count(*) DESC LIMIT 1
Database: candidate_poll
Question sequence:
what is the highest support rate?
show me the top 3.
SQL query sequence:
SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 1
SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3
Final question: what are the top 3 highest support rates?
Final SQL: SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3
Database: candidate_poll
Question sequence:
show the id of the candidate who got the highest oppose rate.
how about the one with the lowest oppose rate?
SQL query sequence:
SELECT Candidate_ID FROM candidate ORDER BY oppose_rate DESC LIMIT 1
SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1
Final question: Find the id of the candidate who got the lowest oppose rate.
Final SQL: SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1
Database: candidate_poll
Question sequence:
which candidate has the highest oppose rate?
just show the poll source.
SQL query sequence:
SELECT * FROM candidate ORDER BY oppose_rate DESC LIMIT 1
SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1
Final question: which poll source does the highest oppose rate come from?
Final SQL: SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1
Database: candidate_poll
Question sequence:
show all males.
what is their average height?
also what is the average weight?
SQL query sequence:
SELECT * FROM people WHERE sex  =  'M'
SELECT avg(height) FROM people WHERE sex  =  'M'
SELECT avg(height) ,  avg(weight) FROM people WHERE sex  =  'M'
Final question: Find the average height and weight for all males (sex is M).
Final SQL: SELECT avg(height) ,  avg(weight) FROM people WHERE sex  =  'M'
Database: candidate_poll
Question sequence:
show the info of people who are taller than 200.
also list the people whose height is lower than 190.
just show their names.
SQL query sequence:
SELECT * FROM people WHERE height > 200
SELECT * FROM people WHERE height > 200 OR height  <  190
SELECT name FROM people WHERE height  >  200 OR height  <  190
Final question: find the names of people who are taller than 200 or lower than 190.
Final SQL: SELECT name FROM people WHERE height  >  200 OR height  <  190
Database: candidate_poll
Question sequence:
what is the average weight?
what is the minimum?
show these values for each gender.
SQL query sequence:
SELECT avg(weight) FROM people
SELECT min(weight) FROM people
SELECT avg(weight), min(weight), sex FROM people GROUP BY sex
Final question: Find the average and minimum weight for each gender.
Final SQL: SELECT avg(weight) ,  min(weight) ,  sex FROM people GROUP BY sex
Database: candidate_poll
Question sequence:
order the candidate table by support rate from high to the low.
what is the name of the candidate in first place?
show the gender as well.
SQL query sequence:
SELECT * FROM candidate ORDER BY support_rate DESC
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id ORDER BY t2.support_rate DESC LIMIT 1
SELECT t1.name,  t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id ORDER BY t2.support_rate DESC LIMIT 1
Final question: Find the name and gender of the candidate who got the highest support rate.
Final SQL: SELECT t1.name,  t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id ORDER BY t2.support_rate DESC LIMIT 1
Database: candidate_poll
Question sequence:
what are the names of all candidates?
among them, whose oppose percentage is the lowest?
for each gender?
SQL query sequence:
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id ORDER BY oppose_rate LIMIT 1
SELECT t1.name ,  t1.sex ,  min(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id GROUP BY t1.sex
Final question: Find the name of the candidates whose oppose percentage is the lowest for each sex.
Final SQL: SELECT t1.name ,  t1.sex ,  min(oppose_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id GROUP BY t1.sex
Database: candidate_poll
Question sequence:
what is the average uncertain ratio of all candidates?
what are the numbers for each sex?
which gender got the higher number?
SQL query sequence:
SELECT avg(unsure_rate) FROM candidate
SELECT t1.sex, avg(t2.unsure_rate) FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id GROUP BY t1.sex
SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id GROUP BY t1.sex ORDER BY avg(t2.unsure_rate) DESC LIMIT 1
Final question: which gender got the highest average uncertain ratio.
Final SQL: SELECT t1.sex FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id GROUP BY t1.sex ORDER BY avg(t2.unsure_rate) DESC LIMIT 1
Database: candidate_poll
Question sequence:
give me info of all candidates.
what are their names?
how about those who were not candidates in the election?
SQL query sequence:
SELECT * FROM candidate
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id
SELECT name FROM people WHERE people_id NOT IN (SELECT people_id FROM candidate)
Final question: what are the names of people who did not participate in the candidate election.
Final SQL: SELECT name FROM people WHERE people_id NOT IN (SELECT people_id FROM candidate)
Database: candidate_poll
Question sequence:
show the name of all candidates with their support and oppose percentages.
just show those whose support percentage is higher than their oppose rate.
no need to show the support and oppose rates.
how about those whose support percentage is lower than their oppose rate.
SQL query sequence:
SELECT t1.name, t2.support_rate, t2.oppose_rate FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id
SELECT t1.name, t2.support_rate, t2.oppose_rate FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id WHERE t2.support_rate  > t2.oppose_rate
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id WHERE t2.support_rate  > t2.oppose_rate
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id WHERE t2.support_rate  <  t2.oppose_rate
Final question: Find the names of the candidates whose support percentage is lower than their oppose rate.
Final SQL: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id WHERE t2.support_rate  <  t2.oppose_rate
Database: candidate_poll
Question sequence:
what are the names of people whose weight is less than 85?
how about those whose weight is greater than 85?
how many are there in total?
what is the number for each gender?
SQL query sequence:
SELECT name FROM people WHERE weight < 85
SELECT name FROM people WHERE weight > 85
SELECT count(*) FROM people WHERE weight > 85
SELECT count(*) ,  sex FROM people WHERE weight  >  85 GROUP BY sex
Final question: how many people are there whose weight is higher than 85 for each gender?
Final SQL: SELECT count(*) ,  sex FROM people WHERE weight  >  85 GROUP BY sex
Database: candidate_poll
Question sequence:
what is the highest support percentage for all candidates?
how about the lowest consider rate and oppose rate?
SQL query sequence:
SELECT max(support_rate) FROM candidate
SELECT min(consider_rate), min(oppose_rate) FROM candidate
Final question: find the highest support percentage, lowest consider rate and oppose rate of all candidates.
Final SQL: SELECT max(support_rate) ,  min(consider_rate) ,  min(oppose_rate) FROM candidate
Database: candidate_poll
Question sequence:
show info for all females (sex is F).
who are candidates among them? Just show their names.
list the result in the alphabetical order.
SQL query sequence:
SELECT * FROM people WHERE sex  =  'F'
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id WHERE t1.sex  =  'F'
SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id WHERE t1.sex  =  'F' ORDER BY t1.name
Final question: list all female (sex is F) candidate names in the alphabetical order.
Final SQL: SELECT t1.name FROM people AS t1 JOIN candidate AS t2 ON t1.people_id  =  t2.people_id WHERE t1.sex  =  'F' ORDER BY t1.name
Database: twitter_1
Question sequence:
How many users are there?
Please list their names and email.
Among these names, whose name contains ‘Swift’?
SQL query sequence:
SELECT COUNT(*) FROM user_profiles
SELECT name, email FROM user_profiles
SELECT name ,  email FROM user_profiles WHERE name LIKE '%Swift%'
Final question: Find the name and email of the user whose name contains the word ‘Swift’.
Final SQL: SELECT name ,  email FROM user_profiles WHERE name LIKE '%Swift%'
Database: twitter_1
Question sequence:
How many users are there?
Please list their names and email.
How many followers do they have?
How many users' emails contain ‘superstar’ or ‘edu’?
Please list their names.
SQL query sequence:
SELECT COUNT(*) FROM user_profiles
SELECT name, email FROM user_profiles
SELECT name, email, followers FROM user_profiles
SELECT COUNT(*) FROM user_profiles WHERE email LIKE '%superstar%' OR email LIKE '%edu%'
SELECT name FROM user_profiles WHERE email LIKE '%superstar%' OR email LIKE '%edu%'
Final question: Find the names of users whose emails contain ‘superstar’ or ‘edu’.
Final SQL: SELECT name FROM user_profiles WHERE email LIKE '%superstar%' OR email LIKE '%edu%'