interaction_utterance
sequencelengths
0
6
interaction_query
sequencelengths
0
6
final_utterance
stringlengths
19
224
final_query
stringlengths
22
577
db_id
stringclasses
140 values
[ "How many tourist attractions are there?", "How many of them are associated with the photo \"fun1\"?", "How about the photo \"game1\"?", "Please show the name of these tourist attractions?" ]
[ "SELECT COUNT(*) FROM TOURIST_ATTRACTIONS", "SELECT COUNT(*) FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = \"fun1\"", "SELECT COUNT(*) FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = \"game1\"", "SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = \"game1\"" ]
What is the name of the tourist attraction that is associated with the photo "game1"?
SELECT T2.Name FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T1.Name = "game1"
cre_Theme_park
[ "How can I get to the tourist attraction \"film festival\"?", "How many photos have been taken at this tourist attraction?", "Please show its name and descriptions." ]
[ "SELECT How_to_Get_There FROM TOURIST_ATTRACTIONS WHERE Name = \"film festival\"", "SELECT COUNT(*) FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = \"film festival\"", "SELECT T1.Name , T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = \"film festival\"" ]
What are the names and descriptions of the photos taken at the tourist attraction "film festival"?
SELECT T1.Name , T1.Description FROM PHOTOS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = "film festival"
cre_Theme_park
[ "How many shops are there?", "How many of them could be accessed by bus?", "How about the number of those that could be accessed by walking?", "Please show the details of these shops." ]
[ "SELECT COUNT(*) FROM SHOPS", "SELECT COUNT(*) FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = \"bus\"", "SELECT COUNT(*) FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = \"walk\"", "SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = \"walk\"" ]
What are the details of the shops that can be accessed by walk?
SELECT T1.Shop_Details FROM SHOPS AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Shop_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = "walk"
cre_Theme_park
[ "Please show the description of the the attraction named \"US museum\".", "How can I get to this place?", "Who is in charge of it?" ]
[ "SELECT Description FROM TOURIST_ATTRACTIONS WHERE Name = \"US museum\"", "SELECT How_to_Get_There FROM TOURIST_ATTRACTIONS WHERE Name = \"US museum\"", "SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = \"US museum\"" ]
What is the name of the staff that is in charge of the attraction named "US museum"?
SELECT T1.Name FROM STAFF AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID WHERE T2.Name = "US museum"
cre_Theme_park
[ "How many markets are there?", "How many of them could be accessed by shuttle?", "How about the number of those that could be accessed by walking or bus?", "Please show the details of these markets." ]
[ "SELECT COUNT(*) FROM Street_Markets", "SELECT COUNT(*) FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = \"shuttle\"", "SELECT COUNT(*) FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = \"walk\" OR T2.How_to_Get_There = \"bus\"", "SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = \"walk\" OR T2.How_to_Get_There = \"bus\"" ]
What are the details of the markets that can be accessed by walk or bus?
SELECT T1.Market_Details FROM Street_Markets AS T1 JOIN TOURIST_ATTRACTIONS AS T2 ON T1.Market_ID = T2.Tourist_Attraction_ID WHERE T2.How_to_Get_There = "walk" OR T2.How_to_Get_There = "bus"
cre_Theme_park
[ "How many visitors are there?", "What is the Tourist_ID of the visitor whose detail is 'Vincent'?", "Please show his visit date and detail." ]
[ "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\"" ]
What are the visit date and details of the visitor whose detail is '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"
cre_Theme_park
[ "What is the Tourist_ID of the visitor whose detail is 'Vivian'?", "Which tourist attractions does she visit?", "How about Vincent?" ]
[ "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\"" ]
Which tourist attractions does the visitor with detail 'Vincent' visit?
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"
cre_Theme_park
[ "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." ]
[ "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\"" ]
What are the names of the tourist attractions and the dates when the tourists named Vincent or Vivian visited there?
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"
cre_Theme_park
[ "What is the price range of the most expensive hotel?", "How about the top 3?", "Please show the details." ]
[ "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" ]
Show the details of the top 3 most expensive hotels.
SELECT other_hotel_details FROM HOTELS ORDER BY price_range DESC LIMIT 3
cre_Theme_park
[ "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." ]
[ "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" ]
Show the details and star ratings of the 3 least expensive hotels.
SELECT other_hotel_details , star_rating_code FROM HOTELS ORDER BY price_range ASC LIMIT 3
cre_Theme_park
[ "How many people choose to get to the tourist attractions by walking?", "How about by bus?", "Then, which transportation method is the most popular?" ]
[ "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" ]
Show the transportation method most people choose to get to tourist attractions.
SELECT How_to_Get_There FROM Tourist_Attractions GROUP BY How_to_Get_There ORDER BY COUNT(*) DESC LIMIT 1
cre_Theme_park
[ "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." ]
[ "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" ]
Show the description and code of the attraction type most tourist attractions belong to.
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
cre_Theme_park
[ "How many tourist attractions are there?", "For each attraction, how many visits does it have?", "Please also show the ids of these attractions." ]
[ "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" ]
Show different tourist attractions' names, ids, and the corresponding number of visits.
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
cre_Theme_park
[ "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." ]
[ "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" ]
Show the names and ids of tourist attractions that are visited at least two times.
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
cre_Theme_park
[ "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." ]
[ "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\"" ]
What are the names of tourist attractions that can be reached by walk or is at address 660 Shea Crescent?
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"
cre_Theme_park
[ "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." ]
[ "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'" ]
What are the names of the tourist attractions that have parking or shopping as their feature details?
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'
cre_Theme_park
[ "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." ]
[ "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\"" ]
What are the names of tourist attractions that can be reached by bus or is at address 254 Ottilie Junction?
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"
cre_Theme_park
[ "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?" ]
[ "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\"" ]
What are the names of tourist attraction that Alison visited but Rosalind did not visit?
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"
cre_Theme_park
[ "what different poll resources exist?", "how many are there?", "which one provides the greatest amount of candidate information?" ]
[ "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" ]
Which poll resource provided the most number of candidate information?
SELECT poll_source FROM candidate GROUP BY poll_source ORDER BY count(*) DESC LIMIT 1
candidate_poll
[ "what is the highest support rate?", "show me the top 3." ]
[ "SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 1", "SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3" ]
what are the top 3 highest support rates?
SELECT support_rate FROM candidate ORDER BY support_rate DESC LIMIT 3
candidate_poll
[ "show the id of the candidate who got the highest oppose rate.", "how about the one with the lowest oppose rate?" ]
[ "SELECT Candidate_ID FROM candidate ORDER BY oppose_rate DESC LIMIT 1", "SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1" ]
Find the id of the candidate who got the lowest oppose rate.
SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1
candidate_poll
[ "which candidate has the highest oppose rate?", "just show the poll source." ]
[ "SELECT * FROM candidate ORDER BY oppose_rate DESC LIMIT 1", "SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1" ]
which poll source does the highest oppose rate come from?
SELECT poll_source FROM candidate ORDER BY oppose_rate DESC LIMIT 1
candidate_poll
[ "show all males.", "what is their average height?", "also what is the average weight?" ]
[ "SELECT * FROM people WHERE sex = 'M'", "SELECT avg(height) FROM people WHERE sex = 'M'", "SELECT avg(height) , avg(weight) FROM people WHERE sex = 'M'" ]
Find the average height and weight for all males (sex is M).
SELECT avg(height) , avg(weight) FROM people WHERE sex = 'M'
candidate_poll
[ "show the info of people who are taller than 200.", "also list the people whose height is lower than 190.", "just show their names." ]
[ "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" ]
find the names of people who are taller than 200 or lower than 190.
SELECT name FROM people WHERE height > 200 OR height < 190
candidate_poll
[ "what is the average weight?", "what is the minimum?", "show these values for each gender." ]
[ "SELECT avg(weight) FROM people", "SELECT min(weight) FROM people", "SELECT avg(weight), min(weight), sex FROM people GROUP BY sex" ]
Find the average and minimum weight for each gender.
SELECT avg(weight) , min(weight) , sex FROM people GROUP BY sex
candidate_poll
[ "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." ]
[ "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" ]
Find the name and gender of the candidate who got the highest support rate.
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
candidate_poll
[ "what are the names of all candidates?", "among them, whose oppose percentage is the lowest?", "for each gender?" ]
[ "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" ]
Find the name of the candidates whose oppose percentage is the lowest for each sex.
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
candidate_poll
[ "what is the average uncertain ratio of all candidates?", "what are the numbers for each sex?", "which gender got the higher number?" ]
[ "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" ]
which gender got the highest average uncertain ratio.
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
candidate_poll
[ "give me info of all candidates.", "what are their names?", "how about those who were not candidates in the election?" ]
[ "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)" ]
what are the names of people who did not participate in the candidate election.
SELECT name FROM people WHERE people_id NOT IN (SELECT people_id FROM candidate)
candidate_poll
[ "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." ]
[ "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" ]
Find the names of the candidates whose support percentage is lower than their 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
candidate_poll
[ "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?" ]
[ "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" ]
how many people are there whose weight is higher than 85 for each gender?
SELECT count(*) , sex FROM people WHERE weight > 85 GROUP BY sex
candidate_poll
[ "what is the highest support percentage for all candidates?", "how about the lowest consider rate and oppose rate?" ]
[ "SELECT max(support_rate) FROM candidate", "SELECT min(consider_rate), min(oppose_rate) FROM candidate" ]
find the highest support percentage, lowest consider rate and oppose rate of all candidates.
SELECT max(support_rate) , min(consider_rate) , min(oppose_rate) FROM candidate
candidate_poll
[ "show info for all females (sex is F).", "who are candidates among them? Just show their names.", "list the result in the alphabetical order." ]
[ "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" ]
list all female (sex is F) candidate names in the alphabetical order.
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
candidate_poll
[ "How many users are there?", "Please list their names and email.", "Among these names, whose name contains ‘Swift’?" ]
[ "SELECT COUNT(*) FROM user_profiles", "SELECT name, email FROM user_profiles", "SELECT name , email FROM user_profiles WHERE name LIKE '%Swift%'" ]
Find the name and email of the user whose name contains the word ‘Swift’.
SELECT name , email FROM user_profiles WHERE name LIKE '%Swift%'
twitter_1
[ "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." ]
[ "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%'" ]
Find the names of users whose emails contain ‘superstar’ or ‘edu’.
SELECT name FROM user_profiles WHERE email LIKE '%superstar%' OR email LIKE '%edu%'
twitter_1
[ "How many tweets are there?", "Among these tweets, how many of them are about the topic 'intern'?", "Please show their texts." ]
[ "SELECT COUNT(*) FROM tweets", "SELECT COUNT(*) FROM tweets WHERE text LIKE '%intern%'", "SELECT text FROM tweets WHERE text LIKE '%intern%'" ]
Return the text of tweets about the topic 'intern'.
SELECT text FROM tweets WHERE text LIKE '%intern%'
twitter_1
[ "How many followers does the user named \"Tyler Swift\" have?", "How many users are there whose number of followers is greater than that of the user named \"Tyler Swift\"?", "Show the names of these users." ]
[ "SELECT count(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 WHERE T1.name = 'Tyler Swift'", "SELECT COUNT(*) FROM (SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING count(*) > (SELECT count(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 WHERE T1.name = 'Tyler Swift'))", "SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING count(*) > (SELECT count(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 WHERE T1.name = 'Tyler Swift')" ]
Find the names of the users whose number of followers is greater than that of the user named "Tyler Swift".
SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING count(*) > (SELECT count(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 WHERE T1.name = 'Tyler Swift')
twitter_1
[ "Who has the least number of followers?", "How many users have more than one follower?", "Show their names and emails." ]
[ "SELECT Name FROM user_profiles ORDER BY followers LIMIT 1", "SELECT COUNT(*) FROM (SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING count(*) > 1)", "SELECT T1.name , T1.email FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING count(*) > 1" ]
Find the name and email for the users who have more than one follower.
SELECT T1.name , T1.email FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING count(*) > 1
twitter_1
[ "How many tweets are there?", "What is the text of the tweet with id 1?", "How many tweets does each user have?", "Who has more than one tweet?" ]
[ "SELECT COUNT(*) FROM tweets", "SELECT text FROM tweets WHERE id = 1", "SELECT T1.name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid", "SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) > 1" ]
Find the names of users who have more than one tweet.
SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) > 1
twitter_1
[ "How many followers does Mary have?", "How about that of Susan?", "Who is followed by either one of them?", "What are their ids?" ]
[ "SELECT Followers FROM user_profiles WHERE name = \"Mary\"", "SELECT Followers FROM user_profiles WHERE name = \"Susan\"", "SELECT T3.NAME FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 JOIN user_profiles AS T3 ON T3.uid = T2.f1 WHERE T1.name = \"Mary\" OR T1.name = \"Susan\"", "SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = \"Mary\" OR T1.name = \"Susan\"" ]
Find the id of users who are followed by Mary or Susan.
SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = "Mary" OR T1.name = "Susan"
twitter_1
[ "Who has the most followers?", "What is the minimum number of followers of all users?", "Please show the name of the user with that number of followers.", "Please also show the email." ]
[ "SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 1", "SELECT followers FROM user_profiles ORDER BY followers LIMIT 1", "SELECT name FROM user_profiles ORDER BY followers LIMIT 1", "SELECT name , email FROM user_profiles ORDER BY followers LIMIT 1" ]
Find the name and email of the user followed by the least number of people.
SELECT name , email FROM user_profiles ORDER BY followers LIMIT 1
twitter_1
[ "How many followers does each user have?", "Who has the most followers?", "Which top 5 users have the most followers?" ]
[ "SELECT name, followers FROM user_profiles", "SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 1", "SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 5" ]
List the names of 5 users followed by the largest number of other users.
SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 5
twitter_1
[ "How many users are there?", "Show their names.", "Please also show the number of tweets tweeted by each of them." ]
[ "SELECT COUNT(*) FROM user_profiles", "SELECT Name FROM user_profiles", "SELECT T1.name , count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid" ]
Find the name of each user and number of tweets tweeted by each of them.
SELECT T1.name , count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid
twitter_1
[ "How many users tweeted less than twice?", "Show their names.", "Please also show their partition id" ]
[ "SELECT COUNT(*) FROM (SELECT count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) < 2)", "SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) < 2", "SELECT T1.name , T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) < 2" ]
Find the name and partition id for users who tweeted less than twice.
SELECT T1.name , T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) < 2
twitter_1
[ "How many users have some tweets?", "How about the number of users that have tweeted more than once?", "Show their names and number of tweets tweeted by them." ]
[ "SELECT COUNT(*) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets)", "SELECT COUNT(*) FROM (SELECT count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) > 1)", "SELECT T1.name , count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) > 1" ]
Find the name of the user who tweeted more than once, and number of tweets tweeted by them.
SELECT T1.name , count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) > 1
twitter_1
[ "How many users have some tweets?", "Show the name of these users and their number of followers.", "What is the average number of followers for these users?" ]
[ "SELECT COUNT(*) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets)", "SELECT Name, followers FROM user_profiles WHERE UID IN (SELECT UID FROM tweets)", "SELECT avg(followers) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets)" ]
Find the average number of followers for the users who had some tweets.
SELECT avg(followers) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets)
twitter_1
[ "What is the id of the customer who made the most recent order?", "What's its status?", "What's its id?" ]
[ "SELECT customer_id FROM orders ORDER BY date_order_placed DESC LIMIT 1", "SELECT order_status FROM orders ORDER BY date_order_placed DESC LIMIT 1", "SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1" ]
What is the id of the most recent order?
SELECT order_id FROM orders ORDER BY date_order_placed DESC LIMIT 1
tracking_orders
[ "When was the oldest order placed?", "What's the id of the customer who placed it?", "What's the id of the order?", "Show me both id's." ]
[ "SELECT date_order_placed FROM orders ORDER BY date_order_placed LIMIT 1", "SELECT customer_id FROM orders ORDER BY date_order_placed LIMIT 1", "SELECT order_id FROM orders ORDER BY date_order_placed LIMIT 1", "SELECT order_id , customer_id FROM orders ORDER BY date_order_placed LIMIT 1" ]
what are the order id and customer id of the oldest order?
SELECT order_id , customer_id FROM orders ORDER BY date_order_placed LIMIT 1
tracking_orders
[ "Show me all the orders with status \"Packing\"", "Who made those orders?", "Show me the distinct customer names." ]
[ "SELECT * FROM orders WHERE order_status = \"Packing\"", "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"Packing\"", "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"Packing\"" ]
List the name of all the distinct customers who have orders with status "Packing".
SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Packing"
tracking_orders
[ "Show me all the orders with status \"On Road\"", "Who made those orders?", "Show me the distinct customer names." ]
[ "SELECT * FROM orders WHERE order_status = \"On Road\"", "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"On Road\"", "SELECT DISTINCT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"On Road\"" ]
Find the details of all the distinct customers who have orders with status "On Road".
SELECT DISTINCT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road"
tracking_orders
[ "What is the id of the customer who has the most orders?", "Show me details", "Show me his or her name." ]
[ "SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1", "SELECT T1.customer_details FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1", "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1" ]
What is the name of the customer who has the most orders?
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
tracking_orders
[ "What is the name of the customer who has the most orders?", "What's his or her id?" ]
[ "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1", "SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1" ]
What is the customer id of the customer who has the most orders?
SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
tracking_orders
[ "Any customer named Jeramie?", "Show me the status of his orders", "Show me the id's of his orders as well." ]
[ "SELECT * FROM Customers WHERE customer_name = \"Jeramie\"", "SELECT T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = \"Jeramie\"", "SELECT T2.order_id, T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = \"Jeramie\"" ]
Give me a list of id and status of orders which belong to the customer named "Jeramie".
SELECT T2.order_id , T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
tracking_orders
[ "Any customer named Jeramie?", "Show me the status of his orders", "Now show me the dates of those orders." ]
[ "SELECT * FROM Customers WHERE customer_name = \"Jeramie\"", "SELECT T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = \"Jeramie\"", "SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = \"Jeramie\"" ]
Find the dates of orders which belong to the customer named "Jeramie".
SELECT T2.date_order_placed FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie"
tracking_orders
[ "Show me the orders placed between 2009-01-01 and 2010-01-01.", "Show me the customers who made those orders." ]
[ "SELECT * FROM orders WHERE date_order_placed >= \"2009-01-01\" AND date_order_placed <= \"2010-01-01\"", "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= \"2009-01-01\" AND T2.date_order_placed <= \"2010-01-01\"" ]
Give me the names of customers who have placed orders between 2009-01-01 and 2010-01-01.
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= "2009-01-01" AND T2.date_order_placed <= "2010-01-01"
tracking_orders
[ "Show me the orders placed between 1975-01-01 and 1976-01-01.", "Show me the product ids of those orders." ]
[ "SELECT * FROM orders WHERE date_order_placed >= \"1975-01-01\" AND date_order_placed <= \"1976-01-01\"", "SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= \"1975-01-01\" AND T1.date_order_placed <= \"1976-01-01\"" ]
Give me a list of distinct product ids from orders placed between 1975-01-01 and 1976-01-01?
SELECT DISTINCT T2.product_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id WHERE T1.date_order_placed >= "1975-01-01" AND T1.date_order_placed <= "1976-01-01"
tracking_orders
[ "Find me customers who have order status \"On Road\".", "Now find me customers who have order status \"Shipped\".", "Now show me customers with both of those order statuses." ]
[ "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"On Road\"", "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"Shipped\"", "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"On Road\" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"Shipped\"" ]
Find the names of the customers who have order status both "On Road" and "Shipped".
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Shipped"
tracking_orders
[ "Find me ids of customers who have order status \"On Road\".", "Now find me ids of customers who have order status \"Shipped\".", "Now show me ids of customers with both of those order statuses." ]
[ "SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"On Road\"", "SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"Shipped\"", "SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"On Road\" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = \"Shipped\"" ]
Find the id of the customers who have order status both "On Road" and "Shipped".
SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" INTERSECT SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Shipped"
tracking_orders
[ "Show me the order with shipment tracking number 3452.", "When was that order placed?" ]
[ "SELECT * FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE shipment_tracking_number = 3452", "SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452" ]
When was the order placed whose shipment tracking number is 3452? Give me the date.
SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.shipment_tracking_number = 3452
tracking_orders
[ "Show me the order with invoice number 10.", "When was that order placed? Give me the date." ]
[ "SELECT * FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE invoice_number = 10", "SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10" ]
What is the placement date of the order whose invoice number is 10?
SELECT T1.date_order_placed FROM orders AS T1 JOIN shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10
tracking_orders
[ "Show me all the products.", "Show me only the products that have been ordered.", "Show me only the count and id of each product" ]
[ "SELECT * FROM Products", "SELECT * FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id", "SELECT count(*) , T3.product_id FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id" ]
List the count and id of each product in all the orders.
SELECT count(*) , T3.product_id FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id
tracking_orders
[ "Show me all the products.", "Show me only the products that have been ordered.", "Show me only the name and count of each product" ]
[ "SELECT * FROM Products", "SELECT * FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id", "SELECT T3.product_name , count(*) FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id" ]
List the name and count of each product in all orders.
SELECT T3.product_name , count(*) FROM orders AS T1 JOIN order_items AS T2 JOIN products AS T3 ON T1.order_id = T2.order_id AND T2.product_id = T3.product_id GROUP BY T3.product_id
tracking_orders
[ "Show me the 10 most recently shipped orders.", "Ok, show me only the most recent one.", "Show me its id." ]
[ "SELECT * FROM shipments ORDER BY shipment_date DESC LIMIT 10", "SELECT * FROM shipments ORDER BY shipment_date DESC LIMIT 1", "SELECT order_id FROM shipments WHERE shipment_date = (SELECT max(shipment_date) FROM shipments)" ]
Find the id of the order which is shipped most recently.
SELECT order_id FROM shipments WHERE shipment_date = (SELECT max(shipment_date) FROM shipments)
tracking_orders
[ "Who ordered the order with most items?", "What is its order id?" ]
[ "SELECT T1.customer_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY count(*) DESC LIMIT 1", "SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY count(*) DESC LIMIT 1" ]
What is the id of the order which has the most items?
SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY count(*) DESC LIMIT 1
tracking_orders
[ "What is the id of the order with the most items?", "What is the id of the customer who ordered it?" ]
[ "SELECT T1.order_id FROM orders AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id GROUP BY T1.order_id ORDER BY count(*) DESC LIMIT 1", "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1" ]
What is the name of the customer who has the largest number of orders?
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
tracking_orders
[ "Show me all the dates between 1989-09-03 and 2007-12-25 that invoice number was created.", "Sorry, I meant dates before 1989-09-03 and after 2007-12-25.", "Now show me their invoice numbers." ]
[ "SELECT invoice_date FROM invoices WHERE invoice_date > \"1989-09-03\" AND invoice_date < \"2007-12-25\"", "SELECT invoice_date FROM invoices WHERE invoice_date < \"1989-09-03\" OR invoice_date > \"2007-12-25\"", "SELECT invoice_number FROM invoices WHERE invoice_date < \"1989-09-03\" OR invoice_date > \"2007-12-25\"" ]
Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25.
SELECT invoice_number FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25"
tracking_orders
[ "Show me all the details of invoices created between 1989-09-03 and 2007-12-25.", "Now show me the distinct details of all the other invoices." ]
[ "SELECT invoice_date FROM invoices WHERE invoice_date > \"1989-09-03\" AND invoice_date < \"2007-12-25\"", "SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < \"1989-09-03\" OR invoice_date > \"2007-12-25\"" ]
Find the distinct details of invoices which are created before 1989-09-03 or after 2007-12-25.
SELECT DISTINCT invoice_details FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25"
tracking_orders
[ "Show me the names of all customers who have at least two orders.", "Show me the number of orders each of them made as well." ]
[ "SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*) >= 2", "SELECT T2.customer_name , count(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*) >= 2" ]
For each customer who has at least two orders, find the customer name and number of orders made.
SELECT T2.customer_name , count(*) FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*) >= 2
tracking_orders
[ "Show me the names of all customers who have at least two orders.", "Now show me names of customers who have at most two orders." ]
[ "SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*) >= 2", "SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*) <= 2" ]
Find the name of the customers who have at most two orders.
SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING count(*) <= 2
tracking_orders
[ "List the ids of the customers who have once bought product \"food\".", "Now list the names." ]
[ "SELECT T1.customer_id FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = \"food\" GROUP BY T1.customer_id HAVING count(*) >= 1", "SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = \"food\" GROUP BY T1.customer_id HAVING count(*) >= 1" ]
List the names of the customers who have once bought product "food".
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = "food" GROUP BY T1.customer_id HAVING count(*) >= 1
tracking_orders
[ "What is the most recent log_entry_date?", "the latest?", "what is the product id that has this?" ]
[ "SELECT log_entry_date FROM problem_log ORDER BY log_entry_date ASC LIMIT 1", "SELECT log_entry_date FROM problem_log ORDER BY log_entry_date DESC LIMIT 1", "SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1" ]
What is the id of the problem log that is created most recently?
SELECT problem_log_id FROM problem_log ORDER BY log_entry_date DESC LIMIT 1
tracking_software_problems
[ "How many problem logs are there?", "Of those, what is the oldest entry date used?", "Show all the problem_log information for this date!", "Actually, just show the log id and problem id." ]
[ "SELECT count(*) FROM problem_log", "SELECT log_entry_date FROM problem_log ORDER BY log_entry_date LIMIT 1", "SELECT * FROM problem_log ORDER BY log_entry_date LIMIT 1", "SELECT problem_log_id , problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1" ]
What is the oldest log id and its corresponding problem id?
SELECT problem_log_id , problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1
tracking_software_problems
[ "How many problem logs have to do with problem id 1?", "Show the log ids, dates, descriptions for these.", "Also show the staff for each.", "Can you give me a distinct list of the names of all staff members!" ]
[ "SELECT count(*) FROM problem_log where problem_id = 1", "SELECT problem_log_id, log_entry_date, log_entry_description FROM problem_log where problem_id = 1", "SELECT problem_log_id, log_entry_date, log_entry_description, assigned_to_staff_id FROM problem_log where problem_id = 1", "SELECT DISTINCT staff_first_name , staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1" ]
List the first and last names of all distinct staff members who are assigned to the problem whose id is 1.
SELECT DISTINCT staff_first_name , staff_last_name FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T2.problem_id = 1
tracking_software_problems
[ "What are the problem reported by named Ryan Homenick.", "How about the problems on which closure is authorized by him?", "Actually can you show the different problem_logs that he is assigned to!", "For these, show the distinct problem ids and log ids!" ]
[ "SELECT * FROM staff AS T1 JOIN problems AS T2 ON T1.staff_id = T2.reported_by_staff_id WHERE T1.staff_first_name = \"Rylan\" AND T1.staff_last_name = \"Homenick\"", "SELECT FROM staff AS T1 JOIN problems AS T2 ON T1.staff_id = T2.closure_authorised_by_staff_id WHERE T1.staff_first_name = \"Rylan\" AND T1.staff_last_name = \"Homenick\"", "SELECT * FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = \"Rylan\" AND T1.staff_last_name = \"Homenick\"", "SELECT DISTINCT T2.problem_id , T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = \"Rylan\" AND T1.staff_last_name = \"Homenick\"" ]
List the problem id and log id which are assigned to the staff named Rylan Homenick.
SELECT DISTINCT T2.problem_id , T2.problem_log_id FROM staff AS T1 JOIN problem_log AS T2 ON T1.staff_id = T2.assigned_to_staff_id WHERE T1.staff_first_name = "Rylan" AND T1.staff_last_name = "Homenick"
tracking_software_problems
[ "Show me all the problems on the product with name voluptatem.", "What are the statuses of each?", "How many are solved?", "Actually how many are there in total?" ]
[ "SELECT * FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = \"voluptatem\"", "SELECT *, T3.problem_status_code FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id join problem_log as T3 on T2.problem_id = T3.problem_id WHERE T1.product_name = \"voluptatem\"", "SELECT count(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id join problem_log as T3 on T2.problem_id = T3.problem_id WHERE T1.product_name = \"voluptatem\" and T3.problem_status_code = \"Solved\"", "SELECT count(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = \"voluptatem\"" ]
How many problems are there for product voluptatem?
SELECT count(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem"
tracking_software_problems
[ "How many problems are there?", "What products are they associated with?", "Now show how many problems exist per product name?", "Which one has the most problems?" ]
[ "SELECT count(*) FROM problems", "SELECT * FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id", "SELECT count(*) , T1.product_id FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_id", "SELECT count(*) , T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY count(*) DESC LIMIT 1" ]
How many problems does the product with the most problems have? List the number of the problems and product name.
SELECT count(*) , T1.product_name FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id GROUP BY T1.product_name ORDER BY count(*) DESC LIMIT 1
tracking_software_problems
[ "How many staff members have the first name Christop.", "What problem are these members authorized to close!", "How about what problems have these members reported!", "List just the problem descriptions for each?" ]
[ "SELECT count(*) FROM staff where staff_first_name = \"Christop\"", "SELECT * FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Christop\"", "SELECT * FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Christop\"", "SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Christop\"" ]
Give me a list of descriptions of the problems that are reported by the staff whose first name is Christop.
SELECT T1.problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop"
tracking_software_problems
[ "List all the problem ids!", "What are the names of the staff members that reported each!", "Show me the ids of those reported by the last name Bosco!" ]
[ "SELECT problem_id FROM problems", "SELECT T1.problem_id, T2.staff_first_name, T2.staff_last_name FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id", "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = \"Bosco\"" ]
Find the ids of the problems that are reported by the staff whose last name is Bosco.
SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = "Bosco"
tracking_software_problems
[ "How many products do not have any problems?", "What are they?", "Show all the different ids of the products other than these!", "Also provide the number of problems they each have!" ]
[ "SELECT count(*) FROM product where product_id not in (SELECT product_id FROM problems)", "SELECT product_id FROM product where product_id not in (SELECT product_id FROM problems)", "SELECT distinct product_id FROM problems", "SELECT count(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id" ]
For each product which has problems, what are the number of problems and the product id?
SELECT count(*), T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_id
tracking_software_problems
[ "How many problems were reported on or before 1986-11-13?", "how about after?", "Show me their problem ids and product ids!", "For these, show the number of problems by product id!" ]
[ "SELECT count(*) FROM problems WHERE date_problem_reported <= \"1986-11-13\"", "SELECT count(*) FROM problems WHERE date_problem_reported > \"1986-11-13\"", "SELECT problem_id, product_id FROM problems WHERE date_problem_reported > \"1986-11-13\"", "SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > \"1986-11-13\" GROUP BY T2.product_id" ]
For each product that has problems, find the number of problems reported after 1986-11-13 and the product id?
SELECT count(*) , T2.product_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > "1986-11-13" GROUP BY T2.product_id
tracking_software_problems
[ "What are all the products reported by staff named Jolie Weber?", "How about Dameon Fami?", "Which products are reported by either one?", "What are their ids?" ]
[ "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Jolie\" AND T2.staff_last_name = \"Weber\"", "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Dameon\" AND T2.staff_last_name = \"Fami\"", "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Dameon\" AND T2.staff_last_name = \"Frami\"", "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Dameon\" AND T2.staff_last_name = \"Frami\" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Jolie\" AND T2.staff_last_name = \"Weber\"" ]
What are the id of problems reported by the staff named Dameon Frami or Jolie Weber?
SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Dameon" AND T2.staff_last_name = "Frami" UNION SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Jolie" AND T2.staff_last_name = "Weber"
tracking_software_problems
[ "For each problem, What are the different names of staff members who can authorize closure!", "Also provide the product_ids!", "Show me the product ids that have closure authorized by Ashley Medhurst!", "Of those, only those that were reported by Christop Beege!" ]
[ "SELECT distinct T2.staff_first_name, T2.staff_last_name FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id", "SELECT product_id, T2.staff_first_name, T2.staff_last_name FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id", "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Ashley\" AND T2.staff_last_name = \"Medhurst\"", "SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Christop\" AND T2.staff_last_name = \"Berge\" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Ashley\" AND T2.staff_last_name = \"Medhurst\"" ]
What are the product ids for the problems reported by Christop Berge with closure authorised by Ashley Medhurst?
SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Christop" AND T2.staff_last_name = "Berge" INTERSECT SELECT product_id FROM problems AS T1 JOIN staff AS T2 ON T1.closure_authorised_by_staff_id = T2.staff_id WHERE T2.staff_first_name = "Ashley" AND T2.staff_last_name = "Medhurst"
tracking_software_problems
[ "How many problems has staff named Lysanne Turcotte reported?", "Show me their ids, and problem descriptions.", "What is the oldest date these were reported?", "Show me the ids of all the other problems that were reported before this date! :" ]
[ "SELECT count(*) FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Lysanne\" AND T2.staff_last_name = \"Turcotte\"", "SELECT problem_id, problem_description FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Lysanne\" AND T2.staff_last_name = \"Turcotte\"", "SELECT min(date_problem_reported) FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Lysanne\" AND T2.staff_last_name = \"Turcotte\"", "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < ( SELECT min(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = \"Lysanne\" AND T4.staff_last_name = \"Turcotte\" )" ]
What are the ids of the problems reported before the date of any problem reported by Lysanne Turcotte?
SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported < ( SELECT min(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Lysanne" AND T4.staff_last_name = "Turcotte" )
tracking_software_problems
[ "What are all the names of the staff members that have reported problems?", "What was the problem id and date of the last problem they each reported?", "Show me the date for staff named Ryan Homenick", "Now show any problem id that was reported after this date!" ]
[ "SELECT T2.staff_first_name, T2.staff_last_name FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id", "SELECT T2.staff_first_name, T2.staff_last_name, T1.problem_id, max(date_problem_reported) FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id group by T2.staff_first_name, T2.staff_last_name", "SELECT max(date_problem_reported) FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_first_name = \"Rylan\" AND T2.staff_last_name = \"Homenick\"", "SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > ( SELECT max(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = \"Rylan\" AND T4.staff_last_name = \"Homenick\" )" ]
What are the ids of the problems reported after the date of any problems reported by Rylan Homenick?
SELECT T1.problem_id FROM problems AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE date_problem_reported > ( SELECT max(date_problem_reported) FROM problems AS T3 JOIN staff AS T4 ON T3.reported_by_staff_id = T4.staff_id WHERE T4.staff_first_name = "Rylan" AND T4.staff_last_name = "Homenick" )
tracking_software_problems
[ "Show me all different products with problems!", "How many problems do they each have for each product name?", "Show me the names of the products in the bottom 3!", "What about the top 3?" ]
[ "SELECT * FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id", "SELECT T2.product_name, count(*) FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name", "SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY count(*) ASC LIMIT 3", "SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY count(*) DESC LIMIT 3" ]
Find the top 3 products which have the largest number of problems?
SELECT T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id GROUP BY T2.product_name ORDER BY count(*) DESC LIMIT 3
tracking_software_problems
[ "What are all the problems that are reported after 1995?", "Show the product names that each are associated with?", "Show the ids of the ones with the product named Rose.", "How about those with the product named voluptatem" ]
[ "SELECT * FROM problems where date_problem_reported > \"1995\"", "SELECT *, T2.product_name FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T1.date_problem_reported > \"1995\"", "SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = \"rose\" AND T1.date_problem_reported > \"1995\"", "SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = \"voluptatem\" AND T1.date_problem_reported > \"1995\"" ]
List the ids of the problems FROM the product "voluptatem" that are reported after 1995?
SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = "voluptatem" AND T1.date_problem_reported > "1995"
tracking_software_problems
[ "What are first and last names of all the staff members?", "Which ones reported on problems with products named \"rem\" or \"aut\"?", "Of these, who reported on \"rem\"?", "Of these, who did not report on \"aut\"" ]
[ "SELECT staff_first_name , staff_last_name FROM staff", "SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = \"rem\" or T2.product_name = \"aut\"", "SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = \"rem\"", "SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = \"rem\" EXCEPT SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = \"aut\"" ]
Find the first and last name of the staff members who reported problems FROM the product "rem" but not "aut"?
SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "rem" EXCEPT SELECT T3.staff_first_name , T3.staff_last_name FROM problems AS T1 JOIN product AS T2 JOIN staff AS T3 ON T1.product_id = T2.product_id AND T1.reported_by_staff_id = T3.staff_id WHERE T2.product_name = "aut"
tracking_software_problems
[ "What are the course names?", "Which course has the least number of registered students?", "Most number?" ]
[ "SELECT course_name FROM courses", "SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) ASC LIMIT 1", "SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) DESC LIMIT 1" ]
which course has most number of registered students?
SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_Id GROUP BY T1.course_id ORDER BY count(*) DESC LIMIT 1
student_assessment
[ "What are the course ids that students registered for?", "What about student ids.", "Which one registered for the least number of courses." ]
[ "SELECT course_id FROM student_course_registrations", "SELECT student_id FROM student_course_registrations", "SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) LIMIT 1" ]
what is id of students who registered some courses but the least number of courses in these students?
SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) LIMIT 1
student_assessment
[ "Who are the students? Give the id and details.", "Which students attend courses?", "Which ones do not? Just give the student id." ]
[ "SELECT student_id, student_details FROM students", "SELECT student_id, student_details FROM students WHERE student_id IN (SELECT student_id FROM student_course_attendance)", "SELECT student_id FROM students WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)" ]
List the id of students who never attends courses?
SELECT student_id FROM students WHERE student_id NOT IN (SELECT student_id FROM student_course_attendance)
student_assessment
[ "What is the course id of the most recent course registration?", "Give the student id instead.", "Give the student details." ]
[ "SELECT course_id FROM student_course_registrations ORDER BY registration_date DESC LIMIT 1", "SELECT student_id FROM student_course_registrations ORDER BY registration_date DESC LIMIT 1", "SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1" ]
What is detail of the student who most recently registered course?
SELECT T2.student_details FROM student_course_registrations AS T1 JOIN students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.registration_date DESC LIMIT 1
student_assessment
[ "Which students attended the course with course id 301?", "Count how many did so.", "What about the course English?" ]
[ "SELECT student_id FROM student_course_attendance WHERE course_id = 301", "SELECT count(*) FROM student_course_attendance WHERE course_id = 301", "SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = \"English\"" ]
How many students attend course English?
SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English"
student_assessment
[ "What are the dates of attendance for the student with id 141?", "With id 171?", "What are the courses that this student attends? Give the course names.", "How many are there?" ]
[ "SELECT date_of_attendance FROM student_course_attendance WHERE student_id = 141", "SELECT date_of_attendance FROM student_course_attendance WHERE student_id = 171", "SELECT course_name FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171", "SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171" ]
How many courses do the student whose id is 171 attend?
SELECT count(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171
student_assessment
[ "What is the first name of the candidate with login name mkou?", "Give the candidate id instead.", "Find the same for the candidate with [email protected]." ]
[ "SELECT first_name FROM people WHERE login_name = \"mkou\"", "SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.login_name = \"mkou\"", "SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = \"[email protected]\"" ]
Find id of the candidate whose email is [email protected]?
SELECT T2.candidate_id FROM people AS T1 JOIN candidates AS T2 ON T1.person_id = T2.candidate_id WHERE T1.email_address = "[email protected]"
student_assessment
[ "What is the oldest date of assessment of the candidates?", "Most recent?", "Give the candidate id instead." ]
[ "SELECT assessment_date FROM candidate_assessments ORDER BY assessment_date ASC LIMIT 1", "SELECT assessment_date FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1", "SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1" ]
Find id of the candidate who most recently accessed the course?
SELECT candidate_id FROM candidate_assessments ORDER BY assessment_date DESC LIMIT 1
student_assessment
[ "Which student registered for the least number of courses? Give the student id.", "Most number of courses?", "Give the student details." ]
[ "SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) ASC LIMIT 1", "SELECT student_id FROM student_course_registrations GROUP BY student_id ORDER BY count(*) DESC LIMIT 1", "SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1" ]
What are the details of the student who registered the most number of courses?
SELECT T1.student_details FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1
student_assessment
[ "How many students registered for each course?", "How many courses did each student register for?", "Give the student id as well." ]
[ "SELECT count(*) FROM student_course_registrations GROUP BY course_id", "SELECT count(*) FROM student_course_registrations GROUP BY student_id", "SELECT T1.student_id , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id" ]
List the id of students who registered some courses and the number of their registered courses?
SELECT T1.student_id , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id
student_assessment
[ "How many registered students are there?", "How many are there for each course?", "Give the course name as well." ]
[ "SELECT count(DISTINCT student_id) FROM student_course_registrations", "SELECT count(*) FROM student_course_registrations GROUP BY course_id", "SELECT T3.course_name , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id" ]
How many registered students does each course have? List course name and the number of their registered students.
SELECT T3.course_name , count(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id
student_assessment
[ "Find the qualifications of the candidates with assessment code \"Pass\"", "Give their candidate details instead.", "What about with assessment code \"Fail\"", "Find the cell mobile number instead." ]
[ "SELECT qualification FROM candidate_assessments WHERE asessment_outcome_code = \"Pass\"", "SELECT T1.candidate_details FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id WHERE T2.asessment_outcome_code = \"Pass\"", "SELECT T1.candidate_details FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id WHERE T2.asessment_outcome_code = \"Fail\"", "SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = \"Fail\"" ]
Find the cell mobile number of the candidates whose assessment code is "Fail"?
SELECT T3.cell_mobile_number FROM candidates AS T1 JOIN candidate_assessments AS T2 ON T1.candidate_id = T2.candidate_id JOIN people AS T3 ON T1.candidate_id = T3.person_id WHERE T2.asessment_outcome_code = "Fail"
student_assessment
[ "Give the most recently attended course.", "What about for the course 301?", "Give the student id instead." ]
[ "SELECT course_id FROM student_course_attendance ORDER BY date_of_attendance DESC LIMIT 1", "SELECT course_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1", "SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1" ]
What is the id of the student who most recently attended course is 301?
SELECT student_id FROM student_course_attendance WHERE course_id = 301 ORDER BY date_of_attendance DESC LIMIT 1
student_assessment