{"question_id": 11, "split": "validation", "changes": {"question": {"before": "For all ratings which are rated in year 2020, name the titles of the movies which has the rating scored 4 and above.", "after": "List the titles of movies that received at least one rating of 4 or higher in 2020."}, "evidence": {"before": "ratings in year 2020 refers to rating_timestamp_utc like '%2020%'; rating_score > = 4;", "after": "ratings.rating_timestamp_utc is the rating’s UTC timestamp, stored as YYYY-MM-DD HH:MM:SS. ratings.rating_score uses a 1-to-5 scale."}}} {"question_id": 17, "split": "validation", "changes": {"question": {"before": "What are the URL to the list page on Mubi of the lists with followers between 1-2 and whose last update timestamp was on 2012?", "after": "List the Mubi URLs for lists that have one or two followers and were last updated in 2012"}, "evidence": {"before": "URL to the list page on Mubi refers to list_url; list_followers = 1 OR list_followers = 2; last update timestamp was on 2012 refers to list_update_timestamp_utc BETWEEN '2012-1-1' AND '2012-12-31';", "after": "URL to the list page on Mubi refers to list_url; list_followers = 1 OR list_followers = 2; last update timestamp was on 2012 refers to list_update_timestamp_utc"}}} {"question_id": 19, "split": "validation", "changes": {"question": {"before": "For movie id 1269, how many users, who was a paying subscriber and was eligible for trial when he rated the movie, gave the movie a rating score of less than or equal to 2?", "after": "For movie 1269, how many paying subscribers eligible for a trial when rating it gave a score of 2 or less?"}, "evidence": {"before": "paying subscriber refers to user_has_payment_method = 1; eligible for trial refers to user_eligible_for_trial = 1; rating_score< = 2;", "after": "ratings.user_has_payment_method = 1 denotes a paying subscriber; ratings.user_eligible_for_trial = 1 denotes trial eligibility when the rating was made. ratings.rating_score records the score."}}} {"question_id": 25, "split": "train", "changes": {"question": {"before": "Which year was the third movie directed by Quentin Tarantino released?", "after": "In what year was Quentin Tarantino’s third-earliest movie released?"}, "evidence": {"before": "third movie refers to third movie that has oldest movie_release_year;", "after": "movies.director_name records 'Quentin Tarantino'; movies.movie_release_year records the release year."}}} {"question_id": 33, "split": "train", "changes": {"SQL": {"before": "SELECT T2.list_id, T1.list_followers, T2.user_subscriber = 1 FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND T2.list_id = T2.list_id WHERE T2.user_id = 4208563 AND T1.list_followers = (SELECT MAX(T1.list_followers) FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND T2.list_id = T2.list_id WHERE T2.user_id = 4208563);", "after": "SELECT T2.list_id, T1.list_followers, T2.user_subscriber = 1 FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND T1.list_id = T2.list_id WHERE T2.user_id = 4208563 AND T1.list_followers = (SELECT MAX(T1.list_followers) FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id AND T1.list_id = T2.list_id WHERE T2.user_id = 4208563);"}}} {"question_id": 37, "split": "train", "changes": {"question": {"before": "How many users rated the movie \"The Magnificent Ambersons\" and gave a rating score of no more than 2?", "after": "How many different users gave “The Magnificent Ambersons” a rating of 2 or lower?"}, "evidence": {"before": "The Magnificent Ambersons refers to movie_title; rating score of no more than 2 refers to rating_score<2", "after": "movies.movie_title records 'The Magnificent Ambersons'; ratings.rating_score records the score and ratings.user_id identifies the user."}}} {"question_id": 38, "split": "train", "changes": {"question": {"before": "Among users who created a list in the February of 2016 and were eligible for trial when they created the list, which user has the most number of followers in their list in February of 2016? Indicate their ids.", "after": "Among users who created a list in February 2016 and were eligible for trial when they created the list, which user has the most followers in their list in February 2016? Indicate their IDs."}, "evidence": {"before": "created a list in the February of 2016 refer to list_creation_date_utc BETWEEN 2/1/2016 and 2/29/2016; eligible for trial refers to user_eligible_for_trial = 1;\n", "after": "lists_users.list_creation_date_utc records list creation date; user_eligible_for_trial = 1 denotes trial eligibility at creation. lists.list_followers records the list’s follower count."}}} {"question_id": 40, "split": "train", "changes": {"question": {"before": "For each director who have directed at least 10 movies between 1960 and 1985, among the movies directed by this director between 1960 and 1985, which movie received the highest amount of 5 rating score? List the movie titles and the amount of 5 rating scores they received.", "after": "Which movies received the most 5-star ratings among each director’s releases from 1960 through 1985? Only consider directors with at least 10 movies released during that period. List the movie titles and their 5-star rating counts, including ties."}, "evidence": {"before": "directed at least 10 movies refers to count(direct_name)>=10; 1960 to 1985 refer to movie_release_year\n", "after": "a movie's 5-star count refers to SUM(CASE WHEN ratings.rating_score = 5 THEN 1 ELSE 0 END) over its ratings; consider only movies released during 1960 through 1985, and only directors with at least 10 such movies; list the titles and that count for every movie equal to its director's MAX, including ties"}}} {"question_id": 47, "split": "train", "changes": {"question": {"before": "What are the titles of the movies directed by Christopher Nolan that have received the highest number of 5 rating scores.", "after": "What are the titles of the movies directed by Christopher Nolan that received the highest number of five-star ratings?"}, "evidence": {"before": "5 rating scores refer to rating_score; Christopher Nolan refer to director_name", "after": "movies.director_name records the director, including 'Christopher Nolan'; ratings.rating_score records the user’s star rating."}}} {"question_id": 50, "split": "train", "changes": {"question": {"before": "How many movie lists were still updated more than 10 years after it was created?", "after": "How many movie lists were updated more than ten years after their creation year?"}, "evidence": {"before": "updated more than 10 years after it was created refers to list_update_timestamp_utc > (list_creation_timestamp_utc+10);", "after": "lists.list_creation_timestamp_utc and lists.list_update_timestamp_utc record creation and latest-update timestamps."}}} {"question_id": 53, "split": "train", "changes": {"question": {"before": "Among the movie lists created after 2010/1/1, how many of them have over 200 followers?", "after": "How many movie lists created from January 2, 2010 onward have more than 200 followers?"}, "evidence": {"before": "created after 2010/1/1 refers to list_creation_timestamp_utc>'2010/1/1'; over 200 followers refers to list_followers>200;", "after": "lists.list_creation_timestamp_utc records creation timestamps with a YYYY-MM-DD date portion; lists.list_followers records follower count."}, "SQL": {"before": "SELECT COUNT(*) FROM lists WHERE list_followers > 200 AND list_creation_timestamp_utc > '2010-01-01'", "after": "SELECT COUNT(*) FROM lists WHERE list_followers > 200 AND list_creation_timestamp_utc >= '2010-01-02';"}}} {"question_id": 70, "split": "train", "changes": {"evidence": {"before": "A Way of Life' refers to movie_title; user 39115684 refers to userid = 39115684;  when the user rate refers to rating_timestamp_utc;", "after": "'A Way of Life' refers to movie_title; user 39115684 refers to userid = 39115684;  when the user rate refers to rating_timestamp_utc;"}}} {"question_id": 73, "split": "train", "changes": {"evidence": {"before": "A Way of Life' refers to movie_title; the user was a trialist when he rated the movie refers to user_trialist = 1;", "after": "'A Way of Life' refers to movie_title; the user was a trialist when he rated the movie refers to user_trialist = 1;"}}} {"question_id": 76, "split": "train", "changes": {"question": {"before": "Which film got 1 like and 2 comments in user 58149469's critic? Indicate the movie titles.", "after": "Which film did user 58149469 review with 1 like and 2 comments? Indicate the movie title."}, "evidence": {"before": "user 58149469 refers to user_id = 58149469; critic with 1 like refers to critic_likes = 1; critic with 2 comments refers to critic_comments = 2;", "after": "ratings.critic_likes and ratings.critic_comments record likes and comments on a user’s review; movies.movie_title records film titles."}}} {"question_id": 78, "split": "train", "changes": {"evidence": {"before": "A Way of Life' is movie_title; rating after the year 2011 refers to rating_timestamp_utc > '2011';", "after": "movies.movie_title records the title 'A Way of Life'. ratings.rating_timestamp_utc records the rating timestamp."}}} {"question_id": 81, "split": "train", "changes": {"evidence": {"before": "A Way of Life' is movie_title; average rating score = Divide (Sum(rating_score), Count(rating_id));", "after": "the movie \"A Way of Life\" refers to movies.movie_title = 'A Way of Life'; average rating score refers to AVG(ratings.rating_score) over the ratings of that movie"}}} {"question_id": 90, "split": "train", "changes": {"evidence": {"before": "It's Winter' is movie_title;", "after": "\"It's Winter\" is movie_title;"}}} {"question_id": 93, "split": "validation", "changes": {"question": {"before": "Which film released in 2008 has the highest average rating score? List the movie titles.", "after": "Which movies released in 2008 have the highest average rating? List all tied titles."}, "evidence": {"before": "film released in 2008 refers to movie_release_year = 2008; scored the highest refers to Max(AVG(rating_score)); film refers to movie;", "after": "movies.movie_release_year records release year; ratings.rating_score records rating scores and ratings.movie_id identifies the movie."}}} {"question_id": 94, "split": "train", "changes": {"question": {"before": "Please list the names of the top three movies in the total number of likes related to the critic made by the user rating the movie.", "after": "What are the names of the top three movies by total critic likes in user ratings?"}, "evidence": {"before": "likes related to the critic made by the user rating the movie refers to critic_likes; top refers to Max(critic_likes);", "after": "total critic likes of a film refers to SUM(ratings.critic_likes) over that film's ratings; return movies.movie_title for the top three by that total, ordered from the largest"}}} {"question_id": 97, "split": "validation", "changes": {"evidence": {"before": "Play it cool' is list_title; cover image of user refers to user_cover_image_url;", "after": "'Georgia related films' is list_title; cover image of user refers to user_cover_image_url;"}}} {"question_id": 101, "split": "validation", "changes": {"evidence": {"before": "Patti Smith: Dream of Life' is movie_title; the user was not a trialist when he created the list refers to user_trialist = 0;", "after": "movies.movie_title records 'Patti Smith: Dream of Life'. ratings.user_trialist = 0 means the user was not a trialist when giving that rating."}}} {"question_id": 106, "split": "train", "changes": {"evidence": {"before": "Versailles Rive-Gauche' is movie_title; average score refers to Avg(rating_score);", "after": "'Versailles Rive-Gauche' is movie_title; average score refers to Avg(rating_score);"}}} {"question_id": 107, "split": "validation", "changes": {"question": {"before": "Which films rated by user 59988436 has received 21 comments? Indicate the movie titles.", "after": "Which films rated by user 59988436 have received 21 comments? Indicate the movie titles."}, "evidence": {"before": "user 59988436 refers to user_id = 59988436; received 21 comments refers to critic_comments = 21; film refers to movie;", "after": "ratings.critic_comments records comments on a review; movies.movie_title records film titles."}}} {"question_id": 119, "split": "train", "changes": {"question": {"before": "What's the number of users gave the movie \"Downfall\" a rating of \"4\"?", "after": "How many different users gave “Downfall” a rating of 4?"}, "evidence": {"before": "movie \"Downfall\" refers to movie_title = 'Downfall'; rating of \"4\" refers to rating_score = 4", "after": "Downfall is recorded in movies.movie_title as 'Downfall'; ratings.rating_score records the score."}}} {"question_id": 122, "split": "validation", "changes": {"evidence": {"before": "at 2019/10/17 1:36:36 refers to rating_timestamp_utc = '2019/10/17 1:36:36'; avatar of the user refers to user_avatar_image_url\n\n", "after": "at 2019/10/17 1:36:36 refers to rating_timestamp_utc = '2019-10-17 01:36:36'; avatar of the user refers to user_avatar_image_url\n\n"}}} {"question_id": 133, "split": "train", "changes": {"evidence": {"before": "1988 movie refers to movie_release_year = '1998'; most ratings refers to MAX(COUNT(rating_score))", "after": "1988 movie refers to movies.movie_release_year = 1988; the most ratings refers to the greatest COUNT of ratings rows associated with a movie; return that movie"}}} {"question_id": 134, "split": "train", "changes": {"question": {"before": "For all the movies that were released in 1995, how many lower than 3 ratings did the most popularity movie had?", "after": "How many ratings below 3 did the most popular movie released in 1995 receive?"}, "evidence": {"before": "released in 1995 refers to movie_release_year = '1995'; lower than 3 ratings refers to rating_score <3; most popularity movie refers to MAX(movie_popularity)", "after": "the most popular movie released in 1995 refers to movies.movie_popularity = MAX(movie_popularity) among the movies released in 1995; ratings below 3 refers to ratings.rating_score < 3; how many such ratings it received refers to COUNT(rating_score) over that movie's ratings"}}} {"question_id": 144, "split": "train", "changes": {"question": {"before": "For all list titles with at least 200 movies in the list, what is their average number of followers?", "after": "What is the average number of followers for lists containing at least 200 movies?"}, "evidence": {"before": "at least 200 movies in the list refers to list_movie_number >= 200; average number of followers refers to avg(list_followers)", "after": "at least 200 movies refers to lists.list_movie_number >= 200; average number of followers refers to AVG(lists.list_followers) over those lists"}}} {"question_id": 145, "split": "train", "changes": {"question": {"before": "List all the titles created by user who was a subsriber when he created the list and have less than 50 movies in the list.", "after": "Which lists contain fewer than 50 movies and were created by subscribers? Give their titles."}, "evidence": {"before": "have less than 50 movies in the list refers to list_movie_number <50; was a subscriber refers to user_subscriber = 1", "after": "lists.list_movie_number is the movie count; lists_users.user_subscriber = 1 means the creator was a subscriber when creating the list."}}} {"question_id": 147, "split": "train", "changes": {"evidence": {"before": "list titled 'Sound and Vision' refers to list_title = 'Sound and Vision'; user_subscriber = 1 means the user was a subscriber when he rated the movie; user_subscriber = 0 means the user was not a subscriber when he rated the movie\n\n\n\n", "after": "list titled 'Sound and Vision' refers to list_title = 'Sound and Vision'; user_subscriber = 1 means the user was a subscriber when he created the list; user_subscriber = 0 means the user was not a subscriber when he created the list\n\n\n\n"}}} {"question_id": 157, "split": "train", "changes": {"question": {"before": "Who is the director that directed the highest number of movies in the 70s? If there are multiple directors with the same amount of movies, list all of their names and indicate the highest rating score that those movies got from the users.", "after": "What is the name of the director who directed the highest number of movies in the 70s? If multiple directors tie, list all their names and the highest rating score their movies received from users."}, "evidence": {"before": "highest number of movies COUNT(T1.movie_id); in the 70s refers to movie_release_year between 1970 and 1979", "after": "in the 70s refers to movies.movie_release_year BETWEEN 1970 AND 1979; the highest number of movies refers to the greatest COUNT(*) of such movies per director; return every movies.director_name whose count is equal to that greatest count, and with each one the MAX(ratings.rating_score) over that director's 70s movies"}}} {"question_id": 163, "split": "train", "changes": {"question": {"before": "What is the average number of number of movies added to the lists of user 8516503? Indicate how many movies did he/she give a rating score of 5.", "after": "What is the average number of movies in user 8516503’s lists, and how many movies has that user rated 5?"}, "evidence": {"before": "average number of number of movies refers to AVG(list_movie_number); user 8516503 refers to user_id = 8516503; rating score of 5 refers to rating_score = 5", "after": "user 8516503 refers to the rows of that user; the average number of movies in that user's lists = AVG(lists.list_movie_number) over that user's lists; the count of movies that user rated 5 = COUNT(DISTINCT movies) over that user's ratings with rating_score = 5, counting each of those movies only one time; return both values"}, "SQL": {"before": "SELECT\n (SELECT AVG(`list_movie_number`) FROM `lists` WHERE `user_id` = 8516503) AS avg_movies_in_lists,\n (SELECT COUNT(*) FROM `ratings` WHERE `user_id` = 8516503 AND `rating_score` = 5) AS count_rating_5;", "after": "SELECT\n (SELECT AVG(`list_movie_number`)\n FROM `lists`\n WHERE `user_id` = 8516503) AS avg_movies_in_lists,\n (SELECT COUNT(DISTINCT `movie_id`)\n FROM `ratings`\n WHERE `user_id` = 8516503\n AND `rating_score` = 5) AS count_rating_5;"}}} {"question_id": 174, "split": "train", "changes": {"question": {"before": "State the royalty percentages for the most year to date sale title within the 20000 range.", "after": "What royalty percentages are associated with the title with the highest year-to-date sales among royalty schedules whose upper range is below 20,000?"}, "evidence": {"before": "most year to date sales refers to MAX(ytd_sales); range limit means high range which refers to hirange; the 20000 range refers to hirange<20000", "after": "royalty percentages refers to roysched.royalty of the schedules with hirange < 20000; the title with the highest year-to-date sales refers to ytd_sales = MAX(ytd_sales) among titles with such a schedule; return the royalty for that title"}}} {"question_id": 176, "split": "train", "changes": {"question": {"before": "List all titles with total sales of quantity more than 20 and store located in the CA state.", "after": "List all titles with a total quantity sold of more than 20 at stores in California."}, "evidence": {"before": "qty is abbreviation for quantity; sales of quantity more than 20 refers to qty>20; store refers to stor_name", "after": "California is recorded as stores.state = 'CA'; sales.qty records quantity sold."}}} {"question_id": 177, "split": "train", "changes": {"question": {"before": "List the name of the store with the highest quantity in sales? What is the least quantity title from the store's sale?", "after": "What is the name of the store with the highest total quantity sold, and which title had the lowest quantity sold at that store?"}, "evidence": {"before": "qty is abbreviation for quantity; highest quantity refers to MAX(qty); least quantity refers to MIN(qty)", "after": "the store with the highest total quantity sold refers to the store whose SUM(sales.qty) is the highest; at that store a title's quantity sold refers to SUM(qty) for that title; return both stores.stor_name and the titles.title with the lowest such per-title total"}}} {"question_id": 182, "split": "train", "changes": {"question": {"before": "Which employee has the lowest job level. State the first name, last name and when he /she was hired.", "after": "Which employees have the lowest job level? List their first names, last names, and hire dates, including ties."}, "evidence": {"before": "lowest job level refers to MIN(job_lvl)", "after": "the lowest job level refers to employee.job_lvl = MIN(job_lvl) over all employees, so every employee at that level qualifies, including ties; list the fname, lname and hire_date of each such employee"}}} {"question_id": 189, "split": "train", "changes": {"evidence": {"before": "most title published refers to MAX(count(title_id); published in 1991 refers to YEAR(pubdate) = 1991", "after": "most title published refers to MAX(count(title_id)); published in 1991 refers to YEAR(pubdate) = 1991"}}} {"question_id": 196, "split": "train", "changes": {"question": {"before": "Calculate the percentage of the employees who are Editor or Designer?", "after": "What percentage of employees are editors or designers?"}, "evidence": {"before": "Editor or Auditor are job description which refers to job_desc; percentage = DIVIDE(count(job_desc = 'Editor' or job_desc = 'Designer'), count(emp_id))*100", "after": "editors or designers refers to jobs.job_desc IN ('Editor', 'Designer'), reached from employee.job_id; percentage = DIVIDE(count of employees in those two jobs, COUNT(employee.job_id) over all employees joined to jobs) * 100, counting employees rather than distinct job titles"}}} {"question_id": 209, "split": "validation", "changes": {"question": {"before": "Please give more detailed note information about the first four books that sell the best.", "after": "Give detailed note information for the four best-selling books."}, "evidence": {"before": "qty is abbreviation for quantity; sells the best mean with the most sales quantity; MAX(SUM(qty))", "after": "titles.notes contains the book notes; sales.qty records quantity sold."}}} {"question_id": 228, "split": "train", "changes": {"evidence": {"before": "\"qty is abbreviation for quantity; Fremont and Portland are name of city; sell in 1993 refers to YEAR(ord_date) = 1993; percentage = DIVIDE(\nSUBTRACT(SUM(qty where city = ‘Fremont’ and year(ord_date = 1993)), \nSUM(qty where city = ‘Portland’ and year(ord_date = 1993))), SUM(qty where city = ‘Portland’ and year(ord_date = 1993)) *100\"", "after": "\"qty is abbreviation for quantity; Fremont and Portland are name of city; sell in 1993 refers to YEAR(ord_date) = 1993; percentage = DIVIDE(\nSUBTRACT(SUM(qty where city = 'Fremont' and year(ord_date = 1993)), \nSUM(qty where city = 'Portland' and year(ord_date = 1993))), SUM(qty where city = 'Portland' and year(ord_date = 1993)) *100\""}}} {"question_id": 230, "split": "train", "changes": {"question": {"before": "Find and list the full name of employees who were hired between 1990 and 1995. Also, arrange them in the descending order of job level.", "after": "List the first names, middle initials, and last names of employees hired from 1990 through 1995, ordered by job level from highest to lowest."}}} {"question_id": 233, "split": "train", "changes": {"evidence": {"before": "Eric the Read Books is a publisher which refers to pub_name;", "after": "New Moon Books is recorded in publishers.pub_name; titles.title, titles.type, and titles.price provide the requested fields."}}} {"question_id": 239, "split": "train", "changes": {"evidence": {"before": "qty is abbreviation for quantity; sold more than average refers to qty > AVG(qty); california refers to state = 'CA\"", "after": "qty is abbreviation for quantity; sold more than average refers to qty > AVG(qty); california refers to state = 'CA'"}}} {"question_id": 241, "split": "train", "changes": {"question": {"before": "When did the earliest complaint start on 2017/3/22?", "after": "When did the earliest complaint begin on 2017/3/22?"}, "evidence": {"before": "earliest complaint refers to oldest ser_start; on 2017/3/22 refers to \"Date received\" = '2017-03-22';", "after": "callcenterlogs.ser_start records the complaint’s start time; \"Date received\" records its received date, represented as '2017-03-22' for March 22, 2017."}}} {"question_id": 257, "split": "train", "changes": {"question": {"before": "What is the percentage of the increase of complaints filed by the clients from New York from the year 2016 to the year 2017?", "after": "What was the percentage increase in complaints from New York City clients between 2016 and 2017? Round your answer to 3 decimal places."}, "evidence": {"before": "percentage of increase = MULTIPLY(DIVIDE(SUBTRACT(SUM(year(\"Date received\") = 2017), SUM(year(\"Date received\") = 2016)), SUM(year(\"Date received\") = 2016)), 1.0); New York refers to city = 'New York City'; year(\"Date received\") BETWEEN 2016 AND 2017; a client's compliant refers to a record in the table events", "after": "client.city records 'New York City'. Each events row is a complaint; events.\"Date received\" records its receipt date. Report the increase on a percentage scale."}, "SQL": {"before": "SELECT 100.0 * (SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2017' THEN 1 ELSE 0 END) - SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2016' THEN 1 ELSE 0 END)) / SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2016' THEN 1 ELSE 0 END) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'New York City'", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * (SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2017' THEN 1 ELSE 0 END) - SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2016' THEN 1 ELSE 0 END)) / SUM(CASE WHEN strftime('%Y', T2.`Date received`) = '2016' THEN 1 ELSE 0 END) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'New York City'\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 263, "split": "validation", "changes": {"question": {"before": "How many days delay for the complaint call from Mr. Brantley Julian Stanley on 2012/5/18?", "after": "How many days elapsed between receiving and sending to the company the complaint from Mr. Brantley Julian Stanley on 2012/5/18?"}, "evidence": {"before": "days delay for the complaint = SUBTRACT(\"date sent to company\", \"Date received\"); Mr refers to sex = 'Male'; on 2012/5/18 refers to \"Date received\" = '2012-05-18';", "after": "events.\"Date received\" and \"Date sent to company\" record the two dates in YYYY-MM-DD form. client.first, middle and last record the name components; client.sex = 'Male' corresponds to Mr."}}} {"question_id": 267, "split": "validation", "changes": {"question": {"before": "How many stars did \"Eagle Capital\" received in total from Little Rock on 2013/4/4?", "after": "How many stars did ‘Eagle Capital’ receive in total from Little Rock on 2013/4/4?"}, "evidence": {"before": "Eagle Capital refers to Product = 'Eagle Capital'; Little Rock is a city; on 2013/4/4 refers to Date = '2013-04-04';", "after": "Eagle Capital is reviews.Product = 'Eagle Capital'; reviews.Stars records stars received and district.city records the city. reviews.Date represents April 4, 2013 as '2013-04-04'."}}} {"question_id": 273, "split": "train", "changes": {"question": {"before": "Please list the full name, date of birth, and email id of the elderly clients in descending order of age.", "after": "For clients older than 65, list their first, middle, and last names, followed by their birth year, month, and day, and their email address. List the oldest clients first."}, "evidence": {"before": "full name = first, middle, last; date of birth = year, month, day; elderly clients refers to age > 65;", "after": "client.year, client.month, and client.day are birth-date components."}}} {"question_id": 282, "split": "train", "changes": {"question": {"before": "Among the clients born between 1980 and 2000, list the name of male clients who complained through referral.", "after": "List the first, middle, and last names of male clients born from 1980 through 2000 who complained through a referral."}, "evidence": {"before": "born between 1980 and 2000 refers to year BETWEEN 1980 AND 2000; name = first, middle, last; male refers to sex = 'Male'; complained through refers to \"Submitted via\";", "after": "client.year records birth year; client.sex = 'Male' denotes male clients. client.first, middle, and last record name components. events.Submitted via = 'Referral' denotes referral complaints."}}} {"question_id": 283, "split": "train", "changes": {"evidence": {"before": "medium refers to \"Submitted via\"; most complaints refers to MAX(Complaint ID); Florida refers to state = 'florida';", "after": "events.Submitted via records the complaint channel. client.state uses 'FL' for Florida."}}} {"question_id": 286, "split": "train", "changes": {"evidence": {"before": "service members refers to client.client_id; Syracuse refers to city = 'Syracuse';", "after": "Service-member complaints have events.Tags = 'Servicemember'. client.city records 'Syracuse'; events.Client_ID identifies the complaining client."}}} {"question_id": 314, "split": "train", "changes": {"question": {"before": "What percentage of clients who sent their complaints by postal mail are age 50 and older?", "after": "What percentage of clients who sent their complaints by postal mail are aged 50 or older?"}, "evidence": {"before": "percentage = MULTIPLY(DIVIDE(SUM(\"Submitted via\" = 'Postal mail'), COUNT(client_id)), 1.0); sent their complaints by refers to \"Submitted via\"; age >= 50;", "after": "clients who sent complaints by postal mail refers to clients having an events row with `Submitted via` = 'Postal mail', each client counted once; aged 50 or older refers to client.age >= 50; percentage = DIVIDE(COUNT(those clients aged 50 or older), COUNT(all of those clients)) * 100"}}} {"question_id": 324, "split": "train", "changes": {"question": {"before": "Among all the clients who complained about their credit cards, what is the percentage of male clients?", "after": "Among all the clients who complained about their credit cards, what is the percentage of male clients? Round your answer to 3 decimal places."}, "evidence": {"before": "percentage = MULTIPLY(DIVIDE(SUM(sex = 'Male'), COUNT(client_id)), 1.0); male refers to sex = 'Male'; credit cards refers to Product = 'Credit card';", "after": "clients who complained about their credit cards refers to DISTINCT events.Client_ID where Product = 'Credit card', joined to client on client_id; male refers to client.sex = 'Male'; percentage = DIVIDE(SUM(CASE WHEN sex = 'Male' THEN 1 ELSE 0 END), COUNT(*)) * 100 over those distinct clients, rounded to 3 decimals"}, "SQL": {"before": "SELECT 100.0 * SUM(CASE WHEN c.sex = 'Male' THEN 1 ELSE 0 END) / COUNT(*) AS pct_male\nFROM (\n SELECT DISTINCT Client_ID\n FROM events\n WHERE Product = 'Credit card'\n) cc\nJOIN client c ON c.client_id = cc.Client_ID;", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * SUM(CASE WHEN c.sex = 'Male' THEN 1 ELSE 0 END) / COUNT(*) AS pct_male\nFROM (\n SELECT DISTINCT Client_ID\n FROM events\n WHERE Product = 'Credit card'\n) cc\nJOIN client c ON c.client_id = cc.Client_ID\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 330, "split": "train", "changes": {"question": {"before": "List the full names of all clients who live in the Pacific division.", "after": "List the first, middle, and last names of clients who live in the Pacific division."}, "evidence": {"before": "full name refers to first, middle, and last", "after": "Client first, middle, and last names are recorded in client.first, client.middle, and client.last. The Pacific division is recorded as district.division = 'Pacific'."}}} {"question_id": 340, "split": "train", "changes": {"question": {"before": "Compute the average time in minute for each age group", "after": "What were the average complaint-handling times in minutes for teenagers, adults, and elders? Return one row with the three averages in that order."}, "evidence": {"before": "teenager refers to 13 < age < = 19; adult refers to 19 < age < = 65; elder refers to age > 65; average time per complaint = max(divide(sum(ser_time), count(ser_time)))", "after": "teenagers refers to age > 13 AND age <= 19, adults to age > 19 AND age <= 65, elders to age > 65, with 'rand client' as the client of a callcenterlogs row; handling time in minutes = 60 * HH + MM + SS / 60.0 from the HH:MM:SS ser_time; per group return DIVIDE(SUM of those minutes, COUNT of its rows), teenagers then adults then elders"}}} {"question_id": 346, "split": "train", "changes": {"question": {"before": "List down the email of client whose complaint is type \"PS\".", "after": "List the email addresses of clients whose complaint type is \"PS\"."}}} {"question_id": 360, "split": "train", "changes": {"question": {"before": "Write down the date received of complaints sent via Fax.", "after": "Write down the dates received for complaints sent via fax."}, "evidence": {"before": "sent via Fax refers to Submitted via = 'Fax'", "after": "Fax submissions are recorded as events.\"Submitted via\" = 'Fax'; events.\"Date received\" records the received date."}}} {"question_id": 363, "split": "train", "changes": {"question": {"before": "Calculate the average age of clients whose response is \"Closed with relief\".", "after": "What is the average age of clients who have had at least one complaint closed with relief? Round your answer to 2 decimal places."}, "evidence": {"before": "average age = avg(age where Company response to consumer = 'Closed with relief'); response \"Closed with relief\" refers to Company response to consumer = 'Closed with relief'", "after": "closed with relief refers to events.`Company response to consumer` = 'Closed with relief'; average age refers to AVG(client.age) over the DISTINCT client_id values having at least one such event, each client counted once, rounded to 2 decimal places"}, "SQL": {"before": "SELECT AVG(age)\nFROM (\n SELECT DISTINCT c.client_id, c.age\n FROM client AS c\n JOIN events AS e ON c.client_id = e.Client_ID\n WHERE e.`Company response to consumer` = 'Closed with relief'\n)", "after": "WITH unrounded(value) AS (\nSELECT AVG(age)\nFROM (\n SELECT DISTINCT c.client_id, c.age\n FROM client AS c\n JOIN events AS e ON c.client_id = e.Client_ID\n WHERE e.`Company response to consumer` = 'Closed with relief'\n)\n) SELECT ROUND(value, 2) FROM unrounded;"}}} {"question_id": 365, "split": "train", "changes": {"evidence": {"before": "final phone number refers to phonefinal; from 1/1/2014 to 12/30/2014 refers to Date received between '2014-01-01' and '2014-12-30'", "after": "The final phone number is stored in phonefinal. Date received contains valid dates in YYYY-MM-DD format, without a time component. Include both January 1 and December 30, 2014, using Date received BETWEEN '2014-01-01' AND '2014-12-30'."}, "SQL": {"before": "SELECT `Complaint ID`, call_id, phonefinal FROM callcenterlogs WHERE strftime('%Y', `Date received`) = '2014' AND server = 'AVIDAN' AND `Date received` != '2014-12-31';", "after": "SELECT `Complaint ID`, call_id, phonefinal FROM callcenterlogs WHERE server = 'AVIDAN' AND `Date received` BETWEEN '2014-01-01' AND '2014-12-30';"}}} {"question_id": 367, "split": "train", "changes": {"question": {"before": "How many times do credit card customers complain about overlimit fees for each year? Return the years and corresponding numbers of customer complains.", "after": "How many times did credit-card customers complain about over-limit fees in each year? List the years and corresponding complaint counts."}, "evidence": {"before": "credit card customer refers to product = 'Credit card'; about overlimit fees refers to issue = 'Overlimit fee'", "after": "events.product uses 'Credit card'; events.issue uses 'Overlimit fee'. events.\"Date received\" records the complaint’s date."}}} {"question_id": 368, "split": "train", "changes": {"question": {"before": "Among the clients in Middle Atlantic, how many are them are female and no more than 18 years old?", "after": "Among clients in the Middle Atlantic, how many are female and no more than 18 years old?"}, "evidence": {"before": "in Middle Atlantic refers to division = 'Middle Atlantic'; female refers to sex = 'Female'; no more than 18 refers to age <= 18", "after": "district.division uses 'Middle Atlantic'; client.sex = 'Female' denotes female and client.age records age in years."}}} {"question_id": 408, "split": "train", "changes": {"question": {"before": "Please list the names of the production company of the movie \"Four Rooms\".", "after": "Please list the names of the production companies for the movie “Four Rooms.”"}, "evidence": {"before": "names of the production company refers to movie_company; movie \"Four Rooms\" refers to title = 'Four Rooms'", "after": "production_company.company_name records production-company names; Four Rooms is recorded in movie.title as 'Four Rooms'."}}} {"question_id": 410, "split": "train", "changes": {"question": {"before": "Please list the titles of all the movie produced by production company \"Universal Pictures\".", "after": "Please list the titles of all movies produced by ‘Universal Pictures’."}, "evidence": {"before": "\"Universal Pictures\" refers to company_name = 'Universal Pictures'", "after": "The company name is production_company.company_name = 'Universal Pictures'; movie.title records movie titles."}}} {"question_id": 420, "split": "train", "changes": {"question": {"before": "Among the movie in which Dariusz Wolski works as the director of photography, what is the percentage of those movie whose vote average is over 5.0?", "after": "What percentage of movies with Dariusz Wolski as director of photography have an average rating above 5.0?"}, "evidence": {"before": "director of photography refers to job = 'Director of Photography'; vote average is over 8.0 refers to vote_average > 5; percentage = divide(sum(movie_id) when vote_average > 5, count(movie_id)) as percentage", "after": "Dariusz Wolski as director of photography refers to a movie_crew row for Dariusz Wolski with job = 'Director of Photography'; average rating above 5.0 refers to vote_average > 5; percentage = DIVIDE(COUNT(DISTINCT such movies with vote_average > 5), COUNT(DISTINCT such movies)) * 100"}, "SQL": {"before": "SELECT CAST(COUNT(CASE WHEN vote_average > 5 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(vote_average) \nFROM (\n SELECT T1.vote_average vote_average\n FROM movie AS T1 \n INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id \n INNER JOIN person AS T3 ON T2.person_id = T3.person_id \n WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography'\n GROUP BY T1.movie_id) ", "after": "SELECT CAST(COUNT(CASE WHEN vote_average > 5 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(*) \nFROM (\n SELECT T1.vote_average vote_average\n FROM movie AS T1 \n INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id \n INNER JOIN person AS T3 ON T2.person_id = T3.person_id \n WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography'\n GROUP BY T1.movie_id) "}}} {"question_id": 437, "split": "train", "changes": {"question": {"before": "What is the title of the movie that was made with the most money and resources?", "after": "Which movies have the largest budget? List their titles, including ties."}, "evidence": {"before": "made with the most money and resources refers to max(budget)", "after": ""}}} {"question_id": 440, "split": "train", "changes": {"question": {"before": "How many crew are named John Young?", "after": "How many crew members are named John Young?"}, "evidence": {"before": null, "after": "person.person_name records crew members’ names, including 'John Young'; movie_crew records crew credits."}}} {"question_id": 457, "split": "validation", "changes": {"question": {"before": "In Movie No. 19, how many people are there in Department No. 7? Please also show their jobs in the second column as a comma separated list.", "after": "In Movie No. 19, how many people work in Department No. 7? In the second column, list their distinct job titles alphabetically, separated by commas with no added spaces."}, "SQL": {"before": "SELECT COUNT(DISTINCT person_id) AS num_people, GROUP_CONCAT(DISTINCT job) AS jobs FROM movie_crew WHERE movie_id = 19 AND department_id = 7;", "after": "SELECT COUNT(DISTINCT person_id) AS num_people, (SELECT GROUP_CONCAT(job, ',') FROM (SELECT DISTINCT job FROM movie_crew WHERE movie_id = 19 AND department_id = 7 AND job IS NOT NULL ORDER BY job)) AS jobs FROM movie_crew WHERE movie_id = 19 AND department_id = 7"}}} {"question_id": 483, "split": "train", "changes": {"question": {"before": "List 10 crews alongside their jobs who worked on the movie 'Mad Max: Fury Road.'", "after": "List 10 crew members and their jobs from the movie \"Mad Max: Fury Road.\""}, "evidence": {"before": "crews refers to person_name; movie 'Mad Max: Fury Road' refers to title = 'Mad Max: Fury Road'", "after": "person.person_name records crew members’ names; movie_crew.job records their jobs. The film title is movie.title = 'Mad Max: Fury Road'."}}} {"question_id": 504, "split": "train", "changes": {"question": {"before": "List down the IDs of the production companies that released the movies in 1916.", "after": "List the IDs of the production companies that released movies in 1916."}, "evidence": {"before": "IDs of the production companies refers to company_id; movies in 1916 refers to release_date LIKE '1916%'", "after": "movie.release_date records the release date; movie_company records production-company associations."}}} {"question_id": 518, "split": "train", "changes": {"question": {"before": "What is the average number of crews for a movie?", "after": "What is the average number of crew members per movie?"}, "evidence": {"before": "average number of crews = divide(count(person_id), COUNT(movie_id))", "after": "movie_crew records crew membership; person_id identifies a crew member and movie_id identifies the movie."}}} {"question_id": 535, "split": "train", "changes": {"question": {"before": "What percentage of films are made in the US?", "after": "What percentage of movies in the movie catalog have the US listed as a production country?"}, "evidence": {"before": "films' and 'movies' are synonyms; made in the US refers to country_iso_code = 'US'; percentage = divide(sum(country_id) when country_iso_code = 'US', count(country_id)) * 100 as percentage", "after": "movies in the movie catalog refers to the movie table, including movies with no production_country row; the US refers to country.country_iso_code = 'US' reached through production_country; percentage = DIVIDE(COUNT(DISTINCT movie_id with a US production country), COUNT(DISTINCT movie.movie_id)) * 100"}, "SQL": {"before": "SELECT 100.0 *\n COUNT(DISTINCT CASE WHEN c.`country_iso_code` = 'US' THEN COALESCE(pc.`movie_id`, m.`movie_id`) END) /\n COUNT(DISTINCT COALESCE(pc.`movie_id`, m.`movie_id`)) AS us_movie_percentage\nFROM `movie` AS m\nFULL JOIN `production_country` pc ON m.`movie_id` = pc.`movie_id`\nLEFT JOIN `country` c ON pc.`country_id` = c.`country_id`;", "after": "SELECT 100.0 * COUNT(DISTINCT CASE WHEN c.country_iso_code = 'US' THEN m.movie_id END) / COUNT(DISTINCT m.movie_id) AS us_movie_percentage\nFROM movie AS m\nLEFT JOIN production_country AS pc ON pc.movie_id = m.movie_id\nLEFT JOIN country AS c ON c.country_id = pc.country_id;"}}} {"question_id": 536, "split": "train", "changes": {"question": {"before": "What is the average ratio between female and male characters in a movie?", "after": "Among movies with both female and male characters, what is the average of their female-to-male character ratios?"}, "evidence": {"before": "female refers to gender = 'Female'; male refers to gender = 'Male'; average ratio = divide(sum(gender_id) when gender = 'Female', sum(gender_id) when gender = 'Male')", "after": "female refers to gender.gender = 'Female' and male refers to gender = 'Male'; for each movie_cast.movie_id the ratio = DIVIDE(COUNT(its female cast entries), COUNT(its male cast entries)), keeping only movies with at least one of each; answer = AVG of those per-movie ratios, unscaled"}}} {"question_id": 563, "split": "train", "changes": {"question": {"before": "What is the proportion of horror movies among all movies genre?", "after": "What percentage of the movies in the movie catalog are horror movies?"}, "evidence": {"before": "horror movies refers to genre_name = 'horror'; average number = divide(sum(movie_id) when genre_name = 'horror', count(movie_id))*100", "after": "movies in the catalog refers to COUNT(DISTINCT movie.movie_id), including catalog movies with no movie_genres assignments; horror movies refers to catalog movies whose movie_genres assignments give genre.genre_name = 'Horror'; percentage = DIVIDE(100.0 * COUNT(DISTINCT movie_id of those horror movies), COUNT(DISTINCT movie.movie_id))"}, "SQL": {"before": "SELECT CAST(COUNT(DISTINCT CASE WHEN T3.genre_name = 'Horror' THEN T1.movie_id ELSE NULL END) AS REAL) * 100.0 / COUNT(DISTINCT T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id", "after": "SELECT 100.0 * COUNT(DISTINCT CASE WHEN g.genre_name = 'Horror' THEN m.movie_id END) / COUNT(DISTINCT m.movie_id) FROM movie m LEFT JOIN movie_genres mg ON m.movie_id=mg.movie_id LEFT JOIN genre g ON mg.genre_id=g.genre_id"}}} {"question_id": 566, "split": "train", "changes": {"question": {"before": "How many English language codes whose comments for the method are in the XML format?", "after": "How many methods marked as English have comments in XML format?"}, "evidence": {"before": "English language refers to Lang = 'en'; the comments for this method is XML format refers to CommentIsXml = 1;", "after": "Method.Lang = 'en' denotes English; Method.CommentIsXml = 1 denotes an XML comment."}}} {"question_id": 575, "split": "train", "changes": {"question": {"before": "Which repository has the longest amount of processed time of downloading? Indicate whether the solution paths in the repository can be implemented without needs of compilation, Yes or No", "after": "Which repository has the longest download processing time, and can all its solutions run without compilation? Give the repository ID and answer Yes or No."}, "evidence": {"before": "longest amount of processed time refers to max(ProcessedTime); the repository can be implemented without needs of compilation refers to WasCompiled = 1 for all solutions;", "after": "longest download processing time refers to Repo.ProcessedTime = MAX(ProcessedTime) over Repo; answer 'Yes' only if every solution of that repository has Solution.NeedsCompilation = 0, otherwise 'No', so a NULL NeedsCompilation or a repository with no solutions gives 'No'; return both the repository Id and that Yes/No answer"}, "SQL": {"before": "SELECT r.Id AS RepoId,\n CASE WHEN MIN(CASE WHEN s.WasCompiled = 1 THEN 1 ELSE 0 END) = 1 THEN 'Yes' ELSE 'No' END AS CanRunWithoutCompilation\nFROM Repo r\nLEFT JOIN Solution s ON s.RepoId = r.Id\nWHERE r.ProcessedTime = (SELECT MAX(ProcessedTime) FROM Repo)\nGROUP BY r.Id;", "after": "SELECT r.Id AS RepoId,\n CASE WHEN MIN(CASE WHEN s.NeedsCompilation = 0 THEN 1 ELSE 0 END) = 1 THEN 'Yes' ELSE 'No' END AS CanRunWithoutCompilation\nFROM Repo r\nLEFT JOIN Solution s ON s.RepoId = r.Id\nWHERE r.ProcessedTime = (SELECT MAX(ProcessedTime) FROM Repo)\nGROUP BY r.Id;"}}} {"question_id": 582, "split": "train", "changes": {"question": {"before": "What is the linearized sequenced of API calls of the method whose solution path is \"mauriciodeamorim_tdd.encontro2\\Tdd.Encontro2.sln\"?", "after": "What is the linearized sequence of API calls for methods in the solution whose path is “mauriciodeamorim_tdd.encontro2\\Tdd.Encontro2.sln”?"}, "evidence": {"before": "linearized sequenced of API calls refers to ApiCalls;", "after": "Linearized API-call sequences are Method.ApiCalls. Solution paths are Solution.Path; the requested path is 'mauriciodeamorim_tdd.encontro2\\Tdd.Encontro2.sln'."}}} {"question_id": 593, "split": "train", "changes": {"question": {"before": "Among the solutions that contain files within the repository followed by over 1000 people, how many of them can be\nimplemented without needs of compilation?", "after": "How many solutions in repositories with more than 1,000 forks do not require compilation?"}, "evidence": {"before": "followed by over 1000 people refers to Forks >1000; can be\nimplemented without needs of compilation refers to WasCompiled = 1;", "after": "Repo.Forks records the number of forks. Solution.NeedsCompilation uses 1 for compilation required and 0 for compilation not required; NULL means unknown."}, "SQL": {"before": "SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks > 1000 AND T2.WasCompiled = 1", "after": "SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks > 1000 AND T2.NeedsCompilation = 0"}}} {"question_id": 594, "split": "train", "changes": {"question": {"before": "Which solution contains files within a more popular repository, the solution ID18 or solution ID19?", "after": "Which of solutions 18 and 19 belongs to the repository with more watchers? Give the solution ID."}, "evidence": {"before": "more watchers mean that this repository is more popular;", "after": "Repo.Watchers records the watcher count. Solution.Id is the solution ID and Solution.RepoId identifies its repository."}, "SQL": {"before": "SELECT CASE WHEN SUM(CASE WHEN T2.Id = 18 THEN T1.Watchers ELSE 0 END) > SUM(CASE WHEN T2.Id = 19 THEN T1.Watchers ELSE 0 END) THEN 'solution ID18' WHEN SUM(CASE WHEN T2.Id = 18 THEN T1.Watchers ELSE 0 END) < SUM(CASE WHEN T2.Id = 19 THEN T1.Watchers ELSE 0 END) THEN 'solution ID19' END isMorePopular FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId", "after": "SELECT s.Id FROM Solution s JOIN Repo r ON r.Id=s.RepoId WHERE s.Id IN (18,19) AND r.Watchers=(SELECT MAX(r2.Watchers) FROM Solution s2 JOIN Repo r2 ON r2.Id=s2.RepoId WHERE s2.Id IN (18,19))"}}} {"question_id": 596, "split": "train", "changes": {"SQL": {"before": "SELECT DISTINCT T2.ProcessedTime FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Path = 'jeffdik_tachy\\src\\Tachy.sln'", "after": "SELECT DISTINCT T1.ProcessedTime FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Path = 'jeffdik_tachy\\src\\Tachy.sln'"}}} {"question_id": 611, "split": "train", "changes": {"evidence": {"before": "repository number refers to RepoId; method refers to Name; Name = ‘SCore.Poisson.ngtIndex’", "after": "repository number refers to RepoId; method refers to Name; Name = 'SCore.Poisson.ngtIndex'"}}} {"question_id": 617, "split": "train", "changes": {"question": {"before": "Give the number of watchers that the repository of the solution No. 326689 have.", "after": "How many watchers does the repository containing the solution with ID 326689 have?"}, "evidence": {"before": "number of watchers refers to Watchers; solution number refers to Solution.Id;", "after": "Solution.RepoId identifies the repository containing a solution."}}} {"question_id": 618, "split": "train", "changes": {"question": {"before": "For each repository that got 189 Stars, how many solutions that needs to be compiled does it contain? List the repository ids and the number of mentioned solutions, respsectively.", "after": "For each repository with 189 stars, give its ID and the number of solutions that require compilation."}, "evidence": {"before": "repository refers to Repository.Id; solution needs to be compiled refers to WasCompiled = 0;", "after": "Repo.Stars records the number of stars; Repo.Id identifies the repository. Solution.NeedsCompilation uses 1 for compilation required and 0 for compilation not required; NULL means unknown."}, "SQL": {"before": "SELECT r.Id AS RepoId,\n COUNT(s.Id) AS NumSolutionsNeedingCompile\nFROM Repo r\nLEFT JOIN Solution s\n ON r.Id = s.RepoId AND s.WasCompiled = 0\nWHERE r.Stars = 189\nGROUP BY r.Id;", "after": "SELECT r.Id AS RepoId,\n COUNT(s.Id) AS NumSolutionsNeedingCompile\nFROM Repo r\nLEFT JOIN Solution s\n ON r.Id = s.RepoId AND s.NeedsCompilation = 1\nWHERE r.Stars = 189\nGROUP BY r.Id;"}}} {"question_id": 624, "split": "train", "changes": {"question": {"before": "For the solution of the most 'sw' methods, what is its path?", "after": "What is the path of the solution with the most methods written in the language “sw”?"}, "evidence": {"before": "solution refers to SolutionId; sw refers to Lang = 'sw'; solution with the most 'sw' methods refers to MAX(COUNT(Lang = 'sw'));", "after": "methods written in the language “sw” refers to Method.Lang = 'sw'; a method belongs to a solution through Method.SolutionId = Solution.Id; the solution with the most such methods refers to the SolutionId whose COUNT of 'sw' methods equals the MAX of those per-solution counts; return Solution.Path"}}} {"question_id": 637, "split": "train", "changes": {"question": {"before": "How many methods with solutions with path 'maravillas_linq-to-delicious\\tasty.sln'?", "after": "How many methods have solutions with the path ‘maravillas_linq-to-delicious\\tasty.sln’?"}, "evidence": {"before": "solution refers to SolutionId;", "after": "Methods are associated with solutions by Method.SolutionId. The requested solution path is Solution.Path = 'maravillas_linq-to-delicious\\tasty.sln'."}}} {"question_id": 638, "split": "train", "changes": {"question": {"before": "List all the solutions ids of the repository with \"636430968896066073\" processed time", "after": "List all the solution IDs for the repository with processed time \"636430968896066073\"."}, "evidence": {"before": "solution ids refers to Solution.Id;", "after": "Repository processing time is Repo.ProcessedTime; the requested value is 636430968896066073. Solution IDs are Solution.Id."}}} {"question_id": 654, "split": "train", "changes": {"question": {"before": "Please provide the path of solution of method whose tokenized name is html parser feed.", "after": "What is the solution path for the method whose tokenized name is ‘html parser feed’?"}, "evidence": {"before": "path of solution refers to Path; tokenized name refers to NameTokenized; NameTokenized = ''html parser feed';", "after": "Solution path is Solution.Path. A method’s tokenized name is Method.NameTokenized; the requested value is 'html parser feed'."}}} {"question_id": 657, "split": "validation", "changes": {"question": {"before": "How many solutions whose repository's stars are a third more than forks?", "after": "How many solutions belong to repositories with at least one-third more stars than forks?"}, "evidence": {"before": "solutions refers to Solution.Id; repository stars are a third more than forks = (MULTIPLY(Forks, 4/3))= Forks * 4.0 / 3;"}}} {"question_id": 659, "split": "train", "changes": {"question": {"before": "Among the repository \"3\", how many methods whose comments is XML format?", "after": "How many methods in the repository with ID 3 have comments in XML format?"}, "evidence": {"before": "repository refers to RepoId; RepoId = 3; method refers to Name; method whose comment is XML format refers to CommentIsXml = 1;", "after": "Method.CommentIsXml = 1 denotes an XML comment. Solution.RepoId identifies the repository containing the method’s solution."}}} {"question_id": 670, "split": "train", "changes": {"question": {"before": "How many methods in the same repository share a tokenized name that begins with \"query language...\"?", "after": "How many methods have tokenized names beginning with \"query language\" in repositories with more than one such method?"}, "evidence": {"before": "tokenized name refers to NameTokenized; NameTokenized LIKE 'query language%';", "after": "A method’s tokenized name is Method.NameTokenized; names beginning with “query language” use 'query language%'. A method belongs to a solution through Method.SolutionId, and the solution’s repository is Solution.RepoId."}}} {"question_id": 678, "split": "train", "changes": {"question": {"before": "List 5 github address that the solutions can be implemented without the need of compilation.", "after": "List any five GitHub repository URLs containing a solution that does not require compilation"}, "evidence": {"before": "github address refers to Url; solution can be implemented without the need of compliation refers to WasCompiled = 1;", "after": "Repo.Url records the GitHub repository URL. Solution.NeedsCompilation uses 1 for compilation required and 0 for compilation not required; NULL means unknown."}, "SQL": {"before": "SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.WasCompiled = 1", "after": "SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.NeedsCompilation = 0"}}} {"question_id": 683, "split": "train", "changes": {"question": {"before": "List all the method name of the solution path \"graffen_NLog.Targets.Syslog\\src\\NLog.Targets.Syslog.sln\".", "after": "List all the method names for the solution path \"graffen_NLog.Targets.Syslog\\src\\NLog.Targets.Syslog.sln\"."}, "evidence": {"before": "method name refers to Name; solution path refers to Path; Path = 'graffen_NLog.Targets.Syslog\\src\\NLog.Targets.Syslog.sln';", "after": "Method names are Method.Name. Solution path is Solution.Path; the requested path is 'graffen_NLog.Targets.Syslog\\src\\NLog.Targets.Syslog.sln'."}}} {"question_id": 686, "split": "train", "changes": {"question": {"before": "\"How many liked by people does the repository of the solution path \"\"ninject_Ninject\\Ninject.sln\"\" have?\"", "after": "How many stars does the repository for solution path “ninject_Ninject\\Ninject.sln” have?"}, "evidence": {"before": "how many liked by people refers to Stars; solution path refers to Path; Path = 'ninject_Ninject\\Ninject.sln';", "after": "Repository star count is Repo.Stars. Solution path is Solution.Path; the requested path is 'ninject_Ninject\\Ninject.sln'."}}} {"question_id": 708, "split": "train", "changes": {"question": {"before": "What is the average number of cars on trains that run in the east direction?", "after": "What is the average number of cars per eastbound train, including trains with no cars?"}, "evidence": {"before": "calculation = DIVIDE(count(id), count(train_id))", "after": "eastbound trains refers to trains.direction = 'east'; average number of cars per eastbound train = DIVIDE(COUNT(cars.id), COUNT(DISTINCT trains.id)), keeping eastbound trains that have no cars in the denominator"}, "SQL": {"before": "SELECT CAST(COUNT(T1.id) AS REAL) / COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'", "after": "SELECT COUNT(c.id) * 1.0 / COUNT(DISTINCT t.id)\nFROM trains AS t LEFT JOIN cars AS c ON c.train_id=t.id\nWHERE t.direction='east';"}}} {"question_id": 743, "split": "train", "changes": {"question": {"before": "How much longer in percentage is the screen time of the most important character in Batman than the least important one?", "after": "By what percentage is Batman’s most important character’s screen time greater than the least important character’s?"}, "evidence": {"before": "most important character refers to max(screentime); least important character refers to min(screentime); movie Batman refers to title = 'Batman'; percentage = divide(subtract(max(screentime) , min(screentime)) , min(screentime)) * 100%", "after": "Batman refers to movie.Title = 'Batman'; screen time refers to characters.screentime converted from hours:minutes:seconds to seconds; the most and least important character refers to the MAX and MIN of that screen time for Batman; percentage greater refers to DIVIDE(SUBTRACT(MAX, MIN), MIN) * 100"}}} {"question_id": 747, "split": "train", "changes": {"question": {"before": "Who were the actors that played in the movie \"Batman\" with the longest screentime?", "after": "Which actors had the longest screen time in the movie ‘Batman’?"}, "evidence": {"before": "movie \"Batman\" refers to Title = 'Batman'; longest screentime refers to max(screentime)", "after": "'Batman' refers to movie.Title = 'Batman'; screen time refers to characters.screentime, read as hours * 3600 + minutes * 60 + seconds; the longest screen time refers to the MAX of that value; return actor.Name for every actor tied at it"}}} {"question_id": 748, "split": "train", "changes": {"question": {"before": "How many movies has the highest networth actor acted in?", "after": "How many movies has the actor with the highest net worth acted in?"}, "evidence": {"before": "highest networth refers to max(networth)", "after": "highest net worth refers to the MAX of actor.NetWorth taken as a number from its formatted currency text; how many movies refers to COUNT(*) of the characters rows of every actor whose net worth is equal to that MAX"}}} {"question_id": 755, "split": "train", "changes": {"question": {"before": "Who played the No.2 character in the credit list of the movie \"American Hustle\"? List the name of the actor.", "after": "Which actor played the No. 2 character in the credit list of ‘American Hustle’?"}, "evidence": {"before": "No.2 character refers to creditOrder = '2'; movie \"American Hustle\" refers to Title = 'American Hustle'", "after": "characters.creditOrder records credit-list position; American Hustle is recorded in movie.Title as 'American Hustle'."}}} {"question_id": 763, "split": "validation", "changes": {"question": {"before": "In romantic movies, how many of them starred by John Travolta?", "after": "How many Romance movies featured John Travolta?"}, "evidence": {"before": "romantic movies refers to Genre = 'Romance'; starred by John Travolta refers to Name = 'John Travolta'", "after": "characters records actors’ movie appearances."}}} {"question_id": 765, "split": "train", "changes": {"question": {"before": "What are the genres of PG rated movies starred by the actors with highest net worth?", "after": "Among the actors who appear in PG rated movies, what are the genres of the PG rated movies starred by those with the highest net worth?"}}} {"question_id": 774, "split": "train", "changes": {"evidence": {"before": "drama genre refers to Genre = 'Drama'; net worth greater than $400,000,000.00 refers to NetWorth > '$400,000,000.00'; percentage = divide(count(ActorID where NetWorth > '$400,000,000.00'), COUNT(ActorID))*100%", "after": "drama genre refers to movie.Genre = 'Drama'; net worth refers to CAST(REPLACE(REPLACE(actor.NetWorth, ',', ''), '$', '') AS REAL), so greater than $400,000,000.00 refers to that value > 400000000; percentage = DIVIDE(COUNT(DISTINCT ActorID with that net worth), COUNT(DISTINCT ActorID)) * 100 over the actors cast in drama movies"}}} {"question_id": 823, "split": "validation", "changes": {"question": {"before": "What gender of users posted the most tweets in `en`?", "after": "Which gender’s users posted the most tweets in English (en)?"}, "evidence": {"before": "\"en\" is the language and refers to Lang = 'en'; most tweet in 'en' refers to Max(Count(text where Lang = 'en'))", "after": "twitter.Lang = 'en' denotes English; twitter.text records the tweet text and user.Gender records the user’s gender."}}} {"question_id": 824, "split": "validation", "changes": {"question": {"before": "What gender of users has a tweet that were retweeted more than 30 times? List all such genders.", "after": "Which genders are recorded for users who posted a tweet that was retweeted more than 30 times?"}, "evidence": {"before": "retweet more than 30 times refers to RetweetCount > 30", "after": "user.Gender uses 'Male', 'Female', and 'Unknown'."}}} {"question_id": 840, "split": "validation", "changes": {"evidence": {"before": "male user refers to Gender = 'Male; 'Monday' is the Weekday; total number of tweet refers to Count (TweetID)", "after": "male user refers to Gender = 'Male'; 'Monday' is the Weekday; total number of tweet refers to Count (TweetID)"}}} {"question_id": 851, "split": "train", "changes": {"question": {"before": "Among all the tweets sent by male users in Argentina, what is the text of the one with the most number of likes?", "after": "Which tweets by male users in Argentina received the most likes? List their text, including ties."}}} {"question_id": 856, "split": "validation", "changes": {"question": {"before": "How many professors are more popular than Zhou Zhihua?", "after": "How many professors are more popular than Zhihua Zhou?"}}} {"question_id": 869, "split": "train", "changes": {"question": {"before": "Which professor advised Willie Rechert to work as a research assistant? Please give his or her full name.", "after": "Which professor advised Willie Rechert as a research assistant? Give the professor’s first and last names."}, "evidence": {"before": "research assistant refers to the student who serves for research where the abbreviation is RA; prof_id refers to professor’s ID; full name refers to f_name and l_name;", "after": "RA records research-assistant appointments; RA.prof_id identifies the advising professor. prof.first_name and prof.last_name record the professor’s name; student.f_name and student.l_name record the student’s name."}}} {"question_id": 871, "split": "train", "changes": {"question": {"before": "What is the average satisfying degree of the course Machine Learning Theory?", "after": "What is the average satisfaction score for the course Machine Learning Theory?"}, "evidence": {"before": "sat refers to student's satisfaction degree with the course;", "after": "Student satisfaction for a course is registration.sat. Course name is course.name; Machine Learning Theory is stored as 'Machine Learning Theory'."}}} {"question_id": 889, "split": "train", "changes": {"question": {"before": "What is the full name of the professor who graduated from an Ivy League School?", "after": "What are the first and last names of professors who graduated from an Ivy League university?"}}} {"question_id": 892, "split": "train", "changes": {"evidence": {"before": "the most popular professors refers to prof_id where MAX(popularity); female refers to gender;", "after": "the most popular professors refers to prof.popularity = MAX(popularity) over prof; females refers to prof.gender = 'Female'; how many refers to COUNT of the prof records with both"}}} {"question_id": 901, "split": "validation", "changes": {"question": {"before": "Which of the two courses, \"Advanced Operating System\" or \"Intro to BlockChain', did most of the students receive an A in?", "after": "Which of the two courses, \"Advanced Operating System\" or \"Intro to BlockChain,\" had the most students receive an A?"}, "evidence": {"before": "A refers to an excellent grade in which grade = 'A';", "after": "An A grade is registration.grade = 'A'. Course name is course.name; the compared courses are 'Advanced Operating System' and 'Intro to BlockChain'."}}} {"question_id": 908, "split": "validation", "changes": {"question": {"before": "Name the professor who got graduation from the University of Boston.", "after": "List the first and last names of professors who graduated from the University of Boston."}, "evidence": {"before": "Name the professor refers to full name which includes f_name and l_name;", "after": "prof.graduate_from records the university a professor graduated from."}}} {"question_id": 916, "split": "train", "changes": {"question": {"before": "Among students registered for the most difficult course, list the students' full names who got grade A.", "after": "What are the first and last names of students who earned an A in any course tied for the highest difficulty?"}, "evidence": {"before": "difficulty refers to diff; most difficult course refers to MAX(diff); student's full names = f_name, l_name;", "after": "a course tied for the highest difficulty refers to course.diff = MAX(diff) over course; earned an A refers to registration.grade = 'A'; return the distinct student.f_name and student.l_name of the students with such a registration"}}} {"question_id": 919, "split": "train", "changes": {"question": {"before": "GPA of the semester refers to student.gpa", "after": "Calculate Laughton Antonio's overall GPA from this semester."}, "evidence": {"before": "GPA of the semester = DIVIDE(SUM(MULTIPLY(credit, grade)), SUM(credit)); grade 'A' refers to gpa = 4; grade 'B' refers to gpa = 3; grade 'C' refers to gpa = 2; grade 'D' refers to gpa = 1;", "after": "Semester GPA is the credit-weighted average of registration grades: A = 4, B = 3, C = 2, D = 1, and a missing or empty grade = 0. Include the credits of failed courses in the denominator."}, "SQL": {"before": "SELECT s.gpa\nFROM student s\nJOIN registration r ON s.student_id = r.student_id\nJOIN course c ON r.course_id = c.course_id\nWHERE s.f_name = 'Laughton'\n AND s.l_name = 'Antonio';", "after": "SELECT SUM(c.credit * CASE r.grade WHEN 'A' THEN 4 WHEN 'B' THEN 3 WHEN 'C' THEN 2 WHEN 'D' THEN 1 ELSE 0 END) * 1.0 / SUM(c.credit) AS semester_gpa FROM student AS s INNER JOIN registration AS r ON s.student_id = r.student_id INNER JOIN course AS c ON r.course_id = c.course_id WHERE s.f_name = 'Laughton' AND s.l_name = 'Antonio' GROUP BY s.student_id"}}} {"question_id": 932, "split": "train", "changes": {"question": {"before": "List the distinct capabilities of research postgraduate students with an intellegence level of 4 and above.", "after": "List the distinct capabilities of research postgraduate students with an intelligence level of 4 or above."}, "evidence": {"before": "research postgraduate students refers to type = 'RPG'; intelligence level of 4 and above refers to intelligence > = 4;", "after": "Research postgraduate students use student.type = 'RPG'. Intelligence level is student.intelligence, with 4 or above represented by >= 4. Capability is RA.capability."}}} {"question_id": 933, "split": "train", "changes": {"question": {"before": "In students with a grade of B, how many of them have an intellegence level of 3?", "after": "Among students with a grade of B, how many have an intelligence level of 3?"}, "evidence": {"before": null, "after": "Student course grade is registration.grade; grade B is stored as 'B'. Student intelligence level is student.intelligence; the requested value is 3."}}} {"question_id": 940, "split": "train", "changes": {"question": {"before": "List the student's email with grade of B in a course with difficulty greater than the 80% of average difficulty of all courses.", "after": "List the email addresses of students with grade B in courses whose difficulty exceeds 80% of the average difficulty of all courses."}, "evidence": {"before": "difficulty refers to diff; course with difficulty greater than the 80% of average difficulty refers to diff > MULTIPLY(AVG(diff), 80%);", "after": "grade B refers to registration.grade = 'B'; difficulty refers to course.diff; difficulty exceeding 80% of the average difficulty of all courses refers to diff > MULTIPLY(AVG(diff) over the whole course table, 0.8); return student.email"}}} {"question_id": 960, "split": "train", "changes": {"question": {"before": "Among professors with the highest teachability, how many of their students have high salary?", "after": "How many students of professors with the highest teachability have high salaries?"}, "evidence": {"before": "highest teachability refers to MAX(teachability); high salary refers to salary = 'high';", "after": "highest teachability refers to prof.teachingability = MAX(teachingability) over all professors; high salaries refers to RA.salary = 'high'; how many students refers to COUNT(DISTINCT RA.student_id) among those RA rows"}}} {"question_id": 962, "split": "validation", "changes": {"question": {"before": "Among students that gave satisfaction of value 4 for the course named \"Statistical learning\", how many of them have a gpa of 3.8?", "after": "Among students who gave a satisfaction value of 4 for the course \"Statistical learning,\" how many have a GPA of 3.8?"}, "evidence": {"before": "satisfaction refers to sat;\n\nsat = 4; gpa = 3.8 ", "after": "Course satisfaction is registration.sat; the requested value is 4. Student GPA is student.gpa; the requested value is 3.8. Course name is course.name; Statistical learning is stored as 'Statistical learning'."}}} {"question_id": 963, "split": "train", "changes": {"question": {"before": "Among courses with difficulty of 3, how many students have intellegence level of 2?", "after": "How many students with an intelligence level of 2 are registered for at least one course with difficulty level 3?"}, "evidence": {"before": "difficulty of 3 refers to diff = 3; intelligence = 2", "after": "course.diff records course difficulty; registration records students’ course registrations."}}} {"question_id": 964, "split": "train", "changes": {"SQL": {"before": "SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Applied Deep Learning ' AND T2.grade = 'C'", "after": "SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Applied Deep Learning' AND T2.grade = 'C'"}}} {"question_id": 971, "split": "train", "changes": {"question": {"before": "List the ID of all professors who are not faculty member along with the courses taught by him/her.", "after": "List the IDs of all professors who are not faculty members, along with the courses they teach."}}} {"question_id": 972, "split": "train", "changes": {"question": {"before": "Provide the ID of professors who are teaching high-level or harder undergraduate course.", "after": "Which professors teach Level 400 undergraduate courses? Give their IDs."}, "evidence": {"before": "ID of professors refers to taughtBy.p_id; high-level or harder undergraduate course refers to courseLevel = 'Level_400'", "after": "course.courseLevel = 'Level_400' denotes the requested undergraduate course level. person.professor = 1 identifies professors; taughtBy.p_id identifies an instructor."}}} {"question_id": 974, "split": "train", "changes": {"question": {"before": "Name the advisors for students in Year 3 of the program.", "after": "List the advisor IDs for students in their third program year."}, "evidence": {"before": "advisors refers to p_id_dummy; students in Year 3 of the program refers to yearsInProgram = 'Year_3'", "after": "advisedBy.p_id identifies the student and advisedBy.p_id_dummy identifies the advisor. person.yearsInProgram uses Year_3 for the third program year."}}} {"question_id": 983, "split": "train", "changes": {"question": {"before": "How many basic and medium undergraduate courses are there?", "after": "How many undergraduate courses are classified as basic and medium level?"}, "evidence": {"before": "basic and medium undergraduate courses refers to courseLevel = 'Level_300' and courses refers to course.course_id", "after": "Basic and medium undergraduate courses use course.courseLevel = 'Level_300'."}}} {"question_id": 984, "split": "train", "changes": {"question": {"before": "How many people teaches course no.11?", "after": "How many professors teach the course with ID 11?"}, "evidence": {"before": "people refers to taughtBy.p_id; course no.11 refers to course_id = 11", "after": "taughtBy records instructors’ course assignments. person.professor = 1 identifies professors."}}} {"question_id": 988, "split": "train", "changes": {"question": {"before": "How many basic or medium undergraduate courses are taught by a professor?", "after": "How many basic or medium undergraduate courses are taught by professors?"}, "evidence": {"before": "basic or medium undergraduate courses refers to courseLevel = 'Level_300'; professor refers to professor = 1", "after": "course.courseLevel = 'Level_300' identifies basic or medium undergraduate courses. person.professor = 1 identifies professors; taughtBy links courses to instructors."}}} {"question_id": 989, "split": "train", "changes": {"question": {"before": "Please list the IDs of all the faculty employees who teaches a basic or medium undergraduate course.", "after": "List the IDs of faculty employees who teach a basic or medium-level undergraduate course."}, "evidence": {"before": "faculty employees refers to hasPosition = 'Faculty_eme'; basic or medium undergraduate course refers to courseLevel = 'Level_300'", "after": "person.hasPosition = 'Faculty_eme' denotes faculty employees. course.courseLevel = 'Level_300' denotes basic or medium-level undergraduate courses. taughtBy records teaching assignments."}}} {"question_id": 991, "split": "train", "changes": {"question": {"before": "Please list the levels of the all courses taught by teacher no.79.", "after": "Please list the levels of all courses taught by teacher no. 79."}, "evidence": {"before": "levels of the all courses refers to courseLevel; teacher no.79 refers to taughtBy.p_id = 79", "after": "Course level is course.courseLevel. Teacher number 79 is taughtBy.p_id = 79."}}} {"question_id": 996, "split": "train", "changes": {"question": {"before": "What is the level of the course with the most number of teachers?", "after": "What is the level of the course with the most teachers?"}, "evidence": {"before": "level of the course refers to courseLevel; course with most number of teachers refers to course_id = max(count(taughtBy.p_id))", "after": "a course's number of teachers refers to COUNT(DISTINCT taughtBy.p_id) grouped by taughtBy.course_id; the course with the most teachers refers to the course whose count equals the greatest such count; return course.courseLevel for every course at that maximum"}}} {"question_id": 1000, "split": "train", "changes": {"question": {"before": "What is the average number of courses taught by a professor?", "after": "Among professors who teach at least one course, what is the average number of courses taught per professor?"}, "evidence": {"before": "professor refers to professor = 1; average number of courses = divide(count(taughtBy.course_id), count(taughtBy.p_id) where professor = 1 )", "after": "professors refers to person.professor = 1; courses taught refers to taughtBy assignments; average number of courses taught per professor = DIVIDE(COUNT(taughtBy assignments), COUNT(DISTINCT professors with at least one assignment))"}, "SQL": {"before": "SELECT CAST(SUM(CASE WHEN tb.course_id IS NULL THEN 0 ELSE 1 END) AS REAL)\n / COUNT(*) AS avg_courses_per_prof\nFROM person p\nLEFT JOIN taughtBy tb ON p.p_id = tb.p_id\nWHERE p.professor = 1;", "after": "SELECT CAST(COUNT(tb.course_id) AS REAL) / COUNT(DISTINCT p.p_id) AS avg_courses_per_prof\nFROM person AS p\nINNER JOIN taughtBy AS tb ON p.p_id = tb.p_id\nWHERE p.professor = 1 AND tb.course_id IS NOT NULL;"}}} {"question_id": 1006, "split": "train", "changes": {"question": {"before": "Describe the year in program and in phase status for the student with most number in advisor.", "after": "For the student with the most advisors, what year of the program are they in, and what is their qualification phase?"}, "evidence": {"before": "student refers to advisedBy.p_id; most number in advisor refers to max(count(p_id_dummy))", "after": "the student refers to the advisee advisedBy.p_id and their advisors to that p_id's advisedBy rows; the student with the most advisors refers to the p_id with the largest COUNT of those rows, taking a single one; return that person's yearsInProgram (Year_N form, 0 for no program) and inPhase (0 means not in that phase)"}}} {"question_id": 1010, "split": "train", "changes": {"question": {"before": "Mention the person ID of faculty professor who taught course ID 104 and the course level.", "after": "Which faculty professors taught the course with ID 104? Give their person IDs and the course level."}, "evidence": {"before": "person ID refers to person.p_id; faculty professor refers to professor = 1 and hasPosition ! = 0", "after": "person.p_id identifies the person; person.professor = 1 denotes a professor. person.hasPosition records faculty membership, with 0 denoting a nonmember. course.courseLevel records the course level."}, "SQL": {"before": "SELECT T1.p_id, T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.course_id = 104 AND T1.hasPosition <> 0", "after": "SELECT T1.p_id, T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.course_id = 104 AND T1.hasPosition <> 0 AND T1.professor = 1;"}}} {"question_id": 1018, "split": "train", "changes": {"question": {"before": "Which professors taught the least amount of courses?", "after": "Among professors who have taught at least one course, which have taught the fewest courses? List their IDs."}, "evidence": {"before": "professor refers to taughtBy.p_id; least amount of courses refers to min(count(course_id))", "after": "professors refers to person.professor = 1; courses taught refers to the number of taughtBy rows per taughtBy.p_id; the fewest courses refers to the MIN of those per-professor counts; list the p_id of every professor whose count equals that minimum, ties included"}}} {"question_id": 1024, "split": "train", "changes": {"question": {"before": "How many professors teaches no more than two high-level or harder undergraduate courses?", "after": "How many professors teach no more than two high-level undergraduate courses, including professors who teach none?"}, "evidence": {"before": "professors refers to taughtBy.p_id; high-level or harder undergraduate courses  refers to courseLevel = 'Level_400' ; no more than two refers to count(taughtBy.course_id) < = 2", "after": "professors refers to person.professor = 1; high-level undergraduate courses refers to course.courseLevel = 'Level_400'; a professor's teaching assignments are that professor's taughtBy records; teach no more than two refers to COUNT(DISTINCT Level_400 courses in those assignments) <= 2, which is 0 for a professor with none; the answer is the COUNT of professors that satisfy it"}}} {"question_id": 1025, "split": "train", "changes": {"question": {"before": "Among the faculty employee professors, how many teaches high-level or harder undergraduate courses?", "after": "Among faculty employee professors, how many teach high-level or harder undergraduate courses?"}, "evidence": {"before": "faculty employee professors refers to hasPosition = 'Faculty_eme' and professor = 1; high-level or harder undergraduate courses refers to courseLevel = 'Level_400'; professors unique identifying number refers to person.p_id", "after": "Faculty employee professors use person.hasPosition = 'Faculty_eme' and person.professor = 1. High-level undergraduate courses use course.courseLevel = 'Level_400'. Professor identifier is person.p_id."}}} {"question_id": 1027, "split": "validation", "changes": {"question": {"before": "What year in the program do the students with more than 2 advisors are in?", "after": "For each student with more than two advisors, what year of their program are they in?"}, "evidence": {"before": "students refers to student = 1; more than 2 advisors refers to count(p_id_dummy) > 2", "after": "person.student = 1 denotes a student. advisedBy.p_id identifies the advisee and advisedBy.p_id_dummy the advisor. person.yearsInProgram uses Year_N for program year N."}}} {"question_id": 1028, "split": "train", "changes": {"question": {"before": "How many professors teaches basic or medium undergraduate courses?", "after": "How many professors teach basic or medium-level undergraduate courses?"}, "evidence": {"before": "professors refers to taughtBy.p_id; basic or medium undergraduate courses refers to couresLevel = 'Level_300'", "after": "person.professor = 1 denotes professors. course.courseLevel = 'Level_300' denotes basic or medium-level undergraduate courses."}}} {"question_id": 1029, "split": "train", "changes": {"question": {"before": "Among the students being advised by advisors, which students' year in the program do the advisors advise the majority of?", "after": "Which year in the program is most common among students who are advised by an advisor?"}, "evidence": {"before": "students refers to student = 1; students' year in the program do the advisors advise the majority of refers to max(count(yearsInProgram))", "after": "students refers to person.student = 1; advised by an advisor refers to person.p_id appearing in advisedBy.p_id; most common year in the program refers to person.yearsInProgram with the greatest COUNT of such students, returning only that single top value"}}} {"question_id": 1050, "split": "train", "changes": {"evidence": {"before": "oldest user refers to MAX(age); active user refers to is_active = 1; on 5/6/2016 refers to timestamp LIKE '2016-05-06%'; coordinates 121, 31 refers to longitude = 120 AND latitude = 32;", "after": "active participation refers to app_events.is_active = 1; the event held on 5/2/2016 at coordinates 120, 32 refers to the events row for 2016-05-02 with events.longitude = 120 and events.latitude = 32; the age of the oldest active user who participated in that event refers to MAX(gender_age.age), returning that one age"}}} {"question_id": 1061, "split": "train", "changes": {"question": {"before": "What is the ratio of male and female users in 27-28 age group?", "after": "What is the ratio of male users to female users in the 27–28 age group? Round your answer to 3 decimal places."}, "evidence": {"before": "ratio = DIVIDE(COUNT(device_id WHERE gender = 'M' AND `group` = 'M27-28'), COUNT(device_id WHERE gender = 'F' AND `group` = 'F27-28')); 27-28 age group refers to `group` = 'F27-28';", "after": "male users in the 27-28 age group refers to gender_age.gender = 'M' AND `group` = 'M27-28'; female users refers to gender = 'F' AND `group` = 'F27-28'; ratio = DIVIDE(COUNT(male-user rows in gender_age), COUNT(female-user rows in gender_age)), rounded to 3 decimal places"}, "SQL": {"before": "SELECT SUM(IIF(gender = 'M' AND `group` = 'M27-28', 1.0, 0.0)) / SUM(IIF(gender = 'F' AND `group` = 'F27-28', 1.0, 0.0)) AS r FROM gender_age", "after": "WITH unrounded(value) AS (\nSELECT SUM(IIF(gender = 'M' AND `group` = 'M27-28', 1.0, 0.0)) / SUM(IIF(gender = 'F' AND `group` = 'F27-28', 1.0, 0.0)) AS r FROM gender_age\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 1065, "split": "train", "changes": {"question": {"before": "Describe the device user gender and age of the event ID of 15251.", "after": "What are the gender and age of the user associated with event ID 15251?"}}} {"question_id": 1098, "split": "train", "changes": {"question": {"before": "Among all the users who use a vivo device, what is the percentage of the users in the M23-26 user group?", "after": "What percentage of vivo devices belong to users in the M23-26 demographic group? Round your answer to 4 decimal places."}, "evidence": {"before": "vivo device refers to phone_brand = 'vivo'; percentage = MULTIPLY(DIVIDE(COUNT(phone_brand = 'vivo WHERE group = 'M23-26), COUNT(phone_brand = 'vivo)), 100); M23-26 user group refers to group = 'M23-26';", "after": "vivo devices refers to phone_brand = 'vivo' in phone_brand_device_model2, one count per record; M23-26 group refers to gender_age.\"group\" = 'M23-26' matched on device_id, records with no demographic match staying in the denominator; percentage = DIVIDE(SUM(CASE WHEN \"group\" = 'M23-26' THEN 1 ELSE 0 END), COUNT(*)) * 100, rounded to 4 decimals"}, "SQL": {"before": "SELECT SUM(IIF(T.`group` = 'M23-26', 1.0, 0)) / COUNT(T.device_id) * 100 AS per FROM (\n SELECT T1.`group`, T1.device_id\n FROM gender_age AS T1 \n INNER JOIN phone_brand_device_model2 AS T2 \n ON T1.device_id = T2.device_id \n WHERE T2.phone_brand = 'vivo'\n GROUP BY T1.device_id) T", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * SUM(CASE WHEN g.`group` = 'M23-26' THEN 1 ELSE 0 END) / COUNT(*) FROM phone_brand_device_model2 p LEFT JOIN gender_age g ON g.device_id=p.device_id WHERE p.phone_brand='vivo'\n) SELECT ROUND(value, 4) FROM unrounded;"}}} {"question_id": 1101, "split": "train", "changes": {"evidence": {"before": "female refers to gender = 'F'; age group of 27 to 28 refers to `group` = 'F27-28';", "after": "gender_age records user demographics. gender_age.gender = 'F' denotes female users; gender_age.\"group\" = 'F27-28' denotes the female 27–28 age group."}}} {"question_id": 1104, "split": "train", "changes": {"grading_method": {"before": "subset", "after": "set"}}} {"question_id": 1105, "split": "train", "changes": {"question": {"before": "How many models does the VIVO phone brand released?", "after": "How many distinct phone models are recorded for VIVO?"}, "evidence": {"before": "models refers to device_model;", "after": "phone_brand_device_model2.phone_brand uses 'vivo'. device_model identifies the model; multiple device records can share a model."}, "grading_method": {"before": "subset", "after": "set"}}} {"question_id": 1123, "split": "validation", "changes": {"evidence": {"before": "on 2016/5/6 refers to timestamp = '2016/5/6 XX:XX:XX';", "after": "May 6, 2016 refers to the date portion of timestamp being '2016-05-06'; ignore the time of day."}}} {"question_id": 1133, "split": "train", "changes": {"evidence": {"before": "at 14:09:49 on 2016/5/6 refers to timestamp = '2016/5/6 14:09:49.0'; location coordinate(116, 40) refers to longitude = '116' AND latitude = '40'; active refers to is_active = '1';", "after": "at 14:09:49 on 2016/5/6 refers to timestamp = '2016-05-06 14:09:49.0'; location coordinate(116, 40) refers to longitude = '116' AND latitude = '40'; active refers to is_active = '1';"}}} {"question_id": 1156, "split": "train", "changes": {"evidence": {"before": "on 2016/5/1 refers to timestamp = '2016-05-01'; male refers to gender = 'M';", "after": "events.timestamp records the event date and time; its date portion uses YYYY-MM-DD. gender_age.gender = 'M' denotes male users."}}} {"question_id": 1167, "split": "train", "changes": {"question": {"before": "How many app users belong to label ID of \"48\"?", "after": "How many apps have label ID 48?"}, "evidence": {"before": null, "after": "app_labels.app_id identifies an app; app_labels.label_id identifies its assigned label."}}} {"question_id": 1183, "split": "train", "changes": {"question": {"before": "How many active users are there in the event?", "after": "How many distinct devices were active across all recorded events?"}, "evidence": {"before": "active refers to is_active = 1;", "after": "app_events.app_id identifies the application, not the user; the device is the unit, reached from app_events through events.event_id to events.device_id. app_events.is_active = 1 denotes activity. A device qualifies if it is active in any recorded event."}, "SQL": {"before": "SELECT COUNT(DISTINCT app_id) FROM app_events WHERE is_active = 1", "after": "SELECT COUNT(DISTINCT e.`device_id`)\nFROM `app_events` ae\nJOIN `events` e ON ae.`event_id` = e.`event_id`\nWHERE ae.`is_active` = 1"}}} {"question_id": 1190, "split": "validation", "changes": {"question": {"before": "What is the average age of the users who use model device of R7?", "after": "What is the average age of users who use the R7 device model?"}, "evidence": {"before": "average age = AVG(age);", "after": "phone_brand_device_model2.device_model uses 'R7'; gender_age.age records age in years."}}} {"question_id": 1205, "split": "train", "changes": {"question": {"before": "Identify by their id all the devices that are used by women who are in the age range of 29 to 31 years.", "after": "Identify by ID all devices used by women aged 29 to 31."}, "evidence": {"before": "id refers to device_id; women refers to gender = 'F'; age range of 29 to 31 years refers to age between 29 and 31;", "after": "gender_age and gender_age_train record device-associated demographics. device_id identifies the device and gender = 'F' denotes female."}}} {"question_id": 1224, "split": "train", "changes": {"question": {"before": "Which gender owned more of the Galaxy Note 2 device model?", "after": "Which gender owned more Galaxy Note 2 devices?"}, "evidence": {"before": "gender that owned more = IIF(SUBTRACT(SUM(gender = 'M'), SUM(gender = 'F'))>0,'M','F'));", "after": "Galaxy Note 2 devices refers to phone_brand_device_model2.device_model = 'Galaxy Note 2'; gender refers to gender_age.gender, which uses 'M' for male and 'F' for female; the gender that owned more = IIF(SUBTRACT(SUM(gender = 'M'), SUM(gender = 'F')) > 0, 'M', 'F'), returning that one gender"}}} {"question_id": 1234, "split": "train", "changes": {"question": {"before": "What is the percentage of users who are in the same behavior category as \"Academic Information\"?", "after": "Among apps with at least one category label, what percentage are labeled “Academic Information”?"}, "evidence": {"before": "percentage = MULTIPLY(DIVIDE(SUM(category = 'Academic Information'), COUNT(app_id)), 100.0); behavior category refers to category; category = 'Academic Information';", "after": "apps with at least one category label refers to COUNT(DISTINCT app_labels.app_id); labeled 'Academic Information' refers to the label assignments whose label_categories.category = 'Academic Information'; percentage = DIVIDE(COUNT(DISTINCT app_id so labeled), COUNT(DISTINCT app_labels.app_id)) * 100"}, "SQL": {"before": "WITH selected_app_ids AS (\n SELECT DISTINCT app_id\n FROM label_categories AS T1 \n INNER JOIN app_labels AS T2 \n ON T1.label_id = T2.label_id AND T1.category = 'Academic Information'\n) SELECT (SELECT COUNT(*) FROM selected_app_ids) * 100 / (SELECT COUNT(DISTINCT app_id) FROM app_labels)", "after": "WITH selected_app_ids AS (\n SELECT DISTINCT app_id\n FROM label_categories AS T1 \n INNER JOIN app_labels AS T2 \n ON T1.label_id = T2.label_id AND T1.category = 'Academic Information'\n) SELECT (SELECT COUNT(*) FROM selected_app_ids) * 100.0 / (SELECT COUNT(DISTINCT app_id) FROM app_labels)"}}} {"question_id": 1235, "split": "train", "changes": {"question": {"before": "Among users who experienced an event on the 3rd of May 2016, what is the percentage of device users in the F27-28 age group?", "after": "Among device users with recorded demographic information who had an event on May 3, 2016, what percentage were in the F27-28 group?"}, "evidence": {"before": "percentage = MULTIPLY(DIVIDE(SUM(`group` = 'F27-28'), COUNT(device_id)), 100.0); on the 3rd of May 2016 refers to timestamp = '2016-05-03%';", "after": "device users with recorded demographic information refers to the device users in gender_age whose gender, age and group are recorded; a device can appear in gender_age with all three left empty, and those are not recorded demographic information; had an event on May 3, 2016 refers to events.timestamp on that day, each device user once; percentage in the F27-28 group = DIVIDE(SUM(CASE WHEN gender_age.group = 'F27-28' THEN 1 ELSE 0 END), COUNT(those device users)) * 100.0"}, "SQL": {"before": "WITH device_on_day AS (\n SELECT DISTINCT `device_id`\n FROM `events`\n WHERE SUBSTR(`timestamp`,1,10) = '2016-05-03'\n)\nSELECT 100.0 * SUM(CASE WHEN ga.`group` = 'F27-28' THEN 1 ELSE 0 END) / COUNT(*) AS percentage_F27_28\nFROM device_on_day d\nJOIN gender_age ga ON ga.`device_id` = d.`device_id`;", "after": "WITH device_on_day AS (\n SELECT DISTINCT `device_id`\n FROM `events`\n WHERE SUBSTR(`timestamp`,1,10) = '2016-05-03'\n)\nSELECT 100.0 * SUM(CASE WHEN ga.`group` = 'F27-28' THEN 1 ELSE 0 END) / COUNT(*) AS percentage_F27_28\nFROM device_on_day d\nJOIN gender_age ga ON ga.`device_id` = d.`device_id`\nWHERE ga.`group` IS NOT NULL;"}}} {"question_id": 1242, "split": "train", "changes": {"question": {"before": "List all the devices' brands and models of events on 5/7/2016 at 6:03:22 AM.", "after": "List the brands and models of devices involved in events on 5/7/2016 at 6:03:22 AM."}, "evidence": {"before": "devices' brands refers to phone_brand; models refers to device_model; on 5/7/2016 at 6:03:22 AM refers to timestamp = '2016-05-07 06:03:22.0';", "after": "phone_brand_device_model2.phone_brand and device_model record the brand and model. events.timestamp represents the requested time as '2016-05-07 06:03:22.0'."}}} {"question_id": 1244, "split": "train", "changes": {"question": {"before": "What percentage of vivo devices belong to users with no information?", "after": "What percentage of vivo devices have no recorded gender, age, or demographic group for their users? Round your answer to 4 decimal places."}, "evidence": {"before": "percentage = MULTIPLY(DIVIDE(SUM(gender = NULL and age = NULL and `group` = NULL), COUNT(device_id)), 100.0); vivo devices refers to phone_brand = 'vivo'; no information refers to gender = NULL AND age = NULL AND `group` = NULL;", "after": "vivo devices refers to phone_brand_device_model2 rows with phone_brand = 'vivo'; no demographic information refers to a vivo row with no gender_age record at all, or with gender, age and group all NULL; percentage = DIVIDE(COUNT(vivo rows with no demographic information), COUNT(vivo rows)) * 100, then ROUND to 4 decimal places"}, "SQL": {"before": "SELECT SUM(CASE WHEN GA.`gender` IS NULL AND GA.`age` IS NULL AND GA.`group` IS NULL THEN 1 ELSE 0 END)*100.0/COUNT(*) AS percentage_no_info\nFROM `phone_brand_device_model2` P\nLEFT JOIN `gender_age` GA ON GA.`device_id` = P.`device_id`\nWHERE P.`phone_brand` = 'vivo';", "after": "WITH unrounded(value) AS (\nSELECT SUM(CASE WHEN GA.`gender` IS NULL AND GA.`age` IS NULL AND GA.`group` IS NULL THEN 1 ELSE 0 END)*100.0/COUNT(*) AS percentage_no_info\nFROM `phone_brand_device_model2` P\nLEFT JOIN `gender_age` GA ON GA.`device_id` = P.`device_id`\nWHERE P.`phone_brand` = 'vivo'\n) SELECT ROUND(value, 4) FROM unrounded;"}}} {"question_id": 1269, "split": "train", "changes": {"question": {"before": "How many times is the number of keywords in \"Refuge: Part 1\" episode than \"Shield\" episode?", "after": "How many times as many keywords does the episode \"Refuge: Part 1\" have as the episode \"Shield\"?"}, "evidence": {"before": "\"Refuge: Part 1\" episode refers to title = 'Refuge: Part 1'; \"Shield\" episode refers to title = 'Shield'; times = divide(count(keyword where title = 'Refuge: Part 1'), count(keyword where title = 'Shield'))", "after": "\"Refuge: Part 1\" episode refers to Episode.title = 'Refuge: Part 1'; \"Shield\" episode refers to Episode.title = 'Shield'; how many times as many keywords = DIVIDE(COUNT(Keyword rows joined to the 'Refuge: Part 1' episode), COUNT(Keyword rows joined to the 'Shield' episode)), an unscaled ratio"}}} {"question_id": 1293, "split": "train", "changes": {"question": {"before": "Who is the youngest person to ever play a \"clerk\" role in the series?", "after": "Among people who have played a clerk role in the series, who is youngest by birth date? Include ties."}, "evidence": {"before": "who refers to name; the youngest person refers to max(birthdate); a \"clerk\" role refers to role LIKE '%clerk%'", "after": "Clerk roles contain 'clerk' in Credit.role. Person.birthdate records date of birth; NULL indicates an unavailable birth date."}}} {"question_id": 1302, "split": "train", "changes": {"question": {"before": "What is the name of the actors born in the USA?", "after": "What are the names of the actors born in the USA?"}, "evidence": {"before": "born in the USA refers to birth_country = 'USA'", "after": "Person.birth_country uses 'USA' for the United States; Credit.category = 'Cast' denotes acting credits."}}} {"question_id": 1315, "split": "train", "changes": {"question": {"before": "What is the average star rating of the episodes Jim Bracchitta has worked on?", "after": "What is the average recorded episode rating for episodes Jim Bracchitta worked on?"}, "evidence": {"before": "average star rating = divide(sum(stars), count(episode_id)) where name = 'Jim Bracchitta'", "after": "Jim Bracchitta refers to Person.name = 'Jim Bracchitta'; episodes he worked on refers to the DISTINCT Episode rows where Credit records his work; average recorded episode rating refers to AVG(Episode.rating) over those episodes"}}} {"question_id": 1365, "split": "train", "changes": {"question": {"before": "Please list all the medication that are prescribed to Elly Koss.", "after": "List all medications prescribed to Elly Koss."}, "evidence": {"before": "medication that are prescribed refers to DESCRIPTION from medications;", "after": "medications.DESCRIPTION contains the medication name or description."}}} {"question_id": 1387, "split": "validation", "changes": {"question": {"before": "What is the id of the patient who has the longest allergy period?", "after": "Which patients had allergies that lasted the longest before ending? List their patient IDs."}, "evidence": {"before": "id of the patient refers to PATIENT from allergies where STOP is not null; the longest allergy period refers to MAX(SUBTRACT((SUBSTR(STOP, - 2, 1)! = '9' then substr(STOP, length(STOP) - 1) + 2000 end), (SUBSTR(START, - 2, 1) = '9' then substr(START, length(START) - 1) + 1900 else substr(START, length(START) - 1) + 2000 end)));\n", "after": "START and STOP record when an allergy began and ended. Only allergies with a recorded end date are considered. Duration is measured in elapsed days, including all patients tied for the longest duration. Dates use month/day/two-digit-year: 69–99 represent 1969–1999, and 00–68 represent 2000–2068."}}} {"question_id": 1393, "split": "train", "changes": {"question": {"before": "What are the most common conditions among the female patients whose ethnicity are American?", "after": "What are the most common conditions among female patients whose ethnicity is American?"}, "evidence": {"before": "the most common condition refers to MAX(COUNT(PATIENT)); among the female Americans refer to PATIENT where gender = 'F' and ethnicity like 'american';", "after": "patients.gender = 'F' denotes female; patients.ethnicity uses 'american'. conditions.DESCRIPTION records the condition name."}}} {"question_id": 1456, "split": "train", "changes": {"question": {"before": "How many patients immunized against 'monovalent rotavirus' ceased their care plan on 11/23/2013?", "after": "How many patients immunized against 'monovalent rotavirus' ceased their care plan on 11/23/2013?"}, "evidence": {"before": "immunized against monovalent rotavirus refers to immunizations.DESCRIPTION = 'rotavirus monovalent'; ceased their care plan on 11/23/2013 refers to careplans.STOP = '2013-11-23';", "after": "immunized against monovalent rotavirus refers to immunizations.DESCRIPTION = 'rotavirus monovalent'; ceased their care plan on 11/23/2013 refers to careplans.STOP = '2013-11-23';"}}} {"question_id": 1458, "split": "train", "changes": {"evidence": {"before": "percentage = MULTIPLY(DIVIDE(SUM(patient WHERE allergies.DESCRIPTION = 'Allergy to grass pollen'), COUNT(patient) WHERE birthplace = 'Pembroke MA US'), 100.0); born in Pembroke MA US refers to birthplace = 'Pembroke MA US'; allergy to grass pollen refers to allergies.DESCRIPTION = 'Allergy to grass';", "after": "born in Pembroke MA US refers to patients.birthplace = 'Pembroke MA US'; allergy to grass pollen refers to allergies.DESCRIPTION = 'Allergy to grass pollen', with allergies.PATIENT identifying the patient; percentage = DIVIDE(COUNT(DISTINCT such patients having that allergy), COUNT(such patients)) * 100"}}} {"question_id": 1501, "split": "train", "changes": {"question": {"before": "How many encounters did Lorri Simonis have with medical professionals between 2010 and 2017? What percentage of encounters are attributed to prenatal visits?", "after": "How many medical encounters did Lorri Simonis have from 2010 through 2017, and what percentage of those were prenatal visits? Round the percentage to two decimal places."}, "evidence": {"before": "between 2010 and 2017 refers to substr(encounters.DATE, 1, 4) between '2010' and '2017'; percentage = MULTIPLY(DIVIDE(COUNT(encounters.ID WHERE DESCRIPTION = 'Prenatal visit'), count(encounters.ID)), 1.0); prenatal visits refers to encounters.DESCRIPTION = 'Prenatal visit' or 'Parenatal initial visit';", "after": "from 2010 through 2017 refers to encounters.DATE with year BETWEEN '2010' AND '2017'; prenatal visits refers to DESCRIPTION IN ('Prenatal visit', 'Prenatal initial visit'); return both the COUNT of Lorri Simonis's medical encounters in that span and ROUND(DIVIDE(COUNT of prenatal visits, that COUNT) * 100, 2)"}}} {"question_id": 1519, "split": "train", "changes": {"question": {"before": "viral sinusitis condition refers to conditions.DESCRIPTION = 'Viral sinusitis (disorder)';", "after": "How many patients with viral sinusitis are there in each gender group? List the gender code (F or M) and the number of patients."}, "evidence": {"before": "Among the patients with viral sinusitis condition, provide the number for each gender. Please list the gender ('F' or 'M') and the corresponding number of patients.", "after": "Viral sinusitis is recorded as conditions.DESCRIPTION = 'Viral sinusitis (disorder)'."}}} {"question_id": 1530, "split": "train", "changes": {"question": {"before": "Among the white patients, what is the overall average of the average body height of each patients?", "after": "Among white patients, what is the average of each patient's average recorded body height?"}, "evidence": {"before": "white refers to race = 'white'; average body height = AVG(observations.VALUE WHERE observations.DESCRIPTION = 'Body Height'); body height refers to observations.DESCRIPTION = 'Body Height';", "after": "body height refers to observations.DESCRIPTION = 'Body Height', with the measurement in observations.VALUE (cm); each patient's average body height refers to AVG(observations.VALUE) grouped by observations.PATIENT, over white patients only; the answer refers to AVG of those per-patient averages"}}} {"question_id": 1538, "split": "train", "changes": {"question": {"before": "Calculate the average age of the male patients that have hypertension.", "after": "What is the average age of male patients with a recorded hypertension diagnosis, using their age at death if deceased and their age on January 1, 2030 otherwise? Round your answer to 2 decimal places."}, "evidence": {"before": "average age = AVG(DIVIDE(if deathdate is null then SUBSTRACT(julianday(substr(datetime('now'), 1, 10)), julianday(patients.birthdate)) else SUBSTRACT(julianday(patients.deathdate), julianday(patients.birthdate)), 365); male refers to gender = 'M'; hypertension refers to conditions.DESCRIPTION = 'Hypertension'", "after": "male patients refers to patients.gender = 'M'; hypertension refers to having a conditions row with DESCRIPTION = 'Hypertension', counted once per patient; age refers to DIVIDE(SUBTRACT(julianday(COALESCE(deathdate, '2030-01-01')), julianday(birthdate)), 365.0); average age refers to ROUND(AVG(age), 2)"}, "SQL": {"before": "SELECT SUM(CASE WHEN deathdate IS NULL THEN ROUND((strftime('%J', date('now')) - strftime('%J', birthdate)) / 365) ELSE ROUND((strftime('%J', deathdate) - strftime('%J', birthdate)) / 365) END) / COUNT(*) \nFROM (\n SELECT T2.deathdate, T2.birthdate \n FROM conditions AS T1 INNER JOIN patients AS T2 \n ON T1.PATIENT = T2.patient \n WHERE T1.DESCRIPTION = 'Hypertension' AND T2.gender = 'M' \n GROUP BY T1.PATIENT)", "after": "WITH unrounded(value) AS (\nSELECT AVG((julianday(COALESCE(p.deathdate, '2030-01-01')) - julianday(p.birthdate)) / 365.0) FROM patients p WHERE p.gender='M' AND EXISTS (SELECT 1 FROM conditions c WHERE c.PATIENT=p.patient AND c.DESCRIPTION='Hypertension')\n) SELECT ROUND(value, 2) FROM unrounded;"}}} {"question_id": 1554, "split": "validation", "changes": {"question": {"before": "How many customers have a credit limit of not more than 100,000 and which customer made the highest total payment amount for the year 2004?", "after": "How many customers have a credit limit of 100,000 or less? Among all customers, who paid the most in total during 2004?"}, "evidence": {"before": "creditLimit < = 100000; total payment amount refers to amount; highest total payment amount refers to MAX(amount); year(paymentDate) = '2004';", "after": "Credit limit refers to creditLimit; payment amount refers to amount. The 2004 total includes all payments a customer made that year, regardless of their credit limit."}}} {"question_id": 1558, "split": "train", "changes": {"question": {"before": "How many distinct orders were there in 2003 when the quantity ordered was less than 30?", "after": "How many orders placed in 2003 contained fewer than 30 units in total?"}, "evidence": {"before": "year(orderDate) = '2003'; quantityOrdered < 30;", "after": "orders.orderDate records the order date. orderdetails.quantityOrdered records the units on an order line; orderNumber identifies the order."}}} {"question_id": 1562, "split": "train", "changes": {"question": {"before": "How many orders which expected profits greater than 100?", "after": "How many orders had expected profits greater than 100?"}, "evidence": {"before": "expected profits greater than 100 = (SUBTRACT(msrp, buyPrice))>100;", "after": "expected profit of an order refers to SUM(MULTIPLY(quantityOrdered, SUBTRACT(MSRP, buyPrice))) over that order's orderdetails rows; expected profits greater than 100 refers to that per-order total > 100; the answer is the COUNT of orders that reach it"}}} {"question_id": 1564, "split": "validation", "changes": {"question": {"before": "How many sales representatives who have office code is 1?", "after": "How many sales representatives have office code 1?"}, "evidence": {"before": "sales representative refers to jobTitle = 'Sales Rep';", "after": "Sales representatives have employees.jobTitle = 'Sales Rep'."}}} {"question_id": 1565, "split": "validation", "changes": {"question": {"before": "Please list different customer names who have a single payment amount of over 50,000.", "after": "List the distinct names of customers with a single payment over 50,000."}, "evidence": {"before": "amount > 50000;", "after": "payments.amount records a payment’s amount; customers.customerName records the customer’s name."}}} {"question_id": 1567, "split": "train", "changes": {"evidence": {"before": "total payment refers to SUM(amount); credit limit larger than 10000 refers to creditLimit > 10000; year(paymentDate) = '2003';", "after": "credit limits larger than 10000 refers to customers.creditLimit > 10000; in 2003 refers to payments whose paymentDate is in 2003; total payments = SUM(payments.amount) over the 2003 payments of those customers"}}} {"question_id": 1569, "split": "train", "changes": {"question": {"before": "How many French customers have two cancelled orders?", "after": "How many French customers have exactly two cancelled orders?"}, "evidence": {"before": "French is a nationality of country = 'France'; cancelled orders refers to status = 'Cancelled';", "after": "French customers have customers.country = 'France'; cancelled orders have orders.status = 'Cancelled'."}}} {"question_id": 1573, "split": "train", "changes": {"question": {"before": "State the email of those who are staff of Murphy Diane whose number is 1002 and living in San Francisco", "after": "What are the email addresses of employees reporting to Diane Murphy (employee number 1002) who work in San Francisco?"}, "evidence": {"before": "staff of refers to reportsTO; San Francisco is a city;", "after": "An employee’s manager is recorded in employees.reportsTo; employee email is employees.email. Office location is offices.city, and San Francisco is stored as 'San Francisco'."}}} {"question_id": 1579, "split": "train", "changes": {"question": {"before": "List out 3 customer numbers who have highest total amount of payment", "after": "List three customer numbers with the highest total payment amounts."}, "evidence": {"before": "amount of payment refers to amount;", "after": "Payment amounts are stored in payments.amount; the paying customer is identified by payments.customerNumber."}}} {"question_id": 1582, "split": "train", "changes": {"question": {"before": "State the emails of UK Sales Rep whose customers have top three highest credit limit", "after": "What are the email addresses of the sales reps for the three UK customers with the highest credit limits?"}, "evidence": {"before": "UK is a country; Sales Rep is a job title;", "after": "UK customers refers to customers.country = 'UK'; sales reps refers to employees.jobTitle = 'Sales Rep'; credit limits refers to customers.creditLimit;"}}} {"question_id": 1583, "split": "train", "changes": {"evidence": {"before": "Norway is a country; credit line refers to creditLimit; creditLimit<220000;", "after": "Norway is a country; stored country names may carry trailing spaces, so 'Norway' and 'Norway ' denote the same country; credit line refers to creditLimit; creditLimit<220000;"}, "SQL": {"before": "SELECT COUNT(creditLimit) FROM customers WHERE creditLimit < 220000 AND country = 'Norway'", "after": "SELECT COUNT(creditLimit) FROM customers WHERE creditLimit < 220000 AND TRIM(country) = 'Norway'"}}} {"question_id": 1584, "split": "train", "changes": {"question": {"before": "List out full name and email of employees who are working in Paris?", "after": "List the first names, last names, and email addresses of employees working in Paris."}, "evidence": {"before": "full name = firstName, LastName; Paris is a city;", "after": "employees.firstName, employees.lastName, and employees.email record the requested details; offices.city identifies the office city."}}} {"question_id": 1593, "split": "validation", "changes": {"question": {"before": "Who are the sales agents of the customer who have made the highest payment? Include the full names of employees and their supervisors.", "after": "For customers who made the highest single payment, list each sales agent’s first name and last name, followed by their supervisor’s first name and last name."}, "evidence": {"before": "payment refers to amount; full name = firstName+lastName; supervisor refers to reportsTO; 'reportsTO' is the leader of the 'employeeNumber';", "after": "Payment refers to payments.amount; highest single payment refers to MAX(amount) across all payments; supervisor refers to employees.reportsTo, which identifies the supervisor's employeeNumber; names are returned as four separate columns in this order: sales agent firstName, sales agent lastName, supervisor firstName, supervisor lastName. Include all matches tied for the highest payment."}}} {"question_id": 1595, "split": "train", "changes": {"question": {"before": "What is the total actual profit gained from orders made by American customers from 2003-01-06 to 2005-05-09?", "after": "What was the total profit from orders placed by customers in the USA from January 6, 2003, through May 9, 2005, inclusive?"}, "evidence": {"before": "total actual profit = SUM(SUBTRACT(priceEach, buyPrice)); American is a nationality of country = 'USA'; orderDate BETWEEN '2003-01-06' AND '2005-05-09';", "after": "customers in the USA refers to customers.country = 'USA'; the period refers to orders.orderDate BETWEEN '2003-01-06' AND '2005-05-09'; total profit = SUM(MULTIPLY(SUBTRACT(orderdetails.priceEach, products.buyPrice), orderdetails.quantityOrdered)) over those orders' detail lines"}}} {"question_id": 1596, "split": "train", "changes": {"question": {"before": "Which sales representative employee made the most sales in 2005? Please indicates his or her employee number, full address, and phone number.", "after": "Which sales representative made the most sales in 2005? Provide the employee number, full address, and phone number."}, "evidence": {"before": "orderDate between '2005-01-01' and '2005-12-31'; full address = addressLine1, addressLine2;", "after": "Sales representatives have employees.jobTitle = 'Sales Rep'; orders.orderDate records the order date. offices.addressLine1 and offices.addressLine2 record the office address, and offices.phone records its phone number."}}} {"question_id": 1597, "split": "train", "changes": {"question": {"before": "What is the phone number of all companies where the last name of the contact person starts with the letter M and are not from Germany?", "after": "List the phone numbers of companies outside Germany whose contact person’s last name starts with M."}, "evidence": {"before": "last name of contact person starts with M refers to lastName LIKE 'M%'; Germany is a country; not from Germany refers to country<>'Germany';", "after": "Customer phone numbers are customers.phone. A customer contact’s surname is customers.contactLastName; surnames beginning with M use 'M%'. Customer country is customers.country, and Germany is stored as 'Germany'."}}} {"question_id": 1599, "split": "train", "changes": {"question": {"before": "Of all the orders placed and shipped throughout the year 2005, what percentage of those orders corresponds to customer number 186?", "after": "What percentage of orders both placed and shipped in 2005 corresponded to customer number 186?"}, "evidence": {"before": "shipped orders refers to status = 'shipped'; year(shippedDate) = 2005; year(orderDate) = 2005; percentage = DIVIDE(SUM(customerNumber = 186)), COUNT(orderNumber))*100 as percentage;", "after": "orders both placed and shipped in 2005 refers to orders.status = 'Shipped' with orderDate and shippedDate each BETWEEN '2005-01-01' AND '2005-12-31'; percentage = DIVIDE(COUNT(those orders with customerNumber = 186), COUNT(all those orders)) * 100"}}} {"question_id": 1600, "split": "validation", "changes": {"evidence": {"before": "cancelled shipment refers to status = 'cancelled'; creditLimit > 115000;", "after": "Cancelled shipment refers to status = 'Cancelled'; credit limit greater than 115,000 refers to creditLimit > 115000."}}} {"question_id": 1606, "split": "train", "changes": {"question": {"before": "What profit can the seller Carousel DieCast Legends make from the sale of the product described as \"The perfect holiday or anniversary gift for executives\"?", "after": "What profit would Carousel DieCast Legends make by selling all its stock in the product line described as “The perfect holiday or anniversary gift for executives” at the suggested retail price?"}, "evidence": {"before": "seller and product vendor are synonyms; Carousel DieCast Legends is a product vendor; profit = SUM(SUBTRACT(msrp, buyPrice) * quantityInStock);", "after": "Carousel DieCast Legends refers to products.productVendor = 'Carousel DieCast Legends'; the product line described as such refers to productlines.textDescription LIKE '%perfect holiday or anniversary gift for executives%'; profit = SUM(MULTIPLY(SUBTRACT(MSRP, buyPrice), quantityInStock))"}}} {"question_id": 1607, "split": "train", "changes": {"question": {"before": "Of the clients whose businesses are located in the city of Boston, calculate which of them has the highest average amount of payment.", "after": "Which Boston clients have the highest average payment amount? Give their customer numbers."}, "evidence": {"before": "average amount payment = AVG(amount);", "after": "Boston clients refers to customers.city = 'Boston' joined to payments on customerNumber; average payment amount refers to AVG(payments.amount) grouped by customerNumber; return every customerNumber whose average equals the highest such average, including ties"}}} {"question_id": 1618, "split": "train", "changes": {"question": {"before": "For the productline where the product No.S18_2949 was produced, what's the text description for that product line?", "after": "What is the text description of the product line for product S18_2949?"}, "evidence": {"before": null, "after": "The product identifier is products.productCode; product-line descriptions are productlines.textDescription, linked through productLine. Product S18_2949 is stored as 'S18_2949'."}}} {"question_id": 1620, "split": "train", "changes": {"evidence": {"before": "Gerakd Hermandez is an employee; French customer refers to customer from France where country = 'France'", "after": "customers.salesRepEmployeeNumber records the employee assigned to a customer."}}} {"question_id": 1622, "split": "train", "changes": {"evidence": {"before": "discount refers to DIVIDE(SUBTRACT(MSRP, priceEach)), MSRP); product No. S18_3482 refers to productCode = 'S18_3482'", "after": "discount refers to DIVIDE(SUBTRACT(MSRP, priceEach), MSRP); product No. S18_3482 refers to productCode = 'S18_3482'"}}} {"question_id": 1625, "split": "train", "changes": {"question": {"before": "Who is the sales representitive of Muscle Machine Inc? Please give the employee's full name.", "after": "Who is the sales representative for 'Muscle Machine Inc'? Give the employee’s first and last names."}, "evidence": {"before": "Sales representative refers to jobTitle = 'Sales Rep'; Muscle Machine Inc is name of customer;", "after": "customers.salesRepEmployeeNumber records the assigned sales representative."}}} {"question_id": 1626, "split": "train", "changes": {"question": {"before": "If I'm from the Muscle Machine Inc, to which e-mail adress should I write a letter if I want to reach the superior of my sales representitive?", "after": "What is the email address of the manager of Muscle Machine Inc’s sales representative?"}, "evidence": {"before": "Muscle Machine Inc is name of customer; superior refers to 'reportsTO', who is the leader of the 'employeeNumber'", "after": "'Muscle Machine Inc' is name of customer; customers.salesRepEmployeeNumber records the sales representative; employees.reportsTo identifies that employee’s direct manager. "}}} {"question_id": 1627, "split": "validation", "changes": {"question": {"before": "Please list all the customers that have Steve Patterson as their sales representitive.", "after": "List all customers whose sales representative is Steve Patterson."}, "evidence": {"before": "Steve Patterson is an employee;", "after": "customers.salesRepEmployeeNumber records the assigned sales representative."}}} {"question_id": 1632, "split": "train", "changes": {"question": {"before": "What's the postal code of the office the VP Sales is at?", "after": "What is the postal code of the office where the VP of Sales works?"}, "evidence": {"before": "VP Sales refers to jobTitle", "after": "Employee job titles are employees.jobTitle; the Vice President of Sales title is stored as 'VP Sales'. An employee’s office is employees.officeCode, and office postal code is offices.postalCode."}}} {"question_id": 1639, "split": "train", "changes": {"question": {"before": "List all the name of customers who have orders that are still processing.", "after": "List the names of customers who have an order that is still being processed."}, "evidence": {"before": "Still processing refers to status = 'In Process';", "after": "An order still being processed has orders.status = 'In Process'."}}} {"question_id": 1640, "split": "train", "changes": {"question": {"before": "Among all orders shipped, calculate the percentage of orders shipped at least 3 days before the required date.", "after": "Among all orders shipped, calculate the percentage of orders shipped at least 3 days before the required date. Round your answer to 4 decimal places."}, "evidence": {"before": "Orders shipped refer to status = 'Shipped'; at least 3 days before the required date refers to SUBTRACT(shippedDate, requiredDate)>3; DIVIDE(COUNT(orderNumber where SUBTRACT(shippedDate, requiredDate)>3), (COUNT(orderNumber)*100 as percentage;", "after": "orders shipped refers to status = 'Shipped'; shipped at least 3 days before the required date refers to JULIANDAY(requiredDate) - JULIANDAY(shippedDate) >= 3; percentage = DIVIDE(COUNT(shipped orders meeting that condition), COUNT(all shipped orders)) * 100, rounded to 4 decimal places"}, "SQL": {"before": "SELECT 100.0 * SUM(CASE WHEN JULIANDAY(`requiredDate`) - JULIANDAY(`shippedDate`) >= 3 THEN 1 ELSE 0 END)\n / COUNT(*) AS early_ship_pct\nFROM orders\nWHERE `status` = 'Shipped';", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * SUM(CASE WHEN JULIANDAY(`requiredDate`) - JULIANDAY(`shippedDate`) >= 3 THEN 1 ELSE 0 END)\n / COUNT(*) AS early_ship_pct\nFROM orders\nWHERE `status` = 'Shipped'\n) SELECT ROUND(value, 4) FROM unrounded;"}}} {"question_id": 1642, "split": "train", "changes": {"question": {"before": "Which are the most ordered quantity products? List their names and expected profit margins per piece?", "after": "Which products had the highest total quantity ordered? List their names and profit per piece."}, "evidence": {"before": "The most ordered quantity product refers to productName where Max(quantityOrdered); SUBTRACT(MSRP, buyPrice);", "after": "Ordered quantities are orderdetails.quantityOrdered. Product names are products.productName. Profit per piece is products.MSRP minus products.buyPrice."}}} {"question_id": 1643, "split": "train", "changes": {"question": {"before": "For the order has the most product ordered, name the customer who placed the order.", "after": "What is the name of the customer that ordered the most units in a single order?"}, "evidence": {"before": "The largest order in terms of total price refers to MAX(SUM(quantityOrdered, priceEach).", "after": "the size of an order refers to SUM(quantityOrdered) for that order; the most units in a single order refers to the greatest order size; return customers.customerName for the customer who placed that order"}}} {"question_id": 1645, "split": "train", "changes": {"question": {"before": "What is the percentage of employees are in Paris office?", "after": "What percentage of employees work in the Paris office?"}, "evidence": {"before": "DIVIDE(COUNT(employeeNumber) when city = 'Paris'), (COUNT(employeeNumber))*100 as percentage;", "after": "the Paris office refers to offices.city = 'Paris'; employees are matched to their office on officeCode; percentage = DIVIDE(COUNT(employeeNumber where city = 'Paris'), COUNT(employeeNumber)) * 100 over all employees matched to an office"}}} {"question_id": 1649, "split": "validation", "changes": {"question": {"before": "What is the percentage of the payment amount in 2004 was made by Atelier graphique?", "after": "What percentage of the payment amount in 2004 was made by Atelier graphique?"}, "evidence": {"before": "DIVIDE(SUM(amount) where customerName = 'Atelier graphique'), (SUM(amount)) as percentage where year(paymentDate)*100 = 2004;", "after": "Payments are recorded in payments.amount and payments.paymentDate. The customer name is customers.customerName; Atelier graphique is stored as 'Atelier graphique'."}}} {"question_id": 1652, "split": "train", "changes": {"evidence": {"before": "SUM(MULTIPLY(quantityOrdered, priceEach)", "after": "SUM(MULTIPLY(quantityOrdered, priceEach))"}}} {"question_id": 1660, "split": "train", "changes": {"question": {"before": "How many transactions payment made by customer that is lower than 10000. Group the result by year.", "after": "For each year, how many customer payments were below 10,000?"}, "evidence": {"before": "Transactions payment lower than 10000 refer to COUNT(amount < 10000); by year refers to YEAR(paymentDate)", "after": "for each year refers to grouping on STRFTIME('%Y', payments.paymentDate); return that year together with the COUNT of the customer payments below 10000 in it"}}} {"question_id": 1664, "split": "train", "changes": {"question": {"before": "Identify the customer and list down the country with the check number GG31455.", "after": "Identify the customer and country associated with check number GG31455."}, "evidence": {"before": null, "after": "Payment check numbers are payments.checkNumber; GG31455 is stored as 'GG31455'. Customer name and country are customers.customerName and customers.country."}}} {"question_id": 1665, "split": "train", "changes": {"question": {"before": "How many 2001 Ferrari Enzo were ordered?", "after": "How many 2001 Ferrari Enzo cars were ordered?"}, "evidence": {"before": "2001 Ferrari Enzo refers to productName;", "after": "Product names are products.productName; 2001 Ferrari Enzo is stored as '2001 Ferrari Enzo'. Ordered units are orderdetails.quantityOrdered."}}} {"question_id": 1666, "split": "validation", "changes": {"question": {"before": "Which 5 products has the lowest ordered quantities in total? List the product names.", "after": "Which five products had the fewest units ordered in total? List their names."}}} {"question_id": 1670, "split": "train", "changes": {"question": {"before": "How many restaurants have not obtained a minimum of 3 in their reviews?", "after": "How many restaurants have review scores below 3?"}, "evidence": {"before": "have not obtained a minimum of 3 in review refers to review < 3", "after": "generalinfo.review records the restaurant’s review score."}}} {"question_id": 1718, "split": "validation", "changes": {"evidence": {"before": "restaurant name refers to label; the least popular refers to min(review); Indian restaurant refers to food_type = 'Indian restaurant'; Shattuck Avenue in Berkeley refers to street_name = 'shattuck ave' and city = 'berkeley'", "after": "Restaurant name refers to label; least popular means the lowest review among eligible restaurants. All text matching is case-insensitive: city is 'Berkeley', food_type contains 'indian', and street_name starts with 'shattuck ave'."}}} {"question_id": 1738, "split": "train", "changes": {"question": {"before": "Among restaurants with recorded locations, what percentage of restaurants are from the Bay Area?", "after": "Among restaurants with a recorded location, what percentage have a location in the Bay Area?"}, "evidence": {"before": "Bay Area refers to region = 'bay area'; percentage = divide(count(id_restaurant where region = 'bay area'), count(id_restaurant)) * 100%", "after": "restaurants with a recorded location refers to COUNT(DISTINCT location.id_restaurant), including cities with no geographic row; a location in the Bay Area refers to geographic.region = 'bay area' matched on location.city; percentage = DIVIDE(COUNT(DISTINCT id_restaurant in the Bay Area), COUNT(DISTINCT id_restaurant)) * 100"}, "SQL": {"before": "SELECT CAST(SUM(IIF(T1.region = 'bay area', 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city", "after": "SELECT 100.0 * COUNT(DISTINCT CASE WHEN g.region='bay area' THEN l.id_restaurant END) / COUNT(DISTINCT l.id_restaurant)\nFROM location AS l LEFT JOIN geographic AS g ON g.city=l.city;"}}} {"question_id": 1768, "split": "train", "changes": {"question": {"before": "Among American restaurants with street number greater than 2000, List the ID of restaurants that has a review greater than the 70% of average review of all American restaurants with street number greater than 2000.", "after": "Among American restaurants with street numbers greater than 2000, list the restaurant IDs whose review is greater than 70% of the average review for that same group."}, "evidence": {"before": "American restaurant refers to food_type = 'american'; street number greater than 2000 refers to street_num > 2000; review greater than the 70% of average review refers to review > multiply(avg(review), 0.7)", "after": "American refers to generalinfo.food_type = 'american'; street numbers greater than 2000 refers to location.street_num > 2000; the average review for that same group refers to AVG(generalinfo.review) over those same restaurants; list the restaurant IDs whose generalinfo.review > MULTIPLY(0.7, that average)"}}} {"question_id": 1803, "split": "train", "changes": {"evidence": {"before": "SC Ganguly refers to Player_Name = 'SC Ganguly'; the average winning margin = divide(sum(Win_Margin), count(Match_Id)) where Player_Name = 'SC Ganguly'", "after": "SC Ganguly refers to Player.Player_Name = 'SC Ganguly'; the matches he played in refers to the Match rows with his Player_Match participation; average winning margin refers to AVG(Match.Win_Margin) over those matches"}}} {"question_id": 1848, "split": "train", "changes": {"evidence": {"before": "in 2015 refers to Match_Date LIKE '2015%'; the winning team refers to Team_Id = Match_Winner; match ID 829768 refers to Match_Id = 829768", "after": "in 2015 refers to Match_Date LIKE '2015%'; the winning team refers to Team_Id = Match_Winner; match ID 829770 refers to Match_Id = 829770"}}} {"question_id": 1888, "split": "train", "changes": {"question": {"before": "Calculate the total winning match for Deccan Chargers.", "after": "How many matches did the Deccan Chargers win?"}, "evidence": {"before": "winning refers to Match_Winner; Deccan Chargers refers to Team_Name = 'Deccan Chargers'", "after": "Match.Match_Winner identifies the winning team; Team.Team_Name uses 'Deccan Chargers'."}}} {"question_id": 1892, "split": "validation", "changes": {"question": {"before": "What are the average extra runs given in the second innings of each match? List the match ids and their corresponding average extra run.", "after": "What are the average extra runs given in the second innings of each match? List each match ID and the average extra runs recorded for its second innings. Include every match, and report zero when no average is available."}, "evidence": {"before": "second innings refers to Innings_No = 2; average extra runs = divide(sum(Extra_Runs), count(Innings_No)) when Innings_No = 2", "after": "Extra_Runs.Extra_Runs records extra runs; Extra_Runs.Innings_No = 2 denotes the second innings. Match.Match_Id identifies a match."}}} {"question_id": 1922, "split": "validation", "changes": {"question": {"before": "List the name of all New Zealand umpires.", "after": "List the names of all New Zealand umpires."}, "evidence": {"before": "New Zealand umpires refers to Country_Name = 'New Zealand'; name of umpires refers to Umpire_Name", "after": "Country.Country_Name uses 'New Zealand'; Umpire.Umpire_Name records the umpire’s name."}}} {"question_id": 1981, "split": "train", "changes": {"question": {"before": "Provide match ID which had the extra type of penalty.", "after": "List the match IDs for matches with penalty extras."}, "evidence": {"before": "extra type of penalty refers to Extra_Name = 'penalty';", "after": "Extra_Type.Extra_Name = 'penalty' denotes penalty extras; Extra_Runs records extras by match."}}} {"question_id": 1982, "split": "train", "changes": {"question": {"before": "Name the teams played in a match which resulted in a tie in 2015.", "after": "Name the teams that played in a tied match in 2015."}, "evidence": {"before": "resulted in a tie refers to Win_Type = 'Tie'; in 2015 refers to SUBSTR(Match_Date, 1, 4) = 2015", "after": "Win_By.Win_Type = 'Tie' denotes a tied result. Match.Win_Type identifies the result in Win_By.Win_Id. Match.Match_Date uses YYYY-MM-DD."}}} {"question_id": 1997, "split": "validation", "changes": {"question": {"before": "What is the second team's name in the match with the lowest winning margin?", "after": "What are the names of the second teams in matches tied for the lowest recorded winning margin?"}, "evidence": {"before": "lowest winning margin refers to MIN(win_margin); team name refers to team_name; second team refers to team_2", "after": "Match.Win_Margin records the winning margin; Match.Team_2 identifies the second team and Team.Team_Name records its name."}}} {"question_id": 2008, "split": "validation", "changes": {"question": {"before": "List the names of players who play by the left hand.", "after": "List the names of players who bat left-handed."}, "evidence": {"before": "play by the left hand refers to Batting_hand =   'Left-hand bat'", "after": "Batting_Style.Batting_hand = 'Left-hand bat' denotes left-handed batting; Player.Batting_hand identifies that style."}}} {"question_id": 2019, "split": "train", "changes": {"question": {"before": "What type did match ID 336000 win?", "after": "What was the win type for match 336000?"}, "evidence": {"before": "type of match won refers to Win_Type", "after": "Match.Win_Type identifies the description in Win_By.Win_Id; Win_By.Win_Type contains the result text."}}} {"question_id": 2023, "split": "train", "changes": {"question": {"before": "Who is the youngest player. List the player's name and the country they came from?", "after": "Who are the youngest players by birth date? Give their names and countries, including ties."}, "evidence": {"before": "youngest player refers to MIN(DOB); city refers to City_Name", "after": "youngest refers to the greatest Player.DOB; a player's country refers to the Country whose identifier equals that player's Player.Country_Name; return the player name and that Country.Country_Name for every player whose Player.DOB = MAX(DOB), including all ties"}}} {"question_id": 2032, "split": "train", "changes": {"question": {"before": "What are the names of players who had been man of the match more than 3 times in season year 2008?", "after": "What are the names of players who were named Man of the Match more than three times during the 2008 season?"}, "evidence": {"before": "man of the match more than 5 times refers to COUNT(Man_of_the_Match) > 5; in season year 2008 refers to Season_Year = 2008; name of player refers to Player_Name;", "after": "the 2008 season refers to Season.Season_Year = 2008; named Man of the Match refers to the player that Match.Man_of_the_Match identifies; named Man of the Match more than three times during that season refers to COUNT(*) > 3 of such Match rows per player; return Player.Player_Name of each such player"}}} {"question_id": 2040, "split": "train", "changes": {"question": {"before": "Among the matches held in St. George's Park, give the match ID of the match with the highest winning margin points.", "after": "List the IDs of all matches at St. George’s Park tied for the highest winning margin."}, "evidence": {"before": "held in St. George's Park refers to Venue_Name = 'St George''s Park'; highest winning margin points refers to MAX(Win_Margin)", "after": "matches at St. George's Park refers to Venue.Venue_Name = 'St George''s Park'; the highest winning margin refers to MAX(Match.Win_Margin) among those matches; list the ID of every match at that venue whose Win_Margin is that MAX, so all tied matches are listed"}}} {"question_id": 2051, "split": "validation", "changes": {"evidence": {"before": "least downloaded album refers to MIN(totalSnatched where releaseType = 'album');", "after": "Live albums are marked 'live album' in releaseType. An album’s snatch count is recorded in totalSnatched, and its tags are recorded in tags."}}} {"question_id": 2071, "split": "train", "changes": {"question": {"before": "Indicates the titles of releases with ids from 10 to 20 and singles downloaded at least 20.", "after": "List the titles of single releases with IDs from 10 to 20 and at least 20 downloads."}, "evidence": {"before": "releaseType = 'single'; downloaded at least 20 refers to totalSnatched ≥ 20; id from 10 to 20 refer to id between 10 and 20; titles refer to groupName;", "after": "torrents.groupName records the release title; torrents.totalSnatched records downloads. Single releases have torrents.releaseType = 'single'."}}} {"question_id": 2075, "split": "train", "changes": {"question": {"before": "Among the artists with the id from 10 to 30. Which artists released the product with the tag \"funk\" in 1980?", "after": "Which artists released funk music in 1980 on releases with IDs from 10 through 30?"}, "evidence": {"before": "id from 10 to 30 refers to id between 10 and 30; groupYear = 1980;", "after": "torrents.id identifies a release; torrents.groupYear is its release year. tags.id identifies the tagged release, and tags.tag = 'funk' denotes the funk tag."}}} {"question_id": 2077, "split": "train", "changes": {"question": {"before": "What's the tag genre of the artist with id 16?", "after": "What are the genre tags for the release with id 16?"}}} {"question_id": 2099, "split": "train", "changes": {"evidence": {"before": "Year = 1990; Aruba is the name of country where ShortName = 'Aruba'", "after": "For this footnote, 1990 is stored as 'YR1990' in Footnotes.Year. Aruba is recorded in Country.ShortName."}}} {"question_id": 2100, "split": "train", "changes": {"question": {"before": "On which years did Aruba got a footnote on the series code AG.LND.FRST.K2?", "after": "In which years did Aruba have a footnote for series AG.LND.FRST.K2?"}, "evidence": {"before": "Aruba is the name of country where ShortName = 'Aruba'", "after": "Aruba is recorded in Country.ShortName. Footnotes.Year uses 'YR' followed by a four-digit year, such as 'YR2010'."}}} {"question_id": 2111, "split": "train", "changes": {"question": {"before": "In 1970, how many Middle Eastern & North African countries whose value for CO2 emissions from gaseous fuel consumption (kt) indicator is more than 600?", "after": "In 1970, how many countries in the Middle East & North Africa region had CO2 emissions from gaseous fuel consumption above 600 kt?"}, "evidence": {"before": "Year = 1970; Middle East & North Africa is the name of the region where Region = 'Middle East & North Africa'; CO2 emissions from gaseous fuel consumption (kt) is the name of indicator where IndicatorName = 'CO2 emissions from gaseous fuel consumption (kt)'", "after": "Indicators.IndicatorName uses 'CO2 emissions from gaseous fuel consumption (kt)'; Indicators.Value is in kilotonnes for this indicator. Country.Region uses 'Middle East & North Africa'."}}} {"question_id": 2114, "split": "validation", "changes": {"evidence": {"before": "Albania is the name of country where Country = 'Albania'", "after": "Albania refers to Country.ShortName = 'Albania'; 1981 refers to FootNotes.Year = 'YR1981'. Match CountryCode to obtain the footnote descriptions."}}} {"question_id": 2120, "split": "train", "changes": {"question": {"before": "Which countries have a fertility rate between 4 and 5 in 1979? List their names.", "after": "Which countries had a fertility rate between 4 and 5 in 1979?"}, "evidence": {"before": "Which countries have a fertility rate between 4 and 5 in 1979? List their short names.", "after": "Fertility rate refers to the IndicatorName ‘Fertility rate, total (births per woman)’. Entries with a Region are individual economies, including territories; those without one are aggregates."}}} {"question_id": 2131, "split": "validation", "changes": {"evidence": {"before": "IncomeGroup = 'Upper middle income'; IndicatorName = 'CO2 emissions (kt); the lowest value refers to MIN(Value);", "after": "IncomeGroup = 'Upper middle income'; IndicatorName = 'CO2 emissions (kt)'; the lowest value refers to MIN(Value);"}}} {"question_id": 2135, "split": "validation", "changes": {"question": {"before": "In 2005, which series codes use the International Monetary Fund, Balance of Payments Statistics Yearbook and data files source?", "after": "Which series have indicator observations recorded in 2005 and use the source International Monetary Fund, Balance of Payments Statistics Yearbook and data files? List their series codes."}, "evidence": {"before": "Year contains '2005'; Series.Source LIKE 'International Monetary Fund, Balance of Payments Statistics Yearbook and data files%'", "after": "Recorded in 2005 refers to Indicators.Year = 2005. Match Indicators.IndicatorCode to Series.SeriesCode. Use Series.Source beginning with 'International Monetary Fund, Balance of Payments Statistics Yearbook and data files'."}}} {"question_id": 2141, "split": "validation", "changes": {"question": {"before": "From 1968 to 1970, what are indicator names whose license type is open and values are less than 100?", "after": "Which indicators with an Open license had at least one value below 100 from 1968 through 1970?"}, "evidence": {"before": "From 1968 to 1970 refers to Year between '1968' and '1970'; values are less than 100 imply Value<100;", "after": "Series.LicenseType uses 'Open'. Indicators.Value records observations in each indicator’s own units."}}} {"question_id": 2142, "split": "validation", "changes": {"question": {"before": "Which country had the highest value of indicator belongs to Private Sector & Trade: Exports topic? Please list the country name and indicator name.", "after": "Which countries have the highest recorded value for an indicator in the Private Sector & Trade: Exports topic? List each country's name and the indicator name, including ties."}, "evidence": {"before": "country refers to CountryName;", "after": "Country refers to an individual World Bank economy, including separately reported territories. Country entries with a nonblank Region are economies; entries with a blank Region are aggregate groups. Use Indicators.CountryName and Indicators.IndicatorName. Restrict the topic to Private Sector & Trade: Exports, find the greatest nonmissing recorded value, and include every matching country/indicator pair."}, "SQL": {"before": "SELECT T1.CountryName, T1.IndicatorName \nFROM Indicators AS T1 INNER JOIN Series AS T2 \nON T1.IndicatorName = T2.IndicatorName WHERE T2.Topic = 'Private Sector & Trade: Exports' AND T1.CountryName NOT IN ('World', 'High income', 'OECD members', 'High income: OECD', 'Europe & Central Asia (all income levels)', 'European Union', 'East Asia & Pacific (all income levels)', 'Low & middle income', 'Middle income', 'Euro area', 'Upper middle income', 'Upper middle income', 'High income: nonOECD', 'East Asia & Pacific (developing only)')\nAND T1.Value = (\n SELECT MAX(T3.Value)\n FROM Indicators AS T3 INNER JOIN Series AS T4 \nON T3.IndicatorName = T4.IndicatorName WHERE T4.Topic = 'Private Sector & Trade: Exports' AND T3.CountryName NOT IN ('World', 'High income', 'OECD members', 'High income: OECD', 'Europe & Central Asia (all income levels)', 'European Union', 'East Asia & Pacific (all income levels)', 'Low & middle income', 'Middle income', 'Euro area', 'Upper middle income', 'Upper middle income', 'High income: nonOECD', 'East Asia & Pacific (developing only)'))", "after": "WITH ranked AS (\n SELECT i.CountryName, i.IndicatorName,\n RANK() OVER (ORDER BY i.Value DESC) AS value_rank\n FROM Indicators AS i\n JOIN Country AS c ON c.CountryCode = i.CountryCode\n JOIN Series AS s ON s.IndicatorName = i.IndicatorName\n WHERE s.Topic = 'Private Sector & Trade: Exports'\n AND TRIM(COALESCE(c.Region, '')) <> ''\n AND i.Value IS NOT NULL\n)\nSELECT CountryName, IndicatorName\nFROM ranked\nWHERE value_rank = 1;"}}} {"question_id": 2150, "split": "train", "changes": {"question": {"before": "List out the long name of countries using an indicator code as DT.DOD.DSTC.CD", "after": "List the full country names for countries with data for indicator DT.DOD.DSTC.CD."}, "evidence": {"before": null, "after": "Full country names are recorded in Country.LongName."}}} {"question_id": 2153, "split": "train", "changes": {"question": {"before": "List out the country code of lower earning countries", "after": "List the country codes of low-income countries."}, "evidence": {"before": "lower earning countries refer to IncomeGroup = 'Low income';", "after": "Country.IncomeGroup = 'Low income' denotes low income."}}} {"question_id": 2155, "split": "train", "changes": {"question": {"before": "Mention the series code of countries using Australian dollar as their currency unit and belonging to the lower middle income group among them.", "after": "List the country codes and series codes for lower-middle-income countries that use the Australian dollar."}, "evidence": {"before": "Lower middle income group refers to IncomeGroup = 'Low middle income';", "after": "Lower middle income group refers to IncomeGroup = 'Lower middle income';"}}} {"question_id": 2164, "split": "train", "changes": {"question": {"before": "How many of the countries do not have special notes?", "after": "How many country records have no special notes?"}, "evidence": {"before": "do not have special notes implies SpecialNotes are NULL;", "after": "Country.SpecialNotes records special notes; an empty string denotes no special notes in this database."}}} {"question_id": 2165, "split": "validation", "changes": {"question": {"before": "Which high income group countries are from East Asia & Pacific? List the country codes of such countries.", "after": "Which high-income countries are in East Asia & Pacific? List their country codes."}, "evidence": {"before": "Asia is the name of the region;", "after": "Country.IncomeGroup uses 'High income: OECD' and 'High income: nonOECD' for high income; Country.Region uses 'East Asia & Pacific'."}}} {"question_id": 2167, "split": "train", "changes": {"question": {"before": "Which low income countries have a indicator code of DT.DOD.DECT.CD? Name the country code of them.", "after": "Give the country codes of low-income countries with data for indicator DT.DOD.DECT.CD."}, "evidence": {"before": "IncomeGroup = 'Low income';", "after": "Country.IncomeGroup uses 'Low income'."}}} {"question_id": 2177, "split": "train", "changes": {"question": {"before": "List the series code of country with country notes description as \"Data sources : Eurostat\" and state the Wb2Code of these countries.", "after": "For country notes with the exact description “Data sources : Eurostat”, list the series codes and the countries’ Wb2Codes."}, "evidence": {"before": null, "after": "CountryNotes.Countrycode corresponds to Country.CountryCode; Country.Wb2Code is a separate country code."}}} {"question_id": 2191, "split": "train", "changes": {"question": {"before": "How many countries uses the 1968 System of National Accounts methodology?", "after": "How many countries use the 1968 System of National Accounts methodology?"}, "evidence": {"before": "uses the 1968 System of National Accounts methodology refers to SystemOfNationalAccounts = 'Country uses the 1968 System of National Accounts methodology.'", "after": "Country.SystemOfNationalAccounts uses 'Country uses the 1968 System of National Accounts methodology.'."}}} {"question_id": 2193, "split": "train", "changes": {"question": {"before": "Name the country in which the topic is about Poverty: Shared Prosperity. Indicate the long name of the country.", "after": "Which countries have footnotes for series under the topic “Poverty: Shared Prosperity”? List their full names."}}} {"question_id": 2196, "split": "validation", "changes": {"evidence": {"before": "any 3 countries refers to count(shortname)>3", "after": "country.currencyunit = 'U.S. dollar' identifies the currency; country.ShortName records the country name."}}} {"question_id": 2206, "split": "train", "changes": {"evidence": {"before": "proportion = divide(count(countrycode where incomegroup = 'Low income'), count(countrycode))*100%; Sub-Saharan Africa's countries refers to region = 'Sub-Saharan Africa'; have lower middle incomes refers to incomegroup = 'Low income'", "after": "proportion = divide(count(countrycode where incomegroup = 'Lower middle income'), count(countrycode))*100%; Sub-Saharan Africa's countries refers to region = 'Sub-Saharan Africa'; have lower middle incomes refers to incomegroup = 'Lower middle income'"}}} {"question_id": 2213, "split": "validation", "changes": {"question": {"before": "How many countries have their country's footnotes described as \"unspecified\"?", "after": "How many countries have a footnote described as \"Not specified\"?"}, "evidence": {"before": "described as \"unspecified\" refers to Description = 'Not specified';", "after": "Footnotes.Description = 'Not specified' denotes an unspecified footnote."}}} {"question_id": 2221, "split": "train", "changes": {"question": {"before": "What is the agricultural land area in sq. km of Italy in 1968?", "after": "What was Italy’s agricultural land area, in square kilometers, in 1968?"}, "evidence": {"before": "agricultural land area in sq. km refers value where indicatorname = 'Agricultural land (sq. km)'; Italy refers to countryname = 'Italy'; in 1968 refers to year = '1968'", "after": "Indicators.IndicatorName uses 'Agricultural land (sq. km)'; Indicators.Value records the area and Indicators.CountryName uses 'Italy'."}}} {"question_id": 2230, "split": "train", "changes": {"question": {"before": "What is the average number of passengers carried via air transport per year by Bulgaria between 1970 to 1980? Indicate the country's system of trade.", "after": "What was the average number of passengers carried by air transport per year by Bulgaria from 1970 to 1980? Indicate the country’s system of trade."}, "evidence": {"before": "average number refers to avg(value); passengers carried via air transport per year refers to value where IndicatorName = 'Air transport, passengers carried'; by Bulgaria refers to CountryName = 'Bulgaria'; between 1970 to 1980 refers to Year between 1970 and 1980", "after": "passengers carried by air transport refers to Indicators.Value where IndicatorName = 'Air transport, passengers carried'; Bulgaria refers to Indicators.CountryName = 'Bulgaria'; 1970 to 1980 refers to Indicators.Year BETWEEN 1970 AND 1980; return both AVG(Value) and the country's Country.SystemOfTrade"}}} {"question_id": 2231, "split": "train", "changes": {"question": {"before": "What's the lastest household survey in Angola?", "after": "What is the latest household survey recorded for Angola?"}, "evidence": {"before": "in Angola refers to ShortName = 'Angola'; when refers to PppSurveyYear", "after": "Country.LatestHouseholdSurvey is descriptive text that can include the survey name, acronym, and year. Angola is recorded in Country.ShortName."}}} {"question_id": 2246, "split": "validation", "changes": {"question": {"before": "What is the average value of Adolescent fertility rate in the country whose Alpha2Code is 1A?", "after": "What was the average adolescent fertility rate in the country whose Alpha2Code is 1A?"}, "evidence": {"before": "average value = AVG(Value) where IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'", "after": "Indicators.IndicatorName uses 'Adolescent fertility rate (births per 1,000 women ages 15-19)'; Indicators.Value records that rate. Country.Alpha2Code records the two-character code."}}} {"question_id": 2249, "split": "train", "changes": {"question": {"before": "List the distinct genres of the movies which actor id 851 is the star.", "after": "List the distinct genres of movies in which actor ID 851 appears."}, "evidence": {"before": null, "after": "Movie genres are recorded in movies2directors.genre."}}} {"question_id": 2252, "split": "train", "changes": {"question": {"before": "What is the average occupation of users whose ratings are not more than 2 ?", "after": "What is the most common occupation among users who have given at least one rating of 2 or lower?"}, "evidence": {"before": null, "after": "users.occupation stores occupation as text. User ratings are recorded in u2base.rating."}, "SQL": {"before": "SELECT AVG(CAST(u.`occupation` AS REAL)) AS avg_occupation\nFROM `users` u\nWHERE u.`userid` IN (\n SELECT DISTINCT `userid`\n FROM `u2base`\n WHERE CAST(`rating` AS REAL) <= 2\n);", "after": "WITH occupation_counts AS (\n SELECT T1.occupation, COUNT(*) AS user_count\n FROM users AS T1\n WHERE EXISTS (\n SELECT 1 FROM u2base AS T2\n WHERE T2.userid = T1.userid AND T2.rating <= 2\n )\n GROUP BY T1.occupation\n)\nSELECT occupation FROM occupation_counts\nWHERE user_count = (SELECT MAX(user_count) FROM occupation_counts);"}}} {"question_id": 2255, "split": "train", "changes": {"question": {"before": "List any 5 movies from other countries which is not English.", "after": "List any five movies from the ‘other’ country category that are not in English."}, "evidence": {"before": "not in English can be represented by isEnglish = 'F'", "after": "The country category is movies.country = 'other'; movies.isEnglish = 'F' denotes a film not in English."}}} {"question_id": 2272, "split": "train", "changes": {"question": {"before": "Please list down ID of movies acted by actors who received a rating of 5.", "after": "List the IDs of movies acted in by actors who received a rating of 5."}, "evidence": {"before": null, "after": "actors.a_quality records the actor’s rating."}}} {"question_id": 2315, "split": "validation", "changes": {"question": {"before": "Among American movies, please calculate the percentage of movies with negative critical reception.", "after": "What percentage of American movies received at least one 1-star rating?"}, "evidence": {"before": "'negative critical reception' refers to percentage of movies with a rating of 1, which = [count(rating = 1) / count(all movies)] * 100% ", "after": "American movies have country = 'USA'. User ratings are recorded in u2base.rating, where 1 represents one star."}}} {"question_id": 2324, "split": "train", "changes": {"question": {"before": "How many female actors have been played a role in any of French or USA movies?", "after": "How many female actors played a role in any French or U.S. movies?"}, "evidence": {"before": "French and USA are two countries; Female actors mean that a_gender = 'F'", "after": "actors.a_gender = 'F' denotes female. Movie countries are recorded in movies.country as 'France' and 'USA'."}}} {"question_id": 2339, "split": "train", "changes": {"question": {"before": "How many female actresses appeared in the movie 2312852, what country was it in, and what was it's running time?", "after": "How many female actors appeared in movie 2312852, and what are the movie's recorded country and running time?"}, "evidence": {"before": "female actresses mean that a_gender = 'F'", "after": "Female actors are identified by actors.a_gender = 'F'. Country and running time are recorded in movies.country and movies.runningtime."}}} {"question_id": 2345, "split": "train", "changes": {"question": {"before": "Please list the names of all the products ordered in order CA-2011-112326 in superstores in the center.", "after": "List the names of all products in order CA-2011-112326 in the Central region."}, "evidence": {"before": "names of all the products refers to \"Product Name\"; order CA-2011-112326 refers to \"Order ID\" = 'CA-2011-112326'; in the center refers to Region = 'Central';", "after": "central_superstore records Central-region orders; product.\"Product Name\" records product names. Product identifiers are region-specific."}}} {"question_id": 2375, "split": "train", "changes": {"question": {"before": "How much is the total quantity of items from the East region shipped on 3/25/2015? Name the products using a comma-separated list in the another column.", "after": "How many items in total were shipped from the East region on March 25, 2015? After the total, list each product name once, in alphabetical order, separated by commas with no added spaces."}, "SQL": {"before": "SELECT SUM(T1.`Quantity`) AS total_quantity, GROUP_CONCAT(DISTINCT T2.`Product Name`) AS products FROM `east_superstore` T1 JOIN `product` T2 ON T1.`Product ID` = T2.`Product ID` AND T2.`Region` = 'East' WHERE T1.`Ship Date` = '2015-03-25';", "after": "WITH selected AS (SELECT T1.Quantity, T2.`Product Name` AS product_name FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` AND T2.Region = 'East' WHERE T1.`Ship Date` = '2015-03-25') SELECT (SELECT SUM(Quantity) FROM selected) AS total_quantity, (SELECT GROUP_CONCAT(product_name, ',') FROM (SELECT DISTINCT product_name FROM selected WHERE product_name IS NOT NULL ORDER BY product_name)) AS products"}}} {"question_id": 2385, "split": "validation", "changes": {"question": {"before": "Who is the customer from the East region that purchased the order with the highest profit?", "after": "Which customer in the East region placed the most profitable order?"}, "evidence": {"before": "highest profit refers to MAX(profit); Region = 'East'", "after": "East refers to the order’s region. Profit records each line item’s profit; an order’s profit is the combined profit of all its line items. Customer names are recorded in Customer Name."}}} {"question_id": 2392, "split": "train", "changes": {"question": {"before": "Name the customers from the Eastern region who has an order that costs the superstore above 8000.", "after": "List the names of customers in the Eastern region who placed an order that cost the superstore more than 8,000."}, "evidence": {"before": "cost above 8000 refers to SUTRACT(Sales, Profit) > 80000", "after": "An order’s cost is the total cost of its line items; each line item’s cost is Sales - Profit. Eastern region refers to order records with Region = 'East'; customer names refer to Customer Name."}}} {"question_id": 2393, "split": "train", "changes": {"evidence": {"before": "Maxwell Schwartz' is the \"Customer Name\"; in 2015 refers to strftime('%Y', \"Order Date\") = '2015';", "after": "Maxwell Schwartz is a customer name recorded in people.Customer Name. Order Date records when an order was placed."}, "SQL": {"before": "SELECT COUNT(DISTINCT `Order ID`) AS num_orders\nFROM (\n SELECT `Order ID`, `Customer ID` FROM `east_superstore` WHERE `Customer ID` = 'MS-17770' AND strftime('%Y',`Order Date`)='2015'\n UNION\n SELECT `Order ID`, `Customer ID` FROM `west_superstore` WHERE `Customer ID` = 'MS-17770' AND strftime('%Y',`Order Date`)='2015'\n UNION\n SELECT `Order ID`, `Customer ID` FROM `central_superstore` WHERE `Customer ID` = 'MS-17770' AND strftime('%Y',`Order Date`)='2015'\n UNION\n SELECT `Order ID`, `Customer ID` FROM `south_superstore` WHERE `Customer ID` = 'MS-17770' AND strftime('%Y',`Order Date`)='2015'\n) t JOIN people ON people.`Customer ID` = t.`Customer ID`", "after": "SELECT COUNT(DISTINCT `Order ID`) AS num_orders\nFROM (\n SELECT `Order ID`, `Customer ID`, `Region` FROM `east_superstore` WHERE strftime('%Y',`Order Date`)='2015'\n UNION\n SELECT `Order ID`, `Customer ID`, `Region` FROM `west_superstore` WHERE strftime('%Y',`Order Date`)='2015'\n UNION\n SELECT `Order ID`, `Customer ID`, `Region` FROM `central_superstore` WHERE strftime('%Y',`Order Date`)='2015'\n UNION\n SELECT `Order ID`, `Customer ID`, `Region` FROM `south_superstore` WHERE strftime('%Y',`Order Date`)='2015'\n) t JOIN people ON people.`Customer ID` = t.`Customer ID` AND people.`Region` = t.`Region`\nWHERE people.`Customer Name` = 'Maxwell Schwartz'"}}} {"question_id": 2400, "split": "train", "changes": {"SQL": {"before": "WITH all_superstores AS (\n SELECT *\n FROM (\n SELECT * FROM `east_superstore` WHERE strftime('%Y', `Order Date`) = '2016'\n UNION\n SELECT * FROM `west_superstore` WHERE strftime('%Y', `Order Date`) = '2016'\n UNION\n SELECT * FROM `central_superstore` WHERE strftime('%Y', `Order Date`) = '2016'\n UNION\n SELECT * FROM `south_superstore` WHERE strftime('%Y', `Order Date`) = '2016'\n ) t\n) SELECT SUM((T1.Sales / (1 - T1.Discount)) * T1.Quantity - T1.Profit) AS cost FROM all_superstores AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T1.`Product ID` = T3.`Product ID` AND T1.Region = T3.Region WHERE T1.Region = 'East' AND T2.`Customer Name` = 'Brad Thomas'", "after": "WITH all_superstores AS (\n SELECT *\n FROM (\n SELECT * FROM `east_superstore` WHERE strftime('%Y', `Order Date`) = '2016'\n UNION\n SELECT * FROM `west_superstore` WHERE strftime('%Y', `Order Date`) = '2016'\n UNION\n SELECT * FROM `central_superstore` WHERE strftime('%Y', `Order Date`) = '2016'\n UNION\n SELECT * FROM `south_superstore` WHERE strftime('%Y', `Order Date`) = '2016'\n ) t\n) SELECT SUM((T1.Sales / (1 - T1.Discount)) * T1.Quantity - T1.Profit) AS cost FROM all_superstores AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` AND T1.Region = T2.Region INNER JOIN product AS T3 ON T1.`Product ID` = T3.`Product ID` AND T1.Region = T3.Region WHERE T2.`Customer Name` = 'Brad Thomas'"}}} {"question_id": 2407, "split": "train", "changes": {"evidence": {"before": "name of all products refers to Product Name; same-day shipment refers to \"Ship Mode\" = 'Same Day'; year 2013 refers to \"Ship Date\" BETWEEN '2013-01-01' AND '2013-12-31'", "after": "product.Product Name records product names; product IDs are region-specific. west_superstore.Ship Mode uses 'Same Day', and Ship Date records the shipping date."}}} {"question_id": 2409, "split": "train", "changes": {"question": {"before": "What is the total quantity that Cindy Stewart order \"Lexmark X 9575 Professional All-in-One Color Printer\" in the south superstore?", "after": "How many \"Lexmark X 9575 Professional All-in-One Color Printer\" units did Cindy Stewart order in the South region?"}, "evidence": {"before": "Lexmark X 9575 Professional All-in-One Color Printer' is the \"Product Name\"", "after": "Customer and product names are recorded in people.\"Customer Name\" and product.\"Product Name\". Their IDs are region-specific. south_superstore contains South-region order lines; south_superstore.Quantity records units ordered."}}} {"question_id": 2412, "split": "train", "changes": {"question": {"before": "What is the total profit of \"Memorex Froggy Flash Drive 8 GB in south superstore?", "after": "What is the total profit from \"Memorex Froggy Flash Drive 8 GB\" sales in the South region?"}, "evidence": {"before": "\"Memorix Froggy Flash Drive 8 GB\" is the \"Product Name\"", "after": "Product names are recorded in product.\"Product Name\"; product IDs are region-specific. south_superstore.Profit is profit per order line; negative values are losses."}}} {"question_id": 2415, "split": "train", "changes": {"question": {"before": "Calculate the percentage of ordered office supplies products in the central and the south superstore.", "after": "Of all units ordered from the Central and South superstores, what percentage were Office Supplies products?"}, "evidence": {"before": "office supplies products refers to Category = 'Office Supplies'; central refers to Region = 'Central'; south superstore refers to Region = 'South'; percentage = divide(SUM(Product ID where Category = 'Office Supplies'), count(Product ID)) * 100 where Region = 'Central' OR Region = 'South'", "after": "units refers to Quantity on an order line; Office Supplies refers to Category = 'Office Supplies'; percentage = DIVIDE(SUM(Quantity on the Office Supplies lines), SUM(Quantity on all those lines)) * 100, over the combined Central and South order lines matched to products by Product ID and Region"}}} {"question_id": 2417, "split": "train", "changes": {"question": {"before": "Among the orders in Central superstore, which art products were ordered the most? List the product names.", "after": "Which Art products appear on the most order lines in the Central superstore? List their names."}, "evidence": {"before": "art product refers to Sub-Category = 'Art'; the most refers to max(order_number)", "after": "Art products refers to product.`Sub-Category` = 'Art' with product.Region = 'Central', matched to central_superstore rows on `Product ID`; order lines for a product refers to COUNT(*) of those rows grouped by product.`Product ID`; return the `Product Name` of every product whose count equals the maximum, ties included"}}} {"question_id": 2440, "split": "validation", "changes": {"question": {"before": "What is the highest profit order in the Central superstore of customers from Houston, Texas?", "after": "Which orders from customers in Houston, Texas, have the highest total profit in the Central superstore? List their order IDs."}, "evidence": {"before": "highest profit refers to max(Profit); Houston, Texas refers to City = 'Houston' and State = 'Texas'", "after": "Houston, Texas refers to City = 'Houston' and State = 'Texas'; total order profit is SUM(Profit) grouped by Order ID; return the order IDs whose total profit equals the highest total order profit, including all ties."}}} {"question_id": 2441, "split": "train", "changes": {"evidence": {"before": "furniture products refers to Category = 'Furniture'", "after": "product.Category uses 'Furniture'; central_superstore.Quantity records units on an order line. Product IDs are region-specific."}, "SQL": {"before": "SELECT COUNT(*) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Furniture' AND T2.Region = 'Central'", "after": "SELECT SUM(T1.Quantity) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Furniture' AND T2.Region = 'Central'"}}} {"question_id": 2446, "split": "train", "changes": {"question": {"before": "What is the percentage of orders with 0.2 discount in the Central superstore that were purchased by customers who live in Texas?", "after": "Of the Central superstore orders containing at least one item discounted by 20%, what percentage were placed by customers living in Texas?"}, "evidence": {"before": "live in Texas refers to State = 'Texas'; percentage = divide(sum(Order ID) when Discount = 0.2, sum(Order ID)) as percentage", "after": "central_superstore.Discount = 0.2 denotes a 20% line discount. people.State records 'Texas'; customer IDs are region-specific."}}} {"question_id": 2456, "split": "validation", "changes": {"question": {"before": "Provide the product's name of the product with the highest total sales in the South region.", "after": "Provide the name of the product with the highest total sales in the South region."}, "evidence": {"before": "highest sales refers to max(SUM(Sales))", "after": "south_superstore.Sales records sales amounts; product.\"Product Name\" records product names. Product identifiers are region-specific."}}} {"question_id": 2463, "split": "train", "changes": {"question": {"before": "In which year has the greatest number of cases where Handgun was used as weapon?", "after": "In which year were the most cases involving a handgun recorded?"}, "evidence": {"before": "year refers to year(date); the greatest number of cases refers to max(count(case_number)); OS Spray was used as weapon refers to subject_weapon = 'OS Spray'", "after": "incidents.subject_weapon records the weapon, including 'Handgun'; incidents.date records the incident date."}}} {"question_id": 2476, "split": "train", "changes": {"question": {"before": "Of all male officers, what percentage are black officers?", "after": "Of all male officers, what percentage are black officers? Round your answer to 1 decimal place."}, "evidence": {"before": "male refers to gender = 'M'; black refers to race = 'B'; percentage = divide(count(officers where race = 'B'), count(officers)) where gender = 'M' * 100%", "after": "male officers refers to officers.gender = 'M'; officers may appear more than once, so take each full_name with its race once; black officers refers to race = 'B'; percentage = DIVIDE(COUNT(those officers with race = 'B'), COUNT(those male officers)) * 100, ROUND to 1 decimal place"}, "SQL": {"before": "SELECT 100.0 * SUM(race = 'B') / COUNT(*) AS pct_black_male_officers\nFROM (\n SELECT DISTINCT `full_name`, `race`\n FROM `officers`\n WHERE `gender` = 'M'\n);", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * SUM(race = 'B') / COUNT(*) AS pct_black_male_officers\nFROM (\n SELECT DISTINCT `full_name`, `race`\n FROM `officers`\n WHERE `gender` = 'M'\n)\n) SELECT ROUND(value, 1) FROM unrounded;"}}} {"question_id": 2479, "split": "train", "changes": {"question": {"before": "Of the black officers, how many of them investigated cases between the years 2010 and 2015?", "after": "How many different Black officer names appear on cases recorded from 2010 through 2015?"}, "evidence": {"before": "black refers to race = 'B'; between the years 2010 and 2015 refers to date between '2010-01-01' and '2015-12-31'; case refers to case_number", "after": "officers.race = 'B' denotes Black officers. officers.full_name records officer names; case_number links officers to incidents. incidents.date uses year/month/day text."}, "SQL": {"before": "SELECT COUNT(DISTINCT T1.full_name)\nFROM officers AS T1\nJOIN incidents AS T2 ON T1.case_number = T2.case_number\nWHERE T1.race = 'B'\n AND T2.date BETWEEN '2010-01-01' AND '2015-12-31';", "after": "SELECT COUNT(DISTINCT o.full_name) FROM officers o JOIN incidents i ON o.case_number=i.case_number WHERE o.race='B' AND SUBSTR(i.date,1,4) BETWEEN '2010' AND '2015'"}}} {"question_id": 2496, "split": "train", "changes": {"question": {"before": "For the pairs of genes with one having 9 chromosomes and the other having 6 chromosomes, what is the highest expression correlation score?", "after": "What is the highest expression correlation score among gene pairs with one gene on chromosome 9 and the other on chromosome 6?"}, "evidence": {"before": null, "after": "Interactions.GeneID1 and Interactions.GeneID2 identify the two members of a gene pair. Interactions.Expression_Corr is their expression correlation score."}}} {"question_id": 2505, "split": "train", "changes": {"question": {"before": "What percentage of genes located in the cytoskeleton are of unknown class? And of these, how many are not conditional phenotypes?", "after": "Among genes recorded in the cytoskeleton, what percentage have an unknown class? Round to two decimal places. Of the genes with an unknown class, how many have no recorded conditional phenotype?"}, "evidence": {"before": "Percentage = count(genes located in the cytoskeleton unknown class) / count(genes located in the cytoskeleton) * 100%; unknown class refers to Class IN ('Unknown','?')", "after": "in the cytoskeleton refers to Genes.Localization = 'cytoskeleton'; a gene is one DISTINCT GeneID and has unknown class if any of its cytoskeleton records has Class IN ('Unknown','?'); percentage = ROUND(DIVIDE(COUNT(unknown-class genes), COUNT(genes)) * 100, 2); also return how many of those unknown-class genes have no cytoskeleton record with Phenotype = 'Conditional phenotypes'"}, "SQL": {"before": "WITH cytoskel AS (\n SELECT `GeneID`,\n MAX(CASE WHEN `Class` IN ('Unknown','?') THEN 1 ELSE 0 END) AS is_unknown,\n MAX(CASE WHEN `Phenotype`='Conditional phenotypes' THEN 1 ELSE 0 END) AS is_conditional\n FROM `Genes`\n WHERE `Localization`='cytoskeleton'\n GROUP BY `GeneID`\n)\nSELECT\n 100.0 * SUM(is_unknown) / COUNT(*) AS pct_unknown_class,\n SUM(CASE WHEN is_unknown=1 AND is_conditional=0 THEN 1 END) AS not_conditional_unknown\nFROM cytoskel;", "after": "WITH cytoskel AS (\n SELECT `GeneID`,\n MAX(CASE WHEN `Class` IN ('Unknown','?') THEN 1 ELSE 0 END) AS is_unknown,\n MAX(CASE WHEN `Phenotype`='Conditional phenotypes' THEN 1 ELSE 0 END) AS is_conditional\n FROM `Genes`\n WHERE `Localization`='cytoskeleton'\n GROUP BY `GeneID`\n)\nSELECT\n ROUND(100.0 * SUM(is_unknown) / COUNT(*), 2) AS pct_unknown_class,\n SUM(CASE WHEN is_unknown=1 AND is_conditional=0 THEN 1 END) AS not_conditional_unknown\nFROM cytoskel;"}}} {"question_id": 2510, "split": "train", "changes": {"question": {"before": "Of the genes whose phenotype and motif are nucleic acid metabolism defects, PS00107, what percentage perform positive interaction with another gene?", "after": "Among genes with the phenotype “Nucleic acid metabolism defects” and motif PS00107, what percentage have a positive interaction with another gene?"}, "evidence": {"before": "Percentage of no interaction = [count(nucleic acid metabolism, PS00107, no interaction) / count(nucleic acid metabolism, PS00107) * 100%", "after": "the population refers to the DISTINCT genes with Genes.Phenotype = 'Nucleic acid metabolism defects' AND Genes.Motif = 'PS00107'; a positive interaction with another gene refers to an Interactions record for that gene with Expression_Corr > 0; percentage = DIVIDE(COUNT(DISTINCT genes in the population that have at least one such positive interaction), COUNT(DISTINCT genes in the population)) * 100"}}} {"question_id": 2515, "split": "train", "changes": {"question": {"before": "What is the name and category of the app with the highest amount of -1 sentiment polarity score?", "after": "Which app name and category have the most user reviews with a sentiment polarity score of -1?"}, "evidence": {"before": "highest amount of -1 sentiment polarity score refers to MAX(Count(Sentiment_Polarity = 1.0))", "after": "a sentiment polarity score of -1 refers to user_reviews.Sentiment_Polarity = '-1.0' stored as text; the most user reviews refers to the apps whose COUNT of such reviews equals the maximum over all apps, keeping every tied app; return both the app name playstore.App and its playstore.Category"}}} {"question_id": 2518, "split": "train", "changes": {"question": {"before": "For the Akinator app, how many reviews have sentiment subjectivity of no more than 0.5?", "after": "How many Akinator app reviews have a recorded sentiment subjectivity score of 0.5 or lower?"}, "evidence": {"before": "Sentiment_Subjectivity<=0.5", "after": "Sentiment subjectivity is recorded in Sentiment_Subjectivity; 'nan' indicates that no score is available."}, "SQL": {"before": "SELECT COUNT(*) AS review_cnt\nFROM `user_reviews`\nWHERE `App` = 'Akinator'\n AND CAST(`Sentiment_Subjectivity` AS REAL) <= 0.5;", "after": "SELECT COUNT(*) AS review_cnt\nFROM `user_reviews`\nWHERE `App` = 'Akinator'\n AND Sentiment_Subjectivity <> 'nan' AND CAST(`Sentiment_Subjectivity` AS REAL) <= 0.5;"}}} {"question_id": 2526, "split": "train", "changes": {"question": {"before": "What is the total sentiment subjectivity of each app that has multiple genres?", "after": "For each app with multiple genres and at least one recorded numeric subjectivity score, what is the total sentiment subjectivity of its reviews?"}, "evidence": {"before": "multiple genres refers to COUNT(Genres>1; total sentiment subjectivity = Sum(Sentiment_Subjectivity);", "after": "multiple genres refers to an app with at least one playstore row whose Genres contains a semicolon, including repeated labels; total sentiment subjectivity refers to SUM(CAST(Sentiment_Subjectivity AS REAL)) over that app's stored review rows, excluding the literal 'nan', with separate review rows of identical contents counted separately; return each such app with at least one numeric subjectivity score and its total"}, "SQL": {"before": "SELECT\n t1.`App`,\n SUM(CAST(t2.`Sentiment_Subjectivity` AS REAL)) AS total_sentiment_subjectivity\nFROM `playstore` AS t1\nJOIN `user_reviews` AS t2 ON t1.`App` = t2.`App`\nWHERE t1.`Genres` LIKE '%;%'\n AND t2.`Sentiment_Subjectivity` != 'nan'\nGROUP BY t1.`App`;", "after": "SELECT T1.App, SUM(CAST(T1.Sentiment_Subjectivity AS REAL)) FROM user_reviews AS T1 WHERE T1.Sentiment_Subjectivity <> 'nan' AND EXISTS (SELECT 1 FROM playstore AS T2 WHERE T2.App = T1.App AND T2.Genres LIKE '%;%') GROUP BY T1.App"}}} {"question_id": 2532, "split": "train", "changes": {"SQL": {"before": "SELECT COUNT(*)\nFROM `user_reviews`\nWHERE `App` = 'Brit + Co'\n AND `Translated_Review` IS NOT NULL\n AND `Translated_Review` <> 'nan'\n AND Sentiment <> 'nan';", "after": "SELECT COUNT(*)\nFROM `user_reviews`\nWHERE `App` = 'Brit + Co'\n AND `Translated_Review` IS NOT NULL\n AND `Translated_Review` <> 'nan';"}}} {"question_id": 2541, "split": "train", "changes": {"evidence": {"before": "Golfshot Plus: Golf GPS refers to App = 'Golfshot Plus: Golf GPS'; review refers to Translated_Review;", "after": "Garden Coloring Book refers to App = 'Garden Coloring Book'; review refers to Translated_Review;"}}} {"question_id": 2542, "split": "train", "changes": {"evidence": {"before": "Photography app refers to Genre = 'Photography'; highest total sentiment subjectivity score = MAX(sum(Sentiment_Subjectivity));", "after": "playstore.Genres = 'Photography' identifies photography apps. user_reviews.Sentiment_Subjectivity records review subjectivity; playstore can have multiple catalog rows for an app."}}} {"question_id": 2543, "split": "validation", "changes": {"question": {"before": "List all the comments on the highest rated apps for everyone.", "after": "Show the comments for the highest-rated apps that are suitable for everyone and have at least one written review."}, "evidence": {"before": "comments refers to Translated_Review; highest rated refers to MAX(Rating); Everyone refers to Content Rating = 'Everyone';", "after": "Everyone refers to Content Rating = 'Everyone'. Overall user ratings are recorded in playstore.Rating; written reviews are recorded in user_reviews.Translated_Review. NULL, blank text, and the literal 'nan' indicate no written review."}, "SQL": {"before": "WITH max_rating AS ( SELECT MAX(`Rating`) AS r FROM `playstore` AS p JOIN user_reviews as u ON p.App = u.App WHERE `Content Rating` = 'Everyone' AND `Rating` IS NOT NULL ) SELECT u.`Translated_Review` FROM `playstore` p JOIN max_rating m ON p.`Rating` = m.r JOIN `user_reviews` u ON u.`App` = p.`App` WHERE p.`Content Rating` = 'Everyone'", "after": "WITH written_reviews AS (\n SELECT App, Translated_Review\n FROM user_reviews\n WHERE Translated_Review IS NOT NULL\n AND TRIM(Translated_Review) <> ''\n AND Translated_Review <> 'nan'\n), max_rating AS (\n SELECT MAX(p.`Rating`) AS r\n FROM `playstore` AS p\n INNER JOIN written_reviews AS u ON p.App = u.App\n WHERE p.`Content Rating` = 'Everyone'\n AND p.`Rating` IS NOT NULL\n)\nSELECT u.Translated_Review\nFROM `playstore` AS p\nINNER JOIN max_rating AS m ON p.`Rating` = m.r\nINNER JOIN written_reviews AS u ON u.App = p.App\nWHERE p.`Content Rating` = 'Everyone'"}}} {"question_id": 2546, "split": "validation", "changes": {"question": {"before": "Which 1,000,000,000+ intalls apps has the most no comment reviews?", "after": "Among apps with at least one billion installs, which has the most reviews without a comment?"}, "evidence": {"before": "no comment refers to Translated_Review = 'nan' or Translated_Review is NULL or Sentiment = 'nan'; most no comment reviews = (MAX(COUNT(Translated_Review = 'nan')));", "after": "At least one billion installs refers to Installs = '1,000,000,000+'. A review has no comment if Translated_Review is 'nan' or NULL, or Sentiment is 'nan'."}, "SQL": {"before": "SELECT T1.`App`\nFROM `playstore` AS T1\nJOIN `user_reviews` AS T2\n ON T1.`App` = T2.`App`\nWHERE T1.`Installs` = '1,000,000,000+'\n AND (T2.`Translated_Review` = 'nan' OR T2.Translated_Review IS NULL OR T2.Sentiment = 'nan')\nGROUP BY T1.`App`\nORDER BY COUNT(*) DESC\nLIMIT 1;", "after": "SELECT T1.App FROM user_reviews AS T1 WHERE (T1.Translated_Review = 'nan' OR T1.Translated_Review IS NULL OR T1.Sentiment = 'nan') AND EXISTS (SELECT 1 FROM playstore AS T2 WHERE T2.App = T1.App AND T2.Installs = '1,000,000,000+') GROUP BY T1.App ORDER BY COUNT(*) DESC LIMIT 1"}}} {"question_id": 2551, "split": "train", "changes": {"question": {"before": "List out genre that have downloads more than 1000000000.", "after": "List the genres of apps with at least one billion installs."}, "evidence": {"before": "downloads and installs are synonyms; Installs = '1,000,000,000+';", "after": "playstore.Installs stores text bands such as '1,000,000,000+', rather than exact install counts. '1,000,000,000+' is the highest band tracked."}}} {"question_id": 2554, "split": "validation", "changes": {"question": {"before": "What is the average review number for application with 5 rating?", "after": "What is the average number of reviews for apps with a rating of 5?"}, "evidence": {"before": "average review = AVG(Review); application refers to app; Rating = 5;", "after": "playstore.Reviews is the recorded number of user reviews; Rating is the app’s overall rating when scraped."}}} {"question_id": 2556, "split": "train", "changes": {"question": {"before": "Among all apps with 4.7 ratings, what is the percentage of application having more positives sentiment than negative sentiment?", "after": "Among apps rated 4.7, what percentage have more positive than negative user reviews?"}, "evidence": {"before": "percentage = DIVIDE(COUNT(app that has a 4.7 rating and has more positive sentiment than negative sentiment), COUNT(app that has a 4.7 rating))*100 as percentage; having more positive sentiment than negative sentiment refers to Sentiment = 'Positive'>Sentiment = 'Negative';", "after": "apps rated 4.7 refers to the DISTINCT app with playstore.Rating = 4.7; more positive than negative user reviews refers to an app whose count of user_reviews.Sentiment = 'Positive' is greater than its count of Sentiment = 'Negative'; percentage = DIVIDE(the apps rated 4.7 with more positive than negative, all apps rated 4.7) * 100"}}} {"question_id": 2557, "split": "train", "changes": {"question": {"before": "List down app that does not have negative sentiment and calculate the average rating for each app?", "after": "Which apps listed in the app catalog have at least one positive or neutral review and no negative reviews? Give each app’s name and average recorded app rating."}, "evidence": {"before": "doest not have negative sentiment refers to Sentiment! = 'Negative'; average = AVG(Sentiment_Polarity);", "after": "at least one positive or neutral review and no negative reviews refers to an App in user_reviews whose Sentiment values include 'Positive' or 'Neutral' and never 'Negative', ignoring 'nan'; return both the App name and AVG(playstore.Rating) over that app's catalog records, grouped by App"}, "SQL": {"before": "SELECT `App`,\n AVG(CAST(`Sentiment_Polarity` AS REAL)) AS avg_polarity\nFROM `user_reviews`\nGROUP BY `App`\nHAVING SUM(CASE WHEN `Sentiment` = 'Negative' THEN 1 ELSE 0 END) = 0;", "after": "WITH eligible_apps AS (\n SELECT App FROM user_reviews\n WHERE Sentiment IN ('Positive', 'Neutral', 'Negative')\n GROUP BY App\n HAVING SUM(CASE WHEN Sentiment = 'Negative' THEN 1 ELSE 0 END) = 0\n)\nSELECT p.App, AVG(p.Rating) AS average_rating\nFROM playstore AS p\nJOIN eligible_apps AS e ON e.App = p.App\nGROUP BY p.App;"}}} {"question_id": 2562, "split": "train", "changes": {"question": {"before": "What is the average price of games belonging in the arcade genre which has a content rating of Everyone 10+?", "after": "What is the average price of games in the arcade genre with a content rating of Everyone 10+?"}, "evidence": {"before": "average price = AVG(Price);", "after": "Game prices are recorded in playstore.Price. The arcade genre is labeled 'Arcade' in playstore.Genres; the content rating is 'Everyone 10+' in playstore.\"Content Rating\". playstore.Genres can contain multiple genres separated by semicolons. An app can have multiple catalog rows."}}} {"question_id": 2563, "split": "train", "changes": {"question": {"before": "How much is the size of Browser 4G and how many users have a pretty positive favorability on it?", "after": "What is the size of Browser 4G, and how many of its reviews have a sentiment polarity score of at least 0.5?"}, "evidence": {"before": "Browser 4G is the App; pretty positive favorability refers to Sentiment_Polarity score >= 0.5", "after": "Browser 4G is recorded in playstore.App as 'Browser 4G'; playstore.Size records its size. Review sentiment polarity is recorded in user_reviews.Sentiment_Polarity."}, "SQL": {"before": "SELECT T1.`Size`, COUNT(*) AS positive_cnt\nFROM `playstore` AS T1\nJOIN `user_reviews` AS T2 ON T1.`App` = T2.`App`\nWHERE T1.`App` = 'Browser 4G' AND CAST(T2.`Sentiment_Polarity` AS REAL) >= 0.5\nGROUP BY T1.`Size`;", "after": "SELECT DISTINCT p.`Size`, r.positive_cnt\nFROM `playstore` AS p\nCROSS JOIN (\n SELECT COUNT(*) AS positive_cnt\n FROM `user_reviews`\n WHERE `App` = 'Browser 4G'\n AND CAST(`Sentiment_Polarity` AS REAL) >= 0.5\n) AS r\nWHERE p.`App` = 'Browser 4G';"}}} {"question_id": 2565, "split": "train", "changes": {"question": {"before": "How much is the average sentiment polarity score of Golf GPS Rangefinder: Golf Pad and what is it's rating in the Google Play Store?", "after": "What is the average review sentiment polarity for Golf GPS Rangefinder: Golf Pad, and what is its Google Play Store rating?"}, "evidence": {"before": "average sentiment polarity score = AVG(Sentiment_Polarity); Golf GPS Rangefinder: Golf Pad  is the App;", "after": "App names are recorded in playstore.App and user_reviews.App. user_reviews.Sentiment_Polarity is a review’s sentiment score; the text 'nan' represents missing data. playstore.Rating is the recorded app rating."}}} {"question_id": 2571, "split": "train", "changes": {"question": {"before": "Which education App has the worst rating?", "after": "Which education app has the lowest rating?"}, "evidence": {"before": "education App refers to Category = 'EDUCATION'; worst rated app refers to Rating = 1;", "after": "Education apps have playstore.Category = 'EDUCATION'; playstore.Rating records the app rating."}}} {"question_id": 2582, "split": "train", "changes": {"question": {"before": "List the numbers, the customer name, and the order dates of the orders that has the highest unit cost.", "after": "List the order numbers, customer names, and order dates for orders with the highest unit cost."}, "evidence": {"before": "the highest unit cost refers to MAX(Unit Cost); who refers to Customer Names; when refers to OrderDate;", "after": "Sales Orders.\"Unit Cost\" records unit cost, with commas used as thousands separators. Customer names are recorded in Customers.\"Customer Names\"."}}} {"question_id": 2587, "split": "train", "changes": {"question": {"before": "Name the sales team name who had orders with the greatest net profit in 2020.", "after": "What is the name of the sales team whose orders had the greatest net profit in 2020?"}, "evidence": {"before": "net profit can be computed as SUBTRACT(Unit Price, Unit Cost)*Quantity; the greatest net profit in 2020 refers to MAX(net profit) where OrderDate LIKE '%/20';", "after": "net profit of an order refers to MULTIPLY(SUBTRACT(\"Unit Price\", \"Unit Cost\"), \"Order Quantity\") with thousands commas removed from the two amounts; in 2020 refers to OrderDate LIKE '%/%/20'; return \"Sales Team\".\"Sales Team\" whose SUM of that net profit is the greatest, including ties"}}} {"question_id": 2588, "split": "validation", "changes": {"question": {"before": "Sate the order number and calculate the net profit for each order under Joshua Bennett.", "after": "State the order number and calculate the net profit for each order under Joshua Bennett."}, "evidence": {"before": "net profit can be computed as SUBTRACT(Unit Price, Unit Cost); Joshua Bennett is the name of Sales Team;", "after": "For this task, net profit means the per-unit difference between Sales Orders.\"Unit Price\" and \"Unit Cost\". These values may contain thousands-separator commas. Joshua Bennett is recorded in Sales Team.\"Sales Team\"."}}} {"question_id": 2597, "split": "train", "changes": {"question": {"before": "Calculate the percentage of order via in-store channel of customer \"Medline\".", "after": "Calculate the percentage of Medline’s orders placed through the in-store channel."}, "evidence": {"before": "Medline is the name of the customer; DIVIDE(COUNT(OrderNumber where Sales Channel = 'In-Store' and Customer Names = 'Medline'), COUNT(OrderNumber where Customer Names = 'Medline'))*100 as percentage;", "after": "Medline refers to Customers.`Customer Names` = 'Medline ' with a trailing space; the in-store channel refers to `Sales Orders`.`Sales Channel` = 'In-Store'; percentage = DIVIDE(COUNT(Medline orders with Sales Channel = 'In-Store'), COUNT(Medline orders)) * 100"}}} {"question_id": 2598, "split": "train", "changes": {"question": {"before": "Describe the customer names and lasting delivery periods for the product of \"Bedroom Furniture\" by wholesale channel in 2019.", "after": "For wholesale orders of Bedroom Furniture placed in 2019, list the customer names and delivery times in days."}, "evidence": {"before": "delivery period in 2019 means time between placing of an order and the receipt of product and refers to SUBTRACT(DeliveryDate, OrderDate) where SUBSTR(OrderDate, -2 ) = '19'; Sales Channel = 'Wholesale'; Product Name = 'Bedroom Furniture';", "after": "wholesale refers to `Sales Orders`.`Sales Channel` = 'Wholesale'; Bedroom Furniture refers to Products.`Product Name`; placed in 2019 refers to SUBSTR(OrderDate, -2) = '19', dates being M/D/YY; delivery time = SUBTRACT(DeliveryDate, OrderDate) in whole days once both are read as dates, skipping orders without one; return both Customers.`Customer Names` and that day count, ordered by customer name"}}} {"question_id": 2599, "split": "validation", "changes": {"question": {"before": "Describe the customer names who had at least an order with over 3800 USD in net profit.", "after": "List the customer names for customers with at least one order whose net profit exceeded 3,800 USD."}, "evidence": {"before": "over 3800 USD in net profit refers to SUBTRACT(Unit Price, Unit Cost) * Quantity where Net Profit > 3800;", "after": "Sales Orders.\"Unit Price\" and \"Unit Cost\" record per-unit amounts with thousands-separator commas; \"Order Quantity\" records units ordered. Order net profit is the price–cost difference for those units."}}} {"question_id": 2609, "split": "train", "changes": {"question": {"before": "How many states located in the Midwest region?", "after": "How many states are located in the Midwest region?"}, "evidence": {"before": null, "after": "Regions.Region records a state’s region, including 'Midwest'; Regions.StateCode identifies the state."}}} {"question_id": 2610, "split": "validation", "changes": {"question": {"before": "List out the product name of order which has unit cost of 781.22.", "after": "List the product name for the order with a unit cost of 781.22."}, "evidence": {"before": null, "after": "Sales Orders.\"Unit Cost\" identifies the order line with a unit cost of 781.22; Products.\"Product Name\" records the product name."}}} {"question_id": 2615, "split": "train", "changes": {"question": {"before": "Calculate the average net profit of bar tools which has ordered quantity exceed 5.", "after": "What is the average per-unit profit for Bar Tools orders with an order quantity exceeding 5?"}, "evidence": {"before": "net profit can be computed as SUBTRACT(Unit Price, Unit Cost); AVG(net profit) where Product Name = 'Bar Tools' and Order Quantity > 5;", "after": "Bar Tools refers to Products.`Product Name` = 'Bar Tools'; order quantity exceeding 5 refers to `Order Quantity` > 5; per-unit profit refers to SUBTRACT(`Unit Price`, `Unit Cost`); average per-unit profit = DIVIDE(SUM of that per-unit profit, COUNT of those Sales Orders rows)"}}} {"question_id": 2621, "split": "train", "changes": {"evidence": {"before": "Ei is the name of the customer; orders have quantity greater than 4 refer to OrderNumber WHERE Order Quantity > 4;", "after": "Customers.Customer Names stores Ei as 'Ei ' with a trailing space. Sales Orders.Order Quantity records quantity."}}} {"question_id": 2623, "split": "train", "changes": {"question": {"before": "What is the customer names of orders which have unit cost greater than 4000USD?", "after": "What are the customer names for orders with a unit cost greater than 4000 USD?"}, "evidence": {"before": "unit cost greater than 4000USD refers to Unit Cost > 4000;", "after": "Sales Orders.\"Unit Cost\" records unit cost and may contain thousands-separator commas; customer names are in Customers.\"Customer Names\"."}}} {"question_id": 2640, "split": "validation", "changes": {"question": {"before": "Please list the names of customers who have total orders of over 3 in 2018.", "after": "List the names of customers with more than three orders in 2018."}, "evidence": {"before": "total orders of over 3 in 2018 refer to COUNT(OrderNumber) > 3 where SUBSTR(OrderDate, -2) = '18';", "after": "Sales Orders.OrderDate uses month/day/two-digit-year dates. Customer names are recorded in Customers.\"Customer Names\"."}}} {"question_id": 2670, "split": "train", "changes": {"question": {"before": "Name the products via wholesale channel of the store under Pacific/Honolulu time zone.", "after": "Which products were sold through the wholesale channel at stores in the Pacific/Honolulu time zone?"}, "evidence": {"before": "products refers to Product Name; via wholesale channel refers to Sales Channel = 'Wholesale'", "after": "\"Sales Orders\".\"Sales Channel\" uses 'Wholesale'. \"Store Locations\".\"Time Zone\" uses 'Pacific/Honolulu'."}}} {"question_id": 2691, "split": "train", "changes": {"evidence": {"before": "\"WARE-MKL1006\" is the WarehouseCode; most shipment to region refers to Max(Count(Region))", "after": "WARE-MKL1006 refers to `Sales Orders`.WarehouseCode = 'WARE-MKL1006'; the sales team that used it the most times refers to the _SalesTeamID with the greatest COUNT(*) of those orders, taking the single top one; return that team's `Sales Team`.Region"}}} {"question_id": 2692, "split": "train", "changes": {"evidence": {"before": "highest sales order unit price refers to Max(Unit Price)", "after": "Sales Orders.Unit Price stores numeric amounts as text with comma thousands separators, so read it as CAST(REPLACE(Unit Price, ',', '') AS REAL); the highest sales order unit price refers to MAX of that numeric price over all Sales Orders; return the Store Locations.City Name of the store with that highest unit price"}}} {"question_id": 2721, "split": "train", "changes": {"evidence": {"before": "average household income = Divide (Sum(Household Income), Count(City Name)); highest number of store refers to Max(Count(StoreID))", "after": "the Northeast region refers to Region = 'Northeast'; the state with the highest number of stores refers to the StateCode with the greatest COUNT of store locations in that region; return each City Name with AVG(Household Income) in that state"}}} {"question_id": 2745, "split": "train", "changes": {"question": {"before": "What is the percentage whereby the away team scored 2 goals during the 2017 seasons?", "after": "What percentage of matches in the 2017 season had an away team that scored exactly 2 goals?"}, "evidence": {"before": "scored 2 goals refers to FTAG = 2, which is short name for Final-time Away-team Goals; DIVIDE(COUNT(Div where season = 2017, FTAG = '2'), COUNT(Div where season = 2017))*100 as percentage;", "after": "the away team scored exactly 2 goals refers to FTAG = 2; percentage = DIVIDE(SUM(CASE WHEN FTAG = 2 THEN 1 ELSE 0 END), COUNT(*)) * 100 over the matchs rows of the 2017 season"}}} {"question_id": 2754, "split": "validation", "changes": {"question": {"before": "What was the difference in home team and away team win percentages across all divisions in 2010?", "after": "Across all divisions in 2010, what was the home-win percentage minus the away-win percentage, in percentage points?"}, "evidence": {"before": "2010 refers to season = 2010; SUBTRACT(DIVIDE(COUNT(Div where FTR = 'H', season = 2010), COUNT(Div where season = 2010)), COUNT(Div where FTR = 'A', season = 2010), COUNT(Div where season = 2010)) as percentage;", "after": "matchs.season records the season year. matchs.FTR uses 'H' for a home win and 'A' for an away win."}}} {"question_id": 2755, "split": "train", "changes": {"question": {"before": "Which division had the most draft matches in the 2008 season?", "after": "Which division had the most draw matches in the 2008 season?"}, "evidence": {"before": "the most draft matches refer to MAX(COUNT(Div)) where FTR = 'D';", "after": "a draw refers to matchs.FTR = 'D'; the 2008 season refers to matchs.season = 2008; the most draw matches refers to the Div with the highest COUNT of such matches, taking the single top division; return that Div"}}} {"question_id": 2760, "split": "train", "changes": {"question": {"before": "Which away teams in the division of Bundesliga have the highest final time goals in one match?", "after": "Which away teams in the Bundesliga division scored the highest number of final-time goals in a single match?"}, "evidence": {"before": "Bundesliga is a name of division; the highest final time goals refers to MAX(FTAG);", "after": "the Bundesliga division refers to divisions.name = 'Bundesliga'; final-time goals scored by the away team refers to matchs.FTAG; the highest number in a single match refers to FTAG = MAX(FTAG) among the Bundesliga matchs; return matchs.AwayTeam for those matchs"}}} {"question_id": 2770, "split": "train", "changes": {"question": {"before": "For the Ligue 2 game that made the most goals, who is the winner of that game?", "after": "For the Ligue 2 game with the most total goals, which team won?"}, "evidence": {"before": "Ligue 2 is the name of division; the most goals refer to MAX(SUM(FTHG, FTAG)) which are short names for Final-time Home-team Goals and Final-time Away-team Goals;", "after": "Ligue 2 is recorded in divisions.name as 'Ligue 2'. matchs.FTHG and matchs.FTAG record full-time home and away goals. matchs.FTR uses 'H' for a home win, 'A' for an away win, and 'D' for a draw."}}} {"question_id": 2777, "split": "train", "changes": {"question": {"before": "How many Scottish League One games took place on the day that \"Pro Vercelli\" and \"Pescara\"had a 5-2 game?", "after": "How many Scottish League One games took place on the day when Pro Vercelli beat Pescara 5–2?"}, "evidence": {"before": "Pro Vercelli and Pescara are names of teams; HomeTeam = 'Pro Vercelli'; AwayTeam = 'Pescara'; 5-2 is a score where FTHG = '5' and FTAG = '2'; Scottish League One is a name of division; games refer to Div;", "after": "matchs.HomeTeam and matchs.AwayTeam record team names; matchs.FTHG and matchs.FTAG record their full-time goals. Scottish League One is recorded in divisions.name as 'Scottish League One'."}}} {"question_id": 2782, "split": "train", "changes": {"evidence": {"before": "1-1 is a score where FTHG = '1' and FTAG = '1'; Liga NOS is the name of division; DIVIDE(COUNT(Div where FTHG = '1', FTAG = '1', name = 'Liga NOS'), COUNT(Div where FTHG = '1' and FTAG = '1')) as percentage;", "after": "games ended up with 1-1 refers to matchs.FTHG = 1 AND matchs.FTAG = 1; Liga NOS refers to divisions.name = 'Liga NOS'; percentage = DIVIDE(COUNT of 1-1 games in Liga NOS, COUNT of all 1-1 games) * 100"}}} {"question_id": 2784, "split": "train", "changes": {"evidence": {"before": "Bundesliga is the name of division; Date = '2020/10/2';", "after": "Bundesliga is the name of division; Date = '2020-10-02';"}}} {"question_id": 2794, "split": "validation", "changes": {"question": {"before": "How many final-time home-team goals were there in total in all the matches of the Bundesliga division in the 2021 season?", "after": "What was the total number of final home-team goals in Bundesliga matches during the 2021 season?"}, "evidence": {"before": "Bundesliga is the name of division; final-time home-team goals refers to FTHG;", "after": "matchs.FTHG records full-time home-team goals; matchs.season records the season. Bundesliga is recorded in divisions.name as 'Bundesliga'."}}} {"question_id": 2795, "split": "train", "changes": {"evidence": {"before": "Division 1A is name of division; season = 2021; Club Brugge is name of team; Club Brugge wins implies HomeTeam = 'Club Brugge' and FTR = 'H' and AwayTeam = 'Club Brugge' and FTR = 'A'; DIVIDE(SUM(COUNT(FTR = 'H' where HomeTeam = 'Club Brugge', name = 'Division 1A', season = 2021), COUNT(FTR = 'A'where AwayTeam = 'Club Brugge', name = 'Division 1A', season = 2021)), COUNT(Div where name = 'Division 1A', season = 2021));", "after": "Division 1A refers to divisions.name = 'Division 1A' and 2021 to matchs.season = 2021; Club Brugge's matches have HomeTeam or AwayTeam = 'Club Brugge'; a win refers to (HomeTeam = 'Club Brugge' AND FTR = 'H') OR (AwayTeam = 'Club Brugge' AND FTR = 'A'); winning rate = DIVIDE(wins, those matches) * 100"}}} {"question_id": 2802, "split": "validation", "changes": {"evidence": {"before": "1970 to 1980 refers to year between 1970 and 1980; longest serving coach Max(Count(coachID)); list teams refers to GROUP_CONCAT(DISTINCT `tmID`)", "after": "1970 to 1980 refers to year between 1970 and 1980; longest serving coach means the maximum number of distinct years coached; list teams refers to GROUP_CONCAT(DISTINCT tmID)"}}} {"question_id": 2804, "split": "train", "changes": {"question": {"before": "List all the coaches with more game lost than won from year 2000-2010. List the coach ID, team name and year.", "after": "List the coach ID, team name, and year for coaching stints from 2000 through 2010 in which the coach lost more games than they won."}, "evidence": {"before": "from year 2000 to 2010 refers to year between 2000 and 2010; more game lost then won refers to lost > won", "after": "coaches.won and lost are recorded per team stint, identified by tmID and stint within a year."}}} {"question_id": 2807, "split": "train", "changes": {"question": {"before": "What is the percentage of player who won \"All-Defensive First Team\" from 1980 - 2000 is from 'NY'.", "after": "What percentage of players who won an All-Defensive First Team award from 1980 through 2000 were born in New York?"}, "evidence": {"before": "\"All-Defensive First Team\" is the award; ' NY' is the birthState; 1980 to 2000 refers to year between 1980 and 2000; percentage = Divide (Count(playerID where birthState = 'NY'), Count(playerID)) * 100", "after": "players.birthState = 'NY' denotes New York. The award label is 'All-Defensive First Team'."}, "SQL": {"before": "WITH winners AS (\n SELECT DISTINCT `playerID`\n FROM `awards_players`\n WHERE `award` = 'All-Defensive First Team' AND `year` BETWEEN 1980 AND 2000\n),\nny_winners AS (\n SELECT w.`playerID`\n FROM winners w\n JOIN `players` p ON p.`playerID` = w.`playerID`\n WHERE p.`birthState` = 'NY'\n)\nSELECT CAST(COUNT(*) AS REAL) * 100.0 / (SELECT COUNT(*) FROM winners) AS pct_ny_winners;", "after": "WITH winners AS (\n SELECT DISTINCT `playerID`\n FROM `awards_players`\n WHERE `award` = 'All-Defensive First Team' AND `year` BETWEEN 1980 AND 2000\n),\nny_winners AS (\n SELECT w.`playerID`\n FROM winners w\n JOIN `players` p ON p.`playerID` = w.`playerID`\n WHERE p.`birthState` = 'NY'\n)\nSELECT CAST(COUNT(*) AS REAL) * 100.0 / (SELECT COUNT(*) FROM winners) AS pct_ny_winners FROM ny_winners;"}}} {"question_id": 2833, "split": "train", "changes": {"evidence": {"before": "high school in New York refers to highSchool like '%New York%'; won the MVP refers to award = 'Most Valuable Player'; average height = Divide (Sum(height), Count(playerID))", "after": "players.hsState = 'NY' identifies high schools in New York. awards_players.award = 'Most Valuable Player' identifies the MVP award; players.height records height."}}} {"question_id": 2843, "split": "validation", "changes": {"evidence": {"before": "from 1962 to 2011 refers to year between 1960 and 2011; received both NBA and ABA award refers to coachID where award LIKE 'NBA%' and 'ABA%'", "after": "coachID identifies a coach. NBA and ABA awards have award values beginning with 'NBA' and 'ABA', respectively. A qualifying coach received at least one award from each league between 1962 and 2011, inclusive."}}} {"question_id": 2849, "split": "validation", "changes": {"question": {"before": "Among players who were born after 1950, who had offence rebounds rates more than 30%? Please list their last names and first names.", "after": "Among players born after 1950, whose offensive rebounds account for more than 30% of their total rebounds across all seasons recorded? List their last and first names."}, "evidence": {"before": "born after 1950 refers to birthDate > = '1950-01-01'; offence rebound rate more than 30% refers to Divide (oRebounds, rebounds) > 0.3", "after": "born after 1950 refers to birthDate > '1950-12-31'; for each player, sum oRebounds and rebounds across all recorded players_teams rows with rebounds > 0; offensive rebound rate more than 30% refers to 1.0 * SUM(oRebounds) / SUM(rebounds) > 0.3."}}} {"question_id": 2851, "split": "train", "changes": {"question": {"before": "Please list the team IDs which have at least 3 all-star players over all time.", "after": "Which team IDs had at least three different players selected as All-Stars in seasons when those players belonged to the team, over all recorded years?"}, "evidence": {"before": "team with at least 3 all star player refers to tmID where Count(player_allstar.playerID) > = 3", "after": "selected as All-Stars in seasons when those players belonged to the team refers to players_teams joined to player_allstar on the same playerID with players_teams.year = season_id; at least three different players refers to COUNT(DISTINCT playerID) >= 3 per team; return those team IDs"}}} {"question_id": 2855, "split": "train", "changes": {"question": {"before": "In 1937, how many teams whose players got at least 500 points in total?", "after": "How many teams scored at least 500 points in total across all their players in 1937?"}, "evidence": {"before": "in 1937 refers to year = 1937; player got at least 500 points refers to Sum(points) > = 500", "after": "players_teams.points records a player’s points for a team and year; tmID identifies the team."}}} {"question_id": 2857, "split": "train", "changes": {"question": {"before": "Please list the top three shortest black players.", "after": "Give the first and last names of the three shortest Black players with positive recorded heights."}, "evidence": {"before": "shortest player refers to Min(height); black players refers to race = 'B'", "after": "Black players refers to players.race = 'B'; positive recorded heights refers to players.height > 0; the three shortest refers to ORDER BY players.height ASC LIMIT 3; return the first and last names of those players"}}} {"question_id": 2859, "split": "train", "changes": {"question": {"before": "How many field goals did George Mikan make overall between 1951 and 1953?", "after": "How many regular-season field goals did George Mikan make overall in the 1951 through 1953 seasons?"}, "evidence": {"before": "between 1951 and 1953 refers to season_id; field goal refers to fg_made", "after": "players_teams.fgMade records field goals made and players_teams.year records the season year. players.firstName and players.lastName identify George Mikan."}}} {"question_id": 2861, "split": "train", "changes": {"question": {"before": "What is the name of the team with the highest per-year home lost rate over all time?", "after": "Which team had the highest per-year home-loss rate over all time?"}, "evidence": {"before": "highest home lost rate = Max(Divide(homelost, Sum(homeWon, homeLost)))", "after": "teams.homeLost and teams.homeWon record home losses and wins for a team-year. Home-loss rate is the share of those home games lost."}}} {"question_id": 2868, "split": "train", "changes": {"question": {"before": "Please list the first names of the players with the most personal fouls in the 'NBL' league.", "after": "Which players committed the most personal fouls over their NBL careers? List their first names."}, "evidence": {"before": "\"NBL\" is the lgID; most  personal foul refers to Max(Count(PF))", "after": "NBL refers to lgID = 'NBL'; personal fouls over their NBL careers refers to SUM(PF) over a player's NBL team season rows; the most personal fouls refers to the greatest such per-player total; list players.firstName"}}} {"question_id": 2885, "split": "train", "changes": {"question": {"before": "Which coach has the most 'won' than 'lost' in year '1988'? List their ids.", "after": "Which coach had the largest margin of wins over losses in 1988? Give the coach ID."}, "evidence": {"before": "in year '1988' refers to year = 1988; the most 'won' than 'lost' refers to max(subtract(won, lost))", "after": "margin of wins over losses refers to SUBTRACT(won, lost) as recorded for a coaches team stint; the largest margin refers to the greatest such margin among coaches in 1988; return the coach ID holding it"}}} {"question_id": 2920, "split": "train", "changes": {"question": {"before": "State the name of teams ranked first five or more times and lost a league two or more times between 1980 and 2000?", "after": "State the names of teams that ranked first at least five times and lost a championship final at least two times between 1980 and 2000."}, "evidence": {"before": "name of team refers to teams.name; between 1980 and 2000 refers to year between 1980 and 2000; ranked first five or more times refers to count(rank = 1) > = 5; lost a league two or more times refers to lost > 2", "after": "between 1980 and 2000 refers to year BETWEEN 1980 AND 2000 in teams and in series_post alike; ranked first at least five times refers to COUNT(teams rows with rank = 1 in those years) >= 5 for a team; lost a championship final at least two times refers to COUNT(series_post rows with round = 'F' in those years having that team as tmIDLoser) >= 2; return the DISTINCT teams.name of every team that satisfies both"}, "SQL": {"before": "WITH first_rank AS (\n SELECT `tmID`, COUNT(*) AS cnt_first\n FROM `teams`\n WHERE `year` BETWEEN 1980 AND 2000 AND `rank` = 1\n GROUP BY `tmID`\n HAVING cnt_first >= 5\n),\nfinal_losses AS (\n SELECT `tmIDLoser` AS `tmID`, COUNT(*) AS cnt_loss\n FROM `series_post`\n WHERE `year` BETWEEN 1980 AND 2000 AND `round` = 'F'\n GROUP BY `tmID`\n HAVING cnt_loss >= 2\n)\nSELECT DISTINCT t.`name`\nFROM first_rank fr\nJOIN final_losses fl ON fr.`tmID` = fl.`tmID`\nJOIN `teams` t ON t.`tmID` = fr.`tmID` AND t.`year` = 2000; ", "after": "WITH first_rank AS (\n SELECT `tmID`, COUNT(*) AS cnt_first\n FROM `teams`\n WHERE `year` BETWEEN 1980 AND 2000 AND `rank` = 1\n GROUP BY `tmID`\n HAVING cnt_first >= 5\n),\nfinal_losses AS (\n SELECT `tmIDLoser` AS `tmID`, COUNT(*) AS cnt_loss\n FROM `series_post`\n WHERE `year` BETWEEN 1980 AND 2000 AND `round` = 'F'\n GROUP BY `tmID`\n HAVING cnt_loss >= 2\n)\nSELECT DISTINCT t.`name`\nFROM first_rank fr\nJOIN final_losses fl ON fr.`tmID` = fl.`tmID`\nJOIN `teams` t ON t.`tmID` = fr.`tmID` AND t.`year` BETWEEN 1980 AND 2000; "}}} {"question_id": 2922, "split": "train", "changes": {"question": {"before": "What is the difference in the average age of players when they are drafted in the ABA vs when they are drafted in the NBA between the years 1970 and 1970?", "after": "For players drafted in 1970, how much higher was the average draft age in the ABA than in the NBA?"}, "evidence": {"before": "ABA refers to lgID = 'ABA'; NBA refers to lgID = 'NBA'; between the years 1970 and 1970 refers to draftYear between 1970 and 1970; difference = subtract(avg(subtract(1970, year(birthDate)) where lgID = 'ABA'), avg(subtract(1970, year(birthDate)) where lgID = 'NBA'))", "after": "draft age refers to SUBTRACT(the draft year, the birth year of players.birthDate in YYYY-MM-DD); the population is players drafted in 1970 with draft.lgID IN ('ABA','NBA'); how much higher refers to SUBTRACT(AVG(draft age where draft.lgID = 'ABA'), AVG(draft age where draft.lgID = 'NBA')), each average taken over its own draft.lgID value only"}}} {"question_id": 2927, "split": "validation", "changes": {"question": {"before": "How many turnovers per game did the assist champion had in the 2003 NBA season?", "after": "How many turnovers per game did the assist champion have in the 2003 NBA season?"}, "evidence": {"before": "turnovers per game = avg(turnovers); 2003 refers to year = 2003; NBA refers to lgID = 'NBA'", "after": "turnovers per game = SUM(turnovers)/SUM(GP); the assist champion is the player with highest SUM(assists)/SUM(GP) in the 2003 NBA season; 2003 refers to year = 2003; NBA refers to lgID = 'NBA'"}}} {"question_id": 2934, "split": "train", "changes": {"question": {"before": "Which NBA team that didn't play in playoffs had the most winning rate in the 2000 NBA regular season? List the team id.", "after": "Among NBA teams that did not make the playoffs in the 2000 season, which had the highest win rate? List their team IDs."}, "evidence": {"before": "NBA refers to lgID = 'NBA'; didn't play in the playoffs refers to PostGP = 0; 2000 refers to year = 2000; the most winning rate refers to max(divide(won, add(won, lost)))", "after": "NBA teams in the 2000 season refers to teams.lgID = 'NBA' AND teams.year = 2000; did not make the playoffs refers to a missing or empty teams.playoff; win rate = DIVIDE(won * 1.0, won + lost), unscaled; the highest win rate refers to MAX of that rate; include all teams tied for it; return their team IDs"}, "SQL": {"before": "WITH team_win_rate AS (\n SELECT T2.tmID, CAST(T2.won AS REAL) / (T2.won + T2.lost) win_rate \n FROM players_teams AS T1 \n INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year \n WHERE T1.PostGP = 0 AND T1.year = 2000\n) SELECT DISTINCT tmID \nFROM team_win_rate\nWHERE win_rate = (SELECT MAX(win_rate) FROM team_win_rate)", "after": "WITH rates AS (SELECT tmID, won * 1.0 / (won + lost) AS win_rate FROM teams WHERE year = 2000 AND lgID = 'NBA' AND (playoff IS NULL OR playoff = '')) SELECT tmID FROM rates WHERE win_rate = (SELECT MAX(win_rate) FROM rates)"}}} {"question_id": 2944, "split": "train", "changes": {"question": {"before": "Which team did the youngest player who could be in F-G position play in the NBA?", "after": "Find the youngest player listed as both a forward and a guard. Which NBA teams did they play for? List the team IDs."}, "evidence": {"before": "team refers to tmID; the youngest refers to max(year); F-G position refers to pos like '%F%' AND like '%G%'; NBA refers to lgID = 'NBA'", "after": "listed as both a forward and a guard refers to players.pos LIKE '%F%' AND players.pos LIKE '%G%'; the youngest such player refers to players.birthDate = MAX(birthDate) over those players; NBA refers to players_teams rows with lgID = 'NBA'; list the DISTINCT players_teams.tmID of that player"}}} {"question_id": 2945, "split": "train", "changes": {"question": {"before": "For the players who played the most PBLA games, who was graduated from Central Missouri State college? Show their first, middle, and last names.", "after": "Among the players who played the most PBLA games, who graduated from Central Missouri State College? Give their first, middle, and last names."}, "evidence": {"before": "the most PBLA games refers to max(games_played); Central Missouri State college refers to college = 'Central Missouri State'", "after": "PBLA games refers to players_teams.GP where lgID = 'PBLA'; the most PBLA games refers to the players whose SUM(GP) over their PBLA rows equals the greatest such total; Central Missouri State College refers to players.college = 'Central Missouri State'; return the first, middle and last names"}}} {"question_id": 2997, "split": "train", "changes": {"question": {"before": "How many paragraphs are there in the chapter with the highest amount of scenes in act 1?", "after": "Which works have the most recorded scenes in Act 1, and how many paragraphs are in that act for each? Give each work’s title and paragraph count."}, "evidence": {"before": "How many paragraphs refers to ParagraphNum; highest amount of scenes refers to max(count(Scene))", "after": "the most recorded scenes in Act 1 refers to the MAX of COUNT(DISTINCT Scene) among chapters with Act = 1 per work, keeping every tied work; paragraphs in that act refers to COUNT(paragraphs.id) over the paragraphs of that work's Act = 1 chapters, 0 if none; return both works.LongTitle and that paragraph count"}, "SQL": {"before": "SELECT COUNT(*) AS num_paragraphs\nFROM `paragraphs`\nWHERE `chapter_id` in (\n SELECT `id`\n FROM `chapters`\n WHERE `Act` = 1\n AND `work_id` = (SELECT work_id FROM chapters WHERE Act = 1 GROUP BY work_id ORDER BY COUNT(Scene) DESC LIMIT 1)\n);", "after": "WITH scene_counts AS (\n SELECT work_id,COUNT(DISTINCT Scene) AS scenes FROM chapters WHERE Act=1 GROUP BY work_id\n), selected AS (\n SELECT work_id FROM scene_counts WHERE scenes=(SELECT MAX(scenes) FROM scene_counts)\n)\nSELECT w.LongTitle,COUNT(p.id) AS paragraphs\nFROM selected s JOIN works w ON w.id=s.work_id\nJOIN chapters c ON c.work_id=w.id AND c.Act=1\nLEFT JOIN paragraphs p ON p.chapter_id=c.id\nGROUP BY w.id,w.LongTitle;"}}} {"question_id": 3006, "split": "train", "changes": {"evidence": {"before": "one-act works refers to count(Act) = 1; genre refers to GenreType\n", "after": "one-act works refers to works for which COUNT(DISTINCT chapters.Act) = 1, since multiple scene records can belong to the same act; return works.Title and works.GenreType for each such work"}}} {"question_id": 3011, "split": "train", "changes": {"question": {"before": "Calculate Romeo and Juliet's individual amount of appearance in percentage against the overall number of characters that appeared in the The Tragedy of Romeo and Juliet. List the character names and their percentage values.", "after": "In The Tragedy of Romeo and Juliet, what percentage of paragraphs is attributed to Romeo, and what percentage to Juliet? Give each name and percentage, rounded to two decimal places."}, "evidence": {"before": "Rome and Juliet refers to CharName = 'Romeo' and CharName = 'Juliet'; The Tragedy of Romeo and Juliet refers to LongTitle = 'The Tragedy of Romeo and Juliet'; percentage = divide(sum(charater.id) when CharName = 'Romeo', sum(charater.id)) as percentage and percentage = divide(sum(charater.id) when CharName = 'Juliet', count(charater.id)) as percentage", "after": "The Tragedy of Romeo and Juliet refers to works.LongTitle = 'The Tragedy of Romeo and Juliet'; paragraphs.character_id attributes each paragraph to a character, and paragraph records are the attribution units; a character's percentage = ROUND(DIVIDE(COUNT(paragraphs of that play attributed to that character), COUNT(paragraphs of that play)) * 100, 2); give the character and its percentage for Romeo and for Juliet"}, "SQL": {"before": "SELECT\n c.`CharName` AS character,\n COUNT(*) * 100.0 /\n (SELECT COUNT(*)\n FROM `paragraphs` p2\n JOIN `chapters` ch2 ON ch2.`id` = p2.`chapter_id`\n JOIN `works` w2 ON w2.`id` = ch2.`work_id`\n WHERE w2.`LongTitle` = 'The Tragedy of Romeo and Juliet') AS percentage\nFROM `paragraphs` p\nJOIN `chapters` ch ON ch.`id` = p.`chapter_id`\nJOIN `works` w ON w.`id` = ch.`work_id`\nJOIN `characters` c ON c.`id` = p.`character_id`\nWHERE w.`LongTitle` = 'The Tragedy of Romeo and Juliet'\n AND c.`CharName` IN ('Romeo','Juliet')\nGROUP BY c.`CharName`;", "after": "SELECT\n c.`CharName` AS character,\n ROUND(COUNT(*) * 100.0 /\n (SELECT COUNT(*)\n FROM `paragraphs` p2\n JOIN `chapters` ch2 ON ch2.`id` = p2.`chapter_id`\n JOIN `works` w2 ON w2.`id` = ch2.`work_id`\n WHERE w2.`LongTitle` = 'The Tragedy of Romeo and Juliet'), 2) AS percentage\nFROM `paragraphs` p\nJOIN `chapters` ch ON ch.`id` = p.`chapter_id`\nJOIN `works` w ON w.`id` = ch.`work_id`\nJOIN `characters` c ON c.`id` = p.`character_id`\nWHERE w.`LongTitle` = 'The Tragedy of Romeo and Juliet'\n AND c.`CharName` IN ('Romeo','Juliet')\nGROUP BY c.`CharName`;"}}} {"question_id": 3012, "split": "train", "changes": {"question": {"before": "What is the paragraph number with plain text \"This is Illyria, lady\"?", "after": "What is the paragraph number for the text \"This is Illyria, lady.\"?"}, "evidence": {"before": "paragraph number refers to ParagraphNum", "after": "The text is recorded in paragraphs.PlainText; its paragraph number is paragraphs.ParagraphNum."}}} {"question_id": 3026, "split": "train", "changes": {"question": {"before": "Calculate average scene per act in Antony and Cleopatra.", "after": "Calculate the average number of scenes per act in Antony and Cleopatra."}, "evidence": {"before": "Antony and Cleopatra refers to Title = 'Antony and Cleopatra'; average scene per act = divide(sum(Scene), count(distinct act))", "after": "Antony and Cleopatra refers to works.Title = 'Antony and Cleopatra'; the chapters rows of that title are its scenes, and chapters.Act identifies the act; average number of scenes per act = DIVIDE(COUNT(chapters rows), COUNT(DISTINCT Act)) as a REAL"}}} {"question_id": 3030, "split": "validation", "changes": {"evidence": {"before": "From 1593 onwards refers to Date >= 1593; comedy works and history works refers to GenreType = 'comedy' and GenreType = 'History'", "after": "From 1593 onwards refers to Date >= 1593; comedy works and history works refer to GenreType = 'Comedy' and GenreType = 'History', respectively."}}} {"question_id": 3038, "split": "train", "changes": {"question": {"before": "How many chapters have the name Gratiano as a character for \"friend to Antonio and Bassiano\"?", "after": "In how many chapters does Gratiano, described as \"friend to Antonio and Bassiano\", appear?"}, "evidence": {"before": "name Gratiano as a character refers to CharName = 'Gratiano'; \"friend to Antonio and Bassiano\" refers to characters.Description = 'friend to Antonio and Bassiano'", "after": "The stored character description is 'friend to Antonio and Bassiano'. paragraphs.character_id attributes a paragraph to a character."}}} {"question_id": 3044, "split": "train", "changes": {"question": {"before": "What is the percentage of historical works that have not fewer than five scenes in the 1500s?", "after": "Among historical works dated from 1500 through 1599, what percentage have at least five scenes?"}, "evidence": {"before": "historical works refers to GenreType = 'history'; have not fewer than five scenes in the 1500s refers to count(Scene) > = 5 and DATE > = 1500 AND DATE < = 1599; percentage = divide(count(works.id) where GenreType = 'history' and count(Scene) > = 5, count(works.id) )*100 as percentage", "after": "historical works refers to works.GenreType = 'History'; dated from 1500 through 1599 refers to works.Date BETWEEN 1500 AND 1599; at least five scenes refers to COUNT(chapters of that work) >= 5; percentage = DIVIDE(COUNT(those works with >= 5 scenes), COUNT(all historical works dated 1500-1599)) * 100"}}} {"question_id": 3056, "split": "train", "changes": {"question": {"before": "In Act 1 Scene 2 of the Twelfth Night, what is the total number of of lines said by Viola?", "after": "How many paragraphs of dialogue does Viola have in Act 1, Scene 2 of Twelfth Night?"}, "evidence": {"before": "Twelfth Night refers to Title = 'Twelfth Night'; total number of lines said by Viola refers to count(character_id) where CharName = 'Viola'", "after": "Viola refers to characters.CharName = 'Viola'; how many paragraphs of dialogue refers to the COUNT of paragraphs records for that character in Act 1, Scene 2 of Twelfth Night"}}} {"question_id": 3084, "split": "train", "changes": {"evidence": {"before": "the $32650.65157 car refers to price = 32650.65157; year refers to model+1990", "after": "price.price records the price. data.model stores the model year as an offset from 1900."}}} {"question_id": 3104, "split": "validation", "changes": {"question": {"before": "What is the percentage of cars that was produced by Japan among those that have a sweep volume of no less than 30?", "after": "What percentage of cars with a sweep volume of at least 30 were produced by Japan?"}, "evidence": {"before": "produced by Japan refers to country = 'Japan'; a sweep volume of no less than 30 refers to divide(displacement, cylinders) >= 30; percentage = divide(count(ID where country = 'Japan'), count(ID)) * 100% where divide(displacement, cylinders) >= 30", "after": "Engine displacement is data.displacement and cylinder count is data.cylinders; sweep volume is displacement divided by cylinders. Production country is country.country, linked through production.country; Japan is stored as 'Japan'."}}} {"question_id": 3106, "split": "train", "changes": {"question": {"before": "Calculate the average price of cars from Europe.", "after": "Calculate the average price of cars from Europe. Round your answer to 2 decimal places."}, "evidence": {"before": "from Europe refers to country = 'Europe'; average price = avg(price) where country = 'Europe'", "after": "from Europe refers to country.country = 'Europe', reached from production by country.origin = production.country; average price refers to AVG(price.price) over the price rows whose price.ID is one of those European cars; round your answer to 2 decimal places refers to ROUND(that average, 2)"}, "SQL": {"before": "SELECT AVG(pr.price) AS avg_price FROM price pr WHERE pr.ID IN ( SELECT DISTINCT p.ID FROM production p JOIN country c ON c.origin = p.country WHERE c.country = 'Europe' )", "after": "WITH unrounded(value) AS (\nSELECT AVG(pr.price) AS avg_price FROM price pr WHERE pr.ID IN ( SELECT DISTINCT p.ID FROM production p JOIN country c ON c.origin = p.country WHERE c.country = 'Europe' )\n) SELECT ROUND(value, 2) FROM unrounded;"}}} {"question_id": 3142, "split": "train", "changes": {"question": {"before": "What years did the Buick Skylark 320 get in production?", "after": "In which years was Buick Skylark 320 in production?"}, "evidence": {"before": "year refers to model_year; Buick Skylark 320 refers to car_name = 'buick skylark 320'", "after": "Car model name is data.car_name; Buick Skylark 320 is stored as 'buick skylark 320'. Production year is production.model_year."}}} {"question_id": 3161, "split": "train", "changes": {"question": {"before": "From the total amount of donation to projects, what is the percentage of the amount is for school projects located in the rural area?", "after": "Of the money contributed to school projects, excluding optional support, what percentage went to rural schools? Round your answer to 3 decimal places."}, "evidence": {"before": "located in the rural area refers to school_metro = 'rural'; percentage = divide(sum(donation_to_project where school_metro = 'rural'), sum(donation_to_project))*100%", "after": "money contributed excluding optional support refers to donations.donation_to_project; rural schools refers to projects.school_metro = 'rural'; percentage = ROUND(DIVIDE(SUM(donation_to_project for rural schools), SUM(donation_to_project)) * 100, 3) over donations joined to their projects"}, "SQL": {"before": "SELECT CAST(SUM(CASE WHEN T2.school_metro = 'rural' THEN T1.donation_to_project ELSE 0 END) AS REAL) * 100 / SUM(donation_to_project) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid", "after": "WITH unrounded(value) AS (\nSELECT CAST(SUM(CASE WHEN T2.school_metro = 'rural' THEN T1.donation_to_project ELSE 0 END) AS REAL) * 100 / SUM(donation_to_project) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 3162, "split": "train", "changes": {"question": {"before": "What is the id of the projects that cost the most. How much has been collected from donations and what is the percentage amount still lacking?", "after": "What are the IDs of the projects with the highest cost, how much has been collected in donations, and what percentage of their cost is still lacking?"}, "evidence": {"before": "costs the most refers to max(total_price_excluding_optional_support); amount collected from donation refers to sum(donation_to_project); percentage amount refers to divide(subtract(total_price_excluding_optional_support, sum(donation_to_project)), sum(total_price_excluding_optional_support))*100%", "after": "the highest cost refers to projects.total_price_excluding_optional_support = MAX(total_price_excluding_optional_support); collected refers to SUM(donations.donation_to_project) toward that project; the percentage of its cost still lacking = DIVIDE(SUBTRACT(cost, collected), cost) * 100; return the project ID, the collected contributions and that percentage"}}} {"question_id": 3165, "split": "train", "changes": {"question": {"before": "Which project have the highest total price including optional support? Indicate the project id.", "after": "Which project has the highest total price including optional support? Indicate its project ID."}, "evidence": {"before": "highest total price including optional support refers to max(total_price_including_optional_support)", "after": "the highest total price including optional support refers to MAX(projects.total_price_including_optional_support); indicate its project ID refers to returning the project ID of the single project holding that maximum"}}} {"question_id": 3166, "split": "train", "changes": {"question": {"before": "Which state have the highest number of PayPal donations for an honoree whose portion of a donation included corporate sponsored giftcard?", "after": "Which state had the highest number of PayPal donations made in honor of someone and including a corporate-sponsored gift card?"}, "evidence": {"before": "which state refers to donor_state; highest number refers to max(count(donor_state)); PayPal donations refers to payment_method = 'paypal'; for an honoree refers to for_honoree = 't'; included corporate sponsored giftcard refers to payment_included_campaign_gift_card = 't'", "after": "PayPal donations made in honor of someone and including a corporate-sponsored gift card refers to payment_method = 'paypal' AND for_honoree = 't' AND payment_included_campaign_gift_card = 't'; the highest number refers to the donor_state with the largest COUNT of those donations"}}} {"question_id": 3169, "split": "train", "changes": {"question": {"before": "What were the resources that were requested by the teacher for project \"d6ef27c07c30c81f0c16c32b6acfa2ff\"? Indicate the quantities as well and indicate 'Yes' or 'No' for whether the teacher acquired P.h.D or doctor degree.", "after": "For project \"d6ef27c07c30c81f0c16c32b6acfa2ff\", list the resources requested, their quantities, and whether the teacher has a Ph.D. or doctoral degree (Yes or No)."}, "evidence": {"before": "resources that were requested refers to item_name; project \"d6ef27c07c30c81f0c16c32b6acfa2ff\" refers to projectid = 'd6ef27c07c30c81f0c16c32b6acfa2ff'; quantities refers to item_quantity; teacher_prefix = 'Dr.' refers to teacher acquired P.h.D or doctor degree", "after": "resources.item_name and resources.item_quantity record requested resources and quantities; projects.teacher_prefix = 'Dr.' denotes that the teacher acquired a Ph.D. or doctoral degree in this dataset."}}} {"question_id": 3179, "split": "train", "changes": {"question": {"before": "From which state do the 5 biggest donor, who gave the highest cost of optional support, come from? List their donor_acctid and calculate for their average cost of optional support for every donations they make and identtify the project's type of resource to which they gave the hightest optional support.", "after": "Find the top five donors who gave the most optional support in total. For each donor, list their known donor states (leave the state blank only if none is recorded), their donor ID, and their average optional support per donation. Also list the resource types of the projects associated with their largest optional-support donations. Round the average optional support to two decimal places."}, "evidence": {"before": "which state refers to school_state; highest cost of optional support refers to max(donation_optional_support); average cost of optional support = avg(donation_optional_support)", "after": "Optional support refers to donation_optional_support; donor states to donations.donor_state; resource types to projects.resource_type. Include zero-support donations in the average. Include all known donor states and all resource types associated with donations tied for each donor’s largest optional-support amount. Return each distinct state/resource-type combination separately. Use NULL when no donor state is known or a project’s resource type is unknown."}, "SQL": {"before": "WITH donor_stats AS (\n SELECT d.`donor_acctid`,\n d.`donor_state`,\n SUM(d.`donation_optional_support`) AS total_opt_support,\n AVG(d.`donation_optional_support`) AS avg_opt_support\n FROM `donations` d\n GROUP BY d.`donor_acctid`\n), top5 AS (\n SELECT *\n FROM donor_stats\n ORDER BY total_opt_support DESC\n LIMIT 5\n), donor_max AS (\n SELECT d1.`donor_acctid`,\n d1.`projectid`,\n d1.`donation_optional_support`\n FROM `donations` d1\n JOIN (\n SELECT `donor_acctid`, MAX(`donation_optional_support`) AS max_opt\n FROM `donations`\n GROUP BY `donor_acctid`\n ) mx ON d1.`donor_acctid` = mx.`donor_acctid` AND d1.`donation_optional_support` = mx.`max_opt`\n), donor_resource AS (\n SELECT dm.`donor_acctid`, MAX(p.`resource_type`) AS resource_type\n FROM donor_max dm\n JOIN `projects` p ON dm.`projectid` = p.`projectid`\n GROUP BY dm.`donor_acctid`\n)\nSELECT t.`donor_state`, t.`donor_acctid`, t.`avg_opt_support`, dr.`resource_type`\nFROM top5 t\nLEFT JOIN donor_resource dr ON t.`donor_acctid` = dr.`donor_acctid`;", "after": "WITH top_donors AS MATERIALIZED (\n SELECT donor_acctid,\n SUM(donation_optional_support) AS total_support,\n ROUND(AVG(donation_optional_support), 2) AS average_support,\n MAX(donation_optional_support) AS largest_support\n FROM donations\n GROUP BY donor_acctid\n ORDER BY total_support DESC\n LIMIT 5\n), selected_donations AS MATERIALIZED (\n SELECT donor_acctid, donor_state, projectid, donation_optional_support\n FROM donations\n WHERE donor_acctid IN (SELECT donor_acctid FROM top_donors)\n), donor_states AS (\n SELECT DISTINCT donor_acctid, donor_state\n FROM selected_donations\n WHERE donor_state IS NOT NULL\n), donor_resources AS (\n SELECT DISTINCT d.donor_acctid, p.resource_type\n FROM selected_donations AS d\n INNER JOIN top_donors AS t\n ON d.donor_acctid = t.donor_acctid\n AND d.donation_optional_support = t.largest_support\n LEFT JOIN projects AS p ON d.projectid = p.projectid\n)\nSELECT DISTINCT s.donor_state, t.donor_acctid,\n t.average_support, r.resource_type\nFROM top_donors AS t\nLEFT JOIN donor_states AS s ON t.donor_acctid = s.donor_acctid\nLEFT JOIN donor_resources AS r ON t.donor_acctid = r.donor_acctid;"}}} {"question_id": 3187, "split": "train", "changes": {"evidence": {"before": "teachers with Doctor Degree refers to teacher_prefix = 'Dr.'; more than 30 students involved refers to students_reached > 300", "after": "teachers with Doctor Degree refers to teacher_prefix = 'Dr.'; more than 30 students involved refers to students_reached > 30"}}} {"question_id": 3189, "split": "train", "changes": {"question": {"before": "What is the title of project that have the most expensive funds?", "after": "What is the title of the project with the highest total cost of requested resources?"}, "evidence": {"before": "the most expensive funds refers to max(sum(multiply(item_unit_price, item_quantity)))", "after": "Project titles are recorded in essays.title. Resource cost is item_unit_price times item_quantity in resources; a project’s cost covers all its requested resources."}}} {"question_id": 3194, "split": "train", "changes": {"question": {"before": "What is the name of the item that is provided in the biggest amount by the vendor Lakeshore Learning Materials?", "after": "Which item has the highest total quantity supplied by Lakeshore Learning Materials? Give its name."}, "evidence": {"before": "lakeshore Learning Materials is vendor_name; biggest amount refers to Max(item_quantity);", "after": "Lakeshore Learning Materials refers to resources.vendor_name = 'Lakeshore Learning Materials'; total quantity of an item refers to SUM(item_quantity) grouped by item_name; the highest total quantity refers to the single item_name with the MAX of that total; return item_name"}}} {"question_id": 3198, "split": "train", "changes": {"question": {"before": "Of the projects whose resources are provided by the vendor Lakeshore Learning Materials, the school of which project has the highest cost of labor fulfillment? Please give its school ID.", "after": "Among projects supplied by Lakeshore Learning Materials, which had the highest labor-fulfillment cost? List their school IDs, including ties."}, "evidence": {"before": "Lakeshore Learning Materials is vendor_name; highest cost of labor fulfillment refers to Max(fulfillment_labor_materials);", "after": "supplied by Lakeshore Learning Materials refers to the projects recorded in resources with vendor_name = 'Lakeshore Learning Materials'; the highest labor-fulfillment cost refers to projects.fulfillment_labor_materials = MAX(fulfillment_labor_materials) among only those projects; list the school IDs, including ties"}}} {"question_id": 3200, "split": "train", "changes": {"question": {"before": "What is the total donated amount for projects created by a teacher working in a school in Brooklyn?", "after": "What is the total donated amount for projects created by teachers working at schools in Brooklyn, NY?"}, "evidence": {"before": "school in Brooklyn refers to school_city = 'Brooklyn'; total donated amount refers to donation_total;", "after": "projects.school_city records the school's city; projects.school_state = 'NY' denotes New York. Stored city names may vary in capitalization or contain surrounding spaces. donations.donation_total is the donation amount, including optional support."}, "SQL": {"before": "SELECT SUM(T2.donation_total) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city = 'Brooklyn'", "after": "SELECT SUM(d.donation_total) FROM donations d JOIN projects p ON p.projectid=d.projectid WHERE LOWER(TRIM(p.school_city))='brooklyn' AND p.school_state='NY';"}}} {"question_id": 3201, "split": "train", "changes": {"question": {"before": "Please list the donation messages of the donations for the projects created by a teacher working in a public magnet school in Brooklyn.", "after": "List the donation messages for projects created by teachers at public magnet schools in Brooklyn, NY."}, "evidence": {"before": "school in Brooklyn refers to school_city = 'Brooklyn'; public magnet refers to school_magnet = 't';", "after": "projects.school_city records the school's city; projects.school_state = 'NY' denotes New York. Stored city names may vary in capitalization or contain surrounding spaces. projects.school_magnet = 't' denotes a magnet school; donations.donation_message records the donor's message."}, "SQL": {"before": "SELECT T2.donation_message FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city = 'Brooklyn' AND T1.school_magnet = 't'", "after": "SELECT d.donation_message FROM projects p JOIN donations d ON p.projectid=d.projectid WHERE LOWER(TRIM(p.school_city))='brooklyn' AND p.school_state='NY' AND p.school_magnet='t';"}}} {"question_id": 3205, "split": "train", "changes": {"question": {"before": "What are the most requested items under the resource type \"Supplies\" for projects whose main subject area is Literacy & Language?", "after": "Which Supplies items were requested in the greatest total quantity by Literacy & Language projects? List their names, including ties."}, "evidence": {"before": "main subject area refers to primary_focus_area = 'Literacy & Language'; resource type \"Supplies\" refers to project_resource_type = 'Supplies'; most requested item refers to Max(item_quantity);", "after": "Literacy & Language projects refers to projects.primary_focus_area = 'Literacy & Language'; Supplies refers to resources.project_resource_type = 'Supplies'; an item's total requested quantity refers to SUM(resources.item_quantity) grouped by item_name; return every item_name whose total equals the MAX of those totals"}}} {"question_id": 3207, "split": "train", "changes": {"question": {"before": "What is the average donation amount to a project created by a teacher working in a school in Brooklyn?", "after": "What is the average amount of individual donations to projects created by teachers at schools in Brooklyn, NY? Round your answer to 2 decimal places."}, "evidence": {"before": "school in Brooklyn refers to school_city = 'Brooklyn'; Average = AVG(donation_total);", "after": "schools in Brooklyn, NY refers to projects whose school_city is 'brooklyn' apart from capitalization and surrounding spaces, with school_state = 'NY'; individual donation amount refers to donation_total, which includes optional support; answer = ROUND(AVG(donation_total), 2) over the donations to those schools' projects"}, "SQL": {"before": "SELECT AVG(project_sum)\nFROM (\n SELECT SUM(`donation_total`) AS project_sum\n FROM `projects` AS p\n JOIN `donations` AS d ON p.`projectid` = d.`projectid`\n WHERE p.`school_city` = 'Brooklyn'\n GROUP BY p.`projectid`\n);", "after": "WITH unrounded(value) AS (SELECT AVG(donation_total) FROM donations WHERE projectid IN (SELECT projectid FROM projects WHERE LOWER(TRIM(school_city))='brooklyn' AND school_state='NY')) SELECT ROUND(value, 2) FROM unrounded;"}}} {"question_id": 3218, "split": "train", "changes": {"question": {"before": "Among the schools donated by donor \"000eebf28658900e63b538cf8a73afbd\",how many schools whose poverty level are highest?", "after": "Among the schools receiving donations from donor ‘000eebf28658900e63b538cf8a73afbd’, how many have the highest poverty level?"}, "evidence": {"before": "donor \"000eebf28658900e63b538cf8a73afbd\" refers to donor_acctid = '000eebf28658900e63b538cf8a73afbd'; highest poverty level refers to poverty_level = 'highest poverty';", "after": "Highest poverty is recorded as projects.poverty_level = 'highest poverty'; donations.donor_acctid identifies the donor."}}} {"question_id": 3219, "split": "train", "changes": {"evidence": {"before": "school “301c9bf0a45d159d162b65a93fddd74e\" refers to schoolid = '301c9bf0a45d159d162b65a93fddd74e';", "after": "school \"301c9bf0a45d159d162b65a93fddd74e\" refers to schoolid = '301c9bf0a45d159d162b65a93fddd74e';"}}} {"question_id": 3221, "split": "train", "changes": {"question": {"before": "How to pay the donation of the project that teacher \"822b79362bbf22b8be4d7bea2fa91a70\" created?", "after": "What payment method was used for the donation to the project created by teacher \"822b79362bbf22b8be4d7bea2fa91a70\"?"}, "evidence": {"before": "teacher \"822b79362bbf22b8be4d7bea2fa91a70\" refers to teacher_acctid = '822b79362bbf22b8be4d7bea2fa91a70'; how to pay the donation refers to payment_method;", "after": "projects.teacher_acctid identifies the teacher; donations.payment_method records the payment method."}}} {"question_id": 3224, "split": "validation", "changes": {"question": {"before": "Among the schools whose donors are teachers, what is the percentage of schools that are in Brooklyn?", "after": "Of the schools that received donations from teachers, what percentage are in Brooklyn, NY?"}, "evidence": {"before": "donors are teachers refers to is_teacher_acct = 't'; Brooklyn is school_city; percentage = Divide(Count(school_city='Brooklyn'),Count(school_city))*100", "after": "projects.school_city records the school's city; projects.school_state = 'NY' denotes New York. Stored city names may vary in capitalization or contain surrounding spaces. Teacher donors have donations.is_teacher_acct = 't'. A school qualifies if at least one of its projects received a donation from a teacher. projects.schoolid identifies a school."}, "SQL": {"before": "WITH teacher_schools AS (\n SELECT DISTINCT p.`schoolid`, p.`school_city`\n FROM `projects` p\n JOIN `donations` d ON p.`projectid` = d.`projectid`\n WHERE d.`is_teacher_acct` = 't'\n)\nSELECT 100.0 *\n SUM(CASE WHEN `school_city` = 'Brooklyn' THEN 1 ELSE 0 END) / COUNT(*) AS brooklyn_school_percentage\nFROM teacher_schools;", "after": "WITH teacher_schools AS (SELECT DISTINCT p.schoolid, p.school_city, p.school_state FROM projects p JOIN donations d ON p.projectid=d.projectid WHERE d.is_teacher_acct='t') SELECT 100.0 * SUM(CASE WHEN LOWER(TRIM(school_city))='brooklyn' AND school_state='NY' THEN 1 ELSE 0 END) / COUNT(*) AS brooklyn_school_percentage FROM teacher_schools;"}}} {"question_id": 3231, "split": "train", "changes": {"question": {"before": "What is the total number of projects that was created by the teachers that teach 3-5 grades in Boston Public School District?", "after": "What is the total number of projects created by teachers who teach grades 3–5 in the Boston Public School District?"}, "evidence": {"before": "teach 3-5 grades refers to grade_level = 'Grades 3-5'; 'Boston Public School District' is school_district;", "after": "Grades 3–5 are recorded as projects.grade_level = 'Grades 3-5'; the district is projects.school_district = 'Boston Public School District'."}}} {"question_id": 3237, "split": "train", "changes": {"evidence": {"before": "Engaging Young Readers with a Leveled Classroom Library ' is the title; total donation amount = Add(donation_to_project, donation_optional_support)", "after": "essays.title records the project title and may contain leading or trailing spaces; donations.donation_to_project and donation_optional_support are the two components of the donation amount."}, "SQL": {"before": "SELECT SUM(T2.donation_to_project) + SUM(T2.donation_optional_support) FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Engaging Young Readers with a Leveled Classroom Library'", "after": "SELECT SUM(T2.donation_to_project) + SUM(T2.donation_optional_support) FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE TRIM(T1.title) LIKE 'Engaging Young Readers with a Leveled Classroom Library'"}}} {"question_id": 3239, "split": "train", "changes": {"evidence": {"before": "donation at 14:44:29 on 2012/9/6 refers to donation_timestamp = '2012/9/6 14:44:28';", "after": "donation at 14:44:28 on 2012/9/6 refers to donation_timestamp LIKE '2012-09-06 14:44:28%';"}}} {"question_id": 3241, "split": "train", "changes": {"evidence": {"before": "donation at 11:38:43 on 2008/7/29 refers to donation_timestamp = '2008/7/29 11:38:43'; teacher's account ID refers to teacher_acctid;", "after": "donation at 11:38:43 on 2008/7/29 refers to donation_timestamp LIKE '2008-07-29 11:38:43%'; teacher's account ID refers to teacher_acctid;"}}} {"question_id": 3244, "split": "validation", "changes": {"question": {"before": "For the donation of the project 'Awesome Audiobooks Make Avid Readers', what was the percentage of the tip in the total amount?", "after": "Across all donations to Awesome Audiobooks Make Avid Readers, what percentage of the total donated amount was optional support?"}, "evidence": {"before": "Awesome Audiobooks Make Avid Readers' is the title; percentage = Divie(donation_optional_support, donation_total)*100;", "after": "essays.title records the project title. donations.donation_optional_support is the optional tip and donation_total is the total donation amount."}}} {"question_id": 3248, "split": "train", "changes": {"evidence": {"before": "suburban metros refer to metro = 'suburban'; Livingston Parish School District refer to school_district", "after": "Livingston Parish School District is recorded as 'Livingston Parish School Dist' in school_district. Suburban areas are labelled 'suburban' in school_metro."}}} {"question_id": 3251, "split": "train", "changes": {"question": {"before": "Which school counties in the state of New York have the highest number of projects with low poverty levels?", "after": "Which school counties in New York had the highest number of projects with low poverty levels?"}, "evidence": {"before": "New York refer to school_state = NY; highest number of low poverty level refer to MAX(poverty level = ’low poverty’)", "after": "New York refers to projects.school_state = 'NY'; low poverty refers to poverty_level = 'low poverty'; highest number of projects refers to the school_county with the greatest COUNT(*) of such projects; return every school_county tied at that maximum"}}} {"question_id": 3260, "split": "train", "changes": {"question": {"before": "What date did the project with he 'Lets Share Ideas essay' went live?", "after": "On what date did the project titled \"Lets Share Ideas\" go live?"}, "evidence": {"before": "date refer to date_posted; Lets Share Ideas refer to title", "after": "Project titles are recorded in essays.title. projects.date_posted records when a project went live, as YYYY-MM-DD."}}} {"question_id": 3275, "split": "train", "changes": {"question": {"before": "What percentage of projects that have not received a cash donation have received a portion of a donation included corporate sponsored giftcard?", "after": "What percentage of projects that received no cash donation also received a donation portion including a corporate-sponsored gift card?"}, "evidence": {"before": "have not received a cash donation refers to payment_method = 'no_cash_received'; received a portion of a donation included corporate sponsored giftcard payment_included_campaign_gift_card = 't'; percentage refers to DIVIDE(payment_included_campaign_gift_card = 't',payment_included_campaign_gift_card)*100", "after": "donations.payment_method uses 'no_cash_received' for a noncash donation. payment_included_campaign_gift_card = 't' identifies a corporate-sponsored gift card."}}} {"question_id": 3290, "split": "train", "changes": {"question": {"before": "What is the average total donations received by Fresno County colleges?", "after": "Among Fresno County schools that received donations, what was the average total donated per school?"}, "evidence": {"before": "Fresno County colleges refers to school_county = 'Fresno'; average refers to DIVIDE(sum(donation_optional_support,donation_to_project),count(schoolid))", "after": "Fresno County refers to projects.school_county = 'Fresno'; the donated amount refers to donations.donation_to_project + donations.donation_optional_support; average total donated per school = DIVIDE(SUM(that amount), COUNT(DISTINCT projects.schoolid)) over Fresno projects that received donations"}}} {"question_id": 3295, "split": "validation", "changes": {"evidence": {"before": "needs a \"Viewscreen LCD from Texas Instruments, TI-84 Plus\" refers to item_name = 'Viewscreen LCD from Texas Instruments, TI-84 Plus'; where is the school refers to school_city; latitude refers to school_latitude; longtitude refers to school_longitude", "after": "needs a \"Viewscreen LCD from Texas Instruments, TI-84 Plus\" refers to item_name = 'Viewscreen LCD from Texas Instruments, TI-84 Plus'; latitude refers to school_latitude; longtitude refers to school_longitude"}}} {"question_id": 3303, "split": "train", "changes": {"question": {"before": "For what grade was the project \"Too Close for Comfort\" for?", "after": "What grade level was the project \"Too Close for Comfort\" intended for?"}, "evidence": {"before": "project \"Too Close for Comfort\" refers to title = 'Too Close for Comfort'; grade refers to grade_level", "after": "The project title is essays.title = 'Too Close for Comfort'; projects.grade_level records its intended grade level."}}} {"question_id": 3306, "split": "train", "changes": {"question": {"before": "Among the technology items, what percentage of them are from Best Buy for Business?", "after": "What percentage of technology resource entries are supplied by Best Buy for Business?"}, "evidence": {"before": "technology items refers to project_resource_type = 'Technology'; from Best Buy for Business refers to vendor_name = 'Best Buy for Business'; percentage refers to DIVIDE(count(case when vendor_name = 'Best Buy for Business'),count(resourceid))", "after": "technology resource entries refers to resources with project_resource_type = 'Technology'; supplied by Best Buy for Business refers to vendor_name = 'Best Buy for Business'; percentage = DIVIDE(SUM(CASE WHEN vendor_name = 'Best Buy for Business' THEN 1 ELSE 0 END), COUNT(resourceid)) * 100"}}} {"question_id": 3341, "split": "train", "changes": {"question": {"before": "For all the games which were published by Namco Bandai Games, what percentage of them were adventure games?", "after": "What percentage of games in the catalog published by Namco Bandai Games are adventure games? Round your answer to 3 decimal places."}, "evidence": {"before": "published by Namco Bandai Games refers to publisher_name = 'Namco Bandai Games'; adventure game refers to genre_name = 'Adventure'; percentage = divide(count(game_id where genre_name = 'Adventure'), count(game_id)) * 100% where publisher_name = 'Namco Bandai Games'", "after": "published by Namco Bandai Games refers to a game_publisher row joined to publisher.publisher_name = 'Namco Bandai Games'; adventure game refers to genre.genre_name = 'Adventure'; percentage = DIVIDE(COUNT(DISTINCT game.id that are Adventure), COUNT(DISTINCT game.id published by them)) * 100, rounded to 3 decimals"}, "SQL": {"before": "SELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Adventure' THEN T1.id ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T3.publisher_name = 'Namco Bandai Games'", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * SUM(CASE WHEN ge.genre_name='Adventure' THEN 1 ELSE 0 END) / COUNT(*) FROM game g LEFT JOIN genre ge ON ge.id=g.genre_id WHERE EXISTS (SELECT 1 FROM game_publisher gp JOIN publisher p ON p.id=gp.publisher_id WHERE gp.game_id=g.id AND p.publisher_name='Namco Bandai Games')\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 3373, "split": "train", "changes": {"question": {"before": "Provide all the game publisher's names of the games with sales greater than 90% of the Japan's average sales.", "after": "Which publishers have a game-platform release whose sales in at least one region exceed 90% of the average sales per game-platform release in Japan?"}, "evidence": {"before": "game publisher's name refers to publisher_name; sales greater than 90% of the average sales refers to num_sales > multiply(0.9, avg(num_sales)); in Japan refers to region_name = 'Japan'", "after": "the threshold refers to MULTIPLY(0.9, AVG(region_sales.num_sales) over rows where region.region_name = 'Japan'); a publisher qualifies when one of its game-platform releases has num_sales above that threshold in any region, not only Japan; return the DISTINCT publisher_name values"}}} {"question_id": 3395, "split": "train", "changes": {"question": {"before": "How many games were released in 2001?", "after": "How many games in the catalog were released in 2001?"}, "evidence": {"before": "released in 2001 refers to release_year = 2001", "after": "game is the game catalog. game_platform.release_year records the release year of a platform release; game_publisher links releases to games."}, "SQL": {"before": "SELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.game_publisher_id WHERE T2.release_year = 2001", "after": "SELECT COUNT(DISTINCT g.id) FROM game g JOIN game_publisher gp ON gp.game_id=g.id JOIN game_platform p ON p.game_publisher_id=gp.id WHERE p.release_year=2001;"}}} {"question_id": 3422, "split": "train", "changes": {"question": {"before": "How many times did other regions make positive sales in DS platform?", "after": "How many positive sales records are there for the DS platform in the Other region?"}, "evidence": {"before": "other regions refers to region_name = 'Other'; positive sales refers to num_sales > 0; DS platform refers to platform_name = 'DS';", "after": "region.region_name = 'Other' identifies other regions; platform.platform_name uses 'DS'. region_sales.num_sales records sales."}}} {"question_id": 3433, "split": "train", "changes": {"question": {"before": "Indicate the name of all adventure games.", "after": "Indicate the names of all adventure games."}, "evidence": {"before": "name of games refers to game_name; adventure games refers to genre_name = 'Adventure';", "after": "genre.genre_name = 'Adventure' identifies the genre; game.game_name records the game name."}}} {"question_id": 3468, "split": "train", "changes": {"question": {"before": "List down the platform IDs of the games with a region ID of 3.", "after": "List the platform IDs of games with region ID 3."}, "evidence": {"before": null, "after": "region_sales.region_id identifies region 3 and links through game_platform_id to game_platform.id; game_platform.platform_id is the requested platform ID."}}} {"question_id": 3523, "split": "train", "changes": {"question": {"before": "How many more papers in percentage were published in the journal \"Cases Journal\" than in the journal \"Molecular Brain\" in percentage?", "after": "By what percentage did the number of papers published in Cases Journal exceed the number published in Molecular Brain?"}, "evidence": {"before": "\"Cases Journal\" and \"Molecular Brain\" are FullName of journal; more paper in percentage = Subtract(Count(Id(FullName = 'Cases Journal')), Count(Id(FullName = 'Molecular Brain')))/ Count(Id(FullNmae = 'Molecular Brain')) * 100", "after": "papers published in a journal refers to the papers whose journal FullName is that journal; percentage by which Cases Journal papers exceed the Molecular Brain baseline = DIVIDE(SUBTRACT(COUNT(papers with FullName = 'Cases Journal'), COUNT(papers with FullName = 'Molecular Brain')), COUNT(papers with FullName = 'Molecular Brain')) * 100"}}} {"question_id": 3525, "split": "train", "changes": {"question": {"before": "Enumerate the paper and author ID of authors with affiliation with Cairo Microsoft Innovation Lab, Egypt.", "after": "List the paper IDs and author IDs for authors affiliated with Cairo Microsoft Innovation Lab, Egypt."}}} {"question_id": 3539, "split": "validation", "changes": {"question": {"before": "In papers with journal IDs from 200 to 300 and with its short name starts with A, what is the percentage of papers with conference ID of 0?", "after": "Among papers with journal IDs from 200 to 300 and journal short names starting with A, what percentage have a conference ID of 0?"}, "evidence": {"before": "journal ID of 200 to 300 refers to JournalId BETWEEN 200 AND 300; short name starts with A refers to ShortName LIKE 'A%'; Percentage = Divide (Count(ConferenceId = 0), Count(ConferenceId)) * 100", "after": "Paper.JournalId identifies the journal; Journal.ShortName is its abbreviated name. Paper.ConferenceId records the conference identifier."}}} {"question_id": 3540, "split": "train", "changes": {"question": {"before": "Within the year of 2001 to 2010, find the paper published rate of 2001.", "after": "What percentage of papers published from 2001 through 2010 were published in 2001?"}, "evidence": {"before": "year of 2001 to 2010 refers to Year BETWEEN 2001 AND 2010; Percentage = Divide(Count (PaperId(Year = 2001)), Count (PaperID(Year BETWEEN 2001 AND 2010))) * 100", "after": "published from 2001 through 2010 refers to Paper.Year >= 2001 AND Paper.Year < 2011; percentage = DIVIDE(SUM(CASE WHEN Year = 2001 THEN 1 ELSE 0 END), COUNT(Id)) * 100 over exactly those papers"}}} {"question_id": 3549, "split": "train", "changes": {"question": {"before": "Among the author included in the paper of \"Inspection resistant memory: Architectural support for security from physical examination\", write down the author name and ID who were affiliated with Microsoft Research, USA.", "after": "For the paper “Inspection resistant memory: Architectural support for security from physical examination,” list the names and IDs of authors affiliated with Microsoft Research, USA."}}} {"question_id": 3558, "split": "train", "changes": {"question": {"before": "What is the homepage address for paper \"Energy-efficiency bounds for noise-tolerant dynamic circuits\"?", "after": "What is the conference homepage for the paper “Energy-efficiency bounds for noise-tolerant dynamic circuits”?"}, "evidence": {"before": "\"Energy-efficiency bounds for noise-tolerant dynamic circuits\" is the Title of paper", "after": "Paper.Title records the paper title; Conference.HomePage records its publication conference’s homepage."}}} {"question_id": 3559, "split": "train", "changes": {"question": {"before": "Write down the name of authors for paper with id from 101 to 105.", "after": "List the names of authors of papers with IDs from 101 to 105."}, "evidence": {"before": "paper with ID from 101 to 105 refers to Id BETWEEN 101 AND 105", "after": "PaperAuthor.Name records author names as listed on papers."}}} {"question_id": 3560, "split": "train", "changes": {"question": {"before": "Among the papers published in 2009, list down 10 different conference's short names of these papers.", "after": "Among papers published in 2009, list 10 distinct conference short names."}, "evidence": {"before": "published in 2009 refers to Year = 2009", "after": "Paper.Year = 2009 identifies the papers; Conference.ShortName records the conference short name."}}} {"question_id": 3563, "split": "train", "changes": {"question": {"before": "Among papers that were published in 2005, provide the author name of paper with key words of \"LOAD; IDE; SNP; haplotype; asso- ciation studies\".", "after": "List the author names as recorded on papers published in 2005 with the keywords “LOAD; IDE; SNP; haplotype; asso- ciation studies”."}, "evidence": {"before": "in 2005 refers to Year = '2005'; key words of \"LOAD; IDE; SNP; haplotype; asso- ciation studies\" refers to Keyword = 'KEY WORDS: LOAD; IDE; SNP; haplotype; asso- ciation studies'", "after": "Paper.Year records publication year; Paper.Keyword stores 'KEY WORDS: LOAD; IDE; SNP; haplotype; asso- ciation studies'. PaperAuthor.Name records author names as listed on papers."}}} {"question_id": 3571, "split": "validation", "changes": {"question": {"before": "List author name for articles that are preprinted but not published.", "after": "List the unique author names appearing on preprinted but unpublished articles."}, "evidence": {"before": "articles that are not published refers to Year = 0", "after": "Preprinted but unpublished articles have Year = 0, with ConferenceId and JournalId each either 0 or missing. Author names as listed on an article are recorded in PaperAuthor.Name."}}} {"question_id": 3575, "split": "train", "changes": {"question": {"before": "For each paper that published in a journal without a short name, list its publication year and the journal's full name.", "after": "List the distinct publication-year and journal-full-name pairs for papers in journals with no recorded short name."}, "evidence": {"before": "don't have short name refers to ShortName is NULL OR ShortName = ''", "after": "A journal has no recorded short name when Journal.ShortName is NULL or an empty string."}}} {"question_id": 3576, "split": "train", "changes": {"question": {"before": "What is the affiliation of the author writing in the journal 'A combined search for the standard model Higgs boson at s = 1.96   TeV'?", "after": "What affiliations are listed for the authors of the paper \"A combined search for the standard model Higgs boson at s = 1.96   TeV\"?"}, "evidence": {"before": "journal 'A combined search for the standard model Higgs boson at s = 1.96   TeV' refers to Title = 'A combined search for the standard model Higgs boson at s = 1.96   TeV'", "after": "PaperAuthor.Affiliation is the affiliation listed on a particular paper, rather than Author.Affiliation. In the stored Paper.Title, the gap between '1.96' and 'TeV' is a space, a non-breaking space (U+00A0), and a space."}}} {"question_id": 3579, "split": "train", "changes": {"question": {"before": "In how many papers and in how many years was the International Conference on Database Theory published?", "after": "How many papers were published at the International Conference on Database Theory, and in how many distinct years?"}}} {"question_id": 3580, "split": "train", "changes": {"question": {"before": "What is the full name of the journals that are published in the database papers whose topic is Sustainability?", "after": "What are the full names of the journals that published papers whose topic is Sustainability?"}, "evidence": {"before": "topic is Sustainability refers to Keyword = 'Sustainability'", "after": "The Sustainability topic is recorded as Keyword = 'Sustainability'; journal full names are recorded in Journal.FullName."}}} {"question_id": 3581, "split": "validation", "changes": {"question": {"before": "What is the name of the authors of papers in which conferences have been published whose full name includes the word Workshop?", "after": "List the author names as they appear on papers published at conferences whose full names contain “Workshop”."}, "evidence": {"before": "full name includes the word Workshop refers to FullName LIKE '%Workshop%'", "after": "Author names as they appear on papers refers to PaperAuthor.Name; conference full names containing “Workshop” refers to Conference.FullName LIKE '%Workshop%'."}}} {"question_id": 3592, "split": "train", "changes": {"question": {"before": "What are the distinct titles of the paper that were written by Cheng Huang and affiliated with Microsoft?", "after": "What are the distinct titles of papers written by Cheng Huang and affiliated with Microsoft?"}}} {"question_id": 3605, "split": "train", "changes": {"question": {"before": "Give the Title and author's name of the papers that were preprint in 1997.", "after": "List the titles and author names as listed on preprints from 1997, excluding papers with no recorded title."}, "evidence": {"before": "in 1997 refers to Year = 1997; books that were preprint refers to ConferenceId = 0 AND JournalId = 0", "after": "Paper.Year records the year; preprints have ConferenceId = 0 and JournalId = 0. Paper.Title is the paper title; PaperAuthor.Name is the name listed on the paper."}, "SQL": {"before": "SELECT DISTINCT T2.Name, T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.ConferenceId = 0 AND T1.JournalId = 0 AND T1.Year = 1997 AND T1.Title <> ''", "after": "SELECT DISTINCT T1.Title, T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.ConferenceId = 0 AND T1.JournalId = 0 AND T1.Year = 1997 AND T1.Title <> ''"}}} {"question_id": 3620, "split": "train", "changes": {"question": {"before": "Calculate the total average number of papers published from 2002 to 2010 under the conference \"Information and Knowledge Engineering\".", "after": "What was the average number of papers published per year at the Information and Knowledge Engineering conference from 2002 through 2010?"}, "evidence": {"before": "average number of papers refers to DIVIDE(count(id), 9); published from 2002 to 2010 refers to Year BETWEEN 2002 AND 2010; 'Information and Knowledge Engineering' is the FullName of conference;", "after": "the conference refers to Conference.FullName = 'Information and Knowledge Engineering'; from 2002 through 2010 refers to Paper.Year >= 2002 AND Paper.Year <= 2010; average papers per year = DIVIDE(COUNT(the Paper rows at that conference in that period), 9.0), a fixed nine calendar year divisor and not the number of years that carry papers"}, "SQL": {"before": "SELECT CAST(COUNT(T1.Id) AS REAL) / COUNT(DISTINCT T1.Year) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.FullName = 'Information and Knowledge Engineering' AND T1.Year >= 2002 AND T1.Year <= 2010", "after": "SELECT CAST(COUNT(T1.Id) AS REAL) / 9.0 FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.FullName = 'Information and Knowledge Engineering' AND T1.Year >= 2002 AND T1.Year <= 2010"}}} {"question_id": 3631, "split": "validation", "changes": {"question": {"before": "How many authors finished the paper \"An Improved Active Suspension Model for Attitude Control of Electric Vehicles\" together?", "after": "How many authors wrote the paper “An Improved Active Suspension Model for Attitude Control of Electric Vehicles”?"}}} {"question_id": 3643, "split": "validation", "changes": {"question": {"before": "Which papers published by the \"TUBERCLE LUNG DIS\" journal are the oldest?", "after": "Which papers in “TUBERCLE LUNG DIS” were published earliest?"}, "evidence": {"before": "paper refers to Title; TUBERCLE LUNG DIS is the ShortName of journal; the oldest refers to MIN(Year)", "after": "“TUBERCLE LUNG DIS” is the journal’s ShortName. Paper titles are recorded in Title, and publication years in Year."}}} {"question_id": 3657, "split": "train", "changes": {"question": {"before": "List the name of the author that affiliated with University of Illinois Chicago?", "after": "List the names of authors affiliated with the University of Illinois Chicago."}}} {"question_id": 3661, "split": "train", "changes": {"question": {"before": "How many author have published papers in the 'IEEE Computer' journal?", "after": "How many authors have published papers in IEEE Computer?"}, "evidence": {"before": "IEEE Computer refer to FullName; How many author published papers refer to COUNT(PaperAuthor.Name) where FullName = ’IEEE Computer’", "after": "IEEE Computer refers to Journal.FullName = 'IEEE Computer'; how many authors refers to COUNT(DISTINCT PaperAuthor.AuthorId) over the papers in that journal, each author counted once however many papers they wrote"}}} {"question_id": 3662, "split": "validation", "changes": {"evidence": {"before": "A context-based navigation paradigm for accessing Web data' is the title of paper; name of conference refer to FullName", "after": "'A context-based navigation paradigm for accessing Web data' is the title of paper; name of conference refer to FullName"}}} {"question_id": 3673, "split": "train", "changes": {"question": {"before": "Among all publications containing keywords 'Turbulent Flows', what percentage of them was published in the journal named 'Physics of Fluids'?", "after": "Of all publications whose keywords contain 'Turbulent Flows', what percentage were published in 'Physics of Fluids'? Round your answer to 3 decimal places."}, "evidence": {"before": "'Physics of Fluids' is the FullName of journal; percentage = DIVIDE(SUM(Keyword contains 'Turbulent Flows' AND FullName = 'Physics of Fluids'), SUM(Keyword contains 'Turbulent Flows'))*100 as percentage", "after": "keywords contain 'Turbulent Flows' refers to Paper.Keyword LIKE '%Turbulent Flows%'; percentage = ROUND(DIVIDE(SUM(CASE WHEN Journal.FullName = 'Physics of Fluids' THEN 1 ELSE 0 END), COUNT(*)) * 100, 3) over those publications, with publications having no Journal record still counted in the denominator"}, "SQL": {"before": "SELECT 100.0 * SUM(CASE WHEN j.`FullName` = 'Physics of Fluids' THEN 1 ELSE 0 END) / COUNT(*) AS percentage\nFROM `Paper` p\nJOIN `Journal` j ON p.`JournalId` = j.`Id`\nWHERE p.`Keyword` LIKE '%Turbulent Flows%'", "after": "SELECT ROUND(100.0 * SUM(CASE WHEN j.FullName='Physics of Fluids' THEN 1 ELSE 0 END) / COUNT(*), 3) FROM Paper p LEFT JOIN Journal j ON p.JournalId=j.Id WHERE p.Keyword LIKE '%Turbulent Flows%'"}}} {"question_id": 3677, "split": "train", "changes": {"question": {"before": "How many papers were written by authors who cooperated with University of Hong Kong?", "after": "How many different papers were written by authors whose recorded author affiliation is University of Hong Kong?"}, "evidence": {"before": "University of Hong Kong' is an affiliation", "after": "Author.Affiliation records an author’s affiliation; 'University of Hong Kong' is the requested value. PaperAuthor records authorship of papers."}}} {"question_id": 3679, "split": "validation", "changes": {"question": {"before": "Sate the author name and published year for paper id 221?", "after": "Who are the authors listed on paper 221, and in what year was it published?"}, "evidence": {"before": "published year refers to year", "after": "Use PaperAuthor.Name for the authors’ names as listed on the paper and Paper.Year for its publication year."}, "SQL": {"before": "SELECT T1.Name, T3.Year FROM Author AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.AuthorId INNER JOIN Paper AS T3 ON T2.PaperId = T3.Id WHERE T2.PaperId = 221", "after": "SELECT T1.Name, T2.Year FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.PaperId = 221"}}} {"question_id": 3686, "split": "train", "changes": {"question": {"before": "State the average median SAT value for institutes in the state with the most male graduate cohort in 2013.", "after": "Among institutions with a recorded median SAT score, what is the average of those scores in the state with the largest male graduate cohort in 2013? Round your answer to 2 decimal places."}, "evidence": {"before": "median SAT value refers to med_sat_value; average = AVG(med_sat_value); male refers to gender = 'M'; graduate cohort refers to grad_cohort; most male graduate cohort refers to MAX(COUNT(grad_cohort WHERE gender = 'M')); in 2013 refers to year = 2013;", "after": "the largest male graduate cohort in 2013 refers to the state with the greatest SUM(grad_cohort) where gender = 'M' and year = 2013, leaving out the 'United States' national aggregate; a recorded median SAT score refers to med_sat_value that is not the text 'NULL'; answer = ROUND(AVG(med_sat_value), 2) over the institutions in that state"}, "SQL": {"before": "WITH top_state AS (\n SELECT `state`\n FROM `state_sector_grads`\n WHERE `year` = 2013\n AND `gender` = 'M'\n AND `state` <> 'United States'\n GROUP BY `state`\n ORDER BY SUM(CAST(`grad_cohort` AS INTEGER)) DESC\n LIMIT 1\n)\nSELECT AVG(CAST(`med_sat_value` AS REAL)) AS avg_med_sat\nFROM `institution_details`\nWHERE `state` IN (SELECT `state` FROM top_state);", "after": "WITH top_state AS (SELECT state FROM state_sector_grads WHERE year=2013 AND gender='M' AND state<>'United States' GROUP BY state ORDER BY SUM(CAST(grad_cohort AS INTEGER)) DESC LIMIT 1) SELECT ROUND(AVG(CAST(NULLIF(TRIM(med_sat_value),'NULL') AS REAL)), 2) FROM institution_details WHERE state IN (SELECT state FROM top_state)"}}} {"question_id": 3688, "split": "train", "changes": {"question": {"before": "List all the public institutes from the state with the least number of graduate cohort in 2013.", "after": "Which public institutions are in the state with the fewest graduate-cohort students at public institutions in 2013? List their names."}, "evidence": {"before": "public refers to control = 'Public'; institutes refers to chronname; least number of graduate cohort refers to MIN(grad_cohort); in 2013 refers to year = 2013;", "after": "public refers to control = 'Public'; the state with the fewest graduate-cohort students in 2013 refers to the state whose SUM(state_sector_grads.grad_cohort) over the state_sector_grads records with year = 2013, control = 'Public', gender = 'B' and race = 'X' equals the MIN of those per-state totals; return the institution_details.chronname of the public institutions in that state"}}} {"question_id": 3689, "split": "train", "changes": {"evidence": {"before": "institute name refers to chronname; less than 200 graduate cohort refers to grad_cohort < 200; all races refers to race = 'X'; all genders refers to gender = 'B'; in 2013 refers to year = 2013; total number of full-time equivalent undergraduates refers to fte_value;", "after": "institute name refers to chronname; less than 200 graduate cohort refers to grad_cohort < 200; grad_cohort is stored as text and an unavailable cohort appears as empty text or as the four letters NULL, which are excluded rather than read as zero; all races refers to race = 'X'; all genders refers to gender = 'B'; in 2013 refers to year = 2013; total number of full-time equivalent undergraduates refers to fte_value;"}, "SQL": {"before": "SELECT DISTINCT d.`chronname`, d.`fte_value` FROM `institution_details` AS d JOIN `institution_grads` AS g ON d.`unitid` = g.`unitid` WHERE g.`year` = 2013 AND g.`gender` = 'B' AND g.`race` = 'X' AND CAST(g.`grad_cohort` AS INTEGER) < 200", "after": "SELECT DISTINCT d.`chronname`, d.`fte_value`\nFROM `institution_details` AS d\nJOIN `institution_grads` AS g ON d.`unitid` = g.`unitid`\nWHERE g.`year` = 2013 AND g.`gender` = 'B' AND g.`race` = 'X'\n AND g.`grad_cohort` NOT IN ('NULL', '')\n AND CAST(g.`grad_cohort` AS INTEGER) < 200"}}} {"question_id": 3693, "split": "train", "changes": {"question": {"before": "Calculate the percentage of Black students in all private for profit institutions.", "after": "What percentage of students across all recorded graduation cohorts at private for-profit institutions are Black?"}, "evidence": {"before": "Black students refers to race = 'B'; private for profit refers to control = 'Private for-profit'; percentage = MULTIPLY(DIVIDE(SUM(race = 'B'), SUM(grad_cohort)), 100.0);", "after": "private for-profit refers to institution_details.control = 'Private for-profit'; Black students refers to SUM(grad_cohort) over institution_grads rows with race = 'B' AND gender = 'B'; all students refers to the same SUM with race = 'X' AND gender = 'B'; percentage = DIVIDE(the Black students total, the all students total) * 100"}}} {"question_id": 3694, "split": "train", "changes": {"question": {"before": "Calculate the percentage of Asian students among students of all races who graduated from institution in Alabama in year 2013 within 100 percent of normal / expected time.", "after": "Calculate the percentage of Asian students among students of all races who graduated from institutions in Alabama in 2013 within 100% of the normal or expected time."}, "evidence": {"before": "Asian refers to race = 'A'; Alabama refers to state = 'Alabama'; graduated within 100 percent of normal/expected time refers to grad_100; percentage = MULTIPLY(DIVIDE(SUM(grad_100 when race = 'A'), SUM(grad_100 when race='X')), 100);", "after": "Asian students refers to race = 'A' and students of all races refers to race = 'X'; within institution_details state = 'Alabama' and institution_grads year = 2013, percentage = DIVIDE(SUM(grad_100 where race = 'A'), SUM(grad_100 where race = 'X')) * 100"}}} {"question_id": 3696, "split": "train", "changes": {"question": {"before": "From which institute is harder to graduate for a bachelor, Amridge University or Auburn University?", "after": "For which institute was it harder to graduate with a bachelor’s degree, Amridge University or Auburn University?"}, "evidence": {"before": "institute refers to chronname; harder to graduate for a bachelor refers to MIN(grad_100_value); Amridge University refers to chronname = 'Amridge University'; Auburn University refers to chronname = 'Auburn University';", "after": "institute refers to institution_details.chronname restricted to 'Amridge University' and 'Auburn University'; graduating with a bachelor's degree within normal time refers to grad_100_value; harder to graduate refers to the smaller grad_100_value of the two; return that single chronname"}}} {"question_id": 3709, "split": "train", "changes": {"question": {"before": "Please list the names of the institutes in the state of Alabama whose all graduates in total exceeded 500 in 2011?", "after": "Which institutions in Alabama had a total graduate cohort of more than 500 students in 2011? List their names."}, "evidence": {"before": "names of the institutes refers to chronname; graduates refers to grad_cohort; grad_cohort > 500; in 2011 refers to year = 2011; all students refer to race = 'X'.", "after": "Institution name is institution_details.chronname; Alabama is institution_details.state = 'Alabama'. Graduate cohort is institution_grads.grad_cohort. All-race records use race = 'X', combined-gender records use gender = 'B', and 2011 is institution_grads.year = 2011. institution_grads.cohort identifies the cohort type; cohort counts are recorded separately by type, so an institution can have multiple records for the same year, race, and gender."}}} {"question_id": 3710, "split": "train", "changes": {"evidence": {"before": "graduates refers to grad_cohort; Central Alabama Community College refers to chronname = 'Central Alabama Community College'; average number of graduates for 3 consecutive years = DIVIDE(SUM(SUM(grad_cohort WHERE year = 2011), SUM(grad_cohort WHERE year = 2012), SUM(grad_cohort WHERE year = 2013)), 3);", "after": "institution_details.chronname records 'Central Alabama Community College'. institution_grads.grad_cohort records cohort size; gender = 'B' denotes both genders and race = 'X' denotes all races."}}} {"question_id": 3711, "split": "train", "changes": {"evidence": {"before": "percentage of students graduating within 100 percent of normal/expected time refers to grade_100_rate; Central Alabama Community College refers to chronname = 'Central Alabama Community College';", "after": "institution_details.chronname records 'Central Alabama Community College'. institution_grads.grad_100_rate is the percentage graduating within the expected time; race = 'X' denotes all races and gender = 'B' both genders. Empty text and the text 'NULL' denote unavailable rates."}}} {"question_id": 3728, "split": "train", "changes": {"question": {"before": "For the state which has the 113 2-year public schools, tell the number of graduated Asian students who seeks another type of degree or certificate at a 2-year institution in 2013.", "after": "For the state with 113 two-year public schools, how many Asian students graduated in 2013 while seeking another degree or certificate at a two-year institution?"}, "evidence": {"before": "schools_count = 113; 2-year refers to level = '2-year'; public refers to control = 'public'; Asian refers to race = 'A'; seeks another type of degree or certificate at a 2-year institution refers to cohort = '2y all'; in 2013 refers to year = 2013;", "after": "State-sector school count is state_sector_details.schools_count; 113 is the requested value. Two-year public records use level = '2-year' and control = 'Public'. Asian students use race = 'A', combined gender uses gender = 'B', the cohort code is '2y all', and 2013 is year = 2013. Graduated-student value is state_sector_grads.grad_150."}}} {"question_id": 3729, "split": "train", "changes": {"question": {"before": "What is the percentage of the number of 4-year public schools in Madison Area Technical College's home state?", "after": "What percentage of schools in Madison Area Technical College’s home state are four-year public schools?"}, "evidence": {"before": "4-year refers to level = '4-year'; public refers to control = 'Public'; Madison Area Technical College refers to chronname = 'Madison Area Technical College'; home state in the United States refers to state;", "after": "The college’s state is institution_details.state for chronname = 'Madison Area Technical College'; four-year public schools have level = '4-year' and control = 'Public'."}}} {"question_id": 3733, "split": "train", "changes": {"question": {"before": "For all states whose count of public schools is ≤ 20, list the race categories that occur in the state-level graduation table for those states.", "after": "Which race categories are recorded in graduation data for states with 20 or fewer public colleges and universities combined?"}, "evidence": {"before": "public refers to control = 'Public'; school_count < 20;", "after": "state_sector_details.schools_count records institution counts separately by state, level, and control. Public institutions have control = 'Public'; level distinguishes two-year and four-year institutions. Race categories are recorded in state_sector_grads.race; 'X' means all students, not a race category."}, "SQL": {"before": "SELECT DISTINCT T2.race FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.schools_count <= 20 AND T1.control = 'Public' AND T2.race <> 'X';", "after": "WITH eligible_states AS (\n SELECT stateid\n FROM state_sector_details\n WHERE control = 'Public'\n GROUP BY stateid\n HAVING SUM(schools_count) <= 20\n)\nSELECT DISTINCT g.race\nFROM state_sector_grads AS g\nINNER JOIN eligible_states AS s ON s.stateid = g.stateid\nWHERE g.race <> 'X';"}}} {"question_id": 3752, "split": "train", "changes": {"question": {"before": "In the state with the highest number of schools, how many institutions have a percentage of no less than 90 of undergraduates who attend full-time?", "after": "In the state with the most colleges and universities across all sectors, how many institutions have at least 90% of their undergraduates attending full-time?"}, "evidence": {"before": "highest number of schools refers to MAX(schools_count); percentage of no less than 90 of undergraduates who attend full-time refers to ft_pct >= 90; institutions' names refers to chronname;", "after": "state_sector_details.schools_count records the number of institutions in a state-sector category; United States is a national aggregate. institution_details.ft_pct records the percentage of undergraduates attending full-time."}}} {"question_id": 3757, "split": "train", "changes": {"question": {"before": "What is the name of the school with the highest difference in the average completion rate for the national in which it belongs? Indicate the state appropriations to higher education in fiscal year 2011 per resident to which the school belongs.", "after": "Which school’s completion rate exceeds its national sector average by the most? For that school’s state, report the higher-education funding per resident in fiscal year 2011."}, "evidence": {"before": "name of the school refers to chronname; highest difference in the average completion rate for the national in which it belongs = MAX(SUBTRACT(awards_per_value, awards_per_natl_value)); state appropriations to higher education in fiscal year 2011 per resident to which the school belongs refers to state_appr_value;", "after": "completion rate refers to institution_details.awards_per_value and the national sector average to awards_per_natl_value; exceeds it by the most refers to MAX(SUBTRACT(awards_per_value, awards_per_natl_value)); report both that school's chronname and state_sector_details.state_appr_value"}}} {"question_id": 3765, "split": "train", "changes": {"question": {"before": "How many more \"buffets\" than \"gyms\" in Yelp business?", "after": "How many more businesses are categorized as Buffets than as Gyms?"}, "evidence": {"before": "buffets refers to category_name = 'Buffets'; gyms refers to category_name = 'Gyms'; difference = SUBTRACT(SUM(category_name = 'Buffets'), SUM(category_name = 'Gyms'));", "after": "Buffets refers to Categories.category_name LIKE 'Buffets' and Gyms to category_name LIKE 'Gyms'; how many more = SUBTRACT(SUM(CASE WHEN category_name LIKE 'Buffets' THEN 1 ELSE 0 END), SUM(CASE WHEN category_name LIKE 'Gyms' THEN 1 ELSE 0 END)), summed over the businesses categorized in Categories"}}} {"question_id": 3776, "split": "train", "changes": {"question": {"before": "Give the number of users who joined Yelp since \"2004\".", "after": "How many users started using Yelp in 2004 or later?"}, "evidence": {"before": "joined yelp since 2004 refers to user_yelping_since_year = 2004;", "after": "Users.user_yelping_since_year records the year a user joined Yelp."}}} {"question_id": 3785, "split": "validation", "changes": {"evidence": {"before": "how many hours = SUBTRACT(closing_time, opening_time); business No. refers to business_id; open on Saturday refers to day_of_week = 'Saturday';", "after": "Business_Hours.opening_time and Business_Hours.closing_time store clock times as AM/PM text. Days.day_of_week records 'Saturday'."}}} {"question_id": 3794, "split": "train", "changes": {"question": {"before": "For all the Yelp businesses that allow customers bring their own beer, what percentage of them are in \"Phoenix\"?", "after": "For Yelp businesses that allow customers to bring their own beer, what percentage are in Phoenix?"}, "evidence": {"before": "bring their own beer refers to attribute_name = 'BYOB' AND attribute_value = 'TRUE'; Phoenix refers to city = 'Phoenix'; percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix'), COUNT(business_id)), 100.0)", "after": "allow customers to bring their own beer refers to Attributes.attribute_name = 'BYOB' with Business_Attributes.attribute_value = 'TRUE'; percentage in Phoenix = DIVIDE(SUM(CASE WHEN Business.city = 'Phoenix' THEN 1 ELSE 0 END), COUNT(those Yelp businesses)) * 100"}}} {"question_id": 3810, "split": "train", "changes": {"question": {"before": "How many businesses are there in Phoenix city? Find the percentage of businesses in Phoenix city in the total city.", "after": "How many businesses are in Phoenix, and what percentage of all businesses are in Phoenix?"}, "evidence": {"before": "percentage = MULTIPLY(DIVIDE(SUM(city = 'Phoenix'), COUNT(business_id)), 100.0);", "after": ""}}} {"question_id": 3838, "split": "train", "changes": {"question": {"before": "How many businesses in AZ state do not open on Thursday?", "after": "Among Arizona businesses with recorded opening hours, how many have no Thursday opening hours recorded?"}}} {"question_id": 3841, "split": "train", "changes": {"question": {"before": "How many Yelp_Businesses in Scottsdale have received positive comments in the Elitestar rating?", "after": "How many businesses in Scottsdale have a star rating above 3?"}, "evidence": {"before": "Scottsdale refers to city = 'Scottsdale'; positive comments refers to stars > 3; Elitestar rating refers to stars;", "after": "Business.stars is the business-level rating."}}} {"question_id": 3842, "split": "train", "changes": {"question": {"before": "Which city has more Yelp_Business that's most appealing to users, Scottsdale or Anthem? Return 'Both' if equal.", "after": "Which city has more businesses in the “Uber” review-count category, Scottsdale or Anthem? Return “Both” if they are tied."}, "evidence": {"before": "most appealing to users refers to review_count = 'Uber';", "after": "Business.review_count records the review-count category; 'Uber' is one of its stored labels. Business.city records the city."}}} {"question_id": 3859, "split": "validation", "changes": {"question": {"before": "How many Yelp_Business under the category of \"Food\" are good for kids?", "after": "How many businesses in the Food category are marked as good for kids?"}, "evidence": {"before": "under the category of \"Food\" refers to category_name = 'Food'; are good for kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'", "after": "Attributes.attribute_name uses 'Good for Kids'; Business_Attributes.attribute_value = 'TRUE' means the attribute is enabled."}, "SQL": {"before": "SELECT COUNT(T3.stars) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Business_Attributes AS T4 ON T3.business_id = T4.business_id INNER JOIN Attributes AS T5 ON T4.attribute_id = T5.attribute_id WHERE T1.category_name LIKE 'Food' AND T5.attribute_name LIKE 'Good for Kids' AND T4.attribute_value LIKE 'TRUE'", "after": "SELECT COUNT(DISTINCT T3.business_id)\nFROM Categories AS T1\nINNER JOIN Business_Categories AS T2\n ON T1.category_id = T2.category_id\nINNER JOIN Business AS T3\n ON T2.business_id = T3.business_id\nINNER JOIN Business_Attributes AS T4\n ON T3.business_id = T4.business_id\nINNER JOIN Attributes AS T5\n ON T4.attribute_id = T5.attribute_id\nWHERE T1.category_name LIKE 'Food'\n AND T5.attribute_name LIKE 'Good for Kids'\n AND T4.attribute_value LIKE 'TRUE';"}}} {"question_id": 3868, "split": "train", "changes": {"evidence": {"before": "Good for Kids refers to attribute_name = 'Good for Kids'and attribute_value = 'true'; open everyday refers to day_id between 1 and 7", "after": "Good for Kids refers to attribute_name = 'Good for Kids' and attribute_value = 'true'; open everyday refers to day_id between 1 and 7"}}} {"question_id": 3871, "split": "train", "changes": {"question": {"before": "Please list the business IDs of the Yelp_Business that have a business time of longer than 12 hours on Sundays.", "after": "List the business IDs of businesses open for more than 12 hours on Sundays."}, "evidence": {"before": "business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'", "after": "Sundays refers to Days.day_of_week; Business_Hours.opening_time and closing_time use AM/PM clock times; hours open refers to SUBTRACT(closing_time, opening_time) on the 24-hour clock, plus 24 when the closing_time is not the later, so equal times give a 24-hour interval; open for more than 12 hours refers to that > 12"}, "SQL": {"before": "WITH time_conversions AS (SELECT bh.business_id, CASE WHEN bh.opening_time LIKE '%AM' THEN CASE WHEN REPLACE(bh.opening_time, 'AM', '') = '12' THEN 0 ELSE CAST(REPLACE(bh.opening_time, 'AM', '') AS INT) END ELSE CASE WHEN REPLACE(bh.opening_time, 'PM', '') = '12' THEN 12 ELSE CAST(REPLACE(bh.opening_time, 'PM', '') AS INT) + 12 END END AS open_hr, CASE WHEN bh.closing_time LIKE '%AM' THEN CASE WHEN REPLACE(bh.closing_time, 'AM', '') = '12' THEN 0 ELSE CAST(REPLACE(bh.closing_time, 'AM', '') AS INT) END ELSE CASE WHEN REPLACE(bh.closing_time, 'PM', '') = '12' THEN 12 ELSE CAST(REPLACE(bh.closing_time, 'PM', '') AS INT) + 12 END END AS close_hr FROM Business_Hours bh JOIN Days d ON bh.day_id = d.day_id WHERE d.day_of_week = 'Sunday') SELECT business_id FROM time_conversions WHERE CASE WHEN close_hr >= open_hr THEN close_hr - open_hr ELSE 24 - (open_hr - close_hr) END > 12;", "after": "WITH time_conversions AS (SELECT bh.business_id, CASE WHEN bh.opening_time LIKE '%AM' THEN CASE WHEN REPLACE(bh.opening_time, 'AM', '') = '12' THEN 0 ELSE CAST(REPLACE(bh.opening_time, 'AM', '') AS INT) END ELSE CASE WHEN REPLACE(bh.opening_time, 'PM', '') = '12' THEN 12 ELSE CAST(REPLACE(bh.opening_time, 'PM', '') AS INT) + 12 END END AS open_hr, CASE WHEN bh.closing_time LIKE '%AM' THEN CASE WHEN REPLACE(bh.closing_time, 'AM', '') = '12' THEN 0 ELSE CAST(REPLACE(bh.closing_time, 'AM', '') AS INT) END ELSE CASE WHEN REPLACE(bh.closing_time, 'PM', '') = '12' THEN 12 ELSE CAST(REPLACE(bh.closing_time, 'PM', '') AS INT) + 12 END END AS close_hr FROM Business_Hours bh JOIN Days d ON bh.day_id = d.day_id WHERE d.day_of_week = 'Sunday') SELECT business_id FROM time_conversions WHERE CASE WHEN close_hr > open_hr THEN close_hr - open_hr ELSE 24 - (open_hr - close_hr) END > 12;"}}} {"question_id": 3879, "split": "train", "changes": {"question": {"before": "How many of the busineses are in Casa Grande?", "after": "How many businesses are in Casa Grande?"}, "evidence": {"before": "in Casa Grande refers to city = 'Casa Grande'", "after": "Casa Grande is recorded in Business.city as 'Casa Grande'."}}} {"question_id": 3882, "split": "train", "changes": {"question": {"before": "In users yelping since 2011 to 2013, how many of them have high count of fans?", "after": "How many users who joined Yelp between 2011 and 2013, inclusive, have a fan-count category of High?"}, "evidence": {"before": "In users yelping since 2011 to 2013 refers to user_yelping_since_year > = 2011 AND user_yelping_since_year < 2014; high count of fans refers to user_fans = 'High'", "after": "Users.user_yelping_since_year is the joining year; Users.user_fans uses categories such as 'High'."}}} {"question_id": 3891, "split": "train", "changes": {"question": {"before": "Among the active businesses located at Chandler, AZ, list the category and atrributes of business with a medium review count.", "after": "List the category names and attribute names recorded for active businesses in Chandler, Arizona, whose review-count category is Medium."}, "evidence": {"before": "active businesses refers to active = 'true'; located at Chandler, AZ refers to city = 'Chandler', state = 'AZ'; category refers to category_name; atrributes refers to attribute_name", "after": "Business.active = 'TRUE' denotes active businesses; Business.state = 'AZ' denotes Arizona. Business.review_count uses categories such as 'Medium'. Business_Attributes records attributes, including ones that are not enabled."}}} {"question_id": 3903, "split": "validation", "changes": {"evidence": {"before": "'Phoenix' is the city; waiter service refers to attribute_name = 'waiter_services'", "after": "Phoenix, Arizona refers to city = 'Phoenix' and state = 'AZ'. Waiter service refers to attribute_name = 'Waiter Service', ignoring case."}}} {"question_id": 3909, "split": "train", "changes": {"question": {"before": "How many business have been reviewed by user ID 3 and how long have this user been with Yelp?", "after": "How many businesses has user ID 3 reviewed, and how many calendar years passed between their joining year and 2014?"}, "evidence": {"before": "year with yelp = Subtract ('%Y'(CURRENT TIME), user_yelping_since_year)", "after": "how many businesses user ID 3 reviewed refers to COUNT(Reviews.business_id) over that user's Reviews rows; how many calendar years passed refers to SUBTRACT(2014, Users.user_yelping_since_year) for that user; the answer returns both values"}, "SQL": {"before": "SELECT COUNT(T1.business_id) , strftime('%Y', 'now') - T2.user_yelping_since_year FROM Reviews AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.user_id = 3", "after": "SELECT COUNT(T1.business_id) , 2014 - T2.user_yelping_since_year FROM Reviews AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.user_id = 3"}}} {"question_id": 3912, "split": "train", "changes": {"question": {"before": "List out the user IDs who are elite users for consecutively 5 years or more and what is the user average stars?", "after": "List the IDs and average review-star ratings of users who have been elite for at least five consecutive years."}, "evidence": {"before": "user average stars refers to user_average_stars;", "after": "Elite.year_id corresponds to the calendar year in Years.actual_year. Users.user_average_stars is the stored average rating given by that user."}}} {"question_id": 3932, "split": "train", "changes": {"question": {"before": "What is the opening time of the active businesses in Surprise that has a low review count.", "after": "What is the opening time of active businesses in Surprise with a low review count?"}, "evidence": {"before": "active business refers to active = 'true'; 'Surprise' is the name of city;  low review count refers to review_count = 'Low'", "after": "Business.active = 'true' denotes an active business; Business.review_count = 'Low' denotes a low review count. Business_Hours.opening_time records opening times."}}} {"question_id": 3938, "split": "train", "changes": {"question": {"before": "What city does the business have a business hour from 10 am to 12 pm on Sunday?", "after": "Which cities have businesses whose Sunday hours are 10 a.m. to noon?"}, "evidence": {"before": "10 am refers to opening_time = '10AM'; 12 pm refers to closing_time = '12PM'; on Sunday refers to day_of_week = 'Sunday'", "after": "Business_Hours stores the requested times as opening_time = '10AM' and closing_time = '12PM'; 12PM is noon."}}} {"question_id": 3939, "split": "train", "changes": {"question": {"before": "How many businesses are opened for 24 hours?", "after": "How many businesses are marked as “Open 24 Hours”?"}, "evidence": {"before": "opened for 24 hours refers to attribute_name = 'Open 24 Hours' AND attribute_value = 'true'", "after": "Attributes.attribute_name = 'Open 24 Hours' identifies the recorded attribute; Business_Attributes.attribute_value = 'true' means it is enabled. This is a separately recorded business attribute."}}} {"question_id": 3941, "split": "train", "changes": {"question": {"before": "Among the active businesses in Ahwatukee, which of them are still open in Sunday?", "after": "Which active businesses in Ahwatukee are open on Sunday?"}, "evidence": {"before": "active business refers to active = 'true'; 'Ahwatukee' is the name of city; open in Sunday refers to day_of_week = 'Sunday'", "after": "Business.active = 'true' denotes an active business; Days.day_of_week uses 'Sunday'. Business_Hours records the business’s scheduled opening days."}}} {"question_id": 3954, "split": "train", "changes": {"question": {"before": "Give the number of \"4\" stars Yelp businesses in \"Mesa\" city.", "after": "How many Yelp businesses in Mesa have a four-star rating?"}, "evidence": {"before": "\"4\" stars refers to stars = '4'; 'Mesa' is the name of city", "after": "Business.stars records the business rating; Business.city records the city."}}} {"question_id": 3977, "split": "train", "changes": {"question": {"before": "Under the attribute name of \"music_playlist\", describe the attribute ID, business ID, and city of inactive businesses.", "after": "For inactive businesses with a recorded music_playlist attribute, list the attribute ID, business ID, and city."}, "evidence": {"before": "inactive business refers to active = 'false'", "after": "Business.active = 'false' denotes inactive businesses. Attributes.attribute_name = 'music_playlist' identifies the music playlist attribute."}}} {"question_id": 3980, "split": "validation", "changes": {"question": {"before": "Mention the user average star, elite year and the compliment type of user ID 6027 whereby number of compliments reach uber.", "after": "For user 6027, list their average review-star rating, elite year IDs, and compliment types whose compliment-count category is Uber."}, "evidence": {"before": "number of compliments reach uber refers to number_of_compliments = 'Uber'; elite year refers to year_id; user average star refers to user_average_stars", "after": "Users.user_average_stars is the stored average review rating. Elite.year_id is a year identifier, not a calendar year. Users_Compliments.number_of_compliments uses categories such as 'Uber'. Compliments.compliment_type names the type."}}} {"question_id": 3981, "split": "train", "changes": {"question": {"before": "Under the category name of \"Coffee & Tea\", mention any 5 business ID , their state and city.", "after": "Under the category ‘Coffee & Tea’, list any five business IDs, their states, and their cities."}}} {"question_id": 3984, "split": "train", "changes": {"question": {"before": "Calculate the arithmetic difference of the number of business between the category of \"Men's Clothing\" and \"Women's Clothing\".", "after": "Calculate the difference between the numbers of businesses in the Men’s Clothing and Women’s Clothing categories."}, "evidence": {"before": "category of \"Men's Clothing\" refers to category_name = 'Men''s Clothing'; \"Women's Clothing\" refers to category_name = 'Women''s Clothing'", "after": "Categories.category_name uses \"Men's Clothing\" and \"Women's Clothing\"."}}} {"question_id": 3990, "split": "train", "changes": {"question": {"before": "Find the percentage of 5 stars rated business.", "after": "What percentage of businesses received a five-star rating?"}, "evidence": {"before": "percentage refers to DIVIDE(COUNT(stars = 5), COUNT(business_id)) * 100%", "after": "a five-star rating refers to Business.stars = 5; percentage = DIVIDE(SUM(CASE WHEN Business.stars = 5 THEN 1 ELSE 0 END), COUNT(*)) * 100 over all Business rows"}}} {"question_id": 4011, "split": "train", "changes": {"question": {"before": "Identify the percent of long reviews among all 5-star reviews given to businesses by the Yelp users.", "after": "Calculate the percentage of long reviews among all five-star reviews given to businesses by Yelp users. Round your answer to 1 decimal place."}, "evidence": {"before": "percentage = divide(count(business_id where review_length = 'Long' and review_stars = 5), count(business_id)) * 100%; long reviews refers to review_length = 'Long'; 5-star review refers to review_stars = 5", "after": "five-star reviews refers to Reviews.review_stars = 5; long reviews refers to review_length = 'Long'; percentage = DIVIDE(COUNT(five-star reviews whose review_length = 'Long'), COUNT(review_length over those five-star reviews)) * 100; round the final answer to 1 decimal place"}, "SQL": {"before": "SELECT CAST(SUM(CASE WHEN review_length = 'Long' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(review_length) FROM Reviews WHERE review_stars = 5", "after": "SELECT ROUND(CAST(SUM(CASE WHEN review_length = 'Long' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(review_length), 1) FROM Reviews WHERE review_stars = 5"}}} {"question_id": 4015, "split": "train", "changes": {"question": {"before": "Identify the IDs and operating hours of businesses in Black Canyon City with a review count greater than the average.", "after": "List the IDs and opening and closing times, by day of the week, for businesses in Black Canyon City whose review-count category is High or Uber."}, "evidence": {"before": "operating hours refers to opening_time, closing_time, and day_of_week; in Black Canyon City refers to city = 'Black Canyon City'; greater than average refers to review_count = 'High' or 'Uber'", "after": "Business.review_count contains categories including 'High' and 'Uber'. Business_Hours opening_time and closing_time use hour strings such as '10AM' and '12PM'; 12AM is midnight and 12PM is noon. Weekday names are recorded in Days.day_of_week."}}} {"question_id": 4022, "split": "train", "changes": {"question": {"before": "Among the users whose fan is medium, how many users received high compliments from other users.", "after": "Among users in the Medium fan-count category, how many received High-category compliments from other users?"}, "evidence": {"before": "is medium refers to user_fans = 'Medium'; high compliments refers to number_of_compliments = 'High'", "after": "Users.user_fans = 'Medium' denotes the Medium fan-count category; Users_Compliments.number_of_compliments = 'High' denotes High-category compliments."}}} {"question_id": 4038, "split": "validation", "changes": {"evidence": {"before": "the shortest business operating hours refer to MIN(SUBTRACT(closing_time, opening_time)); a business operates for 24 hours a day if its opening hour equals to its closing hour on that day", "after": "Business_Hours records each business’s operating periods. A closing time earlier than opening falls on the following day. Identical opening and closing times represent 24 hours of operation."}, "SQL": {"before": "WITH business_operating_hours AS (SELECT SUM(CASE WHEN opening_time_24h < closing_time_24h THEN closing_time_24h - opening_time_24h ELSE closing_time_24h + 24 - opening_time_24h END ) AS total_open_hours, business_id FROM (SELECT CASE WHEN INSTR(opening_time, 'AM') > 0 THEN CAST(SUBSTR(opening_time, 1, LENGTH(opening_time) - 2) AS INTEGER) WHEN INSTR(opening_time, 'PM') > 0 AND CAST(SUBSTR(opening_time, 1, LENGTH(opening_time) - 2) AS INTEGER) = 12 THEN 12 WHEN INSTR(opening_time, 'PM') > 0 THEN CAST(SUBSTR(opening_time, 1, LENGTH(opening_time) - 2) AS INTEGER) + 12 ELSE NULL END AS opening_time_24h, CASE WHEN INSTR(closing_time, 'AM') > 0 THEN CAST(SUBSTR(closing_time, 1, LENGTH(closing_time) - 2) AS INTEGER) WHEN INSTR(closing_time, 'PM') > 0 AND CAST(SUBSTR(closing_time, 1, LENGTH(closing_time) - 2) AS INTEGER) = 12 THEN 12 WHEN INSTR(closing_time, 'PM') > 0 THEN CAST(SUBSTR(closing_time, 1, LENGTH(closing_time) - 2) AS INTEGER) + 12 ELSE NULL END AS closing_time_24h, business_id FROM Business_Hours ) GROUP BY business_id ) SELECT business_id FROM business_operating_hours WHERE total_open_hours = (SELECT MIN(total_open_hours) FROM business_operating_hours);", "after": "WITH business_operating_hours AS (SELECT SUM(CASE WHEN opening_time_24h < closing_time_24h THEN closing_time_24h - opening_time_24h ELSE closing_time_24h + 24 - opening_time_24h END ) AS total_open_hours, business_id FROM (SELECT CASE WHEN INSTR(opening_time, 'AM') > 0 THEN CAST(SUBSTR(opening_time, 1, LENGTH(opening_time) - 2) AS INTEGER) % 12 WHEN INSTR(opening_time, 'PM') > 0 AND CAST(SUBSTR(opening_time, 1, LENGTH(opening_time) - 2) AS INTEGER) = 12 THEN 12 WHEN INSTR(opening_time, 'PM') > 0 THEN CAST(SUBSTR(opening_time, 1, LENGTH(opening_time) - 2) AS INTEGER) + 12 ELSE NULL END AS opening_time_24h, CASE WHEN INSTR(closing_time, 'AM') > 0 THEN CAST(SUBSTR(closing_time, 1, LENGTH(closing_time) - 2) AS INTEGER) % 12 WHEN INSTR(closing_time, 'PM') > 0 AND CAST(SUBSTR(closing_time, 1, LENGTH(closing_time) - 2) AS INTEGER) = 12 THEN 12 WHEN INSTR(closing_time, 'PM') > 0 THEN CAST(SUBSTR(closing_time, 1, LENGTH(closing_time) - 2) AS INTEGER) + 12 ELSE NULL END AS closing_time_24h, business_id FROM Business_Hours ) GROUP BY business_id ) SELECT business_id FROM business_operating_hours WHERE total_open_hours = (SELECT MIN(total_open_hours) FROM business_operating_hours);"}}} {"question_id": 4047, "split": "train", "changes": {"question": {"before": "What is the average year needed by a user with uber fans to become an elite user?", "after": "For users in the Uber fan-count category who became elite, how many years did it take on average to first become elite after joining Yelp?"}, "evidence": {"before": "AVG(MIN(Elite.year_id) - user_yelping_since_year) where user_fans = 'Uber';", "after": "the Uber fan-count category refers to Users.user_fans = 'Uber'; joining Yelp refers to user_yelping_since_year; first became elite refers to MIN(Elite.year_id), the calendar year (Years.actual_year); how many years on average refers to AVG(SUBTRACT(first elite year, user_yelping_since_year)) over Uber users with an Elite record"}}} {"question_id": 4057, "split": "train", "changes": {"question": {"before": "What are the categories of businesses that have opening time on Sunday?", "after": "Which business categories include businesses that are open on Sunday?"}, "evidence": {"before": "categories of businesses refer to category_name; Sunday refers to day_of_week where day_id = 1;", "after": "Business categories are stored in Categories.category_name. Sunday has day_id = 1 and day_of_week = 'Sunday'. A recorded opening time must be neither SQL NULL nor an empty string."}}} {"question_id": 4071, "split": "train", "changes": {"question": {"before": "Write down the number of running business with each review count in Cave Creek city.", "after": "How many active businesses in Cave Creek have High, Medium, and Low review-count categories? Give the three counts in that order."}, "evidence": {"before": "number of running business refers to COUNT(business_id) where active = 'true'; each review count includes review_count = 'High', review_count = 'Medium', review_count = 'Low';", "after": "active refers to Business.active = 'true', restricted to the businesses in Cave Creek; return three counts in one row: SUM(CASE WHEN review_count = 'High' THEN 1 ELSE 0 END), then the same for 'Medium', then for 'Low'"}}} {"question_id": 4075, "split": "train", "changes": {"question": {"before": "Write down the any five of ID and name of category that starts with alphabet \"P\".", "after": "List the IDs and names of any five categories whose names start with P."}, "evidence": {"before": "category that starts with alphabet \"P\" refers to category_name like 'P%';", "after": "Category-name matching is case-insensitive."}}} {"question_id": 4084, "split": "train", "changes": {"question": {"before": "Write down the ID and opening day of a week for the business which are running in Black Canyon City.", "after": "List the business IDs and days of the week when active businesses in Black Canyon City are open."}, "evidence": {"before": "running refers to active = 'true'; opening day of a week means days of the week when business is open;", "after": "Business.active = 'true' denotes active businesses. Business_Hours records operating days, named in Days.day_of_week."}}} {"question_id": 4087, "split": "train", "changes": {"question": {"before": "Calculate the difference between running business in Glendale City and Mesa City.", "after": "How many more active businesses are recorded in Glendale than in Mesa?"}, "evidence": {"before": "running business refers to business where active = 'true';", "after": "Running businesses have Business.active = 'true'. Business.city records the city."}}} {"question_id": 4095, "split": "train", "changes": {"question": {"before": "What are the states of businesses with attribute of beer and wine located?", "after": "In which states are businesses with the beer-and-wine attribute located?"}, "evidence": {"before": "with attribute of beer and wine refers to attribute_value = 'beer_and_wine';", "after": "The beer-and-wine attribute is recorded in Business_Attributes.attribute_value as 'beer_and_wine'; Business.state records the state."}}} {"question_id": 4101, "split": "validation", "changes": {"question": {"before": "In how many businesses have customers had a bad or terrible experience?", "after": "How many businesses have a rating indicating a bad or terrible customer experience?"}, "evidence": {"before": "stars = 2 means bad experience; stars = 1 means terrible experience; customers had a bad or terrible experience refers to stars = 2 OR stars = 1", "after": "Business.stars = 2 means a bad experience; 1 means a terrible experience."}}} {"question_id": 4112, "split": "train", "changes": {"question": {"before": "How many open businesses in the City of Phoenix have users left a long review?", "after": "How many active businesses in Phoenix have received at least one long review?"}, "evidence": {"before": "open businesses refers to active = 'true'; long review refers to review_length = 'Long'", "after": "Business.active = 'true' denotes active businesses; Business.city records the city and may contain surrounding spaces. Reviews.review_length = 'Long' identifies long reviews."}, "SQL": {"before": "SELECT COUNT(DISTINCT T2.business_id) FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.review_length = 'Long' AND T2.active = 'true' AND T2.city = 'Phoenix'", "after": "SELECT COUNT(DISTINCT b.business_id) FROM Business b JOIN Reviews r ON r.business_id=b.business_id WHERE b.active='true' AND lower(trim(b.city))='phoenix' AND r.review_length='Long';"}}} {"question_id": 4130, "split": "train", "changes": {"question": {"before": "Count the active businesses that has an attribute of BYOB with high review count.", "after": "How many active businesses have the BYOB attribute and a high review count?"}, "evidence": {"before": "active business refers to active = 'true'; attribute of BYOB refers to attribute_name = 'BYOB'; high review count refers to review_count = 'High'", "after": "Business.active = 'true' denotes an active business; Business.review_count = 'High' denotes a high review count. BYOB permission is Attributes.attribute_name = 'BYOB' with Business_Attributes.attribute_value = 'true'."}}} {"question_id": 4151, "split": "validation", "changes": {"question": {"before": "Name the papers that are cited the most times and the papers that are cited the least times, along with the number of times each one is cited.", "after": "Which papers in the database have the most and fewest citations? List each paper and its citation count, including any ties."}}} {"question_id": 4154, "split": "train", "changes": {"question": {"before": "How many papers were cited by artale00expressivity cited word3555?", "after": "How many papers cited by artale00expressivity contain the word identified as word3555?"}, "evidence": {"before": "paper cited by refers to citing_paper_id; citing_paper_id = 'artale00expressivity';", "after": "cites.citing_paper_id identifies the paper making a citation; cites.cited_paper_id identifies the paper it cites. content.word_cited_id identifies a vocabulary word occurring in a paper."}}} {"question_id": 4170, "split": "train", "changes": {"question": {"before": "Please list the titles of the episodes that have over 200 voters voting a 10 in star score.", "after": "Please list the titles of episodes with more than 200 voters giving a star score of 10."}, "evidence": {"before": "over 200 votes refers to votes > 200; 10 in star score refers to stars = 10", "after": "Vote.stars records the rating score and Vote.votes records the number of votes for that score; Episode.title records the title."}}} {"question_id": 4180, "split": "train", "changes": {"evidence": {"before": "voiced refers to role; role = 'Helen Lovejoy\"", "after": "voiced refers to role; role = 'Helen Lovejoy'"}}} {"question_id": 4193, "split": "train", "changes": {"question": {"before": "Which episode has the most vote for 10 stars rating?", "after": "Which episode received the most votes for a 10-star rating?"}, "evidence": {"before": "10 stars rating refers to stars = 10; most vote refers to Max(votes)", "after": "a 10-star rating refers to stars = 10; the votes an episode received for that rating refers to SUM(votes) for that episode; the most votes refers to the greatest such per-episode total; return that episode"}}} {"question_id": 4198, "split": "train", "changes": {"question": {"before": "Among the episode that get more than 950 votes, calculate the percentageo of the episodes that were nominated for the 'Outstanding Voice-Over Performance Award in 2009'?", "after": "Among episodes with more than 950 votes, what percentage were nominated for 'Outstanding Voice-Over Performance' in 2009?"}, "evidence": {"before": "more than 950 votes refers to votes > 950; in 2009 refers to year = 2009; number of episode = Count(episode_id); nominated refers to result = 'Nominee'; percentage = Divide(Count(award = 'Outstanding Voice-Over Performance'), Count(episode_id)) * 100", "after": "Award.award records the award name. Award.result = 'Nominee' means nominated without winning; 'Winner' is a separate result."}}} {"question_id": 4213, "split": "train", "changes": {"question": {"before": "What was the first award won by the cast or crew member of the show? Give the name of the person who won the said award.", "after": "What awards were won by named cast or crew members in the earliest year with such a win? List each award and its winner."}}} {"question_id": 4216, "split": "train", "changes": {"question": {"before": "Among the casts who were born in Los Angeles, describe the name and birth date of who have 1.8 m and above in height.", "after": "List the names and birth dates of cast members born in Los Angeles who are at least 1.8 meters tall."}, "evidence": {"before": "\"Los Angeles\" is the birth_place; 1.8 m and above in height refers to height_meters > = 1.8", "after": "Credit.category = 'Cast' identifies cast credits."}}} {"question_id": 4223, "split": "train", "changes": {"question": {"before": "What is the voting numbers and percentage of the best rating scale of the episode which had keyword of \"arab stereotype\"?", "after": "What are the vote count and percentage for the 10-star rating of the episode with the keyword “arab stereotype”?"}, "evidence": {"before": "best rating scale refers to stars = 10", "after": "Vote.stars records the rating score; Vote.votes and Vote.percent record its vote count and percentage. Keyword.keyword uses 'arab stereotype'."}}} {"question_id": 4247, "split": "train", "changes": {"question": {"before": "Which episode of The simpson 20s: Season 20 has received the most nominations? Indicate the title.", "after": "Which episode from season 20 received the most nominations? Give its title."}, "evidence": {"before": "received the most nomination refers to MAX(COUNT(episode_id))", "after": "season 20 refers to Episode.season = 20; the nominations an episode received refers to COUNT of its Award rows; the most nominations refers to the greatest such count; return the Episode.title"}}} {"question_id": 4248, "split": "train", "changes": {"question": {"before": "Please indicate the birthplace of the crew which name is Dan Castellaneta.", "after": "Please indicate the birthplace of the crew member named Dan Castellaneta."}}} {"question_id": 4250, "split": "train", "changes": {"question": {"before": "Please list the name of crew that were born before 1970.", "after": "Please list the names of crew members born before 1970."}, "evidence": {"before": "born before 1970 refers to birthdate < '1970-01-01'", "after": "Person.birthdate records the birth date."}}} {"question_id": 4254, "split": "train", "changes": {"question": {"before": "Among episodes from 10 to 20, which episode has more than 200 votes?", "after": "Which episode numbers from 10 through 20 have more than 200 votes?"}}} {"question_id": 4262, "split": "train", "changes": {"question": {"before": "The person named Al Jean was nominated the Primetime Emmy Award category in 2009, which episode did AI Jean achieve? List the episode ids.", "after": "List the episode IDs for which Al Jean received a Primetime Emmy nomination in 2009 but did not win."}, "evidence": {"before": "in 2009 refers to year = 2009", "after": "Primetime Emmy is recorded in Award.award_category. Nominated refers to Award.result = 'Nominee', excluding winners"}, "SQL": {"before": "SELECT T2.episode_id FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2009' AND T1.person = 'Al Jean' AND T1.award_category = 'Primetime Emmy';", "after": "SELECT T2.episode_id\nFROM Award AS T1\nINNER JOIN Episode AS T2\n ON T1.episode_id = T2.episode_id\nWHERE SUBSTR(T1.year, 1, 4) = '2009'\n AND T1.person = 'Al Jean'\n AND T1.award_category = 'Primetime Emmy'\n AND T1.result = 'Nominee';"}}} {"question_id": 4301, "split": "train", "changes": {"evidence": {"before": "nominated episodes refers to result = 'Nominee'; percentage of votes = DIVIDE(SUM(result = 'Nominee), SUM(Votes)) as percentage", "after": "nominated episodes refers to result = 'Nominee'; percentage of votes = DIVIDE(SUM(result = 'Nominee'), SUM(Votes)) as percentage"}}} {"question_id": 4315, "split": "train", "changes": {"question": {"before": "What is the average heights of crew members from Animation Department?", "after": "What is the average height of people with a recorded height and at least one Animation Department credit? Round your answer to 3 decimal places."}, "evidence": {"before": "from Animation Department refers to category = 'Animation Department'; AVG(height_meters) where category = 'Animation Department'", "after": "at least one Animation Department credit refers to Credit.category = 'Animation Department'; a person may hold several such credits, so take each Person.name once; average height refers to AVG(Person.height_meters) over those distinct people whose height_meters IS NOT NULL, rounded to 3 decimal places"}, "SQL": {"before": "SELECT AVG(height_meters) FROM ( SELECT DISTINCT P.name, P.height_meters FROM Person AS P JOIN Credit AS C ON P.name = C.person WHERE C.category = 'Animation Department' AND P.height_meters IS NOT NULL )", "after": "WITH unrounded(value) AS (\nSELECT AVG(height_meters) FROM ( SELECT DISTINCT P.name, P.height_meters FROM Person AS P JOIN Credit AS C ON P.name = C.person WHERE C.category = 'Animation Department' AND P.height_meters IS NOT NULL )\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 4328, "split": "train", "changes": {"question": {"before": "Out of the rating of 6.8 scored by title \"No Loan Again, Naturally\", how many percent of it consists of scores 5 to 10?", "after": "For No Loan Again, Naturally, which has an overall rating of 6.8, what percentage of votes gave it a score from 5 through 10? Round your answer to 3 decimal places."}, "evidence": {"before": "scores 5 to 10 refers to TOTAL(percent) where 1 < = stars < 5", "after": "Episode.title records 'No Loan Again, Naturally'; Episode.rating is its overall rating. Vote.stars records a score and Vote.votes is the number of votes at that score; Vote.percent is a separately rounded percentage."}, "SQL": {"before": "SELECT SUM(T2.percent) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'No Loan Again, Naturally' AND T1.rating = 6.8 AND T2.stars BETWEEN 5 AND 10;", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * SUM(CASE WHEN v.stars BETWEEN 5 AND 10 THEN v.votes ELSE 0 END) / SUM(v.votes) FROM Vote v JOIN Episode e ON e.episode_id=v.episode_id WHERE e.title='No Loan Again, Naturally' AND e.rating=6.8\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 4333, "split": "train", "changes": {"question": {"before": "How many awards had been held in 2009?", "after": "How many different award names were recorded in 2009?"}, "evidence": {"before": "had been held in 2009 refers to year = 2009", "after": "Award.award records the award name; Award.year records the award year."}}} {"question_id": 4335, "split": "train", "changes": {"question": {"before": "List out the birth name of crews who are co-executive producer and higher than 1.60 meters.", "after": "List the birth names of crew members who worked as co-executive producers and are taller than 1.60 meters."}, "evidence": {"before": "co-executive producer refers to role = 'co-executive producer'; higher than 1.60 meters refers to height_meters > 1.60", "after": "Credit.role uses 'co-executive producer'; Person.birth_name is the name given at birth."}}} {"question_id": 4352, "split": "train", "changes": {"question": {"before": "In between the episode 5 and 10 (inclusive) of season 20, how many of them are credited for casting?", "after": "How many episodes from episodes 5 through 10 of season 20, inclusive, have a credited casting role?"}, "evidence": {"before": "between the episode 5 and 10 of season 20 refers to episode_id IN('S20-E5', 'S20-E6', 'S20-E7', 'S20-E8', 'S20-E9', 'S20-E10'); credited refers to credited = 'true'; for casting refers to role = 'casting'", "after": "Episode.episode_id encodes season and episode as, for example, 'S20-E5'. Credit.role uses 'casting'; Credit.credited = 'true' indicates a credited role."}}} {"question_id": 4355, "split": "validation", "changes": {"evidence": {"before": "aired in 2008 refers to air_date LIKE '2008%'; 5 stars and below refers to stars < 5", "after": "aired in 2008 refers to air_date LIKE '2008%'; 5 stars and below refers to stars <= 5"}}} {"question_id": 4382, "split": "validation", "changes": {"evidence": {"before": "females students have filed for bankruptcy refers to name that appeared in both filed_for_bankrupcy and male tables", "after": "The filed_for_bankrupcy table lists students who filed for bankruptcy. In this database, male students are listed in the male table; all other students are recorded as female."}}} {"question_id": 4384, "split": "train", "changes": {"question": {"before": "What is the average time for a disabled student to be absent from school?", "after": "What is the average length, in months, of the longest school absence recorded for students with disabilities?"}, "evidence": {"before": "average time refers to DIVIDE(SUM(`month`), COUNT(name))", "after": "disabled.name lists students with disabilities. longest_absense_from_school.month records their longest absence in months; 0 means never absent."}}} {"question_id": 4392, "split": "train", "changes": {"question": {"before": "List all students in the air force and which school they were enrolled at.", "after": "List all students enlisted in the air force and their recorded schools, leaving the school blank if none is recorded."}}} {"question_id": 4403, "split": "train", "changes": {"question": {"before": "What is the percentage ratio of students who are enlisted in foreign legions that have a due payment?", "after": "What percentage of students enlisted in foreign legions have a due payment?"}, "evidence": {"before": "have a due payment refers to bool = 'pos'; in foreign legions refers to organ = 'foreign_legion'; ratio refers to DIVIDE(COUNT(bool = 'pos'), COUNT(bool = 'neg' OR bool = 'pos'))*100", "after": "enlist.organ = 'foreign_legion' denotes the foreign legion; no_payment_due.bool = 'pos' denotes a payment due."}}} {"question_id": 4408, "split": "train", "changes": {"question": {"before": "How many students were absence for 4 month?", "after": "How many students’ longest school absence was four months?"}, "evidence": {"before": "absence for 4 month refers to month = 4;", "after": "longest_absense_from_school.month records the longest school absence in months."}}} {"question_id": 4416, "split": "train", "changes": {"question": {"before": "What is the ratio of disable female to male students?", "after": "What is the ratio of disabled female students to disabled male students?"}, "SQL": {"before": "SELECT CAST(SUM(IIF(T2.name IS NULL, 1, 0)) AS REAL) * 100 / COUNT(T2.name) FROM disabled AS T1 LEFT JOIN male AS T2 ON T1.`name` = T2.`name`", "after": "SELECT CAST(SUM(IIF(T2.name IS NULL, 1, 0)) AS REAL) / COUNT(T2.name) FROM disabled AS T1 LEFT JOIN male AS T2 ON T1.`name` = T2.`name`"}}} {"question_id": 4428, "split": "train", "changes": {"question": {"before": "Mention the name of disabled students who have never been absent from school.", "after": "Mention the names of disabled students who have never been absent from school."}, "evidence": {"before": "never been absent from school refers to month = 0", "after": "longest_absense_from_school.month records the longest absence in months; zero denotes no absence. disabled records disabled students."}}} {"question_id": 4437, "split": "train", "changes": {"question": {"before": "State name of unemployed students who have the longest duration of absense from school.", "after": "State the names of unemployed students who had the longest absence from school."}, "evidence": {"before": "longest duration of absense refers to MAX(month)", "after": "unemployed students refers to the names listed in unemployed; the longest absence from school refers to MAX(longest_absense_from_school.month) taken over those unemployed students only; return the names of the students whose month equals that maximum"}}} {"question_id": 4438, "split": "train", "changes": {"question": {"before": "Mention the name of unemployed students who have never been absent from school.", "after": "Mention the names of unemployed students who have never been absent from school."}, "evidence": {"before": "have never been absent from school refers to month = 0", "after": "longest_absense_from_school.month = 0 denotes no recorded absence; unemployed records unemployed students."}}} {"question_id": 4441, "split": "train", "changes": {"question": {"before": "State name of students who filed for bankruptcy and have the longest duration of absense from school.", "after": "State the names of students who filed for bankruptcy and had the longest absence from school."}, "evidence": {"before": "longest duration of absense refers to MAX(month)", "after": "filed for bankruptcy refers to appearing in filed_for_bankrupcy; the longest absence from school refers to longest_absense_from_school.month = MAX(month); state the names of the students who filed for bankruptcy and had that longest absence"}}} {"question_id": 4447, "split": "train", "changes": {"question": {"before": "Find the average time of absences in months across all students.", "after": "What is the average length, in months, of students’ longest recorded school absences?"}, "evidence": {"before": "average refers to DIVIDE(SUM(month), COUNT(name))", "after": "average length, in months, of students' longest recorded school absences = AVG(month) over every longest_absense_from_school record"}}} {"question_id": 4459, "split": "train", "changes": {"question": {"before": "Among students enlisted in the fire department, find the percentage of male students.", "after": "Among students enlisted in the fire department, find the percentage of male students. Round your answer to 1 decimal place."}, "evidence": {"before": "percentage refers to DIVIDE(COUNT(organ = 'fire_department'), COUNT(name))*100", "after": "students enlisted in the fire department refers to enlist.organ = 'fire_department'; male students refers to those whose enlist.name appears in male; percentage = DIVIDE(COUNT(DISTINCT male student names), COUNT(DISTINCT enlisted student names)) * 100, rounded to 1 decimal place"}, "SQL": {"before": "SELECT 100.0 * COUNT(DISTINCT m.name)\n / COUNT(DISTINCT e.name) AS percentage_male\nFROM `enlist` AS e\nLEFT JOIN `male` AS m ON e.`name` = m.`name`\nWHERE e.`organ` = 'fire_department';", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * COUNT(DISTINCT m.name)\n / COUNT(DISTINCT e.name) AS percentage_male\nFROM `enlist` AS e\nLEFT JOIN `male` AS m ON e.`name` = m.`name`\nWHERE e.`organ` = 'fire_department'\n) SELECT ROUND(value, 1) FROM unrounded;"}}} {"question_id": 4464, "split": "validation", "changes": {"question": {"before": "How many of the students joined at least two organization?", "after": "How many students joined at least two organizations?"}, "evidence": {"before": "joined two organization refers to COUNT(organ) > = 2", "after": "enlist.name identifies the student and enlist.organ records the organization joined."}}} {"question_id": 4475, "split": "train", "changes": {"question": {"before": "List at least 5 students who have payment due and are enlisted in Peace Corps organization?", "after": "List 5 students who have payment due and are enlisted in Peace Corps organization."}}} {"question_id": 4484, "split": "validation", "changes": {"question": {"before": "Calculate the average enlisted students per organization.", "after": "On average, how many different students are enlisted in each organization? Round your answer to 4 decimal places."}, "evidence": {"before": "average = DIVIDE(FLOOR(COUNT(NAME), COUNT(DISTINCT organ)));", "after": "Enlistment records are stored in enlist, where name identifies the student and organ identifies the organization."}, "SQL": {"before": "SELECT CAST(COUNT(`name`) AS REAL) / COUNT(DISTINCT `organ`) AS avg_enlisted_per_organ FROM `enlist`", "after": "WITH unrounded(value) AS (\nSELECT AVG(student_count) FROM (SELECT organ,COUNT(DISTINCT name) AS student_count FROM enlist GROUP BY organ)\n) SELECT ROUND(value, 4) FROM unrounded;"}}} {"question_id": 4507, "split": "train", "changes": {"question": {"before": "What is the percentage decrease from month 0 absence to month 9 absence?", "after": "What is the percentage decrease from the number of students whose longest absence was zero months to the number whose longest absence was nine months?"}, "evidence": {"before": "percentage difference = DIVIDE(MULTIPLY(SUBTRACT(COUNT(name WHERE month = 0), COUNT(name WHERE month = 9)), 100), COUNT(name WHERE month = 0));", "after": "longest absence of zero months refers to longest_absense_from_school.month = 0 and of nine months to month = 9, one row per student; percentage decrease = DIVIDE(MULTIPLY(SUBTRACT(COUNT(students with month = 0), COUNT(students with month = 9)), 100), COUNT(students with month = 0))"}}} {"question_id": 4508, "split": "train", "changes": {"question": {"before": "Which school have the highest student enrollment? How many of those students are filed for bankruptcy?", "after": "Which school has the highest student enrollment, and how many of its students filed for bankruptcy?"}, "evidence": {"before": "highest student enrollment refers to MAX(COUNT(school));", "after": "enrolled.school records a student’s school; filed_for_bankrupcy records students who filed for bankruptcy."}}} {"question_id": 4533, "split": "validation", "changes": {"question": {"before": "Calculate the average duration of absense of female students.", "after": "What is the average length, in months, of female students’ longest school absences?"}, "evidence": {"before": "average duration = DIVIDE(SUM(month), COUNT(longest_absence_from_school.name which are NOT in male.name)); female students refers to longest_absence_from_school.name who are NOT in male.name;", "after": "longest_absense_from_school.month records absence duration in months; in this dataset, students not listed in male are female."}}} {"question_id": 4535, "split": "train", "changes": {"question": {"before": "Mention the status of payment of student 299.", "after": "Mention the payment status of student 299."}, "evidence": {"before": "status of payment is mentioned in no_payment_due; bool = 'pos' means the student has payment due; bool = 'neg' means the student has no payment due; student299 is a name of student;", "after": "no_payment_due.bool uses 'pos' for a payment due and 'neg' for no payment due. Student 299 is recorded as 'student299'."}}} {"question_id": 4537, "split": "train", "changes": {"question": {"before": "How many students have absent from school?", "after": "How many students have been absent from school?"}, "evidence": {"before": "have absent from school refers to month >= 1;", "after": "longest_absense_from_school.month records the longest school absence in months; zero denotes no absence."}}} {"question_id": 4548, "split": "train", "changes": {"question": {"before": "Among students with 1 month of absenses, how many of them are enlisted in the air force department?", "after": "Among students absent for 1 month, how many are enlisted in the air force?"}, "evidence": {"before": "1 month of absences refers to month = 1; department refers to organ; organ = 'air_force';", "after": "longest_absense_from_school.month records absence duration in months; enlist.organ = 'air_force' denotes the air force."}}} {"question_id": 4557, "split": "train", "changes": {"question": {"before": "What is the name of the organization which most of the students are enlisted in?", "after": "What is the name of the organization in which most students are enlisted?"}, "evidence": {"before": "name of the organization refers to organ; organization which most of the students are enlisted in refers to MAX(COUNT(organ));", "after": "the organization refers to enlist.organ; how many students are enlisted in it refers to COUNT(DISTINCT enlist.name) for that organ, not the number of enlistment rows; the organization in which most students are enlisted refers to the maximum of those counts; return every organ at that maximum"}}} {"question_id": 4575, "split": "validation", "changes": {"question": {"before": "Betweeen 2016 to 2019, which year recorded the highest number of people with mental illness?", "after": "Between 2016 and 2019, inclusive, which survey years had the most respondents reporting mental illness? Include ties."}, "evidence": {"before": "Between 2016 to 2019 refer to SurveyID 2016 BETWEEN 2019; People with mental illness refers to AnswerText = 'Yes' where questionid = 34", "after": "Answer.SurveyID is the survey year. Answer.QuestionID = 34 identifies the mental-illness question; Answer.AnswerText = 'Yes' is a positive response."}}} {"question_id": 4605, "split": "train", "changes": {"question": {"before": "For the question “What US state or territory do you work in?”, how many people gave \"Kansas\" as the answer?", "after": "For the question ‘What US state or territory do you work in?’, how many people answered ‘Kansas’?"}, "evidence": {"before": "question refers to questiontext; AnswerText = 'Kansas'", "after": "Question.questiontext records survey questions and Answer.AnswerText records responses, including 'Kansas'."}}} {"question_id": 4618, "split": "train", "changes": {"question": {"before": "How many questions were asked in the questionary for the mental health survey in total?", "after": "How many questions were asked in the mental-health survey questionnaire?"}, "evidence": {"before": null, "after": "Question.questiontext records a survey question’s text."}}} {"question_id": 4621, "split": "validation", "changes": {"question": {"before": "more gross refers to SUBTRACT(SUM(Total WHERE Year = 1998), SUM(Total WHERE Year = 1997))", "after": "How much greater was the Walt Disney Company's total recorded revenue in 1998 than in 1997?"}, "evidence": {"before": "SUBTRACT(SUM(Year = 1998), SUM(Year = 1997))", "after": "Use revenue.Total for each year and subtract the 1997 total from the 1998 total. Here Total means the company revenue recorded in the revenue table, not the movie-level box-office gross in movies_total_gross."}}} {"question_id": 4622, "split": "train", "changes": {"question": {"before": "In which segment did the Walt Disney Company earned a bigger revenue in 1998, Studio Entertainment or Disney Media Networks?", "after": "In which segment did The Walt Disney Company earn more revenue in 1998: Studio Entertainment or Disney Media Networks?"}, "evidence": {"before": "If 'Studio Entertainment[NI 1]' > 'Disney Media Networks' then Studio Entertainment[NI 1] else Disney Media Networks where Year = 1998;", "after": "Segment revenues are recorded in revenue.\"Studio Entertainment[NI 1]\" and revenue.\"Disney Media Networks\"; revenue.Year records the year."}}} {"question_id": 4625, "split": "train", "changes": {"evidence": {"before": "Wolfgang Reitherman refers to director = 'Wolfgang Reitherman'; released in December refers to (release_date, instr(release_date, '-') + 1, 3) = 'Dec';", "after": "Dates in characters.release_date are stored as YYYY-MM-DD. The film’s director is recorded in director.director."}, "SQL": {"before": "SELECT COUNT(movie_title) FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE SUBSTR(release_date, INSTR(release_date, '-') + 1, 3) = 'Dec' AND T2.director = 'Wolfgang Reitherman'", "after": "SELECT COUNT(movie_title) FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE strftime('%m', T1.release_date) = '12' AND T2.director = 'Wolfgang Reitherman'"}}} {"question_id": 4646, "split": "train", "changes": {"question": {"before": "Wolfgang Reitherman has directed several Disney movies, which one has the highest grossing after accounting for inflation?", "after": "Which Disney movie directed by Wolfgang Reitherman had the highest inflation-adjusted gross?"}, "evidence": {"before": "Wolfgang Reitherman refers to director = 'Wolfgang Reitherman'; the highest grossing after accounting for inflation refers to MAX(inflation_adjusted_gross);", "after": "movies_total_gross.inflation_adjusted_gross records inflation-adjusted gross. Wolfgang Reitherman is recorded in director.director as 'Wolfgang Reitherman'."}}} {"question_id": 4647, "split": "train", "changes": {"evidence": {"before": "released on 2016/3/4 refers to release_date = '4-Mar-16'; adventure movie refers to genre = 'Adventure' ;", "after": "Dates in characters.release_date are stored as YYYY-MM-DD. Adventure movies are labelled 'Adventure' in movies_total_gross.genre."}, "SQL": {"before": "SELECT T1.hero FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie_title WHERE T2.genre = 'Adventure' AND T1.release_date = '4-Mar-16'", "after": "SELECT T1.hero FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie_title WHERE T2.genre = 'Adventure' AND T1.release_date = '2016-03-04'"}}} {"question_id": 4648, "split": "train", "changes": {"question": {"before": "The character Winnie the Pooh has appeared in two Disney movies, which one has more grossing?", "after": "The character Winnie the Pooh has appeared in two Disney movies. Which one had the higher gross?"}, "evidence": {"before": "Winnie the Pooh is the main character of the movie which refers to hero = 'Winnie the Pooh'; which one has more grossing refers to movie_title where MAX(total_gross);", "after": "Winnie the Pooh refers to characters.hero = 'Winnie the Pooh'; the higher gross refers to the greater gross revenue in movies_total_gross.total_gross; return the one of those two Disney movies whose gross revenue is greater, ORDER BY that revenue DESC LIMIT 1"}}} {"question_id": 4657, "split": "train", "changes": {"question": {"before": "Which director did Bill Thompson work the most with?", "after": "Which directors worked with voice actor Bill Thompson on the most different movies? Include ties."}, "evidence": {"before": "Bill Thompson refers to voice-actor = 'Bill Thompson'; worked the most refers to MAX(COUNT(name));", "after": "Bill Thompson refers to voice-actors.voice-actor = 'Bill Thompson'; voice-actors.movie and director.name both identify the movie of a credit; the most different movies refers to COUNT(DISTINCT director.name) per director.director equal to the greatest such count; return director.director at that count and include ties"}}} {"question_id": 4659, "split": "train", "changes": {"evidence": {"before": "Ben Sharpsteen refers to director = 'Ben Sharpsteen'; released on February 9, 1940 refers to release_date = 'Feb 9, 1940';", "after": "Ben Sharpsteen is the director. In movies_total_gross.release_date, February 9, 1940 is recorded as 'Feb 9, 1940': abbreviated month, day, and four-digit year. In voice-actors, the text 'None' means no voice actor is recorded."}}} {"question_id": 4694, "split": "train", "changes": {"question": {"before": "Describe the voice actors and villains in Cinderella.", "after": "List the voice actors and villains recorded for Cinderella, with the voice actor first."}, "evidence": {"before": "Cinderella refers to movie_title = ' Cinderella';", "after": "characters.movie_title records 'Cinderella'; characters.villian records the villain. voice-actors.voice-actor records the voice actor."}}} {"question_id": 4698, "split": "train", "changes": {"question": {"before": "Among the movies released from 2001 to 2005, list down the titles and directors of the movies which had a total gross of more than 100% above the average total gross from 2001 to 2005.", "after": "Which movies released from 2001 through 2005 earned more than twice the average total gross for movies released in that period? Give their titles and directors, leaving the director blank when it is unknown."}, "evidence": {"before": "Released from 2001 to 2005 refers to substr(release_date, length(release_date) - 3, length(release_date)) between '2001' and '2005'; average total gross refers to DIVIDE(SUM(total_gross), COUNT(movie_title));", "after": "movies_total_gross.movie_title records the title, release_date records its release date, and total_gross records gross revenue as currency text. director.director records the director’s name."}, "SQL": {"before": "SELECT d.`name` AS title,\n d.`director`\nFROM `movies_total_gross` m\nJOIN `director` d\n ON m.`movie_title` = d.`name`\nWHERE SUBSTR(m.`release_date`, LENGTH(m.`release_date`) - 3, 4) BETWEEN '2001' AND '2005'\n AND CAST(REPLACE(TRIM(m.`total_gross`, '$'), ',', '') AS REAL) >\n 2 * ( SELECT AVG(CAST(REPLACE(TRIM(`total_gross`, '$'), ',', '') AS REAL))\n FROM `movies_total_gross`\n WHERE SUBSTR(`release_date`, LENGTH(`release_date`) - 3, 4) BETWEEN '2001' AND '2005' );", "after": "SELECT m.`movie_title` AS title,\n d.`director`\nFROM `movies_total_gross` m\nLEFT JOIN `director` d\n ON m.`movie_title` = d.`name`\nWHERE SUBSTR(m.`release_date`, LENGTH(m.`release_date`) - 3, 4) BETWEEN '2001' AND '2005'\n AND CAST(REPLACE(TRIM(m.`total_gross`, '$'), ',', '') AS REAL) >\n 2 * ( SELECT AVG(CAST(REPLACE(TRIM(`total_gross`, '$'), ',', '') AS REAL))\n FROM `movies_total_gross`\n WHERE SUBSTR(`release_date`, LENGTH(`release_date`) - 3, 4) BETWEEN '2001' AND '2005' );"}}} {"question_id": 4701, "split": "train", "changes": {"question": {"before": "List the movie titles with the voice actor Jeff Bennet", "after": "List the movie titles featuring voice actor Jeff Bennett."}, "evidence": {"before": "Jeff Bennett refers to voice-actor = 'Jeff Bennett';", "after": "Voice-acting credits are in voice-actors; movie records the title. The voice-actor field may contain multiple names separated by semicolons."}, "SQL": {"before": "SELECT `movie` FROM `voice-actors` WHERE `voice-actor` = 'Jeff Bennett';", "after": "SELECT DISTINCT va.movie FROM `voice-actors` va JOIN json_each('[' || REPLACE(json_quote(va.`voice-actor`), ';', '\",\"') || ']') a WHERE TRIM(a.value)='Jeff Bennett'"}}} {"question_id": 4709, "split": "validation", "changes": {"evidence": {"before": "Jack Kinney refers to director = 'Jack Kinney'; released before 1947 refers to substr(release_date, length(release_date) - 1, length(release_date)) < '47' AND substr(release_date, length(release_date) - 1, length(release_date)) > '30';", "after": "Dates in characters.release_date are stored as YYYY-MM-DD. The film’s director is recorded in director.director."}, "SQL": {"before": "SELECT T1.movie_title FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Jack Kinney' \nAND SUBSTR(T1.release_date, LENGTH(T1.release_date) - 1, LENGTH(T1.release_date)) < '47'\nAND SUBSTR(T1.release_date, LENGTH(T1.release_date) - 1, LENGTH(T1.release_date)) > '30'", "after": "SELECT T1.movie_title FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Jack Kinney' AND date(T1.release_date) < '1947-01-01'"}}} {"question_id": 4711, "split": "train", "changes": {"question": {"before": "Which movie's song title has the highest total gross?", "after": "Among movies with a recorded song, which had the highest total gross? List their song titles."}, "evidence": {"before": "The highest total gross refers to MAX(total_gross);", "after": "total gross as a number refers to CAST(REPLACE(TRIM(total_gross, '$'), ',', '') AS REAL), which drops the currency symbols and comma separators; movies with a recorded song refers to the movies_total_gross rows paired with a characters row for the same movies; the highest total gross refers to the MAX of that number over those paired rows; list the characters.song of every paired row at that MAX"}}} {"question_id": 4716, "split": "train", "changes": {"question": {"before": "The main character Elsa is voiced by which actor and who is the director of the movie?", "after": "Which actor voiced the main character Elsa, and who directed the movie?"}, "evidence": {"before": "Elsa is the main character of the movie which refers to hero = 'Elsa'; voiced by which actor refers to voice-actor;", "after": "Elsa is recorded in characters.hero and voice-actors.character as 'Elsa'. Voice actors are recorded in voice-actors.\"voice-actor\"; film directors are recorded in director.director."}}} {"question_id": 4718, "split": "train", "changes": {"question": {"before": "Among all the vioce actors, calculate the percentage of those who have at least one main character's movie is in the Drama genre.", "after": "What percentage of all voice actors voiced a main character in at least one Drama movie?"}, "evidence": {"before": "DIVIDE(COUNT(voice-actor where genre = 'Drama'), COUNT(voice-actor))*100 as percentage;", "after": "Main characters are recorded in characters.hero; 'and' separates names when more than one is listed. Voice-acting credits are in voice-actors: character and movie identify the role, and semicolons separate multiple names in voice-actor. The text 'None' or NULL means no voice actor is recorded. Movie genres are in movies_total_gross.genre. Titles can be reused for remakes; release years distinguish versions in these catalogs, although release days may differ. characters.release_date uses YYYY-MM-DD; movies_total_gross.release_date uses an abbreviated month, day and four-digit year."}, "SQL": {"before": "SELECT 100.0 * COUNT(DISTINCT CASE WHEN m.genre = 'Drama' THEN va.`voice-actor` END)\n / COUNT(DISTINCT va.`voice-actor`) AS percentage\nFROM characters c\nJOIN `voice-actors` va ON va.character = c.hero\nJOIN movies_total_gross m ON m.movie_title = c.movie_title;", "after": "WITH voice_credits AS (\n SELECT va.movie, va.character, TRIM(a.value) AS actor\n FROM `voice-actors` AS va\n JOIN json_each('[' || REPLACE(json_quote(va.`voice-actor`), ';', '\",\"') || ']') AS a\n WHERE a.value IS NOT NULL AND TRIM(a.value) NOT IN ('', 'None')\n),\ndrama_actors AS (\n SELECT DISTINCT vc.actor\n FROM characters AS c\n JOIN movies_total_gross AS m\n ON m.movie_title = c.movie_title\n AND SUBSTR(m.release_date, -4) = SUBSTR(c.release_date, 1, 4)\n JOIN json_each('[' || REPLACE(json_quote(c.hero), ' and ', '\",\"') || ']') AS h\n JOIN voice_credits AS vc\n ON vc.movie = c.movie_title AND vc.character = TRIM(h.value)\n WHERE m.genre = 'Drama'\n)\nSELECT 100.0 * (SELECT COUNT(*) FROM drama_actors)\n / (SELECT COUNT(DISTINCT actor) FROM voice_credits) AS percentage;"}}} {"question_id": 4719, "split": "train", "changes": {"question": {"before": "Name the first movie released by Disney.", "after": "Which Disney film was released first?"}, "evidence": {"before": "The first movie released refers to movie_title where substr(release_date, length(release_date) - 1, length(release_date)) asc limit 1;", "after": "Dates in characters.release_date are stored as YYYY-MM-DD."}, "SQL": {"before": "WITH movie_date AS (SELECT julianday(\n (CASE WHEN CAST(substr(release_date, -2) AS INT) < 20 THEN '20' ELSE '19' END || substr(release_date, -2)) || '-' ||\n CASE \n WHEN release_date LIKE '%Jan%' THEN '01' WHEN release_date LIKE '%Feb%' THEN '02'\n WHEN release_date LIKE '%Mar%' THEN '03' WHEN release_date LIKE '%Apr%' THEN '04'\n WHEN release_date LIKE '%May%' THEN '05' WHEN release_date LIKE '%Jun%' THEN '06'\n WHEN release_date LIKE '%Jul%' THEN '07' WHEN release_date LIKE '%Aug%' THEN '08'\n WHEN release_date LIKE '%Sep%' THEN '09' WHEN release_date LIKE '%Oct%' THEN '10'\n WHEN release_date LIKE '%Nov%' THEN '11' WHEN release_date LIKE '%Dec%' THEN '12'\n END || '-' ||\n printf('%02d', CAST(release_date AS INT))\n) AS julian_val,\nmovie_title\nFROM characters)\nSELECT movie_title FROM movie_date WHERE julian_val = (SELECT MIN(julian_val) FROM movie_date)", "after": "SELECT movie_title FROM characters WHERE julianday(release_date) = (SELECT MIN(julianday(release_date)) FROM characters)"}}} {"question_id": 4721, "split": "train", "changes": {"question": {"before": "Who was the first ever Disney villain?", "after": "Who was the villain in Disney’s earliest film?"}, "evidence": {"before": "the first ever villian is villian that was released before all others in time which refers to substr(release_date, length(release_date) - 1, length(release_date)) desc limit 1;", "after": "Dates in characters.release_date are stored as YYYY-MM-DD."}, "SQL": {"before": "WITH movie_date AS (SELECT julianday(\n (CASE WHEN CAST(substr(release_date, -2) AS INT) < 20 THEN '20' ELSE '19' END || substr(release_date, -2)) || '-' ||\n CASE \n WHEN release_date LIKE '%Jan%' THEN '01' WHEN release_date LIKE '%Feb%' THEN '02'\n WHEN release_date LIKE '%Mar%' THEN '03' WHEN release_date LIKE '%Apr%' THEN '04'\n WHEN release_date LIKE '%May%' THEN '05' WHEN release_date LIKE '%Jun%' THEN '06'\n WHEN release_date LIKE '%Jul%' THEN '07' WHEN release_date LIKE '%Aug%' THEN '08'\n WHEN release_date LIKE '%Sep%' THEN '09' WHEN release_date LIKE '%Oct%' THEN '10'\n WHEN release_date LIKE '%Nov%' THEN '11' WHEN release_date LIKE '%Dec%' THEN '12'\n END || '-' ||\n printf('%02d', CAST(release_date AS INT))\n) AS julian_val,\nvillian\nFROM characters)\nSELECT villian FROM movie_date WHERE julian_val = (SELECT MIN(julian_val) FROM movie_date)", "after": "SELECT villian FROM characters WHERE julianday(release_date) = (SELECT MIN(julianday(release_date)) FROM characters)"}}} {"question_id": 4730, "split": "validation", "changes": {"question": {"before": "Find the average estimated inflation rate that was used to adjust the 1995 box office revenue for Disney's films.", "after": "What was the average inflation-adjustment factor (adjusted gross divided by original gross) for Disney films released in 1995?"}, "evidence": {"before": "DIVIDE(inflation_adjusted_gross, total_gross) as percentage where substr(release_date, length(release_date) - 3, length(release_date)) = '1995';", "after": "movies_total_gross.total_gross records original gross and inflation_adjusted_gross records adjusted gross, both as formatted currency amounts."}}} {"question_id": 4733, "split": "train", "changes": {"evidence": {"before": "Actors who voiced refer to voice-actor;", "after": "Actors who voiced refers to voice-actor; exclude missing actor names, including the literal 'None'; count distinct character names per actor."}, "SQL": {"before": "SELECT `voice-actor` FROM `voice-actors` GROUP BY 'voice-actor' HAVING COUNT(movie) > 5", "after": "SELECT `voice-actor` FROM `voice-actors` WHERE `voice-actor` IS NOT NULL AND `voice-actor` <> 'None' GROUP BY `voice-actor` HAVING COUNT(DISTINCT character) > 5"}}} {"question_id": 4753, "split": "train", "changes": {"evidence": {"before": "served for more than 6 terms refers to COUNT(bioguide > 6); born after 1960 refers to birthday_bio > = '1960-01-01'", "after": "current lists current legislators; current.birthday_bio records birth dates. current-terms records their terms of service."}}} {"question_id": 4759, "split": "validation", "changes": {"question": {"before": "How many females were members of the past legislators?", "after": "How many female members were among the past legislators?"}, "evidence": {"before": "female refers to gender_bio = 'F'", "after": "Historical legislators are recorded in historical; gender_bio = 'F' denotes female."}}} {"question_id": 4770, "split": "train", "changes": {"evidence": {"before": "full name refers to official_full_name; official_full_name refers to first_name, last_name; female refers to gender_bio = 'F'; chose Republican as their political party refers to party = 'Republican'", "after": "full name refers to official_full_name, which is recorded in its own column and is not first_name and last_name joined together; female refers to gender_bio = 'F'; chose Republican as their political party refers to party = 'Republican'"}}} {"question_id": 4773, "split": "train", "changes": {"question": {"before": "Calculate the average number of the male legislators who are currently serving chose Democrat from 2000 until 2021.", "after": "What was the average yearly number of male Democrats serving from 2000 through 2021, considering only legislators listed as current?"}, "evidence": {"before": "male refers to gender_bio = 'M'; legislators who chose Democrat refers to party = 'Democrat'; from 2000 until 2021 refers to start > = 2000 AND END < = 2021; calculation = DIVIDE(SUM(COUNT(male legislators who chose Democrat each year)), 22)", "after": "The current table contains legislators classified as current in this dataset. current.gender_bio = 'M' denotes male. current-terms.party records the latest party during a term; party_affiliations records within-term changes. current-terms.start and end use YYYY-MM-DD; end is the last date of service."}}} {"question_id": 4792, "split": "train", "changes": {"question": {"before": "What percentage of historical senators were from class 1?", "after": "What percentage of historical senators served at least one term in class 1?"}, "evidence": {"before": "senator refers to type = 'sen'; class 1 refers to class = 1; calculation = MULTIPLY(DIVIDE(COUNT(class = 1), COUNT(bioguide)), 100.0)", "after": "historical senators refers to rows of `historical-terms` with type = 'sen'; served at least one term in class 1 refers to class = 1; percentage = DIVIDE(COUNT(DISTINCT bioguide with class = 1), COUNT(DISTINCT bioguide)) * 100"}, "SQL": {"before": "SELECT SUM(CASE WHEN class = 1 THEN 1 ELSE 0 END) * 100.0 / COUNT(*) FROM (SELECT DISTINCT bioguide, class FROM `current-terms` WHERE type = 'sen' )", "after": "SELECT 100.0 * COUNT(DISTINCT CASE WHEN class = 1 THEN bioguide END) / COUNT(DISTINCT bioguide) FROM `historical-terms` WHERE type = 'sen'"}}} {"question_id": 4813, "split": "validation", "changes": {"question": {"before": "List out the first name of current legislators who are senior Senator.", "after": "List the first names of current legislators who have served as senior senators."}, "evidence": {"before": "senior refers to state_rank = 'senior'; only senator has this value 'senior'", "after": "current-terms.state_rank = 'senior' denotes senior senator. For completed terms, this is rank at the term’s end."}}} {"question_id": 4829, "split": "train", "changes": {"question": {"before": "List the full name of current legislators whose born in 1960.", "after": "List the official full names of current legislators born in 1960."}, "evidence": {"before": "full name refers to official_full_name; born in 1960 refers to birthday_bio like '1960%';", "after": "current.birthday_bio is the birth date, stored as YYYY-MM-DD."}}} {"question_id": 4850, "split": "train", "changes": {"question": {"before": "How many current legislators are not senator?", "after": "How many current legislators are not senators?"}, "evidence": {"before": "not senator refers to class is null;", "after": "The supplied convention identifies nonsenators by a missing class in current-terms.class."}}} {"question_id": 4857, "split": "train", "changes": {"question": {"before": "List all the junior senators in 2009.", "after": "List the first and last names of senators who were junior senators during 2009."}, "evidence": {"before": "junior senators refers to state_rank = 'junior'; in 1997 refers to start like '1997%';", "after": "current-terms.state_rank and historical-terms.state_rank use 'junior' for a junior senator; for completed terms, rank is recorded at the term’s end. The terms tables record service start and end dates; end is the last date of service. current-terms dates use YYYY-MM-DD."}}} {"question_id": 4878, "split": "validation", "changes": {"question": {"before": "List the official full names of all the current legislators that have served 3 districts for 26 consecutive years.", "after": "Which legislators listed as current have exactly 13 consecutive House terms recorded and represented three different congressional districts during that time? List their official full names."}, "evidence": {"before": "served only one district for 26 consecutive years refers to SUM(SUBTRACT(cast(strftime('%Y', end)), CAST(strftime('%Y', start)))) = 26", "after": "Current legislators are those listed in current; official names are recorded in official_full_name. House terms are marked type = 'rep' in current-terms. For this question, a term means one two-year congressional period, including any recorded partial or ongoing term. Exactly 13 refers to all of the legislator’s recorded House terms. Consecutive means no congressional period is skipped; later swearing-in dates do not break the sequence. Districts are identified by their state and district number."}, "SQL": {"before": "WITH summary AS (\n SELECT bioguide,\n COUNT(DISTINCT district) AS dist_cnt,\n SUM(CAST(strftime('%Y', end) AS INT) -\n CAST(strftime('%Y', start) AS INT)) AS total_years,\n MIN(CAST(strftime('%Y', start) AS INT)) AS first_year,\n MAX(CAST(strftime('%Y', end) AS INT)) AS last_year\n FROM `current-terms`\n WHERE type = 'rep'\n GROUP BY bioguide\n HAVING dist_cnt = 3\n AND total_years = 26\n AND last_year - first_year = 26\n)\nSELECT c.`official_full_name`\nFROM summary s\nJOIN `current` c ON c.`bioguide_id` = s.bioguide;", "after": "WITH house_terms AS (\n SELECT bioguide, state, district,\n CAST(strftime('%Y', start) AS INTEGER)\n - CASE\n WHEN CAST(strftime('%Y', start) AS INTEGER) % 2 = 0 THEN 1\n WHEN strftime('%m-%d', start) < '01-03' THEN 2\n ELSE 0\n END AS term_year\n FROM `current-terms`\n WHERE type = 'rep'\n), periods AS (\n SELECT DISTINCT bioguide, term_year\n FROM house_terms\n), ordered_periods AS (\n SELECT bioguide, term_year,\n LAG(term_year) OVER (PARTITION BY bioguide ORDER BY term_year) AS previous_term_year\n FROM periods\n), tenure AS (\n SELECT bioguide\n FROM ordered_periods\n GROUP BY bioguide\n HAVING COUNT(*) = 13\n AND SUM(CASE\n WHEN term_year IS NULL THEN 1\n WHEN previous_term_year IS NULL THEN 0\n WHEN term_year = previous_term_year + 2 THEN 0\n ELSE 1\n END) = 0\n), districts AS (\n SELECT DISTINCT bioguide, state, district\n FROM house_terms\n WHERE state IS NOT NULL AND district IS NOT NULL\n), district_counts AS (\n SELECT bioguide\n FROM districts\n GROUP BY bioguide\n HAVING COUNT(*) = 3\n)\nSELECT c.official_full_name\nFROM current AS c\nINNER JOIN tenure AS t ON c.bioguide_id = t.bioguide\nINNER JOIN district_counts AS d ON c.bioguide_id = d.bioguide"}}} {"question_id": 4897, "split": "train", "changes": {"question": {"before": "What is the full official name of the current legislator that has served for the most number of terms?", "after": "What is the full official name of the current legislator who has served the most terms?"}, "evidence": {"before": "served for the most number of terms refers to MAX(COUNT(bioguide));", "after": "the terms a current legislator has served refers to their COUNT of current-terms rows; served the most terms refers to that count being the maximum among current legislators; return current.official_full_name"}}} {"question_id": 4903, "split": "train", "changes": {"question": {"before": "How many of the legislators are female?", "after": "How many female legislators are listed across the current and historical records?"}, "evidence": {"before": "female refers to gender_bio = 'F';", "after": "current and historical record legislators; gender_bio = 'F' denotes female. bioguide_id identifies a legislator."}}} {"question_id": 4924, "split": "train", "changes": {"question": {"before": "For how many times has London held the Olympic games?", "after": "How many times has London hosted the Olympic Games?"}, "evidence": {"before": "London refers to city_name = 'London'; how many times refer to COUNT(games_id);", "after": "London refers to city.city_name = 'London'; how many times London has hosted refers to COUNT(DISTINCT games) in games_city for that city"}}} {"question_id": 4927, "split": "train", "changes": {"question": {"before": "Which sport does the event \"Shooting Women's Trap\" belong to? List the sport names.", "after": "Which sport does the event “Shooting Women’s Trap” belong to?"}, "evidence": {"before": "sport refers to sport_name; event \"Shooting Women's Trap\" refers to event_name = 'Shooting Women''s Trap';", "after": "sport.sport_name records the sport; event.event_name records event names, including Shooting Women’s Trap."}}} {"question_id": 4952, "split": "validation", "changes": {"evidence": {"before": "1992 Summer Olympics refer to games_name = '1928 Summer';", "after": "1992 Summer Olympics refers to games_name = '1992 Summer'."}}} {"question_id": 4959, "split": "train", "changes": {"question": {"before": "What is the name of the competitor who has won the most medals?", "after": "Who won the most medals across all their Olympic Games appearances? Give their name."}, "evidence": {"before": "name of the competitor refers to full_name; won the most medals refer to MAX(COUNT(medal_id));", "after": "medals won by a competitor refers to the COUNT of that person's competitor_event records across all their Games appearances whose medal_id identifies a medal apart from 4, which denotes no medal; the most medals refers to the MAX of those counts; return the full_name of every competitor whose count is that MAX"}}} {"question_id": 4961, "split": "train", "changes": {"question": {"before": "What is the name of all the sports Chin Eei Hui has competed in?", "after": "What sports has Chin Eei Hui competed in?"}, "evidence": {"before": "name of the sport refers to sport_name;", "after": "Chin Eei Hui is recorded in person.full_name as 'Chin Eei Hui'; sport.sport_name records sport names."}}} {"question_id": 4969, "split": "train", "changes": {"evidence": {"before": "DIVIDE(COUNT(person_id where gender = 'F), COUNT(person_id))*100 as percentage where event_name = 'Equestrianism Mixed Three-Day Event, Individual';", "after": "the population is the distinct people who participated, counted once each however many times they are entered; percentage of women = DIVIDE(COUNT(distinct participants where gender = 'F'), COUNT(distinct participants))*100 where event_name = 'Equestrianism Mixed Three-Day Event, Individual';"}}} {"question_id": 5009, "split": "train", "changes": {"question": {"before": "How many 20 years old athletes were there in the 1984 Summer Olympic Games?", "after": "How many 20-year-old athletes competed in the 1984 Summer Olympic Games?"}, "evidence": {"before": "20 years old athletes refer to person_id where age = 20; 1984 Summer Olympic Games refer to games_name = '1984 Summer';", "after": "games.games_name uses '1984 Summer'; games_competitor.age records a competitor’s age at those Games."}}} {"question_id": 5017, "split": "train", "changes": {"question": {"before": "What is the percentage of athletes from Vanuatu who are taller than 175 and have recorded weight?", "after": "Among athletes from Vanuatu with both height and weight recorded, what percentage are taller than 175 cm? Round your answer to 2 decimal places."}, "evidence": {"before": "DIVIDE(COUNT(id where height > 175), COUNT(id))*100 as percentage where region_name = 'Vanuatu';", "after": "athletes from Vanuatu refers to region_name = 'Vanuatu'; with both height and weight recorded refers to height <> 0 AND weight <> 0, since missing or zero values are unrecorded; percentage taller than 175 = DIVIDE(COUNT(DISTINCT athletes with height > 175), COUNT(DISTINCT athletes)) * 100; round the final answer to 2 decimal places"}, "SQL": {"before": "SELECT 100.0 * COUNT(DISTINCT CASE WHEN p.height > 175 THEN p.id END) /\n COUNT(DISTINCT CASE WHEN p.height <> 0 THEN p.id END) AS percentage\nFROM noc_region nr\nJOIN person_region pr ON pr.region_id = nr.id\nJOIN person p ON p.id = pr.person_id\nWHERE nr.region_name = 'Vanuatu';", "after": "SELECT ROUND(100.0 * COUNT(DISTINCT CASE WHEN p.height > 175 THEN p.id END) /\n COUNT(DISTINCT p.id), 2) AS percentage\nFROM noc_region AS nr\nINNER JOIN person_region AS pr ON pr.region_id = nr.id\nINNER JOIN person AS p ON p.id = pr.person_id\nWHERE nr.region_name = 'Vanuatu'\n AND p.height <> 0\n AND p.weight <> 0;"}}} {"question_id": 5018, "split": "train", "changes": {"evidence": {"before": "AVG(weight) where region_name = 'Tonga' and gender = 'M';", "after": "male athletes from Tonga refers to person.gender = 'M' among the athletes whose noc_region.region_name = 'Tonga'; average weight = AVG(person.weight) over those athletes, leaving out weight = 0 because zero denotes an unrecorded weight"}}} {"question_id": 5028, "split": "train", "changes": {"question": {"before": "How many male competitors were there who participated in 1948 Summer?", "after": "How many male competitors participated in the 1948 Summer Olympics?"}, "evidence": {"before": "male competitors refers to id where gender = 'M'; in 1948 Summer refers to games_name = '1948 Summer';", "after": "games.games_name uses '1948 Summer'; person.gender = 'M' denotes male."}}} {"question_id": 5038, "split": "validation", "changes": {"question": {"before": "What are the id of the games held in London?", "after": "What are the IDs of the games held in London?"}, "evidence": {"before": "London refers to city_name = 'London';", "after": "Host cities are recorded in city.city_name, including 'London'; games_city.games_id identifies the hosted Games."}}} {"question_id": 5045, "split": "validation", "changes": {"question": {"before": "List out the id of event that achieve the gold medal.", "after": "List the IDs of events where a gold medal was awarded."}, "evidence": {"before": "the gold medal refers to medal_name = 'Gold';", "after": "medal.medal_name = 'Gold' denotes a gold medal."}}} {"question_id": 5048, "split": "train", "changes": {"question": {"before": "Which regions are the majority of the athletes from?", "after": "Which regions are most athletes from?"}, "evidence": {"before": "region refers to region_name; the majority of the athletes from refer to MAX(COUNT(region_name));", "after": "the athletes from a region refers to its person_region associations; the most refers to the maximum COUNT of those associations over all regions; return every noc_region.region_name whose count equals that maximum"}}} {"question_id": 5060, "split": "train", "changes": {"evidence": {"before": "DIVIDE(COUNT(competitor_id where medal_name = 'Bronze'), COUNT(competitor_id)) as percentage where event_name = 'Basketball Men''s Basketball';", "after": "men's basketball refers to event_name = 'Basketball Men''s Basketball'; medal_name = 'NA' means no medal was awarded and is not a medal won; percentage bronze = DIVIDE(COUNT(medal_name = 'Bronze'), COUNT(medal_name != 'NA')) * 100"}}} {"question_id": 5074, "split": "validation", "changes": {"question": {"before": "What is the season of the game where a competitor who weighted 73 kg and 180 cm tall, participated?", "after": "What was the season of the game in which a competitor weighing 73 kg and standing 180 cm tall participated?"}, "evidence": {"before": "competitor who weighted 73 kg and 180 cm tall refers to person_id where height = 180 and weight = 73;", "after": "person.height records height in centimeters; person.weight records weight in kilograms. games.season records the season."}}} {"question_id": 5108, "split": "train", "changes": {"question": {"before": "What are the top 3 states with the highest Asian population? List their full names and the abbreviations of their states for all the representatives in the said states.", "after": "For the three states with the highest total Asian population, list each representative’s state abbreviation, followed by their first and last names."}, "evidence": {"before": "city with highest asian population refers to Max(Sum(asian_population)); full name refers to first_name, last_name", "after": "the three states with the highest total Asian population refers to grouping zip_data by state, ordering by SUM(asian_population) descending and taking the top 3; zip_data.state matches congress.abbreviation; return the state abbreviation followed by first_name and last_name for every representative in those states"}, "SQL": {"before": "WITH top_states AS (SELECT t.state FROM zip_data AS T INNER JOIN congress AS T1 ON t.state = T1.abbreviation GROUP BY t.state ORDER BY SUM(t.asian_population) DESC LIMIT 3)\nSELECT T1.state, first_name, last_name FROM top_states T1 JOIN congress T2 WHERE T1.state = T2.abbreviation", "after": "WITH top_states AS (SELECT state FROM zip_data GROUP BY state ORDER BY SUM(asian_population) DESC LIMIT 3) SELECT T1.state, T2.first_name, T2.last_name FROM top_states AS T1 INNER JOIN congress AS T2 ON T1.state = T2.abbreviation;"}}} {"question_id": 5119, "split": "train", "changes": {"question": {"before": "Give the name and the position of the cbsa officer from the area with the zip code 45503.", "after": "What CBSA is ZIP code 45503 in, and where is that ZIP code located?"}, "evidence": {"before": "position refers to latitude, longitude", "after": "CBSA means Core-Based Statistical Area; its name is recorded in CBSA_name. ZIP-code locations are given by latitude and longitude in zip_data."}}} {"question_id": 5135, "split": "validation", "changes": {"question": {"before": "What is the percentage ratio between Democrats and Republicans in Indiana?", "after": "For Indiana, what is the ratio of Democratic to Republican congressional representatives, expressed as a percentage?"}, "evidence": {"before": "\"Democrats\" and \"Republicans\" refers to party = 'Democrat\" and party = 'Republican'; percentage ratio = Multiply (Divide (Count(party = 'Democrat\"), Count(party = 'Republican')), 100)", "after": "The congress table records representatives, their state, and party names Democrat and Republican."}}} {"question_id": 5142, "split": "train", "changes": {"question": {"before": "What is the state abbreviation for area code of 787?", "after": "What state abbreviation corresponds to area code 787?"}}} {"question_id": 5143, "split": "train", "changes": {"question": {"before": "List all representatives of districts which have more than 30 000 population in 2020.", "after": "List the first and last names of representatives whose districts have a total recorded ZIP-code population over 30,000 in 2020."}, "evidence": {"before": "more than 30000 population in 2020 refers to population_2020 > 30000; representative refers to first_name, last_name", "after": "zip_data.population_2020 records population per ZIP code. zip_congress associates ZIP codes with districts; congress.first_name and last_name record representatives’ names."}}} {"question_id": 5154, "split": "train", "changes": {"question": {"before": "Give the area code of the city with the white population ranging between 1700 to 2000.", "after": "Which area codes serve ZIP codes with a white population between 1,700 and 2,000?"}, "evidence": {"before": null, "after": "White population is recorded in zip_data.white_population for each ZIP code. Area codes are recorded in area_code.area_code."}}} {"question_id": 5162, "split": "train", "changes": {"question": {"before": "What is the difference in the number of cities with P.O. box only and cities with Post Office among the cities with area code 787?", "after": "For cities with area code 787, how many more have a P.O. Box Only ZIP code than have a Post Office ZIP code?"}, "evidence": {"before": "SUBTRACT(COUNT(type = 'P.O. Box Only'), COUNT(type = 'Post Office')) where area_code = 787;", "after": "area code 787 refers to area_code.area_code = 787; a city refers to a DISTINCT city and state; how many more refers to SUBTRACT(COUNT(DISTINCT cities of zip_data.type = 'P.O. Box Only'), COUNT(DISTINCT cities of zip_data.type = 'Post Office')) for the cities with area code 787"}}} {"question_id": 5177, "split": "train", "changes": {"question": {"before": "What are the zip code for the House?", "after": "Which ZIP codes are linked to a member of the House of Representatives in the database?"}, "evidence": {"before": "House of Repsentatives can stand for the House", "after": "congress.House uses the label 'House of Repsentatives'. zip_congress.district identifies the representative in congress.cognress_rep_id."}}} {"question_id": 5189, "split": "train", "changes": {"question": {"before": "What are the full names of the states with an above-average female population?", "after": "Which states have a total female population above the average state total? Give their full names."}, "evidence": {"before": "above-average female population refers to female_population > DIVIDE(SUM(female_population), COUNT(state));", "after": "a state's total female population refers to SUM(zip_data.female_population) over its zip_data records; the average state total refers to AVG of those per-state totals; return the full name of each state whose total is above that average"}}} {"question_id": 5196, "split": "train", "changes": {"question": {"before": "Which state has the most bad aliases? List its name.", "after": "Which state or territory has the most recorded bad ZIP-code aliases? Give its abbreviation."}, "evidence": {"before": "the most bad aliases refer to MAX(COUNT(bad_alias));", "after": "avoid.bad_alias records an incorrect ZIP-code alias; zip_data.state records the state or territory abbreviation."}}} {"question_id": 5198, "split": "train", "changes": {"question": {"before": "Which states have greater than 20 CBSA officers of metro type? List their names.", "after": "Which states contain ZIP codes in more than 20 metropolitan statistical areas? List their state abbreviations."}, "evidence": {"before": "greater than 20 CBSA officers of metro type refers to COUNT(DISTINCT CBSA WHERE CBSA_type = 'Metro') > 20;", "after": "metropolitan statistical areas refers to CBSA.CBSA_type = 'Metro'; a state's number of them refers to COUNT(DISTINCT CBSA.CBSA) over the zip_data ZIP codes in that state; more than 20 refers to that count > 20; return the zip_data.state abbreviation of each qualifying state"}}} {"question_id": 5200, "split": "train", "changes": {"question": {"before": "Indicate the name of the county with a population greater than 10000 in 2010.", "after": "Which counties include a ZIP code with more than 10,000 residents in 2010? List their names."}, "evidence": {"before": "population greater than 10000 in 2010 refers to population_2010 > 10000;", "after": "zip_data.population_2010 records a ZIP code's 2010 population. Despite its name, country maps ZIP codes to counties through zip_code, county, and state. A ZIP code can be associated with multiple counties."}, "SQL": {"before": "SELECT DISTINCT c_tot.`county`\nFROM (\n SELECT c.`county`, SUM(z.`population_2010`) AS tot_pop\n FROM `country` AS c\n JOIN `zip_data` AS z ON c.`zip_code` = z.`zip_code`\n GROUP BY c.`county`,c.state\n) AS c_tot\nWHERE c_tot.tot_pop > 10000;", "after": "SELECT DISTINCT c.county\nFROM country AS c\nJOIN zip_data AS z ON z.zip_code = c.zip_code\nWHERE z.population_2010 > 10000;"}}} {"question_id": 5201, "split": "train", "changes": {"question": {"before": "Name the county with the largest total number of households in a residential area.", "after": "Which county has the most households across its ZIP codes? Give its name."}, "evidence": {"before": "the largest number of households refers to MAX(households);", "after": "households across a county's ZIP codes refers to SUM(zip_data.households) over the zip_code values linked by country.zip_code, grouped by country.county and country.state; the most refers to the largest such total; give only that top county's name, taking 1"}}} {"question_id": 5210, "split": "train", "changes": {"question": {"before": "Among the listed cities, provide the area code of the city with the largest water area.", "after": "Which area codes belong to the city with the largest water area?"}, "evidence": {"before": "the largest water area refers to MAX(water_area);", "after": "a city's water area refers to SUM(zip_data.water_area) over its ZIP codes, by zip_data.city; the city with the largest water area refers to the city whose total is the maximum of those city totals; the area codes are the area_code.area_code of that city's ZIP codes"}}} {"question_id": 5211, "split": "train", "changes": {"evidence": {"before": "the highest population in year 2020 refers to MAX(SUM(population_2020));", "after": "A city is identified by its city and state values in zip_data. population_2020 gives the population for one ZIP-code record; a city’s population is the combined population of its ZIP-code records."}, "SQL": {"before": "SELECT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.city HAVING SUM(T2.population_2020) = ( SELECT SUM(population_2020) FROM zip_data GROUP BY city ORDER BY SUM(population_2020) DESC LIMIT 1 )", "after": "WITH city_totals AS (SELECT city, state, SUM(population_2020) AS population FROM zip_data GROUP BY city, state) SELECT DISTINCT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code INNER JOIN city_totals AS T3 ON T2.city = T3.city AND T2.state = T3.state WHERE T3.population = (SELECT MAX(population) FROM city_totals)"}}} {"question_id": 5214, "split": "train", "changes": {"question": {"before": "Give the alias of the cities with an Asian population of 7.", "after": "List the aliases of cities with an Asian population of 7."}, "evidence": {"before": "Asian population of 7 refers to asian_population = 7;", "after": "zip_data.asian_population records the Asian population for each ZIP code. A city is identified by zip_data.city and zip_data.state. Its Asian population is the total across ZIP codes sharing that city and state. Alternate names are recorded in alias.alias and linked to ZIP codes through alias.zip_code."}}} {"question_id": 5262, "split": "validation", "changes": {"evidence": {"before": "3 star rating refers to StarRating = 3; Frostie refers to  BrandName = 'Frostie'; if SubscribedToEmailList = 'TRUE', it means the user permit the company to send regular emails to him/her; if SubscribedToEmailList = FALSE', it means the user did not permit the company to send regular emails to him/her; rating on 2014/4/24 refers to ReviewDate = '2014-04-24';", "after": "3 star rating refers to StarRating = 3; Frostie refers to  BrandName = 'Frostie'; if SubscribedToEmailList = 'TRUE', it means the user permit the company to send regular emails to him/her; if SubscribedToEmailList = 'FALSE', it means the user did not permit the company to send regular emails to him/her; rating on 2014/4/24 refers to ReviewDate = '2014-04-24';"}}} {"question_id": 5264, "split": "train", "changes": {"question": {"before": "What is the percentage of 5 star ratings River City brand root beer get?", "after": "What percentage of River City brand root beer reviews received a 5-star rating?"}, "evidence": {"before": "percentage = MULTIPLY(DIVIDE(SUM(BrandID WHERE StarRating = 5), COUNT(BrandID) WHERE BrandName = 'River City'), 1.0); 5 star ratings refers to StarRating = 5; River City refers to BrandName = 'River City';", "after": "River City refers to rootbeerbrand.BrandName = 'River City'; percentage of that brand's root beer reviews with a 5-star rating = DIVIDE(COUNT(CASE WHEN rootbeerreview.StarRating = 5 THEN 1 ELSE NULL END), COUNT(rootbeerreview.StarRating)) * 100"}}} {"question_id": 5268, "split": "validation", "changes": {"question": {"before": "What are the full names of the first top 11 customers?", "after": "What are the first and last names of the first 11 customers that made a purchase?"}, "evidence": {"before": "full name = First, Last; first top 11 customers refers to MIN(FirstPurchaseDate) LIMIT 11;", "after": "FirstPurchaseDate records a customer’s first purchase date. First and Last contain the customer’s name."}}} {"question_id": 5279, "split": "validation", "changes": {"question": {"before": "Among the root beer brands that do not advertise on Facebook and Twitter, which brand has the highest number of purchases?", "after": "Of the root beer brands with neither a Facebook page nor a Twitter account listed, which was purchased most often?"}, "evidence": {"before": "do not advertise on Facebook and Twitter refers to FacebookPage IS NULL AND Twitter IS NULL; highest number of purchases refers to MAX(COUNT(BrandID));", "after": "FacebookPage and Twitter record a brand’s Facebook page and Twitter account. Both must be missing for a brand to qualify. Purchase frequency is measured by the number of transactions."}}} {"question_id": 5284, "split": "train", "changes": {"question": {"before": "List the brands of root beer produced by Dr Pepper Snapple Group. Among all purchases by Dr Pepper Snapple Group between 2014 and 2016, calculate the share of each branch. Represent each share in a percentage.", "after": "For Dr Pepper Snapple Group brands purchased from 2014 through 2016, list each brand and its percentage of those purchase records. Round the percentages to two decimal places."}, "evidence": {"before": "brand of root beer refers to BrandName; produced by Dr Pepper Snapple Group refers to BreweryName = 'Dr Pepper Snapple Group'; percentage of purchases = MULTIPLY(DIVIDE(SUM(BrandID WHERE PurchaseDate > = '2014-01-01' AND PurchaseDate < = '2016-12-31'), COUNT(BrandID) WHERE BreweryName = 'Dr Pepper Snapple Group'), 1.0); between 2014 to 2016 refers to PurchaseDate > = '2014-01-01' AND PurchaseDate < = '2016-12-31;", "after": "Dr Pepper Snapple Group brands refers to rootbeerbrand.BreweryName = 'Dr Pepper Snapple Group'; 2014 through 2016 refers to rootbeer.PurchaseDate falling in the years 2014, 2015 and 2016; each brand's percentage = ROUND(DIVIDE(COUNT(its purchase rows), COUNT(all such rows)) * 100, 2); return BrandName with that percentage"}, "SQL": {"before": "SELECT T1.BrandName, COUNT(*) * 100.0 / (SELECT COUNT(*) FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BreweryName = 'Dr Pepper Snapple Group' AND T2.PurchaseDate >= '2014-01-01' AND T2.PurchaseDate <= '2016-12-31') FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BreweryName = 'Dr Pepper Snapple Group' AND T2.PurchaseDate >= '2014-01-01' AND T2.PurchaseDate <= '2016-12-31' GROUP BY T2.BrandID", "after": "SELECT BrandName, ROUND(pct, 2) FROM (SELECT T1.BrandName, COUNT(*) * 100.0 / (SELECT COUNT(*) FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BreweryName = 'Dr Pepper Snapple Group' AND T2.PurchaseDate >= '2014-01-01' AND T2.PurchaseDate <= '2016-12-31') AS pct FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BreweryName = 'Dr Pepper Snapple Group' AND T2.PurchaseDate >= '2014-01-01' AND T2.PurchaseDate <= '2016-12-31' GROUP BY T2.BrandID)"}}} {"question_id": 5285, "split": "validation", "changes": {"question": {"before": "For brand of root beer has the lowest unit profit available to wholesalers, please Indicate the ID of the customer that has the highest number of purchases of the said brand.", "after": "For the root beer brand or brands with the lowest unit profit, which customer ID had the highest number of purchases?"}, "evidence": {"before": "brand of root beer refers to BrandName; lowest unit profit available to wholesalers refers to MIN(SUBTRACT(CurrentRetailPrice, WholesaleCost)); ID of the customer refers to CustomerID; highest number of purchases refers to MAX(COUNT(CustomerID));", "after": "Unit profit is rootbeerbrand.CurrentRetailPrice minus rootbeerbrand.WholesaleCost. Purchases are recorded in transaction; transaction.CustomerID identifies the customer."}}} {"question_id": 5290, "split": "validation", "changes": {"evidence": {"before": "visa card refers to CreditCardType = 'Visa'; percentage = MULTIPLY(DIVIDE(SUM(CreditCardType = 'Visa'), COUNT(TransactionID)), 1.0);", "after": "Visa refers to CreditCardType = 'Visa'."}}} {"question_id": 5292, "split": "train", "changes": {"question": {"before": "Calculate the percentage of sales done at Sac State American River Courtyard.", "after": "What percentage of sales transactions took place at Sac State American River Courtyard? Round your answer to 3 decimal places."}, "evidence": {"before": "percentage =   MULTIPLY(DIVIDE(COUNT(LocationName = 'Sac State American River Courtyard'), COUNT(LocationID)), 100); Sac State American River Courtyard refers to LocationName = 'Sac State American River Courtyard';", "after": "Sac State American River Courtyard refers to location.LocationName = 'Sac State American River Courtyard'; percentage = DIVIDE(COUNT(transactions at that location), COUNT(all transaction.TransactionID joined to a location)) * 100, rounded to 3 decimal places"}, "SQL": {"before": "SELECT CAST(COUNT(CASE WHEN T2.LocationName = 'Sac State American River Courtyard' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID", "after": "WITH unrounded(value) AS (\nSELECT CAST(COUNT(CASE WHEN T2.LocationName = 'Sac State American River Courtyard' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 5298, "split": "validation", "changes": {"question": {"before": "Which root beers got the most five stars in 2012? Give the brand names of these beers.", "after": "Which root beer brands received the most five-star reviews in 2012? List their names."}, "evidence": {"before": "most five stars refers to MAX(COUNT(StarRating = 5)); in 2012 refers to FirstBrewedYear = 2012;", "after": "Five-star reviews have StarRating = 5; “in 2012” refers to the year of ReviewDate."}}} {"question_id": 5302, "split": "train", "changes": {"evidence": {"before": "male customers refers to Gender = 'M'; Sacramento refers to City = 'Sacramento'; percentage = MULTIPLY(DIVIDE(SUM(BrandID WHERE BrandName = 'Dominion'), COUNT(BrandID) WHERE City = 'Sacramento'), 1.0); Dominion refers to BrandName = 'Dominion'; in 2014 refers to TransactionDate > = 2014-01-01 AND TransactionDate < 2015-01-01;", "after": "customers.Gender = 'M' denotes male; customers.City records 'Sacramento'. rootbeerbrand.BrandName records 'Dominion'; transaction.TransactionDate records purchase date."}}} {"question_id": 5304, "split": "train", "changes": {"question": {"before": "Find and list the full name and email of the customers who used American Express cards in Sac State Union.", "after": "List the first names, last names, and email addresses of customers who used American Express at Sac State Union."}, "evidence": {"before": "full name = First, Last; American Express cards refers to CreditCardType = 'American Express'; Sac State Union refers to LocationName = 'Sac State Union';", "after": "customers.First and customers.Last record first and last names; customers.Email records email. transaction.CreditCardType uses 'American Express'; location.LocationName uses 'Sac State Union'."}}} {"question_id": 5309, "split": "train", "changes": {"question": {"before": "What brands of beer has Peg Winchester reviewed?", "after": "What beer brands did Peg Winchester review?"}, "evidence": {"before": "brands of beer refers to BrandName;", "after": "Brand names are recorded in rootbeerbrand.BrandName; Peg Winchester is recorded in customers.First and customers.Last."}}} {"question_id": 5310, "split": "train", "changes": {"question": {"before": "What brand of beer has been the worst rated most times?", "after": "Which root beer brand received 1-star ratings most often?"}, "evidence": {"before": "brand of beer refers to BrandName; worst rated most times refers to MAX(COUNT(StarRating = 1));", "after": "1-star ratings refers to rootbeerreview.StarRating = 1; return the single rootbeerbrand.BrandName with the greatest COUNT of such reviews, grouped by BrandName"}}} {"question_id": 5311, "split": "train", "changes": {"question": {"before": "What credit card is the most used in the purchase of non-alcoholic beer?", "after": "Which credit card type was used most often to purchase non-alcoholic beer?"}, "evidence": {"before": "credit card that is the most used refers to MAX(COUNT(CreditCardType)); non-alcoholic beer refers to Alcoholic = 'FALSE';", "after": "non-alcoholic beer refers to rootbeerbrand.Alcoholic = 'FALSE'; credit card type refers to transaction.CreditCardType; used most often refers to the CreditCardType with the greatest COUNT of transaction rows for those non-alcoholic brands, returning that one type"}}} {"question_id": 5323, "split": "train", "changes": {"question": {"before": "How many female mailing list subscribers from Sacramento gave a 4-star rating between 1/3/2013 and 10/26/2013?", "after": "How many female mailing-list subscribers from Sacramento gave a 4-star rating between January 3 and October 26, 2013, inclusive?"}, "evidence": {"before": "female refers to Gender = 'F'; mailing list subscribers refers to SubscribedToEmailList = 'TRUE'; Elk Grove refers to City = 'Sacramento'; 4-star rating refers to StarRating = 4; between 1/3/2013 and 10/26/2013 refers to ReviewDate BETWEEN '2013-01-03' AND '2013-10-26';", "after": "Gender F denotes female, and SubscribedToEmailList TRUE denotes an email-list subscriber. ReviewDate is the review date. Rating refers to StarRating."}}} {"question_id": 5327, "split": "train", "changes": {"question": {"before": "What is the average star rating given by female customers to brand ID 10018 from 1/25/2013 to 3/10/2015?", "after": "What is the average star rating female customers gave brand 10018 between January 25, 2013, and March 10, 2015, inclusive?"}, "evidence": {"before": "average star rating = AVG(StarRating); female customers refers to Gender = 'F; from 1/25/2015 to 3/10/2015 refers to ReviewDate BETWEEN '2015-01-25' AND '2015-03-10';", "after": "BrandID identifies the brand; 10018 is the requested brand. Gender = 'F' denotes female. StarRating is the review score, and ReviewDate is the date of the review."}}} {"question_id": 5340, "split": "train", "changes": {"question": {"before": "How many transactions have been made to purchase a root beer brand from California?", "after": "How many transactions purchased a root beer from a brand in California?"}}} {"question_id": 5342, "split": "train", "changes": {"question": {"before": "What is the amount difference between the bottles of root beer whose brand are from Louisiana and Missouri?", "after": "How many more bottled root beer listings are there for Louisiana brands than for Missouri brands?"}, "evidence": {"before": "difference = SUBTRACT(COUNT(ContainerType = 'Bottle' WHERE State = 'LA'), COUNT(ContainerType = 'Bottle' State = 'MO')); bottles refers to ContainerType = 'Bottle'; Louisiana refers to State = 'LA'; Missouri refers to State = 'MO';", "after": "bottled refers to rootbeer.ContainerType = 'Bottle'; Louisiana brands refers to rootbeerbrand.State = 'LA' and Missouri brands to rootbeerbrand.State = 'MO'; how many more refers to SUBTRACT(COUNT(bottled rootbeer listings of LA brands), COUNT(bottled rootbeer listings of MO brands))"}}} {"question_id": 5384, "split": "validation", "changes": {"question": {"before": "Among customers with the last name of Alvarez, who purchased the highest quantity? Report the customer id.", "after": "Among customers with the last name of Alvarez, who purchased the highest total quantity? Report the customer id."}, "evidence": {"before": "highest quantity refers to MAX(Quantity);", "after": "highest quantity refers to the largest SUM(Sales.Quantity) for a customer across all sales;"}}} {"question_id": 5398, "split": "train", "changes": {"question": {"before": "What is the difference in price between HL Mountain Frame - Black, 42 and LL Mountain Frame - Black, 42?", "after": "How much higher is the price of 'HL Mountain Frame - Black, 42' than the price of 'LL Mountain Frame - Black, 42'?"}, "evidence": {"before": "difference = SUBTRACT((Price WHERE Name = 'HL Mountain Frame - Black, 42'), (Price WHERE Name = 'HL Mountain Frame - Black, 42'));", "after": "how much higher refers to SUBTRACT(the unit Products.Price of 'HL Mountain Frame - Black, 42', the unit Products.Price of 'LL Mountain Frame - Black, 42')"}}} {"question_id": 5413, "split": "train", "changes": {"evidence": {"before": "Blade' is name of product;", "after": "'Blade' is name of product;"}}} {"question_id": 5418, "split": "train", "changes": {"question": {"before": "List the first names of customers who have purchased products from sale person id 1.", "after": "List the first names of customers who purchased products from salesperson ID 1."}}} {"question_id": 5431, "split": "validation", "changes": {"question": {"before": "Among customers named Kate, who has the highest quantity? Output his first name and last name", "after": "Among customers with the first name Kate, who bought the most units in total? List their first and last names."}, "evidence": {"before": "highest quantity refers to MAX(Quantity);", "after": "Kate refers to FirstName = 'Kate'; Sales.Quantity records the number of items purchased."}}} {"question_id": 5436, "split": "validation", "changes": {"question": {"before": "Among products bought by Kathryn Deng, what are the names of the products with the highest quantity?", "after": "What are the names of the products Kathryn Deng bought in the greatest total quantity across all her purchases?"}, "evidence": {"before": "highest quantity refers to MAX(Quantity);", "after": "greatest total quantity refers to the largest SUM(Sales.Quantity) for a product across all purchases by Kathryn Deng;"}}} {"question_id": 5443, "split": "train", "changes": {"question": {"before": "What is the name of the most expensive product?", "after": "Which products are tied for the highest price? Give their names."}, "evidence": {"before": "most expensive product refers to MAX(Price);", "after": "the highest price refers to Products.Price = MAX(Price) over all products, so every product tied at that price qualifies; return their Name values"}}} {"question_id": 5450, "split": "train", "changes": {"question": {"before": "How many \"Mountain-500 Black 42\" were sold in total?", "after": "How many units of 'Mountain-500 Black, 42' were sold in total?"}, "evidence": {"before": "Mountain-500 Black 42' is name of product; sold in total = SUM(Quantity);", "after": "units sold refers to Sales.Quantity; how many units of 'Mountain-500 Black, 42' were sold in total refers to SUM(Sales.Quantity) over the sales of 'Mountain-500 Black, 42'"}}} {"question_id": 5452, "split": "validation", "changes": {"evidence": {"before": "Mountain-100 Silver, 38' is name of product;", "after": "'Mountain-100 Silver, 38' is name of product;"}}} {"question_id": 5455, "split": "train", "changes": {"question": {"before": "Among the \"Mountain-500 Black\" product types, which type was purchased the most?", "after": "Which Mountain-500 Black variant was purchased the most?"}, "evidence": {"before": "Mountain-500 Black product types refers to Name like 'Mountain-500 Black%'; purchased the most refers to MAX(SUM(Quantity)); which type refers to product name", "after": "Mountain-500 Black variants refers to Products.Name LIKE 'Mountain-500 Black%'; purchased the most refers to the Name with the greatest SUM(Sales.Quantity), taking the single top one; return that Products.Name"}}} {"question_id": 5458, "split": "train", "changes": {"question": {"before": "How many employees sold over 20,000 quantities of \"Touring-2000 Blue, 50\"?", "after": "How many employees sold more than 20,000 units of \"Touring-2000 Blue, 50\"?"}, "evidence": {"before": "over 20,000 quantities refers to Quantity > 20000; 'Touring-2000 Blue, 50' is name of product;", "after": "Products.Name uses 'Touring-2000 Blue, 50'; Sales.Quantity records units sold and Sales.SalesPersonID identifies the employee making the sale."}}} {"question_id": 5466, "split": "train", "changes": {"question": {"before": "Of the employees who sold Blade, who has the most amount of sales? Report his or her full name.", "after": "Among employees who sold Blade, who had the highest sales amount? Report the full name."}, "evidence": {"before": "Blade' is name of product; most amount of sales refers to MAX(MULTIPLY(Quantity, Price));", "after": "Blade refers to Products.Name = 'Blade'; sales amount refers to MULTIPLY(Sales.Quantity, Products.Price); the highest sales amount refers to the greatest SUM of that amount among the employees who sold Blade; report the full name"}}} {"question_id": 5469, "split": "train", "changes": {"question": {"before": "Find and list the name of products that sold below the average quantity.", "after": "Which products sold fewer units in total than the average per product, including products with no sales? List their names."}, "evidence": {"before": "below the average quantity refers to Quantity < AVG(Quantity);", "after": "a product's total units sold refers to SUM(Sales.Quantity) for its ProductID, taken as 0 when the product has no sales; the average per product refers to AVG of those per-product totals over every product in Products; return Products.Name for each product whose total is below that average"}}} {"question_id": 5485, "split": "train", "changes": {"question": {"before": "Please list the IDs of the menus that are DIYs of the restaurant and have the dish \"Clear green turtle\".", "after": "Please list the IDs of menus without a sponsor that include the dish ‘Clear green turtle’."}, "evidence": {"before": "IDs of the menus refers to menu_id; menus that are DIYs of the restaurant refers to sponsor is null; Clear green turtle is a name of dish;", "after": "Menu.sponsor records a menu’s sponsor; a missing sponsor is represented by NULL. Dish.name records dish names, including 'Clear green turtle'."}}} {"question_id": 5509, "split": "train", "changes": {"question": {"before": "List down the distinct locations of all menus sponsored by Norddeutscher Lloyd Bremen.", "after": "List the distinct locations of all menus sponsored by Norddeutscher Lloyd Bremen."}, "evidence": {"before": "sponsored by Norddeutscher Lloyd Bremen refers to sponsor = 'Norddeutscher Lloyd Bremen';", "after": "Menu.location records a menu’s location; its sponsor is recorded in Menu.sponsor as 'Norddeutscher Lloyd Bremen'."}}} {"question_id": 5518, "split": "train", "changes": {"question": {"before": "List down the name of dishes created in April.", "after": "Which dishes have menu entries created in April? List their names."}, "evidence": {"before": "created in April refers to SUBSTR(created_at, 7, 1) = '4';", "after": "MenuItem.created_at records when a menu entry was created; Dish.name records the dish name."}}} {"question_id": 5524, "split": "train", "changes": {"question": {"before": "List the top five dishes, by descending order, in terms of highest price.", "after": "List the top five dishes in descending order of price."}, "evidence": {"before": "highest price refers to MAX(highest_price);", "after": "Dish.highest_price records a dish’s highest recorded price."}}} {"question_id": 5530, "split": "train", "changes": {"evidence": {"before": "appeared on the menu for more than 100 years = SUBTRACT(last_appeared, first_appeared) > 100;", "after": "appeared on the menu for more than 100 years refers to SUBTRACT(Dish.last_appeared, Dish.first_appeared) > 100, with no endpoint adjustment; only dishes whose first_appeared and last_appeared both lie BETWEEN 1851 AND 2012 count; tally refers to COUNT(*) of those dishes"}}} {"question_id": 5531, "split": "train", "changes": {"question": {"before": "How many dishes have appeared on the menu for less than 5 years?", "after": "How many dishes have valid first and last appearance years spanning fewer than five calendar years, counting both endpoint years?"}, "evidence": {"before": "appeared on the menu in less than 5 years = SUBTRACT(last_appeared, first_appeared) + 1 < 5;", "after": "spanning fewer than five calendar years counting both endpoints refers to SUBTRACT(Dish.last_appeared, Dish.first_appeared) + 1 < 5; valid years refers to first_appeared and last_appeared both BETWEEN 1851 AND 2012; the answer is COUNT(*) of the dishes meeting both"}}} {"question_id": 5556, "split": "train", "changes": {"question": {"before": "Among the menus that include baked apples with cream, who are the sponsors of the menus with the highest price?", "after": "Which menus have the highest total listed price for “Baked apples with cream”? Give their sponsors."}, "evidence": {"before": "baked apples with cream is a name of dish; highest price refers to MAX(price);", "after": "“Baked apples with cream” refers to Dish.name = 'Baked apples with cream'; a menu's total listed price for it refers to SUM(MenuItem.price) over that menu's listings of that dish, grouped by Menu.id; return Menu.sponsor for every menu whose total equals the MAX of those totals"}}} {"question_id": 5577, "split": "train", "changes": {"question": {"before": "What is the average number of dishes per menu page of menu ID12882?", "after": "On average, how many different dishes appear on each page of the menu with ID 12882? Round your answer to 1 decimal place."}, "evidence": {"before": "average number of dishes per menu = DIVIDE(COUNT(dish_id), COUNT(page_count));", "after": "different dishes on a page refers to COUNT(DISTINCT MenuItem.dish_id) for that menu_page_id, counting 0 for a page with no entries; on average per page refers to AVG of those counts, one for each page of the menu with ID 12882, ROUND(that average, 1)"}, "SQL": {"before": "SELECT 1.0 * COUNT(*) / COUNT(DISTINCT mp.id) AS avg_dishes_per_page\nFROM MenuItem mi\nJOIN MenuPage mp ON mi.menu_page_id = mp.id\nWHERE mp.menu_id = 12882;", "after": "WITH unrounded(value) AS (\nSELECT AVG(dishes) FROM (SELECT mp.id,COUNT(DISTINCT mi.dish_id) AS dishes FROM MenuPage mp LEFT JOIN MenuItem mi ON mi.menu_page_id=mp.id WHERE mp.menu_id=12882 GROUP BY mp.id)\n) SELECT ROUND(value, 1) FROM unrounded;"}}} {"question_id": 5587, "split": "train", "changes": {"question": {"before": "What is the maximum weight being transported to New York during a single shipment?", "after": "What is the heaviest shipment sent to New York City?"}, "evidence": {"before": "\"New York\" is the city_name; maximum weight refers to Max(weight)", "after": "New York City refers to city.city_name = 'New York'; the heaviest shipment refers to MAX(shipment.weight) over the shipment rows sent to that destination city"}}} {"question_id": 5605, "split": "train", "changes": {"evidence": {"before": "\"Kenworth\" is the make of truck; average = Divide (Count(ship_id where make = 'Kenworth'), Count(truck_id where make = 'Kenworth))", "after": "\"Kenworth\" is the make of truck; average = Divide (Count(ship_id where make = 'Kenworth'), Count(truck_id where make = 'Kenworth'))"}}} {"question_id": 5631, "split": "validation", "changes": {"question": {"before": "How many cities whose polulation is larger than 50000 have shipment in 2017?", "after": "How many cities with populations over 50,000 had shipments in 2017?"}, "evidence": {"before": "population is larger than 50000 refers to population > 50000", "after": "shipment.city_id is the destination city. shipment.ship_date is when the driver received the shipment, stored as YYYY-MM-DD."}}} {"question_id": 5670, "split": "train", "changes": {"question": {"before": "What is the truck's model year used to ship the ship ID 1245?", "after": "What is the model year of the truck used for shipment ID 1245?"}}} {"question_id": 5684, "split": "train", "changes": {"question": {"before": "Name the longest Catalan language Wikipedia page title and state the number of different words in this page.", "after": "Which Catalan-language Wikipedia pages have the longest titles? List their titles and character counts."}, "evidence": {"before": "longest title refers to max(length(title))", "after": "the longest titles refers to LENGTH(pages.title) = MAX(LENGTH(title)) over all rows of pages, counting characters including spaces and punctuation; return both the title and its character count LENGTH(title), for every page tied at that maximum"}, "SQL": {"before": "SELECT `title`, `words` FROM `pages` WHERE LENGTH(`title`) = (SELECT MAX(LENGTH(`title`)) FROM `pages`)", "after": "SELECT `title`, LENGTH(`title`) AS title_character_count FROM `pages` WHERE LENGTH(`title`) = (SELECT MAX(LENGTH(`title`)) FROM `pages`);"}}} {"question_id": 5685, "split": "train", "changes": {"question": {"before": "List all the Catalan language wikipedia page title with less than 10 number of different words in these pages.", "after": "List the titles of Catalan Wikipedia pages containing fewer than 10 distinct words."}, "evidence": {"before": "less than 10 number of different words refers to words < 10", "after": "pages.lid = 1 denotes Catalan. pages.words counts distinct words in page content, not in the title."}}} {"question_id": 5696, "split": "train", "changes": {"question": {"before": "In the Catalan language, which biwords pair appeared the most in this language/page?", "after": "Which word pairs occur most often in the Catalan corpus? List both words in each pair, including ties."}, "evidence": {"before": "biwords pair refers to w1st.word w2nd.word; appeared the most refers to max(occurrences)", "after": "the Catalan corpus refers to biwords.lid = 1; occur most often refers to biwords.occurrences = MAX(occurrences) over the lid = 1 rows; return both words of each such pair as words.word, the w1st word then the w2nd word, including ties"}}} {"question_id": 5714, "split": "train", "changes": {"question": {"before": "What are the occurrence of word \"del\" in title \"Any anomalístic\"?", "after": "How many occurrences of the word ‘del’ are associated with the page titled ‘Any anomalístic’?"}, "evidence": {"before": null, "after": "pages.title records the page title; words.word records the word. pages_words.occurrences records occurrences of that word on that page."}}} {"question_id": 5718, "split": "validation", "changes": {"question": {"before": "List down the revision page id of pages where \"fresc\" appears.", "after": "List the revision page IDs of pages where \"fresc\" appears."}, "evidence": {"before": "revision page id refers to revision; \"fresc\" refers to word = 'fresc'", "after": "Revision identifiers are recorded in pages.revision; the word is recorded in words.word as 'fresc'."}}} {"question_id": 5733, "split": "train", "changes": {"evidence": {"before": "Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word;  w1st = word = 'fukunaga' or w2nd = word = 'fukunaga'; w1st = word = 'd'egees'or w2nd = word = 'd'egees';", "after": "Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word;  w1st = word = 'fukunaga' or w2nd = word = 'fukunaga'; w1st = word = 'd''egees' or w2nd = word = 'd''egees';"}}} {"question_id": 5804, "split": "validation", "changes": {"question": {"before": "How many times of repetition does the word \"exemple\" show in the Catalan language?", "after": "How many occurrences does the word \"exemple\" have in Catalan?"}, "evidence": {"before": "exemple refers to word = 'exemple'; repetition refers to langs_words.occurrences; lid = 1 menas it's Catalan language", "after": "langs_words.occurrences records a word’s occurrence count for a language; lid = 1 denotes Catalan. The word is words.word = 'exemple'."}}} {"question_id": 5826, "split": "train", "changes": {"question": {"before": "For the flight on 2018/8/1 that was delayed for the longest time, which was the destination airport of this flight?", "after": "What are the destination airport names for the flights with the longest departure delay on August 1, 2018?"}, "evidence": {"before": "on 2018/8/1 refers to FL_DATE = '2018/8/1';  delayed for the longest time refers to MAX(DEP_DELAY); destination airport refers to DEST;", "after": "on August 1, 2018 refers to Airlines.FL_DATE = '2018/8/1'; the longest departure delay refers to MAX(Airlines.DEP_DELAY) over that day's flights; the destination airport name refers to the Airports.Description of the airport that Airlines.DEST identifies; return that Description for every one of those flights whose DEP_DELAY equals the maximum"}}} {"question_id": 5836, "split": "validation", "changes": {"evidence": {"before": "average departure delay time = DIVIDE(SUM(DEP_DELAY), COUNT(Code)); American Airlines Inc. refers to Description = 'American Airlines Inc.: AA';", "after": "American Airlines Inc. refers to Description = 'American Airlines Inc.: AA'. Departure delay is recorded in DEP_DELAY; missing values indicate that no delay measurement was recorded."}}} {"question_id": 5837, "split": "train", "changes": {"question": {"before": "How many flights on average does American Airlines Inc. operate every day in August, 2018?", "after": "How many flights did American Airlines Inc. operate per day on average during August 2018, excluding cancellations?"}, "evidence": {"before": "flights on average = DIVIDE(COUNT(Code), 31); American Airlines Inc. refers to Description = 'American Airlines Inc.: AA'; every day in August, 2018 refers to FL_DATE like '2018/8%';", "after": "American Airlines Inc. refers to Description = 'American Airlines Inc.: AA'; during August 2018 refers to Airlines.FL_DATE LIKE '2018/8%'; excluding cancellations refers to CANCELLED = 0; flights per day on average = DIVIDE(COUNT(those flights), 31.0), 31 being the days of August"}}} {"question_id": 5842, "split": "train", "changes": {"question": {"before": "Tell the number of fights landed earlier on Miami Airport on 2018/8/12.", "after": "How many flights landed early at Miami Airport on 2018/8/12?"}}} {"question_id": 5847, "split": "train", "changes": {"question": {"before": "Provide the name of the airport which landed the most number of flights on 2018/8/15.", "after": "Provide the name of the airport where the most flights landed on 2018/8/15."}, "evidence": {"before": "name of the airport refers to Description; airport that landed the most number of flights refers to MAX(COUNT(DEST)); on 2018/8/15 refers to FL_DATE = '2018/8/15';", "after": "landed on 2018/8/15 refers to Airlines.FL_DATE = '2018/8/15'; the airport where a flight landed refers to the Airports row that Airlines.DEST identifies; the most flights refers to the arrival airport with the greatest COUNT of those flights, taking the top 1; provide that airport's Airports.Description"}}} {"question_id": 5852, "split": "train", "changes": {"question": {"before": "What is the percentage of flights which landed at Pittsburgh were faster than scheduled?", "after": "Among flights arriving in Pittsburgh with both actual and scheduled flight durations recorded, what percentage took less time than scheduled?"}, "evidence": {"before": "percentage = MULTIPLY(DIVIDE(SUM(ACTUAL_ELAPSED_TIME < T2.CRS_ELAPSED_TIME), COUNT(Code)), 100); landed at refers to DEST; Pittsburgh refers to Description which contains 'Pittsburgh'; faster than scheduled refers to ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME;", "after": "arriving in Pittsburgh refers to flights whose Airlines.DEST identifies an Airports row with Description LIKE '%Pittsburgh%'; restrict to flights with Airlines.ACTUAL_ELAPSED_TIME IS NOT NULL AND Airlines.CRS_ELAPSED_TIME IS NOT NULL; took less time than scheduled refers to ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME; percentage = DIVIDE(SUM(CASE WHEN ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME THEN 1 ELSE 0 END), COUNT(*)) * 100"}}} {"question_id": 5862, "split": "train", "changes": {"SQL": {"before": "SELECT T2.TAIL_NUM FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE LIKE '2018/8%' AND T1.Description = 'Bakersfield, CA: Meadows Field' AND T2.DEST = 'BFL' AND T2.ARR_DELAY <= 0 GROUP BY T2.TAIL_NUM", "after": "SELECT T2.TAIL_NUM FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE LIKE '2018/8%' AND T1.Description = 'Bakersfield, CA: Meadows Field' AND T2.ARR_DELAY <= 0 GROUP BY T2.TAIL_NUM"}}} {"question_id": 5869, "split": "train", "changes": {"question": {"before": "Which airport did Republic Airline fly the most from?", "after": "From which airport did Republic Airline operate the most flights?"}, "evidence": {"before": "Republic Airline refers to Description = 'Republic Airline: YX'; fly the most from refers to MAX(COUNT(ORIGIN));", "after": "Republic Airline is recorded in Description as 'Republic Airline: YX'. ORIGIN identifies the departure airport."}}} {"question_id": 5871, "split": "train", "changes": {"question": {"before": "How many hours in total did all of the Delta Air Lines aircraft were delayed due to a late aircraft in August of 2018?", "after": "How many hours of delay did Delta Air Lines flights incur because of late-arriving aircraft in August 2018? Round your answer to 1 decimal place."}, "evidence": {"before": "hours in total = DIVIDE(SUM(LATE_AIRCRAFT_DELAY), 60); Delta Air Lines refers to Description = 'Delta Air Lines Inc.: DL'; delayed due to a late aircraft refers to LATE_AIRCRAFT_DELAY; in August of 2018 refers to FL_DATE like '2018/8/%'; ", "after": "Delta Air Lines refers to `Air Carriers`.Description = 'Delta Air Lines Inc.: DL'; in August 2018 refers to FL_DATE LIKE '2018/8/%'; delay due to a late-arriving aircraft refers to LATE_AIRCRAFT_DELAY in minutes; hours of delay = DIVIDE(SUM(LATE_AIRCRAFT_DELAY), 60), rounded to 1 decimal place"}, "SQL": {"before": " SELECT cast(SUM(`LATE_AIRCRAFT_DELAY`) as REAL)/60\n FROM `Airlines` AS a\n JOIN `Air Carriers` AS c ON c.`Code` = a.`OP_CARRIER_AIRLINE_ID`\n WHERE c.`Description` = 'Delta Air Lines Inc.: DL'\n AND a.`FL_DATE` LIKE '2018/8/%'", "after": "WITH unrounded(value) AS (\nSELECT cast(SUM(`LATE_AIRCRAFT_DELAY`) as REAL)/60\n FROM `Airlines` AS a\n JOIN `Air Carriers` AS c ON c.`Code` = a.`OP_CARRIER_AIRLINE_ID`\n WHERE c.`Description` = 'Delta Air Lines Inc.: DL'\n AND a.`FL_DATE` LIKE '2018/8/%'\n) SELECT ROUND(value, 1) FROM unrounded;"}}} {"question_id": 5891, "split": "train", "changes": {"question": {"before": "Provide the date and tail number of flight with air carrier \"ExpressJet Airlines Inc.: EV\".", "after": "Provide the date and tail number for each flight operated by ExpressJet Airlines Inc.: EV."}}} {"question_id": 5904, "split": "train", "changes": {"evidence": {"before": "flight date refers to FL_DATE; Profit Airlines Inc.: XBH refers to Description = 'Endeavor Air Inc.: 9E'; actual elapsed time below 100 refers to ACTUAL_ELAPSED_TIME < 40", "after": "flight date refers to FL_DATE; Endeavor Air Inc.: 9E refers to Description = 'Endeavor Air Inc.: 9E'; actual elapsed time below 40 refers to ACTUAL_ELAPSED_TIME < 40"}}} {"question_id": 5911, "split": "train", "changes": {"question": {"before": "Among the flights of the air carrier described as American Airlines, what is the percentage of the flights with earlier departure?", "after": "Among all recorded American Airlines flights, what percentage have a recorded departure earlier than scheduled?"}, "evidence": {"before": "American Airlines can be found in Description which contains 'American Airlines'; percentage = MULTIPLY(DIVIDE(SUM(DEP_DELAY < 0), COUNT(DEP_DELAY)), 100.0); earlier departure refers to DEP_DELAY < 0;", "after": "American Airlines refers to Description LIKE '%American Airlines%'; a departure earlier than scheduled refers to DEP_DELAY < 0, since a negative delay means departure before schedule; percentage = DIVIDE(SUM(CASE WHEN DEP_DELAY < 0 THEN 1 ELSE 0 END), COUNT(*)) * 100"}}} {"question_id": 5916, "split": "validation", "changes": {"question": {"before": "What is the name of the publisher that has published the most number of books?", "after": "What is the name of the publisher that published the most books?"}, "evidence": {"before": "name of publisher refers to publisher_name; publisher published the most number of books refers to Max(Count(book_id))", "after": "Publisher names are recorded in publisher.publisher_name."}}} {"question_id": 5924, "split": "train", "changes": {"question": {"before": "Among the book order lines made by Lucas Wyldbore, how many of them are over 300 pages?", "after": "Among Lucas Wyldbore’s book order lines, how many are for books with more than 300 pages?"}, "evidence": {"before": "books have over 300 pages refers to num_pages > 300", "after": "book.num_pages records the number of pages; Lucas Wyldbore is recorded in customer.first_name and customer.last_name."}}} {"question_id": 5957, "split": "train", "changes": {"question": {"before": "What are the names of the publisher that published the most books?", "after": "What are the names of the publishers that published the most books?"}, "evidence": {"before": "name of publisher refers to publisher_name; publisher published the most number of books refers to Max(Count(book_id))", "after": "published the most books refers to the per-publisher COUNT of books equal to the maximum such count over all publishers; return publisher.publisher_name for every publisher holding that maximum"}}} {"question_id": 5960, "split": "train", "changes": {"evidence": {"before": "\"AI Gore\" is the author_name; have less than 400 pages refers to num_pages < 400", "after": "Author names are recorded in author.author_name; book_author links authors to books through author_id and book_id. Page counts are recorded in book.num_pages."}}} {"question_id": 5961, "split": "train", "changes": {"question": {"before": "List the author's and publisher's name of the book published on July 10, 1997.", "after": "List the author and publisher names for books published on July 10, 1997."}}} {"question_id": 5988, "split": "train", "changes": {"question": {"before": "How many percent of orders in 2020 used international shipping?", "after": "What percentage of orders in 2020 used international shipping?"}, "evidence": {"before": "international shipping refers to method_name = 'International'; orders in 2020 refers to order_date = '2020%'; percentage = Divide (Sum(method_name = 'International'), Count(order_id)) * 100", "after": "orders in 2020 refers to the cust_order records whose order_date falls in 2020; international shipping refers to shipping_method.method_name = 'International' for the shipping used by that order; percentage = DIVIDE(SUM(CASE WHEN method_name = 'International' THEN 1 ELSE 0 END), COUNT(*)) * 100 over those 2020 orders"}}} {"question_id": 5995, "split": "train", "changes": {"question": {"before": "Which language is the rarest among all the books?", "after": "Among languages represented in the books, which languages are tied for appearing in the fewest books?"}, "evidence": {"before": "language written in refers to language_name; rarest refers to Min(Count(book_id))", "after": "a language's books refers to the COUNT of book records with that book_language.language_id, counted over languages appearing in the books; the fewest refers to the minimum such count; return every language_name tied at that minimum"}}} {"question_id": 6023, "split": "train", "changes": {"question": {"before": "Among the books that were published by Scholastic, how many were written by J.K Rowling?", "after": "Among the books that were published by Scholastic, how many were written by J.K. Rowling?"}, "evidence": {"before": "\"J.K Rowling\" is the author_name; 'Scholastic' is the publisher_name", "after": "publisher.publisher_name records Scholastic; author.author_name records J.K. Rowling."}}} {"question_id": 6024, "split": "train", "changes": {"evidence": {"before": "published at least 30 books refers to Count(book_id) > = 30", "after": "published at least 30 books refers to COUNT(book.book_id) >= 30 for the publisher, grouping book rows by publisher_id; return publisher.publisher_name for each publisher that meets it"}, "SQL": {"before": "SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_name HAVING COUNT(T2.publisher_name) >= 30", "after": "SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_id, T2.publisher_name HAVING COUNT(T2.publisher_name) >= 30"}}} {"question_id": 6041, "split": "train", "changes": {"evidence": {"before": "under 300 pages refers to num_pages < 300; 'HarperCollins Publishers\" is the publisher_name", "after": "under 300 pages refers to num_pages < 300; 'HarperCollins Publishers' is the publisher_name"}}} {"question_id": 6044, "split": "train", "changes": {"evidence": {"before": "shipped by international method refers to method_name = 'International'; percentage = Divide (Sum(method_name = 'International'), Count(method_name)) * 100", "after": "Kaleena refers to customer.first_name = 'Kaleena'; the international method refers to shipping_method.method_name = 'International'; percentage = DIVIDE(COUNT(orders placed by Kaleena that were shipped by that method), COUNT(orders placed by Kaleena)) * 100"}}} {"question_id": 6058, "split": "train", "changes": {"question": {"before": "Among all orders updated in 2022, identify the percentage that has been returned.", "after": "Among orders with a status update in 2022, what percentage had a Returned update during that year?"}, "evidence": {"before": "order updated in 2022 refers to SUBSTR(status_date, 1, 4) = '2022'; has been returned refers to status_value = 'Returned'; percentage = Divide (Count(status_value = 'Returned'), Count(status_value)) * 100", "after": "orders with a status update in 2022 refers to order_history rows whose status_date falls in 2022; a Returned update refers to order_status.status_value = 'Returned'; percentage = DIVIDE(COUNT(DISTINCT order_id with a Returned update that year), COUNT(DISTINCT order_id with a status update that year)) * 100"}}} {"question_id": 6068, "split": "train", "changes": {"evidence": {"before": "\"Polan\" is the country_name; address refers to street_number, street_name, city", "after": "country.country_name = 'Poland' identifies the country; address.country_id identifies an address's country. address.street_number, address.street_name, and address.city are the requested address components. The question permits ten qualifying addresses."}}} {"question_id": 6069, "split": "train", "changes": {"question": {"before": "What is the shipping method ordered by Nicolette Sadler at 6/29/2020 7:40:07 PM?", "after": "What shipping method did Nicolette Sadler use for the order placed at 6/29/2020 7:40:07 PM?"}}} {"question_id": 6072, "split": "train", "changes": {"question": {"before": "What percentage of books written by Hirohiko make up the number of books published by Viz Media?", "after": "What percentage of Viz Media’s books were written by Hirohiko Araki?"}, "evidence": {"before": "\"Hirohiko Araki\" is the author_name; 'Viz Media' refers to publisher_name='Viz Media'; percentage = Divide (Count(author_name = 'Hirohiko Araki'), Count(book_id)) * 100", "after": "Hirohiko Araki is recorded in author.author_name as 'Hirohiko Araki'; VIZ Media is recorded in publisher.publisher_name as 'VIZ Media'."}}} {"question_id": 6102, "split": "train", "changes": {"question": {"before": "Provide the email of the customers that purchased books with a price range of 3 to 5 dollars.", "after": "Provide the email addresses of customers who purchased books priced from 3 to 5 dollars."}, "evidence": {"before": "books with a price range of 3 to 5 dollars refers to price BETWEEN 3 AND 5", "after": "The purchase price is recorded in order_line.price; customer.email records the customer’s email address."}}} {"question_id": 6137, "split": "train", "changes": {"question": {"before": "What is the average number of inspections did risk level 3 taverns have?", "after": "What was the average number of inspections for risk-level-3 taverns?"}, "evidence": {"before": "risk level 3 refers to risk_level = '3'; tavern refers to facility_type = 'TAVERN'; average number = divide(count(inspection_id), sum(license_no)) where risk_level = '3' and facility_type = 'TAVERN'", "after": "risk-level-3 taverns refers to establishment.facility_type = 'TAVERN' with establishment.risk_level = 3; a tavern's inspections refers to COUNT(inspection_id) for its license_no; the average number of inspections refers to AVG of those per-tavern counts, one count for each such tavern"}}} {"question_id": 6141, "split": "train", "changes": {"question": {"before": "What is the full name of the employee with the lowest salary?", "after": "What is the first and last name of the employee with the lowest salary?"}}} {"question_id": 6145, "split": "train", "changes": {"question": {"before": "When did Renaldi's Pizza had its first inspection?", "after": "When was Renaldi’s Pizza first inspected?"}, "evidence": {"before": "Renaldi's Pizza refers to dba_name = 'RENALDI''S PIZZA'; first inspection refers to min(inspection_date)", "after": "Renaldi's Pizza refers to establishment.dba_name = 'RENALDI''S PIZZA'; first inspected refers to MIN(inspection.inspection_date), the minimum YYYY-MM-DD inspection_date over that establishment's inspection rows"}}} {"question_id": 6151, "split": "train", "changes": {"question": {"before": "What is the assumed name of the business that has the highest total fine in 2014?", "after": "Which business establishments received the highest total fines across their inspections in 2014? List their trading names, including ties."}, "evidence": {"before": "assumed name of business refers to dba_name; the highest total fine refers to max(sum(fine)); in 2014 refers to inspection_date like '2014%'", "after": "in 2014 refers to inspection.inspection_date >= '2014-01-01' AND < '2015-01-01'; total fines refers to SUM(violation.fine) over an establishment's 2014 inspections, grouped by establishment.license_no; the highest refers to the MAX of those totals; return the dba_name of every establishment tied at that maximum"}, "SQL": {"before": "SELECT T.dba_name FROM ( SELECT T1.dba_name, SUM(T3.fine) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE strftime('%Y', T2.inspection_date) = '2014' GROUP BY T1.dba_name ORDER BY SUM(T3.fine) DESC LIMIT 1 ) AS T", "after": "WITH totals AS (\n SELECT e.license_no, e.dba_name, SUM(v.fine) AS total_fine\n FROM establishment AS e\n JOIN inspection AS i ON i.license_no = e.license_no\n JOIN violation AS v ON v.inspection_id = i.inspection_id\n WHERE i.inspection_date >= '2014-01-01'\n AND i.inspection_date < '2015-01-01'\n GROUP BY e.license_no, e.dba_name\n)\nSELECT DISTINCT dba_name FROM totals\nWHERE total_fine = (SELECT MAX(total_fine) FROM totals);"}}} {"question_id": 6156, "split": "train", "changes": {"question": {"before": "What are the full names of the employee who gave the highest amount of fine of all time?", "after": "Which employees had the highest total fines across all their inspections? Give their first and last names."}, "evidence": {"before": "full name refers to first_name, last_name; the highest amount of fine refers to max(sum(fine))", "after": "an employee's total fines refers to SUM(violation.fine) summed across the violations linked to that employee's inspections; the highest refers to the employees whose total equals the MAX of those per-employee totals, so every employee tied at that maximum qualifies; return their first_name and last_name"}}} {"question_id": 6163, "split": "train", "changes": {"question": {"before": "Provide the inspection ID of the establishment named \"PIZZA RUSTICA, INC.\"", "after": "List the inspection IDs for the establishment named \"PIZZA RUSTICA, INC.\""}, "evidence": {"before": "\"PIZZA RUSTICA, INC.\" refers to dba_name = 'PIZZA RUSTICA, INC'", "after": "The establishment is stored as establishment.dba_name = 'PIZZA RUSTICA, INC', without a trailing period."}}} {"question_id": 6167, "split": "train", "changes": {"question": {"before": "How many of the restaurants with the lowest risk level failed the complaint inspection type?", "after": "How many restaurants with recorded risk level 1 have failed a complaint inspection?"}, "evidence": {"before": "restaurant refers to facility_type = 'Restaurant'; the lowest risk level refers to min(risk_level); failed refers to results = 'Fail'; the complaint inspection type refers to inspection_type = 'Complaint'", "after": "restaurants refers to establishment.facility_type = 'Restaurant'; recorded risk level 1 refers to establishment.risk_level = '1'; failed a complaint inspection refers to inspection.inspection_type = 'Complaint' with inspection.results = 'Fail'; how many restaurants refers to COUNT(DISTINCT establishment), each establishment counted only one time"}}} {"question_id": 6172, "split": "validation", "changes": {"question": {"before": "Among the establishments that failed in the inspection, what is the percentage of establishments with the highest risk level?", "after": "Among listed establishments that have failed an inspection, what percentage have the highest recorded risk-level code? Round your answer to 3 decimal places."}, "evidence": {"before": "failed in inspection refers to results = 'Fail'; the highest risk level refers to max(risk_level); percentage = divide(count(license_no where risk_level = max(risk_level)), count(license_no)) * 100% where results = 'Fail'", "after": "establishment lists establishments by license_no and records their numeric risk_level. inspection.results = 'Fail' denotes a failed inspection. Risk-level code refers to the recorded number, not an independently inferred safety classification."}, "SQL": {"before": "WITH failed_establishments AS (\n SELECT DISTINCT `license_no`\n FROM `inspection`\n WHERE `results` = 'Fail'\n),\nrl AS (\n SELECT fe.`license_no`, e.`risk_level`\n FROM failed_establishments fe\n JOIN `establishment` e USING (`license_no`)\n),\nmx AS (\n SELECT MAX(`risk_level`) AS max_risk FROM rl\n)\nSELECT\n CAST(SUM(CASE WHEN rl.`risk_level` = mx.`max_risk` THEN 1 ELSE 0 END) AS REAL) * 100.0 /\n COUNT(*) AS percentage_highest_risk\nFROM rl\nCROSS JOIN mx;", "after": "WITH unrounded(value) AS (\nWITH failed_establishments AS (\n SELECT DISTINCT `license_no`\n FROM `inspection`\n WHERE `results` = 'Fail'\n),\nrl AS (\n SELECT fe.`license_no`, e.`risk_level`\n FROM failed_establishments fe\n JOIN `establishment` e USING (`license_no`)\n),\nmx AS (\n SELECT MAX(`risk_level`) AS max_risk FROM rl\n)\nSELECT\n CAST(SUM(CASE WHEN rl.`risk_level` = mx.`max_risk` THEN 1 ELSE 0 END) AS REAL) * 100.0 /\n COUNT(*) AS percentage_highest_risk\nFROM rl\nCROSS JOIN mx\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 6173, "split": "train", "changes": {"question": {"before": "Among the employees that receive a salary between $75000 to $85000, what is the difference between the number of employees which undergone an inspection that fined 100 and 500?", "after": "Among employees earning between $75,000 and $85,000, what is the difference between the numbers who had an inspection with a $100 fine and a $500 fine?"}, "evidence": {"before": "salary between $75000 and $85000 refers to 75000 < = salary < = 85000; difference = subtract(count(inspection_id where fine = 100), count(inspection_id where fine = 500)) where 75000 < = salary < = 85000", "after": "salary between $75,000 and $85,000 refers to employee.salary BETWEEN 75000 AND 85000; a fine refers to violation.fine on an inspection linked by inspection.employee_id; answer = SUBTRACT(COUNT(DISTINCT employees with at least one fine = 100), COUNT(DISTINCT employees with at least one fine = 500))"}}} {"question_id": 6240, "split": "train", "changes": {"question": {"before": "List down the inspection ID with the inspector's comment \"A certified food service manager must be present in all establishments at which potentially hazardous food is prepared or served. NO CERTIFIED FOOD MANAGER ON DUTY AT THIS TIME FOODS ARE COOKED AND SERVED SERIOUS CITATION ISSUED\" and inspection category of Personnel.", "after": "Which Personnel inspections have the following inspector’s comment, treating multiple consecutive spaces as a single space? List their inspection IDs.\n\n“A certified food service manager must be present in all establishments at which potentially hazardous food is prepared or served. NO CERTIFIED FOOD MANAGER ON DUTY AT THIS TIME FOODS ARE COOKED AND SERVED SERIOUS CITATION ISSUED”"}, "evidence": {"before": "inspector's comment \"A certified food service manager must be present in all establishments at which potentially hazardous food is prepared or served. NO CERTIFIED FOOD MANAGER ON DUTY AT THIS TIME FOODS ARE COOKED AND SERVED SERIOUS CITATION ISSUED\" refers to inspector_comment = 'A certified food service manager must be present in all establishments at which potentially hazardous food is prepared or served.FOUND NO CITY OF CHICAGO SANITATION CERTIFICATE POSTED OR VALID DOCUMENTATION DURING THIS INSPECTION.'; inspection category of Personnel refers to category = 'Personnel'", "after": "Inspector comments are recorded in violation.inspector_comment; inspection_point.category uses 'Personnel'. Repeated spaces are insignificant when matching the quoted comment."}, "SQL": {"before": "SELECT DISTINCT v.`inspection_id` FROM `violation` v JOIN `inspection_point` p ON v.`point_id` = p.`point_id` WHERE p.`category` = 'Personnel' AND v.`inspector_comment` LIKE 'A certified food service manager must be present in all establishments at which potentially hazardous food is prepared or served.%NO CERTIFIED FOOD MANAGER ON DUTY AT THIS TIME FOODS ARE COOKED AND SERVED%'", "after": "WITH RECURSIVE normalized_comments(inspection_id, comment) AS (\n SELECT v.inspection_id, v.inspector_comment\n FROM violation AS v\n JOIN inspection_point AS p ON v.point_id = p.point_id\n WHERE p.category = 'Personnel'\n UNION ALL\n SELECT inspection_id, REPLACE(comment, ' ', ' ')\n FROM normalized_comments\n WHERE INSTR(comment, ' ') > 0\n)\nSELECT DISTINCT inspection_id\nFROM normalized_comments\nWHERE comment = 'A certified food service manager must be present in all establishments at which potentially hazardous food is prepared or served. NO CERTIFIED FOOD MANAGER ON DUTY AT THIS TIME FOODS ARE COOKED AND SERVED SERIOUS CITATION ISSUED';"}}} {"question_id": 6252, "split": "train", "changes": {"question": {"before": "For all transactions for WRAP in August 2016, list the time to achieve highest price and the time to achieve the lowest price.", "after": "For WARP records in August 2016, list the times when the highest and lowest prices were reached."}, "evidence": {"before": "in August 2013 refers to month(date) = 8 AND year(date) = 2013; time to achieve the highest price refers to time_high; time to achieve the lowest price refers to time_low; WRAP refers to name = 'WARP'", "after": "historical.time_high and historical.time_low record when each dated record’s highest and lowest prices occurred, as HH:MM:SS. historical.date uses YYYY-MM-DD."}}} {"question_id": 6260, "split": "train", "changes": {"question": {"before": "Name the coin and date of transactions with the greatest decline in percent change in 1 hour.", "after": "Which coins had the largest one-hour percentage price decline, and on what dates?"}, "evidence": {"before": "the greatest decline in percent change in 1 hour refers to max(percent_change_1h)", "after": "historical.percent_change_1h is the percentage price change from one hour earlier; negative values indicate declines."}}} {"question_id": 6263, "split": "train", "changes": {"question": {"before": "Which crytocurrency was ranked the first by CoinMarketCap on 2013/4/28?", "after": "Which cryptocurrency ranked first on CoinMarketCap on 2013/4/28?"}, "evidence": {"before": "ranked the first refers to cmc_rank = 1; on 2013/4/28 refers to date = '2013-04-28'", "after": "Coin name is coins.name. Historical CoinMarketCap rank is historical.cmc_rank; first place is 1. Historical date is historical.date, and 2013/4/28 is stored as '2013-04-28'."}}} {"question_id": 6273, "split": "train", "changes": {"question": {"before": "Which crytocurrency had a bigger number of coins circulating in the market and in the general public's hands on 2013/4/28, Bitcoin or Litecoin?", "after": "On 2013/4/28, which had more coins in circulation, Bitcoin or Litecoin?"}, "evidence": {"before": "a bigger number of coins circulating in the market refers to max(circulating_supply); on 2013/4/28 refers to date = '2013-04-28'", "after": "on 2013/4/28 refers to historical.date = '2013-04-28'; the two compared coins refer to coins.name IN ('Bitcoin', 'Litecoin'); more coins in circulation refers to the greater historical.circulating_supply on that date; return the coins.name with the greater circulating_supply"}}} {"question_id": 6277, "split": "train", "changes": {"question": {"before": "Please list the names of coins that has been disappeared.", "after": "Please list the names of coins that have disappeared."}, "evidence": {"before": "has disappeared refers to status = 'extinct'", "after": "A coin’s status is coins.status; disappeared coins are stored with status 'extinct'. Coin name is coins.name."}}} {"question_id": 6296, "split": "train", "changes": {"question": {"before": "What's the name of coins that is higher than the price 1 hour ago in May 29,2013? List the names of these coins.", "after": "Which coins showed a one-hour price increase on May 29, 2013? List their names."}, "evidence": {"before": "is higher than the price 1 hour ago refers to percent_change_1h>0; in May 29,2013 refers to date = '2013-05-29'", "after": "historical.percent_change_1h is the percentage change from one hour earlier. historical.date uses YYYY-MM-DD."}}} {"question_id": 6364, "split": "train", "changes": {"question": {"before": "What are the most widely used shipping companies in the United States of America?", "after": "Which shippers handled the most orders for customers in the USA? Give all tied shipper names."}, "evidence": {"before": "most widely used refers to max(count(ShipVia)); shipping company refers to CompanyName; in the United States of America refers to ShipCountry = 'USA'", "after": "customers in the USA refers to Customers.Country = 'USA'; a shipper refers to Shippers.ShipperName joined via Orders.ShipperID; handled the most orders refers to the greatest COUNT(*) of those orders per ShipperName; return every ShipperName tied at that maximum"}}} {"question_id": 6371, "split": "train", "changes": {"question": {"before": "What is the name of the supplier that supplies the most unique products?", "after": "Which supplier supplies the most distinct products?"}, "evidence": {"before": "the most product refers to max(count(DISTINCT ProductID))", "after": "a supplier's products refers to the Products rows carrying that Suppliers.SupplierID, one row per product; supplies the most distinct products refers to the supplier whose COUNT of those products equals the maximum over all suppliers, keeping ties; return Suppliers.SupplierName"}}} {"question_id": 6374, "split": "validation", "changes": {"question": {"before": "What is the most ordered products by customers?", "after": "Which products have the largest total quantity ordered? List their product IDs, including ties."}, "evidence": {"before": "most ordered refers to max(SUM(Quantity)); product refers to ProductID", "after": "OrderDetails.Quantity records units on an order line."}}} {"question_id": 6403, "split": "train", "changes": {"evidence": {"before": "the highest total price paid for an order can be calculated as MAX(MULTIPLY(UnitPrice, Quantity));", "after": "an order's total price refers to SUM(MULTIPLY(Products.Price, OrderDetails.Quantity)) over the OrderDetails records sharing that OrderID, each priced by its own product's Products.Price; the highest total price paid for an order refers to the MAX of those per-order totals"}}} {"question_id": 6437, "split": "validation", "changes": {"question": {"before": "Who is the one representing the supplier \"Heli Swaren GmbH & Co. KG\"?", "after": "Who is the contact representing the supplier \"Heli Süßwaren GmbH & Co. KG\"?"}, "evidence": {"before": "Heli Swaren GmbH & Co. KG is the name of the supplier; who is representing refers to ContactName;", "after": "SupplierName = 'Heli Süßwaren GmbH & Co. KG'; the supplier's representative refers to ContactName."}}} {"question_id": 6472, "split": "train", "changes": {"question": {"before": "What is the contact name for the person who supplied a product that is 10 boxes x 12 pieces.", "after": "What are the supplier contact names for products packaged as 10 boxes x 12 pieces?"}, "evidence": {"before": "\"10 boxes x 12 pieces\" is the Unit", "after": "Products.Unit stores packaging descriptions such as '10 boxes x 12 pieces'. Suppliers.ContactName is the contact person, not the company name."}}} {"question_id": 6475, "split": "train", "changes": {"question": {"before": "List the product ID of the top five products, by descending order, the number of quantities ordered.", "after": "List the IDs of the five products with the highest quantities ordered, in descending order."}, "evidence": {"before": "by descending in number of quantity ordered refers to max(sum(quantity)", "after": "quantities ordered for a product refers to SUM(OrderDetails.Quantity) grouped by OrderDetails.ProductID; the five with the highest refers to ordering those totals in descending order and taking 5; list only the ProductID values in that order"}}} {"question_id": 6482, "split": "train", "changes": {"question": {"before": "Among the distinct seafoods, how many of them have an order quantity of more than 50?", "after": "How many distinct seafood products have an order line with a quantity greater than 50?"}, "evidence": {"before": "\"Seafood\" is the CategoryName; order quantity of more than 50 refers to Quantity > 50", "after": "OrderDetails.Quantity is the quantity on an individual order line."}}} {"question_id": 6503, "split": "train", "changes": {"question": {"before": "Please list the full names of all employees.", "after": "List the first and last names of all employees."}, "evidence": {"before": "full name refers to FirstName, LastName", "after": "First and last names are recorded in FirstName and LastName, respectively."}}} {"question_id": 6516, "split": "train", "changes": {"evidence": {"before": "August of 1996 refers to OrderDate = '1996-8'; highest amount of orders refers to MAX(COUNT(OrderID))", "after": "August of 1996 refers to OrderDate LIKE '1996-08%'; highest amount of orders refers to MAX(COUNT(OrderID))"}}} {"question_id": 6530, "split": "train", "changes": {"evidence": {"before": "in December 1996 refers to year(OrderDate) = 1996 AND month(OrderDate) = 12; total amount of sales refers to MULTIPLY((UnitPrice, Quantity))", "after": "Nancy Davolio refers to Employees.FirstName = 'Nancy' AND Employees.LastName = 'Davolio'; in December 1996 refers to an OrderDate in December 1996; total amount of sales refers to SUM(MULTIPLY(Products.Price, OrderDetails.Quantity)) over the OrderDetails of her Orders"}}} {"question_id": 6541, "split": "train", "changes": {"question": {"before": "List down the customer names and addresses which are located in London.", "after": "List the customer names and addresses located in London."}, "evidence": {"before": "in London refers to City = 'London'", "after": "Customers.CustomerName records customer names; Customers.City uses 'London'."}}} {"question_id": 6562, "split": "train", "changes": {"question": {"before": "Provide calculate the total payment of products in order ID 10359.", "after": "What is the total value of the products in order 10359?"}, "evidence": {"before": "total payment refers to SUM(MULTIPLY(UnitPrice, Quantity))", "after": "the total value of the products in order 10359 refers to SUM(MULTIPLY(Products.Price, the ordered quantities)) over the products in that order, Products.Price being the unit price"}}} {"question_id": 6577, "split": "train", "changes": {"question": {"before": "Identify the total number of orders placed by the customer 'Around the Horn' and it's average value.", "after": "How many orders has Around the Horn placed, and what is the average order value?"}, "evidence": {"before": "Around the Horn refers to CustomerName; calculation = DIVIDE(SUM(UnitPrice * Quantity), COUNT(OrderID))", "after": "Order value uses ordered quantities at the unit prices in Products.Price."}, "SQL": {"before": "WITH order_totals AS (\n SELECT o.`OrderID`,\n SUM(od.`Quantity` * p.`Price`) AS order_value\n FROM `Orders` o\n JOIN `OrderDetails` od ON o.`OrderID` = od.`OrderID`\n JOIN `Products` p ON od.`ProductID` = p.`ProductID`\n JOIN `Customers` c ON o.`CustomerID` = c.`CustomerID`\n WHERE c.`CustomerName` = 'Around the Horn'\n GROUP BY o.`OrderID`\n)\nSELECT COUNT(*) AS total_orders,\n AVG(order_value) AS average_order_value\nFROM order_totals;", "after": "WITH order_totals AS (\n SELECT o.OrderID,\n CASE WHEN COUNT(od.OrderDetailID) = 0 THEN 0.0\n ELSE SUM(od.Quantity * p.Price)\n END AS order_value\n FROM Orders AS o\n INNER JOIN Customers AS c ON o.CustomerID = c.CustomerID\n LEFT JOIN OrderDetails AS od ON o.OrderID = od.OrderID\n LEFT JOIN Products AS p ON od.ProductID = p.ProductID\n WHERE c.CustomerName = 'Around the Horn'\n GROUP BY o.OrderID\n)\nSELECT COUNT(*) AS total_orders,\n AVG(order_value) AS average_order_value\nFROM order_totals;"}}} {"question_id": 6602, "split": "validation", "changes": {"question": {"before": "Calculate the percentage of orders with an order quantity of fewer than 50, out of the total number of orders.", "after": "What percentage of all orders contain fewer than 50 items in total?"}, "evidence": {"before": "order quantity less than 50 refers to SUM(Quantity) < 50; Calculation = DIVIDE(SUM(Quantity < 50), SUM(ProductID)) * 100", "after": "Quantity records the number of items on an order line. Orders with no line items are treated as containing zero items."}}} {"question_id": 6652, "split": "validation", "changes": {"question": {"before": "Name the shipper which had the most shipments in first quarter of 1997.", "after": "Which shippers were assigned the most orders placed in the first quarter of 1997? Give their names, including any ties."}, "evidence": {"before": "Name the shipper refers to ShipperName; most shipments refers to max(count(OrderID)); first quarter of 1997 refers to ShippedDate = 1997/1 and ShippedDate = 1997/2 and ShippedDate = 1997/3", "after": "OrderDate records when an order was placed; shipper names are recorded in ShipperName. The first quarter covers January through March."}}} {"question_id": 6659, "split": "train", "changes": {"question": {"before": "What is the name of the employee who handled order id 10270?", "after": "What are the first and last names of the employee who handled order 10270?"}, "evidence": {"before": "name refers to firstname, lastname", "after": "First and last names are recorded in FirstName and LastName, respectively."}}} {"question_id": 6661, "split": "train", "changes": {"question": {"before": "What is the country where the customer who placed the order id 10276 located?", "after": "In which country is the customer who placed order 10276 located?"}, "evidence": {"before": null, "after": "Orders.OrderID identifies order 10276 and Orders.CustomerID links it to Customers.CustomerID. Customers.Country records the customer’s country."}}} {"question_id": 6697, "split": "train", "changes": {"question": {"before": "Clerk#000000936 dealt with a \"Not Specified\" order on 1995/3/13, what was the charge for the part of the order shipped by truck?", "after": "For the “Not Specified” order handled by Clerk#000000936 on 1995/3/13, what was the charge for the part shipped by truck?"}, "evidence": {"before": "MULTIPLY(MULTIPLY(l_extendedprice, SUBTRACT(1, l_discount)), SUM(1, l_tax)) WHERE o_clerk = 'Clerk#000000936', o_orderpriority = '4-NOT SPECIFIED', o_orderdate = '1995-03-13' AND l_shipmode = 'TRUCK';", "after": "'Not Specified' refers to orders.o_orderpriority = '4-NOT SPECIFIED'; handled by Clerk#000000936 on 1995/3/13 refers to o_clerk = 'Clerk#000000936' AND o_orderdate = '1995-03-13'; shipped by truck refers to lineitem.l_shipmode = 'TRUCK'; charge = SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) over those lineitem rows"}}} {"question_id": 6704, "split": "train", "changes": {"evidence": {"before": "customer with the highest amount of debt refers to c_name where MIN(c_acctbal);", "after": "debt refers to a negative customer.c_acctbal, with more negative balances meaning larger debt; the customer with the highest amount of debt refers to the customer whose c_acctbal equals MIN(c_acctbal); return c_name"}}} {"question_id": 6710, "split": "train", "changes": {"question": {"before": "When was the order with the highest amount of total price shipped?", "after": "List all shipment dates recorded for the order or orders with the highest total price."}, "evidence": {"before": "when shipped refers to l_shipdate; the highest amount of total price refers to MAX(o_totalprice);", "after": "shipment date refers to lineitem.l_shipdate; total price refers to orders.o_totalprice;"}}} {"question_id": 6727, "split": "train", "changes": {"question": {"before": "How many part supplies were nearly out of stock?", "after": "How many supplier listings show a part with fewer than 10 units in stock?"}, "evidence": {"before": "supplies nearly out of stock refer to ps_partkey where ps_availqty < 10;", "after": "A supplier listing represents one part stocked by one supplier. The available quantity is recorded in ps_availqty."}, "SQL": {"before": "SELECT COUNT(DISTINCT ps_suppkey) FROM partsupp WHERE ps_availqty < 10", "after": "SELECT COUNT(*) FROM partsupp WHERE ps_availqty < 10"}}} {"question_id": 6728, "split": "train", "changes": {"question": {"before": "Calculate the percentage of manufactured parts by Manufacturer#3.", "after": "What percentage of all parts were manufactured by Manufacturer#3?"}, "evidence": {"before": "DIVIDE(COUNT(p_partkey where p_mfgr = 'Manufacturer#3')*100, COUNT(p_partkey)) as percentage;", "after": "manufactured by Manufacturer#3 refers to p_mfgr = 'Manufacturer#3'; percentage = DIVIDE(SUM(CASE WHEN p_mfgr = 'Manufacturer#3' THEN 1 ELSE 0 END), COUNT(*) over all part rows) * 100"}}} {"question_id": 6729, "split": "train", "changes": {"question": {"before": "List any five parts name in Medium Plated Brass.", "after": "List any five part names in Medium Plated Brass."}, "evidence": {"before": "p_type = 'MEDIUM PLATED BRASS'; parts name refer to p_name;", "after": "part.p_type uses 'MEDIUM PLATED BRASS'; part.p_name records the part name."}}} {"question_id": 6755, "split": "train", "changes": {"question": {"before": "Among the products that have a retail price greater than 1,000, how many products were shipped via ship?", "after": "How many distinct products with a retail price above 1,000 have been shipped by ship?"}, "evidence": {"before": "products refer to l_partkey; retail price greater than 1,000 refers to p_retailprice > 1000; shipped via ship refers to l_shipmode = 'SHIP';", "after": "part.p_partkey identifies a product; part.p_retailprice is its retail price. lineitem.l_shipmode = 'SHIP' denotes shipment by ship."}}} {"question_id": 6765, "split": "validation", "changes": {"question": {"before": "Calculate the percentage of part supply that costs more than 500.", "after": "What percentage of supplier listings have a supply cost above 500?"}, "evidence": {"before": "DIVIDE(COUNT(ps_suppkey where ps_supplycost > 500)*100, COUNT(ps_suppkey)) as percentage;", "after": "Each partsupp row represents a part offered by a supplier; ps_supplycost records its supply cost."}}} {"question_id": 6779, "split": "train", "changes": {"question": {"before": "Calculate the difference in the average number of low-priority orders shipped by truck in each month of 1995 and 1996.", "after": "What is the difference between the average monthly number of low-priority orders shipped by truck in 1995 and in 1996? Round your answer to 1 decimal place."}, "evidence": {"before": "SUBTRACT(DIVIDE(SUM(l_orderkey where year(l_shipdate) = 1995), 12), DIVIDE(SUM(l_orderkey where year(l_shipdate) = 1996), 12)) where o_orderpriority = '5-LOW';", "after": "low-priority orders shipped by truck refers to orders.o_orderpriority = '5-LOW' and lineitem.l_shipmode = 'TRUCK'; a year's average monthly number refers to DIVIDE(COUNT(DISTINCT such orders with lineitem.l_shipdate in that year), 12); the difference refers to SUBTRACT(the 1995 number, the 1996 number); round the final answer to 1 decimal place"}, "SQL": {"before": "SELECT (COUNT(DISTINCT CASE WHEN STRFTIME('%Y', T2.`l_shipdate`)='1995' THEN T1.`o_orderkey` END)/12.0) - (COUNT(DISTINCT CASE WHEN STRFTIME('%Y', T2.`l_shipdate`)='1996' THEN T1.`o_orderkey` END)/12.0) FROM `orders` AS T1 JOIN `lineitem` AS T2 ON T1.`o_orderkey` = T2.`l_orderkey` WHERE T1.`o_orderpriority`='5-LOW' AND T2.`l_shipmode`='TRUCK'", "after": "SELECT ROUND((COUNT(DISTINCT CASE WHEN STRFTIME('%Y', T2.`l_shipdate`)='1995' THEN T1.`o_orderkey` END)/12.0) - (COUNT(DISTINCT CASE WHEN STRFTIME('%Y', T2.`l_shipdate`)='1996' THEN T1.`o_orderkey` END)/12.0), 1) FROM `orders` AS T1 JOIN `lineitem` AS T2 ON T1.`o_orderkey` = T2.`l_orderkey` WHERE T1.`o_orderpriority`='5-LOW' AND T2.`l_shipmode`='TRUCK'"}}} {"question_id": 6788, "split": "train", "changes": {"question": {"before": "To which segment belongs the customer that made the most orders in April 1994?", "after": "Which segment does the customer who made the most orders in April 1994 belong to?"}, "evidence": {"before": "segment refers to c_mktsegment; customer made the most orders in April 1994 refers to c_custkey where o_orderdate LIKE '1994-04-%' and MAX(COUNT(o_orderkey));", "after": "customer.c_mktsegment records the market segment; orders.o_orderdate records the order date in YYYY-MM-DD form."}}} {"question_id": 6819, "split": "train", "changes": {"evidence": {"before": "customer refers to c_name; the most in debt refers to max(c_acctbal)", "after": "customer refers to c_name; the most in debt refers to min(c_acctbal)"}}} {"question_id": 6839, "split": "validation", "changes": {"evidence": {"before": "order key refers to l_orderkey; not applied for the discount refers to l_discount = 0", "after": "An undiscounted order has no discounted line items. Orders are identified by l_orderkey; a nonzero l_discount indicates a discount on a line item."}}} {"question_id": 6889, "split": "train", "changes": {"question": {"before": "Which part is ordered in a bigger amount in order no.1, \"burnished seashell gainsboro navajo chocolate\" or \"salmon white grey tan navy\"?", "after": "Which part was ordered in a greater quantity in order 1: \"burnished seashell gainsboro navajo chocolate\" or \"salmon white grey tan navy\"?"}, "evidence": {"before": "which part refers to part name; amount refers to sum(l_quantity); order no.1 refers to l_orderkey = 1; \"burnished seashell gainsboro navajo chocolate\" or \"salmon white grey tan navy\" refers to p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate')", "after": "order 1 refers to lineitem.l_orderkey = 1; the two candidates refer to part.p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate'); quantity ordered refers to SUM(l_quantity) per part; return the p_name of the one with the greater total"}}} {"question_id": 6896, "split": "train", "changes": {"question": {"before": "Which market segment does the customer with the highest amount of debt belongs to?", "after": "Which market segment does the customer with the largest debt belong to?"}, "evidence": {"before": "market segment refers to c_mktsegment; the highest amount of debt refers to min(c_acctbal)", "after": "the largest debt refers to the minimum account balance, MIN(c_acctbal); market segment refers to customer.c_mktsegment; return the c_mktsegment where c_acctbal = MIN(c_acctbal)"}}} {"question_id": 6928, "split": "train", "changes": {"question": {"before": "What is the average height in centimeters of all the players in the position of defense?", "after": "What is the average height in centimeters of players whose only listed position is defense? Round your answer to 3 decimal places."}, "evidence": {"before": "average = AVG(height_in_cm); players refers to PlayerName; position of defense refers to position_info = 'D' ;", "after": "players whose only listed position is defense refers to PlayerInfo.position_info = 'D' alone, since slash-separated values denote multiple positions; PlayerInfo.height refers to height_info.height_id, and height_info.height_in_cm gives the height in centimeters; average = DIVIDE(SUM(height_info.height_in_cm), COUNT(those players)), then ROUND to 3 decimal places"}, "SQL": {"before": "SELECT CAST(SUM(T2.height_in_cm) AS REAL) / COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.position_info = 'D'", "after": "WITH unrounded(value) AS (\nSELECT CAST(SUM(T2.height_in_cm) AS REAL) / COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.position_info = 'D'\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 6936, "split": "train", "changes": {"evidence": {"before": "names of the players refers to PlayerName; played for Acadie-Bathurst Titan refers to TEAM = 'AcadieandBathurst Titan'; regular season refers to GAMETYPE = 'Regular Season'; in 1998-1999 refers to SEASON = '1998-1999';", "after": "names of the players refers to PlayerName; played for Acadie-Bathurst Titan refers to TEAM = 'Acadie-Bathurst Titan'; regular season refers to GAMETYPE = 'Regular Season'; in 1998-1999 refers to SEASON = '1998-1999';"}}} {"question_id": 6950, "split": "train", "changes": {"question": {"before": "Among all players drafted by the Toronto Maple Leafs in 2008, identify the player with the highest prospects for the draft.", "after": "What is the name of the player with the highest draft-prospects ranking among those drafted by the Toronto Maple Leafs in 2008?"}, "evidence": {"before": "players refers to PlayerName; drafted by the Toronto Maple Leafs refers to overallby = 'Toronto Maple Leafs'; highest prospects for the draft refers to MIN(CSS_rank);", "after": "drafted by the Toronto Maple Leafs in 2008 refers to PlayerInfo.overallby = 'Toronto Maple Leafs' AND PlayerInfo.draftyear = '2008'; the highest draft-prospects ranking refers to MIN(CSS_rank), because a smaller CSS_rank is a better rank; identify the single player holding it"}}} {"question_id": 6989, "split": "validation", "changes": {"question": {"before": "Which teams have the most Swedish?", "after": "Which teams have the most Swedish players?"}, "evidence": {"before": "Swedish refers to nation = 'Sweden'; team with the most Swedish refers to MAX(TEAM WHERE nation = 'Sweden');", "after": "Swedish players have PlayerInfo.nation = 'Sweden'; SeasonStatus.TEAM records a player’s team."}}} {"question_id": 6994, "split": "train", "changes": {"evidence": {"before": "height in inches refers to height_in_inch; players refers to PlayerName; team Oshawa Generals refers to TEAM = 'Oshawa Generals';", "after": "SeasonStatus.TEAM records 'Oshawa Generals'. PlayerInfo.height identifies the height entry whose height_info.height_in_inch is the height in inches."}}} {"question_id": 6997, "split": "train", "changes": {"evidence": {"before": "percentage = MULTIPLY(DIVIDE(SUM(nation = 'Sweden'), COUNT(ELITEID)) WHERE SEASON = '1997-2000', 100); Swedish refers to nation = 'Sweden'; players refers to PlayerName; playoffs games refers to GAMETYPE = 'Playoffs'; 1997-2000 season refers to 3 consecutive SEASONs : '1997-1998', '1998-1999', '1999-2000';", "after": "PlayerInfo.nation = 'Sweden' identifies Swedish players. SeasonStatus.ELITEID identifies the player; SEASON uses '1997-1998', '1998-1999', and '1999-2000'. GAMETYPE uses 'Playoffs' for playoff records."}}} {"question_id": 7001, "split": "train", "changes": {"question": {"before": "List the names of the products whereby the standard cost is at least $80 more than previous standard cost in history.", "after": "Which products have a standard cost at least $80 higher than their previous standard cost? List their names."}, "evidence": {"before": "SUBTRACT(product.StandardCost, CostHistory.StandardCost)>=80", "after": "Product.StandardCost is the current unit cost; ProductCostHistory.StandardCost is a historical unit cost. ProductCostHistory.StartDate and EndDate use YYYY-MM-DD HH:MM:SS with fractional seconds."}}} {"question_id": 7009, "split": "train", "changes": {"question": {"before": "List all product names that are high in quality. Please also state its selling price.", "after": "List all high-quality product names and their selling prices."}, "evidence": {"before": "High quality refers to the product's quality class, therefore Class = 'H'", "after": "Product.Class = 'H' denotes high quality; Product.ListPrice records the selling price."}}} {"question_id": 7023, "split": "train", "changes": {"question": {"before": "List the names and calculate their profit for products with the highest rating in review.", "after": "List the names and calculate the profit for products with the highest review rating."}, "evidence": {"before": "Profit = SUBTRACT(ListPrice, StandardCost); the highest rating in review refers to MAX(Rating)", "after": "Product.ListPrice is the selling price and Product.StandardCost is the cost; profit is their difference. ProductReview.Rating records the review rating."}}} {"question_id": 7025, "split": "train", "changes": {"question": {"before": "Which currency pairs' average exchange rates for the day are the highest?", "after": "Which currency pairs have the highest recorded daily average exchange rate? Give the source currency code followed by the destination currency code."}, "evidence": {"before": "currency pair refers to FromCurrencyCode/ToCurrencyCode", "after": "CurrencyRate.FromCurrencyCode and CurrencyRate.ToCurrencyCode identify the source and destination currencies. CurrencyRate.AverageRate is the recorded daily average rate."}}} {"question_id": 7027, "split": "train", "changes": {"question": {"before": "Between Northwest and Southeast of the United States, which territory one recorded the highest amount of sales last year?", "after": "Which of these U.S. territories recorded the highest sales last year: Northwest or Southeast?"}, "evidence": {"before": "United States refers to CountryRegionCode = 'US';", "after": "SalesTerritory.SalesLastYear is the recorded previous-year sales total; CountryRegionCode = 'US' denotes U.S. territories."}}} {"question_id": 7045, "split": "train", "changes": {"question": {"before": "How many business enetities have an address that is too long?", "after": "How many business entities have an address that uses a second address line?"}, "evidence": {"before": "address that is too long refers to AddressLine2! = null", "after": "A second address line is present when Address.AddressLine2 is neither NULL nor empty."}}} {"question_id": 7067, "split": "validation", "changes": {"question": {"before": "Please list the ids of employees who have more than 20 vacations hours and wish to receive e-mail promotions.", "after": "Please list the IDs of employees with more than 20 vacation hours who wish to receive email promotions."}, "evidence": {"before": "Contact does wish to receive e-mail promotions refers to EmailPromotion = (1,2); more than 20 vacations hours refers to VacationHours>20", "after": "Person.EmailPromotion values 1 and 2 indicate willingness to receive email promotions; Employee.VacationHours records vacation hours."}}} {"question_id": 7086, "split": "validation", "changes": {"question": {"before": "What is the percentage of orders with quantities not greater than 3 and without a discount?", "after": "What percentage of orders contain at most three items in total and have no discount on any item?"}, "evidence": {"before": "quantities not greater than 3 refers to OrderQty<=3; without a discount refers to UnitPriceDiscount = 0; percentage = DIVIDE(count(SalesOrderID(OrderQty<3 & UnitPriceDiscount = 0)), count(SalesOrderID))*100%", "after": "SalesOrderHeader.SalesOrderID identifies an order. SalesOrderDetail.OrderQty records the quantity on an order line; UnitPriceDiscount records its discount, with 0 meaning no discount. Orders with no detail rows have no items or discounts."}, "SQL": {"before": "WITH total_orders AS (\n SELECT DISTINCT `SalesOrderID`\n FROM `SalesOrderDetail`\n),\nqual_orders AS (\n SELECT DISTINCT `SalesOrderID`\n FROM `SalesOrderDetail`\n WHERE `OrderQty` <= 3\n AND `UnitPriceDiscount` = 0\n)\nSELECT 100.0 * (SELECT COUNT(*) FROM qual_orders)\n / NULLIF((SELECT COUNT(*) FROM total_orders),0) AS percentage;", "after": "WITH order_totals AS (\n SELECT h.SalesOrderID,\n COALESCE(SUM(d.OrderQty), 0) AS total_quantity,\n MAX(CASE WHEN d.UnitPriceDiscount <> 0 THEN 1 ELSE 0 END) AS has_discount\n FROM SalesOrderHeader AS h\n LEFT JOIN SalesOrderDetail AS d ON d.SalesOrderID = h.SalesOrderID\n GROUP BY h.SalesOrderID\n)\nSELECT 100.0 * SUM(CASE WHEN total_quantity <= 3 AND has_discount = 0\n THEN 1 ELSE 0 END) / NULLIF(COUNT(*), 0) AS percentage\nFROM order_totals;"}}} {"question_id": 7091, "split": "train", "changes": {"evidence": {"before": "last receipt date is August 17, 2011 refers to LastReceiptDate> = '2011-08-17 00:00:00' and LastReceiptDate < '2011-08-18 00:00:00';", "after": "ProductVendor.AverageLeadTime = 16, ProductVendor.StandardPrice = 18.9900, and ProductVendor.LastReceiptDate is August 27, 2011; Vendor.CreditRating records the requested rating."}}} {"question_id": 7095, "split": "train", "changes": {"question": {"before": "How many products are there if we add all those located in the Subassembly category?", "after": "How many units of products are stored at the Subassembly location in total?"}, "evidence": {"before": "located in the Subassembly category refers to Name = 'Subassembly'", "after": "ProductInventory.Quantity records product units at an inventory location."}}} {"question_id": 7111, "split": "train", "changes": {"question": {"before": "How many vendors are having their products ordered with an average delivery time of 25 days?", "after": "How many vendors supply at least one product with an average delivery lead time of 25 days?"}, "evidence": {"before": "vendors refers to distinct BusinessEntityID; average delivery time of 25 days refers to AverageLeadTime = 25", "after": "ProductVendor.AverageLeadTime is days from ordering to receipt, recorded per product-vendor relationship."}}} {"question_id": 7126, "split": "train", "changes": {"question": {"before": "How many addresses are in Bothell as opposed to Kenmore? What is the name of the State that comprises these two cities?", "after": "How many addresses are recorded in Bothell and Kenmore, respectively, and what state are they in? Give the two counts followed by the state name."}, "evidence": {"before": "SUBTRACT(count(address where city = 'Bothell'), count(address where city = 'Kenmore'))", "after": "Address.StateProvinceID identifies the state or province named in StateProvince.Name."}}} {"question_id": 7127, "split": "train", "changes": {"question": {"before": "Which chromoly steel product model has AdventureWorks saved in English?", "after": "Which product models have an English description about chromoly steel? List their names."}, "evidence": {"before": "which product model refers to product model name; Saved in English refers to product description written in English where Culture.name = 'English'", "after": "Descriptions are recorded in ProductDescription.Description; Culture.Name identifies the language. ProductModelProductDescriptionCulture associates a model with its description and language. The stored subject text is 'Chromoly steel'."}}} {"question_id": 7169, "split": "validation", "changes": {"question": {"before": "How is the Credit Rating for company whose rowguid is \"33671A4E-DF2B-4879-807B-E3F930DD5C0C\"?", "after": "What is the numeric credit-rating code of the company with business entity rowguid “33671A4E-DF2B-4879-807B-E3F930DD5C0C”?"}, "evidence": {"before": null, "after": "Vendor.CreditRating uses 1 for Superior, 2 for Excellent, 3 for Above average, 4 for Average, and 5 for Below average."}}} {"question_id": 7171, "split": "train", "changes": {"evidence": {"before": "ActiveFlag = 1 means 'Vendor no longer used'; ActiveFlag = 2 means 'Vendor is actively used", "after": "ActiveFlag = 1 means 'Vendor no longer used'; ActiveFlag = 2 means 'Vendor is actively used'"}}} {"question_id": 7182, "split": "train", "changes": {"question": {"before": "What are the total per assembly quantity for unit measure code EA, IN and OZ respectively? What are the name of these 3 code?", "after": "For each unit code EA, IN, and OZ, what is the total per-assembly quantity and the unit name?"}, "evidence": {"before": "Pre assembly quantity refers to PerAssemblyQty", "after": "BillOfMaterials.PerAssemblyQty is component quantity required for an assembly; UnitMeasure.Name names its unit code."}}} {"question_id": 7183, "split": "train", "changes": {"question": {"before": "Which product ID do not have any work order ID?", "after": "Which product IDs do not have any work order ID?"}, "evidence": {"before": "Do not have any work order ID means WorkOrderID is null", "after": "WorkOrder records product work orders; WorkOrder.ProductID identifies the product."}}} {"question_id": 7192, "split": "train", "changes": {"question": {"before": "Among the sales people, who are hired prior to 2012? Provide their firstname and lastname.", "after": "Which salespeople were hired before 2012? Provide their first and last names."}, "evidence": {"before": "Sales people refer to PersonType = 'SP'; hired prior to 2010 means the person's hiring date was before 2010, therefore year(HireDate)<2010", "after": "Person.PersonType = 'SP' identifies salespeople. Employee.HireDate records the hire date; Person.FirstName and Person.LastName record names."}}} {"question_id": 7194, "split": "train", "changes": {"question": {"before": "How many people with the name Alex are single and occupying organization level of 1?", "after": "How many people named Alex are single and at organization level 1?"}, "evidence": {"before": "Alex refers to FirstName = 'Alex'; single refers to MaritalStatus = 'S'", "after": "Employee.MaritalStatus = 'S' denotes single; Employee.OrganizationLevel records organization level. Person.FirstName uses 'Alex'."}}} {"question_id": 7200, "split": "train", "changes": {"question": {"before": "List down the email address of female single employees.", "after": "List the email addresses of female single employees."}, "evidence": {"before": "female refers to Gender = 'F'; single refers to MaritalStatus = 'S';", "after": "Employee.Gender = 'F' denotes female and Employee.MaritalStatus = 'S' denotes single."}}} {"question_id": 7204, "split": "train", "changes": {"question": {"before": "Among the employees who wish to receive e-mail promotion from AdventureWorks, how many percent of them are female?", "after": "What percentage of employees who opted into email promotions are female? Round your answer to 3 decimal places."}, "evidence": {"before": "female refers to Gender = 'F'; employee who wish to receive email promotion refers to EmailPromotion = 1; percentage = DIVIDE(SUM(Gender = 'F')), (sum(Gender = 'F' or Gender = 'M'))) as percentage;", "after": "Employee.Gender = 'F' denotes female employees. Person.EmailPromotion values 1 and 2 indicate willingness to receive email promotions."}, "SQL": {"before": "SELECT CAST(SUM(CASE WHEN e.Gender = 'F' THEN 1 ELSE 0 END) AS REAL) * 100.0 / COUNT(*) AS FemalePercent FROM Employee e JOIN Person p ON e.BusinessEntityID = p.BusinessEntityID WHERE p.EmailPromotion IN (1, 2)", "after": "WITH unrounded(value) AS (\nSELECT CAST(SUM(CASE WHEN e.Gender = 'F' THEN 1 ELSE 0 END) AS REAL) * 100.0 / COUNT(*) AS FemalePercent FROM Employee e JOIN Person p ON e.BusinessEntityID = p.BusinessEntityID WHERE p.EmailPromotion IN (1, 2)\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 7207, "split": "train", "changes": {"question": {"before": "How many types of credit cards are there and how many are vista?", "after": "How many credit card types are recorded, and how many are Vista?"}, "evidence": {"before": "type of credit card refers to CardType; CardType = 'Vista';", "after": "CreditCard.CardType is a card-type category shared by individual cards; the stored label is 'Vista'."}}} {"question_id": 7219, "split": "train", "changes": {"evidence": {"before": "Catgo Transport 5 is a name of shipping method; OrderDate = '2011-12-14'; total shipment cost = SUM(Freight);", "after": "'CARGO TRANSPORT 5' refers to ShipMethod.Name; created on 12/14/2011 refers to purchase orders whose PurchaseOrderHeader.OrderDate falls on that day; total shipping cost refers to SUM(PurchaseOrderHeader.Freight) over those purchase orders"}}} {"question_id": 7251, "split": "train", "changes": {"question": {"before": "What is the profit on net of the vendor with the highest standard price? If there are two vendors of the same amount, calculate only for one vendor.", "after": "What is the net profit of the vendor with the highest standard price? If multiple vendors tie, calculate it for only one."}, "evidence": {"before": "profit on net = SUBTRACT(LastReceiptCost, StandardPrice);", "after": "the vendor with the highest standard price refers to the single ProductVendor record with the greatest StandardPrice, taking only one when several tie; net profit = SUBTRACT(LastReceiptCost, StandardPrice) for that record"}}} {"question_id": 7259, "split": "train", "changes": {"question": {"before": "What is the profit of a single product that received the highest rating from John Smith? List the product/s' names.", "after": "What is the profit per unit for each product John Smith rated highest? List the profit followed by the product name."}, "evidence": {"before": "highest rating refers to MAX(Rating); profit = SUBTRACT(ListPrice, StandardCost);", "after": "rated highest refers to the MAX value John Smith rated, taken over every product John Smith rated; profit per unit refers to SUBTRACT(Product.ListPrice, Product.StandardCost); list that profit followed by the product name, once for each product John Smith rated at that MAX value"}}} {"question_id": 7267, "split": "train", "changes": {"question": {"before": "What are the names of the vendors to which the company purchased its women's tights products?", "after": "Which vendors does the company buy women’s tights from? List their names."}, "evidence": {"before": "product is purchased refers to MakeFlag = 0; women's refers to Style = 'W'; ProductSubcategoryID = 'Tights';", "after": "Product.MakeFlag = 0 denotes purchased products. Product.Style = 'W' denotes women’s products; ProductSubcategory.Name uses 'Tights'."}}} {"question_id": 7286, "split": "train", "changes": {"question": {"before": "Please list the names of the products that get over 1 review and are salable.", "after": "List the names of products with more than one review that are salable."}, "evidence": {"before": "salable product refers to FinishedGoodsFlag = 1; over 1 reviews refers to count(comments)>1", "after": "Product.FinishedGoodsFlag = 1 denotes a salable product; ProductReview records product reviews."}}} {"question_id": 7290, "split": "validation", "changes": {"question": {"before": "Please list the names of the products that have at least 2 price changes.", "after": "Which products have changed price at least twice? List their names."}, "evidence": {"before": "at least 2 price changes refers to count(ListPrice)>2", "after": "ProductListPriceHistory records historical list prices and their start dates. A history row does not necessarily represent a transition to a different price."}, "SQL": {"before": "SELECT P.`Name`\nFROM `Product` P\nJOIN `ProductListPriceHistory` PLPH ON PLPH.`ProductID` = P.`ProductID`\nGROUP BY P.`ProductID`, P.`Name`\nHAVING COUNT(*) > 2;", "after": "WITH price_history AS (\n SELECT ProductID, ListPrice,\n LAG(ListPrice) OVER (\n PARTITION BY ProductID ORDER BY StartDate\n ) AS previous_price\n FROM ProductListPriceHistory\n)\nSELECT P.Name\nFROM Product AS P\nINNER JOIN price_history AS H ON H.ProductID = P.ProductID\nWHERE H.ListPrice <> H.previous_price\nGROUP BY P.ProductID, P.Name\nHAVING COUNT(*) >= 2;"}}} {"question_id": 7296, "split": "train", "changes": {"question": {"before": "Which vendor's selling price for Hex Nut 5 is the lowest, please give the vendor's name.", "after": "Which vendor has the lowest selling price for Hex Nut 5? Give the vendor’s name."}, "evidence": {"before": "vendor's selling price refers to StandardPrice; lowest selling price = MIN(StandardPrice)", "after": "Hex Nut 5 refers to Product.Name = 'Hex Nut 5'; the vendor's selling price refers to ProductVendor.StandardPrice; the lowest refers to StandardPrice = MIN(StandardPrice) among the ProductVendor rows for Hex Nut 5; return that vendor's name"}}} {"question_id": 7301, "split": "validation", "changes": {"question": {"before": "Please list the email adresses of the reviewers who have given the lowest rating to the product HL Mountain Pedal.", "after": "What are the email addresses of reviewers who gave \"HL Mountain Pedal\" its lowest rating?"}, "evidence": {"before": "lowest rating refers to MIN(Rating)", "after": "ProductReview.EmailAddress is the address supplied with the review."}}} {"question_id": 7303, "split": "train", "changes": {"question": {"before": "Please list the names of the products that are out of stock and were purchased in house.", "after": "Which products bought from suppliers have no units left in inventory? List their names."}, "evidence": {"before": "out of stock refers to OnOrderQty = 0 or OnOrderQty is null; purchased in house refers to MakeFlag = 0", "after": "Product.MakeFlag = 0 denotes purchased products. ProductInventory.Quantity records units held at a storage location; ProductID identifies the product and LocationID identifies the location. A product with no inventory records has no recorded stock."}, "SQL": {"before": "SELECT DISTINCT p.Name FROM `Product` p WHERE p.`MakeFlag` = 0 AND NOT EXISTS ( SELECT 1 FROM `ProductVendor` pv WHERE pv.`ProductID` = p.`ProductID` AND pv.`OnOrderQty` > 0)", "after": "SELECT DISTINCT p.Name\nFROM Product AS p\nWHERE p.MakeFlag = 0\n AND COALESCE((SELECT SUM(i.Quantity)\n FROM ProductInventory AS i\n WHERE i.ProductID = p.ProductID), 0) = 0;"}}} {"question_id": 7315, "split": "train", "changes": {"question": {"before": "What is the job title of the oldest employee in the company? In which department is he in?", "after": "What is the job title of the oldest employee, and in which department does that employee work?"}, "evidence": {"before": "oldest employee refers to min(BirthDate)", "after": "the oldest employee refers to Employee.BirthDate = MIN(BirthDate) over all Employee rows; that employee's department refers to the EmployeeDepartmentHistory row with EndDate IS NULL, the ongoing assignment; return both that employee's job title and the Department name"}}} {"question_id": 7316, "split": "train", "changes": {"question": {"before": "Based on the latest pay rate for each employee, calculate the average hourly pay rate for each department. Provide the department ID, department name, and the average hourly pay rate.", "after": "Using each employee’s latest hourly pay rate and current department assignment, give each department’s ID, name, and average hourly pay rate."}, "evidence": {"before": "latest payrate refers to max(RateChangeDate); average hourly payrate = divide(sum(Rate), count(BusinessEntityID)) for each DepartmentID", "after": "an employee's latest hourly pay rate refers to the EmployeePayHistory rate whose RateChangeDate is the MAX for that employee; a current department assignment refers to EmployeeDepartmentHistory.EndDate IS NULL; per department return its ID, its name and AVG(rate) over those latest rates"}}} {"question_id": 7320, "split": "train", "changes": {"question": {"before": "Which vendor gives the best profit on net for product ID 342?", "after": "Which vendor provides the highest net profit for product ID 342?"}, "evidence": {"before": "which vendor refers to vendor name; profit on net = subtract(LastReceiptCost, StandardPrice); best profit on net refers to max(subtract(LastReceiptCost, StandardPrice))", "after": "net profit refers to SUBTRACT(ProductVendor.LastReceiptCost, ProductVendor.StandardPrice) over the ProductVendor rows of product ID 342; the vendor that provides the highest net profit refers to every Vendor name whose net profit is equal to the MAX such net profit"}}} {"question_id": 7322, "split": "train", "changes": {"question": {"before": "Calculate the average length of employment for employee working in the Research and Development deparment.", "after": "For employees currently assigned to the Research and Development department, what is the average number of calendar years from their hiring year to 2014? Round your answer to 4 decimal places."}, "evidence": {"before": "average length of employment = AVG(subtract(year(NOW), year(HireDate)))", "after": "Department.Name = 'Research and Development' identifies the department; Department.GroupName is a broader group. Employee.HireDate records hiring date. EmployeeDepartmentHistory.EndDate is NULL for a current assignment."}, "SQL": {"before": "SELECT AVG(STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.HireDate)) FROM Employee AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Department AS T3 ON T2.DepartmentID = T3.DepartmentID WHERE T3.Name = 'Research and Development'", "after": "WITH unrounded(value) AS (\nSELECT AVG(2014 - CAST(strftime('%Y', e.HireDate) AS INTEGER)) FROM Employee e WHERE EXISTS (SELECT 1 FROM EmployeeDepartmentHistory h JOIN Department d ON d.DepartmentID=h.DepartmentID WHERE h.BusinessEntityID=e.BusinessEntityID AND h.EndDate IS NULL AND d.Name='Research and Development')\n) SELECT ROUND(value, 4) FROM unrounded;"}}} {"question_id": 7328, "split": "train", "changes": {"question": {"before": "Name all stores and its sales representative in France territory.", "after": "Which stores have a sales representative assigned to France? List each store’s name and its representative’s first and last name."}, "evidence": {"before": "sales representative name refers to first name, last name; France territory refers to SalesTerritory.Name = 'France';", "after": "Store.SalesPersonID identifies the store’s assigned salesperson; SalesPerson.TerritoryID identifies their territory. France is recorded as SalesTerritory.Name = 'France'."}}} {"question_id": 7336, "split": "train", "changes": {"evidence": {"before": "Average = Divide(Sum(Substract(year(@today),year(BirthDate))),Count(BusinessEntityID) by each Department ID; current employee refers to EndDate is NULL;", "after": "Average = Divide(Sum(Substract(year(@today),year(BirthDate))),Count(BusinessEntityID)) by each Department ID; current employee refers to EndDate is NULL;"}}} {"question_id": 7339, "split": "train", "changes": {"question": {"before": "Please list the sale person with the lowest total sales from last year.", "after": "Please list the salesperson with the lowest total sales from last year."}, "evidence": {"before": "lowest total sales in last year refers to Min(SalesLastYear); businesses refer to businessEntityID", "after": "total sales from last year refers to SalesPerson.SalesLastYear; the lowest refers to MIN(SalesLastYear); the salesperson refers to SalesPerson.BusinessEntityID; return the BusinessEntityID of every salesperson at that minimum"}}} {"question_id": 7343, "split": "train", "changes": {"evidence": {"before": "estimated manufacturing cost refers PlannedCost; actual manufacturing cost refers to ActualCost; difference = Substract(SUM(ActualCost(ProductID(818)))),SUM(PlannedCost(ProductID(818))));", "after": "estimated manufacturing cost refers PlannedCost; actual manufacturing cost refers to ActualCost; difference = Substract(SUM(ActualCost(ProductID(818))),SUM(PlannedCost(ProductID(818))));"}}} {"question_id": 7357, "split": "train", "changes": {"question": {"before": "Please list the top 5 products with the most orders.", "after": "Which five products have the largest total number of units ordered? List their names."}, "evidence": {"before": "most order refers to Max(SUM(OrderQty));", "after": "units ordered on a sales-order line refers to SalesOrderDetail.OrderQty; total units ordered refers to SUM(OrderQty) grouped by the products' names, not the count of order lines; the five products with the largest total refers to the five greatest such sums; list their names"}}} {"question_id": 7358, "split": "train", "changes": {"question": {"before": "Where are the shelves where the down tube product was stored?", "after": "On which shelves is the \"Down Tube\" product stored?"}, "evidence": {"before": "shelves refer to shelf; down tube is a product", "after": "ProductInventory.Shelf records the shelf or storage compartment."}}} {"question_id": 7362, "split": "train", "changes": {"question": {"before": "What is the 12th business's first line address?", "after": "For the business entity with ID 12, list the first line of each address."}, "evidence": {"before": "12th business refers to BusinessEntityID = 12;", "after": ""}}} {"question_id": 7369, "split": "train", "changes": {"question": {"before": "What is the company's second highest salary per hour for employees who are paid monthly?", "after": "What is the second-highest distinct hourly pay rate recorded for employees paid monthly?"}, "evidence": {"before": "salary received monthly refers to PayFrequency = 1; highest salary per hour refers to Max(Rate);", "after": "employees paid monthly refers to EmployeePayHistory.PayFrequency = 1; hourly pay rate refers to EmployeePayHistory.Rate; return the second-highest value among the DISTINCT rates of those records, ordered descending"}}} {"question_id": 7374, "split": "validation", "changes": {"question": {"before": "What are the names of products that has the biggest size in centimeter and what are its reorder point?", "after": "Which products have the largest size measured in centimeters, and what are their reorder points?"}, "evidence": {"before": "in centimeter refers to SizeUnitMeasureCode = 'CM';", "after": "Product.Size is text; Product.SizeUnitMeasureCode = 'CM' denotes centimeters. Product.ReorderPoint is the replenishment threshold."}}} {"question_id": 7376, "split": "train", "changes": {"question": {"before": "What profit will the company gain if they sell 10 items of the product that has the lightest weight?", "after": "How much profit would selling 10 units of the lightest product generate?"}, "evidence": {"before": "Lightest product refers to Min(Weight); profit if they sell 10 items refers to Subtract (ListPrice , StandardCost) *10;", "after": "the lightest product refers to the Product with the smallest Weight in grams, a Weight with WeightUnitMeasureCode 'LB' taken as MULTIPLY(Weight, 453.59237) and a 'G' Weight as grams, over Product rows with Weight NOT NULL and WeightUnitMeasureCode 'G' or 'LB'; profit from selling 10 units = MULTIPLY(10, SUBTRACT(ListPrice, StandardCost))"}, "SQL": {"before": "SELECT 10 * (ListPrice - StandardCost) FROM Product WHERE Weight IS NOT NULL ORDER BY Weight LIMIT 1", "after": "SELECT 10 * (ListPrice - StandardCost)\nFROM Product\nWHERE Weight IS NOT NULL\n AND WeightUnitMeasureCode IN ('G', 'LB')\nORDER BY CASE WeightUnitMeasureCode\n WHEN 'G' THEN Weight\n WHEN 'LB' THEN Weight * 453.59237\nEND\nLIMIT 1"}}} {"question_id": 7384, "split": "train", "changes": {"question": {"before": "Which department has the most number of night shifts?", "after": "Which department has the most recorded employee assignments to the night shift?"}, "evidence": {"before": "most number of night shift = MAX(count(shift.Name = 'Night'))", "after": "the night shift refers to Shift.Name = 'Night'; employee assignments refers to rows of EmployeeDepartmentHistory; the department with the most refers to the Department.Name with the greatest COUNT of those rows"}}} {"question_id": 7389, "split": "train", "changes": {"question": {"before": "What is the full name of the non-sales employee who made the most number of rejected purchase orders?", "after": "Which non-sales employee created the most rejected purchase orders? Give their first and last names."}, "evidence": {"before": "full name refers to first name, last name; non-sales employee refers to PersonType = 'EM'; rejected purchase order refers to Status = 3; ", "after": "Person.PersonType = 'EM' denotes a non-sales employee. PurchaseOrderHeader.EmployeeID identifies the creator; Status = 3 means rejected."}}} {"question_id": 7418, "split": "train", "changes": {"question": {"before": "How many people were there in the Engineering Department in the year 2009?", "after": "How many different employees worked in Engineering at any time during 2009?"}, "evidence": {"before": "year(EndDate)>2009 and year(StartDate)<2009;", "after": "EmployeeDepartmentHistory.StartDate and EndDate delimit a department assignment; NULL EndDate denotes an ongoing assignment. Department.Name records the department name."}}} {"question_id": 7423, "split": "train", "changes": {"question": {"before": "What is the e-mail address of the employee who switched departments for the most times?", "after": "Which employee changed departments the most times? List their email address."}, "evidence": {"before": "switched department the most refers to MAX(count(DepartmentID));", "after": "a department change refers to an EmployeeDepartmentHistory row whose department is not the same as that employee's previous row in date order, changing shifts within the same department not counting; changed departments the most refers to the greatest count of such rows for an employee; return the email address of that employee"}, "SQL": {"before": "SELECT T2.EmailAddress FROM EmployeeDepartmentHistory AS T1 INNER JOIN EmailAddress AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID GROUP BY T2.BusinessEntityID ORDER BY COUNT(T1.DepartmentID) DESC LIMIT 1", "after": "WITH ordered AS (\n SELECT BusinessEntityID, DepartmentID,\n LAG(DepartmentID) OVER (\n PARTITION BY BusinessEntityID\n ORDER BY StartDate\n ) AS previous_department\n FROM EmployeeDepartmentHistory\n),\nchanges AS (\n SELECT BusinessEntityID,\n SUM(CASE\n WHEN previous_department IS NOT NULL\n AND DepartmentID <> previous_department\n THEN 1 ELSE 0\n END) AS change_count\n FROM ordered\n GROUP BY BusinessEntityID\n)\nSELECT DISTINCT T1.EmailAddress\nFROM EmailAddress AS T1\nINNER JOIN changes AS T2\n ON T1.BusinessEntityID = T2.BusinessEntityID\nWHERE T2.change_count = (\n SELECT MAX(change_count) FROM changes\n);"}}} {"question_id": 7434, "split": "train", "changes": {"evidence": {"before": "average profit = DIVIDE(SUM(SUBTRACT(ListPrice, StandardCost))), (COUNT(ProductSubcategoryID))));", "after": "average profit = DIVIDE(SUM(SUBTRACT(ListPrice, StandardCost)), COUNT(ProductSubcategoryID));"}}} {"question_id": 7451, "split": "train", "changes": {"question": {"before": "How many products with the id \"476\" are stored in Metal Storage?", "after": "How many units of product ID 476 are stored in Metal Storage?"}, "evidence": {"before": "Metal Storage is name of location", "after": "ProductInventory.Quantity records units in stock; Location.Name identifies Metal Storage."}}} {"question_id": 7455, "split": "train", "changes": {"question": {"before": "How many days did it take to end the work order \"425\"?", "after": "How many days elapsed between the start and end of work order ID 425?"}, "evidence": {"before": "days to end a work order = SUBTRACT(ActualEndDate, ActualStartDate);", "after": "work order ID 425 refers to WorkOrder.WorkOrderID = 425; days elapsed = SUBTRACT(JULIANDAY(WorkOrder.EndDate), JULIANDAY(WorkOrder.StartDate))"}}} {"question_id": 7460, "split": "train", "changes": {"question": {"before": "What is the cost and the product number of product with the id \"888\"?", "after": "What are the cost and product number of the product with ID 888?"}, "evidence": {"before": "cost refers to StandardCost;", "after": "Product.StandardCost records cost; Product.ProductNumber records the product number."}}} {"question_id": 7462, "split": "train", "changes": {"question": {"before": "List the locations ids, compartments and containers for the Lock Ring", "after": "List the location IDs, compartments, and containers for the Lock Ring."}, "evidence": {"before": "compartment refers to Shelf; container refers to Bin; Lock Ring is a name of product", "after": "ProductInventory.Shelf records the compartment and ProductInventory.Bin records the container. Product.Name uses 'Lock Ring'."}}} {"question_id": 7464, "split": "train", "changes": {"question": {"before": "List all the scraped work orders for handling damage reason.", "after": "List the IDs of work orders with \"Handling damage\" as the scrap reason."}, "evidence": {"before": "handling damage is descrription of manufacturing failure which refers to ScrapReason.Name", "after": "ScrapReason.Name uses 'Handling damage'."}}} {"question_id": 7488, "split": "validation", "changes": {"question": {"before": "What are the bounding boxes of the object samples with a predicted relation class of \"by\" in image no.1?", "after": "For image 1, list the bounding boxes of both objects in each “by” relationship. Give each box’s x-coordinate, y-coordinate, width and height, without repeating any boxes."}, "evidence": {"before": "bounding boxes of the object samples refers to (x, y, W, H); predicted relation class of \"by\" refers to PRED_CLASS = 'by'; image no.1 refers to IMG_ID = 1", "after": "Image number refers to IMG_ID; relationship labels are recorded in PRED_CLASS. Bounding-box coordinates and dimensions are recorded in X, Y, W and H."}}} {"question_id": 7523, "split": "train", "changes": {"question": {"before": "Among the objects that have multiple relations, how many images whose captions for the prediction class ids are \"on\"?", "after": "How many images show an “on” relationship between two different objects?"}, "evidence": {"before": "objects that have multiple relations refers to OBJ1_SAMPLE_ID ! = OBJ2_SAMPLE_ID; captions for the prediction class ids are \"on\" refers to PRED_CLASS = 'on'", "after": "OBJ1_SAMPLE_ID and OBJ2_SAMPLE_ID identify the two objects in a relation. PRED_CLASS = 'on' denotes an “on” relationship."}}} {"question_id": 7534, "split": "train", "changes": {"question": {"before": "What colour is the van that can be spotted in image no. 1?", "after": "What attributes are recorded for the van in image 1?"}, "evidence": {"before": "colour refers to ATT_CLASS; van refers to OBJ_CLASS = 'van'; image no. 1 refers to IMG_ID = 1", "after": "IMG_OBJ.IMG_ID identifies the image; OBJ_CLASSES.OBJ_CLASS = 'van' identifies vans. ATT_CLASSES.ATT_CLASS contains attribute labels associated with object samples through IMG_OBJ_ATT."}}} {"question_id": 7536, "split": "train", "changes": {"evidence": {"before": "relationship refers to PRED_CLASS; object sample no. 25 and object sample no. 2 refers to (OBJ1_SAMPLE_ID = 25 and OBJ2_SAMPLE_ID = 2) or (OBJ1_SAMPLE_ID = 2 and OBJ2_SAMPLE_ID = 25; image no. 1 refers to IMG_ID = 1", "after": "relationship refers to PRED_CLASS; object sample no. 25 and object sample no. 2 refers to (OBJ1_SAMPLE_ID = 25 and OBJ2_SAMPLE_ID = 2) or (OBJ1_SAMPLE_ID = 2 and OBJ2_SAMPLE_ID = 25); image no. 1 refers to IMG_ID = 1"}}} {"question_id": 7544, "split": "train", "changes": {"question": {"before": "Name the object class of the image with a bounding (422, 63, 77, 363).", "after": "List the object classes for objects with bounding box (422, 63, 77, 363)."}, "evidence": {"before": "image with a bounding (422, 63, 77, 363) refers to OBJ_CLASS_ID where X = 422 and Y = 63 and W = 77 and H = 363;", "after": "Bounding boxes use (IMG_OBJ.X, IMG_OBJ.Y, IMG_OBJ.W, IMG_OBJ.H): position followed by width and height. OBJ_CLASSES.OBJ_CLASS is the class label."}}} {"question_id": 7580, "split": "train", "changes": {"question": {"before": "How many images have a total of 10 attribute classes?", "after": "How many images have exactly ten different attribute classes?"}, "evidence": {"before": "images refer to IMG_ID; total of 10 attribute classes refers to COUNT(OBJ_CLASS_ID) = 10;", "after": "exactly ten different attribute classes refers to COUNT(DISTINCT IMG_OBJ_ATT.ATT_CLASS_ID) = 10 for one IMG_OBJ_ATT.IMG_ID; how many images refers to the COUNT of IMG_ID groups meeting that condition"}}} {"question_id": 7587, "split": "train", "changes": {"question": {"before": "List all the ID of the images that have an attribute class of \"horse\".", "after": "List the IDs of all images with the attribute class horse."}, "evidence": {"before": "ID of all images refer to IMG_ID; attribute class of \"horse\" refers to ATT_CLASS = 'horse';", "after": "Attribute labels are recorded in ATT_CLASSES.ATT_CLASS; IMG_OBJ_ATT associates attribute classes with image objects."}}} {"question_id": 7627, "split": "validation", "changes": {"question": {"before": "Name the goalies with the most seasons played. State the overall average playing time per season across all seasons", "after": "Which goalies played in the most seasons? Give their first and last names and their average playing time per regular season in minutes, rounded to two decimal places."}, "evidence": {"before": "name refers to first name, last name; most seasons played refers to MAX(COUNT(playerID)); average time he played for each season refers to DIVIDE(SUM(T2.Min),COUNT(T2.playerID)); different seasons refer to different years", "after": "Goalies.year identifies the season, and Goalies.Min records regular-season playing time in minutes. A goalie can have multiple records for the same season. Names are recorded in Master.firstName and Master.lastName."}, "SQL": {"before": "WITH seasons_cnt AS (\n SELECT playerID,\n COUNT(DISTINCT year) AS seasons\n FROM `Goalies`\n GROUP BY playerID\n),\nmax_goalies AS (\n SELECT playerID\n FROM seasons_cnt\n WHERE seasons = (SELECT MAX(seasons) FROM seasons_cnt)\n),\navg_minutes AS (\n SELECT g.playerID,\n SUM(CAST(g.Min AS REAL))/COUNT(DISTINCT year) AS avg_minutes\n FROM `Goalies` g\n WHERE g.playerID IN (SELECT playerID FROM max_goalies)\n GROUP BY g.playerID\n)\nSELECT m.firstName,\n m.lastName,\n a.avg_minutes\nFROM avg_minutes a\nJOIN `Master` m ON m.playerID = a.playerID", "after": "WITH seasons_cnt AS (\n SELECT playerID,\n COUNT(DISTINCT year) AS seasons\n FROM `Goalies`\n GROUP BY playerID\n),\nmax_goalies AS (\n SELECT playerID\n FROM seasons_cnt\n WHERE seasons = (SELECT MAX(seasons) FROM seasons_cnt)\n),\navg_minutes AS (\n SELECT g.playerID,\n ROUND(SUM(CAST(g.Min AS REAL))/COUNT(DISTINCT year), 2) AS avg_minutes\n FROM `Goalies` g\n WHERE g.playerID IN (SELECT playerID FROM max_goalies)\n GROUP BY g.playerID\n)\nSELECT m.firstName,\n m.lastName,\n a.avg_minutes\nFROM avg_minutes a\nJOIN `Master` m ON m.playerID = a.playerID"}}} {"question_id": 7628, "split": "train", "changes": {"question": {"before": "Name the goalie and the season he played where he had 5% shutouts among the number of goals recorded while the goalie was on the ice.", "after": "Which goalies had season totals of exactly one shutout for every 20 goals conceded? List their first names, last names, and seasons."}, "evidence": {"before": "name refers to first name, last name; shutouts refers to SHO; number of goals refers to GA; 5% shutouts among the number of goals refers to DIVIDE(SHO,GA)*100 = 5.00", "after": "season totals refers to SUM(SHO) and SUM(GA) per Goalies.playerID and year (several records in a season are summed), keeping seasons with SUM(GA) > 0; one shutout per 20 goals conceded refers to MULTIPLY(SUM(SHO), 20) = SUM(GA); return Master.firstName, Master.lastName and year, ordered by year, lastName, firstName"}, "SQL": {"before": "WITH season_totals AS (\n SELECT playerID,\n year,\n SUM(CAST(SHO AS INTEGER)) AS tot_SHO,\n SUM(CAST(GA AS INTEGER)) AS tot_GA\n FROM Goalies\n GROUP BY playerID, year\n HAVING tot_GA > 0\n AND ABS(1.0 * tot_SHO / tot_GA - 0.05) < 1e-6 -- exactly 5 %\n)\nSELECT M.firstName,\n M.lastName,\n S.year\nFROM season_totals S\nJOIN Master M ON M.playerID = S.playerID\nORDER BY S.year, M.lastName, M.firstName;", "after": "WITH season_totals AS (\n SELECT playerID,\n year,\n SUM(CAST(SHO AS INTEGER)) AS tot_SHO,\n SUM(CAST(GA AS INTEGER)) AS tot_GA\n FROM Goalies\n GROUP BY playerID, year\n HAVING tot_GA > 0\n AND 20 * tot_SHO = tot_GA -- exactly 5 %\n)\nSELECT M.firstName,\n M.lastName,\n S.year\nFROM season_totals S\nJOIN Master M ON M.playerID = S.playerID\nORDER BY S.year, M.lastName, M.firstName;"}}} {"question_id": 7644, "split": "train", "changes": {"question": {"before": "What is first name for player 'aebisda01'. Calculate the average time in minutes for the all his games played as goaltender.", "after": "What is the first name of player aebisda01, and what was his average regular-season playing time per game as a goaltender, in minutes?"}, "evidence": {"before": "played as goaltender refers to pos = 'G'; time in minutes refers to Min; all his games played refers to GP; average time in minutes refers to DIVIDE(SUM(Min)/SUM(GP))", "after": "player aebisda01 refers to the Master row for aebisda01 and his Goalies rows; average regular-season playing time per game refers to DIVIDE(SUM(Min), SUM(GP)) over those Goalies rows, in minutes; return both Master.firstName and that average"}}} {"question_id": 7647, "split": "train", "changes": {"question": {"before": "Among the players who won an award in the year 1983, how many of them play the position of goalie?", "after": "Among players with an award record in 1983, how many were listed as goalies in an award record that year?"}, "evidence": {"before": "position of goalie refers to pos = 'G'", "after": "AwardsPlayers.pos = 'G' identifies a goalie in an award record; AwardsPlayers.year records award year."}}} {"question_id": 7671, "split": "train", "changes": {"question": {"before": "Among the players who died in Massachussets, how many of them have won an award?", "after": "How many award-winning players died in Massachusetts?"}, "evidence": {"before": "died in Massachussets refers to deathState = 'MA'", "after": "Master.deathState = 'MA' denotes Massachusetts; AwardsPlayers records award recipients."}}} {"question_id": 7697, "split": "train", "changes": {"question": {"before": "Which teams had the most postseason empty net goals in 2010 season? List their team names.", "after": "Which teams had the highest total postseason empty-net goals across their goalie records in 2010? Give their names."}, "evidence": {"before": "most postseason empty net goals refers to max(PostENG)", "after": "in 2010 refers to Goalies.year = 2010; a team's total refers to SUM(CAST(PostENG AS INT)) over its goalie records that year, with a missing PostENG counted as 0; return the Teams.name (matched on tmID with year = 2010) of every team whose total equals the maximum"}}} {"question_id": 7717, "split": "train", "changes": {"question": {"before": "Who were the coaches for the teams which had the most bench minors penalty in 2003?", "after": "List the first and last names of the coaches of the teams with the most bench-minor penalty minutes in 2003."}, "evidence": {"before": "Coach of the team refers to firstName+lastName; 2003 refers to the year", "after": "coaches refers to firstName and lastName; 2003 refers to Teams.year = 2003; bench-minor penalty minutes refers to the numeric value of Teams.BenchMinor; select the teams with the highest value in 2003 and return all of their coaches for that year;"}, "SQL": {"before": "SELECT DISTINCT T3.firstName, T3.lastName FROM Teams AS T1 INNER JOIN Coaches AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN Master AS T3 ON T2.coachID = T3.coachID WHERE T1.year = '2003' GROUP BY T3.firstName, T3.lastName HAVING SUM(T1.BenchMinor) = (SELECT SUM(T1.BenchMinor) FROM Teams AS T1 INNER JOIN Coaches AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN Master AS T3 ON T2.coachID = T3.coachID WHERE T1.year = '2003' GROUP BY T3.firstName, T3.lastName ORDER BY SUM(T1.BenchMinor) DESC LIMIT 1);", "after": "SELECT DISTINCT T3.firstName, T3.lastName FROM Teams AS T1 INNER JOIN Coaches AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN Master AS T3 ON T2.coachID = T3.coachID WHERE T1.year = 2003 AND CAST(T1.BenchMinor AS REAL) = (SELECT MAX(CAST(BenchMinor AS REAL)) FROM Teams WHERE year = 2003)"}}} {"question_id": 7724, "split": "validation", "changes": {"question": {"before": "What are the power play percentages of the teams with the most number of loses?", "after": "What are the overall power-play percentages of the teams with the highest total number of losses across all seasons?"}, "evidence": {"before": "Power play percentage refers to PPG/PCC, most number of loses refers to MAX(L)", "after": "Overall power-play percentage refers to 100.0 * SUM(PPG) / SUM(PPC), calculated across all seasons for each team grouped by tmID; highest total number of losses refers to the largest SUM(L) across those team groups. Include all teams tied for that largest total."}}} {"question_id": 7746, "split": "train", "changes": {"question": {"before": "In 1997, how many loss did the coach have who temporary coached Tampa Bay Lightning? Indicate his/her coach ID.", "after": "In 1997, how many losses did the coach who temporarily coached Tampa Bay Lightning have? Include the coach ID."}, "evidence": {"before": "temporary coached refers to notes = 'interim'; number of loss refers to L (to add)", "after": "Interim coaching is recorded as Coaches.notes = 'interim'; Coaches.l records losses. Team names are recorded in Teams.name."}}} {"question_id": 7747, "split": "train", "changes": {"question": {"before": "Among the players whose short handed assists are greater or equal to 7, what are the final standings of the teams with the most number of assists? Indicate the years to which the most number of assists were achieved and the names of the teams.", "after": "Among players who recorded at least seven short-handed assists during a stint with one team, who recorded the most assists in that stint? List their team’s final standing, the year, and the team name."}, "evidence": {"before": "short handed assists refers to SHA; SHA> = 7; final standing refers to rank; the final standing of the team with the most number of assists refers to max(A)", "after": "Scoring records a player’s statistics for a stint with a team in a season; Scoring.stint identifies the stint. Scoring.SHA records short-handed assists, and Scoring.A records assists. Teams.rank records the team’s final standing; Teams.year and Teams.name record the year and team name."}}} {"question_id": 7756, "split": "train", "changes": {"question": {"before": "Please list the names of the first 3 teams that got the most penalty minutes in 2006.", "after": "Please list the three teams with the most penalty minutes in 2006."}, "evidence": {"before": "the first 3 teams that got the most penalty minutes refer to name where MAX(PIM) limit to 3; year = 2006;", "after": "in 2006 refers to Teams.year = 2006; a team's penalty minutes refers to SUM(Teams.PIM) over that team's 2006 rows; return the Teams.name of the three teams with the greatest such SUM, ORDER BY SUM(PIM) DESC LIMIT 3"}}} {"question_id": 7762, "split": "train", "changes": {"question": {"before": "Which team got the most wins in the Stanley Cup finals?", "after": "Which teams have won the most Stanley Cup Final games?"}, "evidence": {"before": "team refers name; most wins = MAX(SUM(W)); Stanley Cup finals refer to round='SCF'", "after": "Stanley Cup Final games refers to SeriesPost rows with round = 'SCF'; in such a row a team's game wins are W when it is the tmIDWinner and L when it is the tmIDLoser; a team's Stanley Cup Final wins = SUM of both over all 'SCF' rows; the most refers to the greatest such total; return the DISTINCT Teams.name of every team that reaches it"}}} {"question_id": 7779, "split": "validation", "changes": {"question": {"before": "Which coach was the first one to teach the Montreal Canadiens, please give his first name.", "after": "Which coach was the first to coach the Montreal Canadiens? Give his first name."}, "evidence": {"before": "the first one refers to MIN(year);", "after": "Coaches.year records a coaching season; Master.firstName records a coach’s first name. Montreal Canadiens is recorded in Teams.name as 'Montreal Canadiens'."}}} {"question_id": 7780, "split": "train", "changes": {"question": {"before": "What is the average winning rate of the Buffalo Sabres in 2000?", "after": "What was the Buffalo Sabres’ winning rate in the 2000 season, expressed as a fraction of games won?"}, "evidence": {"before": "DIVIDE(W,G) where year = 2000; Buffalo Sabres is name of team;", "after": "Buffalo Sabres refers to Teams.name = 'Buffalo Sabres'; the 2000 season refers to Teams.year = 2000; winning rate = DIVIDE(Teams.W, Teams.G) as a real fraction of games won, not multiplied by 100"}}} {"question_id": 7804, "split": "train", "changes": {"question": {"before": "What is the full name of players origin from Finland?", "after": "Give the first and last names of players born in Finland."}, "evidence": {"before": "origin from Finland refers to birthCountry = 'Finland'; full name refers to firstName, lastName", "after": "Master.birthCountry records country of birth."}}} {"question_id": 7808, "split": "validation", "changes": {"question": {"before": "How much is the total goals for player with player ID aaltoan01 and how old is this person?", "after": "What are the total goals for player ID aaltoan01, and how old is the player now?"}, "evidence": {"before": "total goals refer to SUM(G); how old = SUBTRACT(YEAR(CURDATE), birthYear);", "after": "Scoring.G records goals; Master.birthyear records birth year. Age here means the current calendar year minus birth year."}}} {"question_id": 7811, "split": "train", "changes": {"question": {"before": "What is the total number of game played for players from USA?", "after": "What is the total number of regular-season games played by players born in the USA?"}, "evidence": {"before": "game played refers to GP; from USA refers to birthCountry = 'USA';", "after": "Games played refers to Scoring.GP, which records regular-season appearances in the scoring statistics."}}} {"question_id": 7828, "split": "validation", "changes": {"question": {"before": "Provide the name, capital city and its official language of the country with the highest life expectancy.", "after": "Provide the name, capital city, and official language(s) of the country with the highest life expectancy."}, "evidence": {"before": "capital city refers to Capital; official language refers to IsOfficial = 'T'; highest life expectancy refers to MAX(LifeExpectancy);", "after": "Country.Capital identifies the capital city; CountryLanguage.IsOfficial = 'T' denotes an official language. Country.LifeExpectancy records life expectancy."}}} {"question_id": 7838, "split": "train", "changes": {"question": {"before": "In which continent does the country with the smallest surface area belongs?", "after": "Which continent is the country with the smallest surface area in?"}, "evidence": {"before": "smallest surface area refers to MIN(surface area);", "after": ""}}} {"question_id": 7846, "split": "train", "changes": {"question": {"before": "Give the cities and district names that belong to the country with Hajastan as its local name.", "after": "Give the cities and district names in the country whose local name is Hajastan."}, "evidence": {"before": null, "after": "Country.LocalName = 'Hajastan' identifies the country; City.CountryCode joins its cities, and City.Name and City.District record the requested fields."}}} {"question_id": 7855, "split": "train", "changes": {"question": {"before": "What is the name of country in Asia has the largest gross national product(GNP)?", "after": "Which country in Asia has the largest gross national product (GNP)?"}, "evidence": {"before": "Asia refers to Continent = 'Asia'; largest gross national product refers to MAX(GNP);", "after": "Country.GNP records gross national product."}}} {"question_id": 7867, "split": "train", "changes": {"question": {"before": "List the names of all the cities in the country where there is highest life expectancy.", "after": "List all cities in the country with the highest life expectancy."}, "evidence": {"before": "highest life expectancy refers to MAX(LifeExpectancy);", "after": "the highest life expectancy refers to Country.LifeExpectancy = MAX(LifeExpectancy) over the Country rows; list the City.Name of every city in that country"}}} {"question_id": 7872, "split": "train", "changes": {"question": {"before": "Calculate the percentage of the surface area of all countries that uses Chinese as one of their languages.", "after": "Calculate what percentage of all countries’ surface area belongs to countries that use Chinese as one of their languages."}, "evidence": {"before": "percentage = MULTIPLY(DIVIDE(SUM(SurfaceArea WHERE Language = 'Chinese'), SUM(SurfaceArea)), 100); Chinese as one of the languages refers to Language = 'Chinese';", "after": "countries that use Chinese refers to the DISTINCT Country rows with a CountryLanguage Language = 'Chinese'; percentage = DIVIDE(SUM(SurfaceArea) of those countries, SUM(SurfaceArea) of all Country rows) * 100"}}} {"question_id": 7881, "split": "train", "changes": {"question": {"before": "What are the life expectancies of residents in the most crowded cities?", "after": "What is the life expectancy in the country with the largest city by population?"}, "evidence": {"before": "most crowded city refers to MAX(Population);", "after": "the largest city by population refers to the city whose Population = MAX(Population) over every city; life expectancy refers to Country.LifeExpectancy of that city's country, a national expectancy at birth rather than a city-specific statistic"}}} {"question_id": 7883, "split": "validation", "changes": {"question": {"before": "Within the countries of 5 most crowded cities in the world, which country has the most languages used?", "after": "Among the countries containing the five most populous cities in the world, which country has the most languages?"}, "evidence": {"before": "most crowded cities refers to MAX(Population); has the most languages used refers to MAX(COUNT(Language));", "after": "City.Population records city population; CountryLanguage.Language records languages used in a country."}}} {"question_id": 7886, "split": "train", "changes": {"question": {"before": "What are the cities for country called \"´Uman\" in local name.", "after": "Which cities are in the country whose local name is \"´Uman\"? List their names."}, "evidence": {"before": null, "after": "The stored local name is '´Uman', beginning with the acute-accent character ´."}}} {"question_id": 7922, "split": "train", "changes": {"question": {"before": "Name all the categories for podcast titled 'I Heart My Life Show'.", "after": "Name all the categories for the podcast titled 'I Heart My Life Show'."}, "evidence": {"before": "'I Hearty My Life Show' is the title of podcast", "after": "podcasts.title = 'I Heart My Life Show' identifies the podcast; categories.category records its categories."}}} {"question_id": 7923, "split": "train", "changes": {"question": {"before": "List all the podcast title and its itunes url under the 'society-culture' category.", "after": "List all podcast titles and their iTunes URLs in the “society-culture” category."}, "evidence": {"before": null, "after": "podcasts.itunes_url records the iTunes URL; categories.category uses 'society-culture'."}}} {"question_id": 7947, "split": "train", "changes": {"evidence": {"before": "review added each year refers to runs_at like '2021%' and runs_at like '2022%'; percentage for 2021 = Divide (Sum(reviews_added(runs_at like '2021%)), Sum(reviews_added)) * 100; percentage of 2022 = Divide (Sum(reviews_added(runs_at like '2022%')), Sum(reviews_added)) * 100", "after": "review added each year refers to runs_at like '2021%' and runs_at like '2022%'; percentage for 2021 = Divide (Sum(reviews_added(runs_at like '2021%')), Sum(reviews_added)) * 100; percentage of 2022 = Divide (Sum(reviews_added(runs_at like '2022%')), Sum(reviews_added)) * 100"}}} {"question_id": 7948, "split": "train", "changes": {"question": {"before": "Indicates the title of all podcasts in the fiction category.", "after": "List the titles of all podcasts in the fiction category."}, "evidence": {"before": "in the fiction category refers to category = 'fiction'", "after": "categories.category uses 'fiction'; podcasts.title records podcast titles."}}} {"question_id": 7965, "split": "train", "changes": {"question": {"before": "What are the longest reviews?", "after": "Which reviews have the longest content?"}, "evidence": {"before": "review refers to content; longest review refers to Max(length(content))", "after": "a review refers to reviews.content; the longest content refers to LENGTH(content) = MAX(LENGTH(content)) over all reviews, measured in characters; return the content of every review tied at that maximum length"}}} {"question_id": 7995, "split": "validation", "changes": {"question": {"before": "In 2014, what are the names of the universities which were considered leaders in the publications rank?", "after": "Which universities had the largest publication rank number in 2014? Include any ties."}, "evidence": {"before": "In 2014 refers to year = 2014; leader refers to MAX(score); in the publications rank refers to criteria_name = 'Publications Rank'; name of university refers to university_name;", "after": "Publication rank refers to criteria_name = 'Publications Rank'; its numerical value is recorded in score. University names are recorded in university_name."}}} {"question_id": 8021, "split": "train", "changes": {"question": {"before": "In which country does the most populated university in 2014 located ?", "after": "In which country is the most populated university in 2014 located?"}, "evidence": {"before": "in which country refers to country name; the most populated university refers to max(num_students); in 2014 refers to year = 2014", "after": "the most populated university in 2014 refers to the university_year row for 2014 with the greatest num_students; return the country_name of the country where that university is located"}}} {"question_id": 8052, "split": "train", "changes": {"question": {"before": "How many universities got less than 50 scores under ranking criteria ID 6 in 2011?", "after": "How many universities received scores below 50 for ranking criterion ID 6 in 2011?"}, "evidence": {"before": "in 2011 refers to year 2011; less than 50 scores refers to score < 50;", "after": "university_ranking_year.ranking_criteria_id identifies the ranking criterion; score records its score for the recorded year."}}} {"question_id": 8113, "split": "train", "changes": {"question": {"before": "In years 2011 to 2013, what is the total number of female students in university ID 40?", "after": "For university ID 40, what is the estimated total female enrollment across 2011, 2012, and 2013? Round your answer to 2 decimal places."}, "evidence": {"before": "total number of female students refers to SUM(DIVIDE(MULTIPLY(pct_female_students, num_students), 100)); In years 2011 to 2013 refers to year BETWEEN 2011 AND 2013", "after": "university ID 40 refers to the university_year rows for university 40; across 2011, 2012 and 2013 refers to year BETWEEN 2011 AND 2013; estimated total female enrollment = ROUND(SUM(DIVIDE(MULTIPLY(num_students, pct_female_students), 100)), 2)"}, "SQL": {"before": "SELECT SUM(CAST(num_students * pct_female_students AS REAL) / 100) FROM university_year WHERE year BETWEEN 2011 AND 2013 AND university_id = 40", "after": "WITH unrounded(value) AS (\nSELECT SUM(CAST(num_students * pct_female_students AS REAL) / 100) FROM university_year WHERE year BETWEEN 2011 AND 2013 AND university_id = 40\n) SELECT ROUND(value, 2) FROM unrounded;"}}} {"question_id": 8124, "split": "train", "changes": {"evidence": {"before": "highest number of female students refers to MAX(SUBTRACT(num_students, DIVIDE(MULTIPLY(num_students, pct_female_students), 100))); name of university refers to university_name", "after": "male students in a university's year refers to MULTIPLY(university_year.num_students, 1 - DIVIDE(university_year.pct_female_students, 100.0)); the highest number of male students in a single year refers to the greatest such value over the university_year records; provide the university_name of that university"}}} {"question_id": 8181, "split": "train", "changes": {"question": {"before": "Which weather station has the highest number of stores?", "after": "Which weather station serves the highest number of stores?"}, "evidence": {"before": "number of store refers to Count(store_nbr); highest number of store refers to Max(Count(store_nbr)); weather station refers to station_nbr", "after": "a station's number of stores refers to COUNT(relation.store_nbr) for that station_nbr; return the single relation.station_nbr with the greatest such count"}}} {"question_id": 8206, "split": "train", "changes": {"question": {"before": "List out stations number of and items sold by store 17.", "after": "List the weather station number for store 17 and the item numbers it has sold."}, "evidence": {"before": "station number refers to station_nbr; store 17 refers to store_nbr = 17; sold by refers to units>0", "after": "relation.station_nbr identifies the store’s weather station. sales_in_weather.item_nbr identifies an item; units records its daily units sold."}}} {"question_id": 8215, "split": "train", "changes": {"question": {"before": "What was the total unit sold for item 10 when the average temperature was below the average of the average temperature?", "after": "How many units of item 10 were sold on days when the average temperature at the store’s weather station was below the overall average recorded temperature?"}, "evidence": {"before": "item 10 refers to item_nbr = 10; average temperature below median temperature refers to tavg < avg(tavg); total units refers to Sum(units)", "after": "item 10 refers to item_nbr = 10; match each store to its weather station through relation, and weather to the sale on that station_nbr and the same date; below the overall average recorded temperature refers to that day's tavg < AVG(tavg) over all weather rows, ignoring missing tavg; how many units refers to SUM(units)"}, "SQL": {"before": "SELECT SUM(T5.units) FROM weather AS T4 INNER JOIN sales_in_weather AS T5 ON T4.`date` = T5.`date` INNER JOIN relation AS T6 ON T5.store_nbr = T6.store_nbr WHERE T5.item_nbr = 10 AND T4.tavg < ( SELECT AVG(T1.tavg) FROM weather AS T1 )", "after": "SELECT SUM(T5.units) FROM weather AS T4 INNER JOIN sales_in_weather AS T5 ON T4.`date` = T5.`date` INNER JOIN relation AS T6 ON T5.store_nbr = T6.store_nbr AND T4.station_nbr = T6.station_nbr WHERE T5.item_nbr = 10 AND T4.tavg < ( SELECT AVG(T1.tavg) FROM weather AS T1 )"}}} {"question_id": 8218, "split": "train", "changes": {"question": {"before": "Which countries have more than 90% of African? List the name of the country in full.", "after": "Which countries have more than 90% of their population in the African ethnic group? Give the full country names."}, "evidence": {"before": "Percentage = 90 means 90% of the population", "after": "ethnicGroup.Percentage records a group’s percentage of the country’s population; ethnicGroup.Name uses 'African'."}}} {"question_id": 8222, "split": "validation", "changes": {"question": {"before": "State the country and its population with population growth greater than 2% but infant mortality rate less than 5%.", "after": "Which countries have population growth above 2% and an infant mortality rate below 5%? List their names and populations."}, "evidence": {"before": null, "after": "Country names and populations are recorded in country.Name and country.Population. population.Population_Growth is the annual growth rate expressed as a percentage; population.Infant_Mortality is expressed per thousand."}}} {"question_id": 8232, "split": "train", "changes": {"question": {"before": "What is the number of growth population for country with the lowest infant mortality?", "after": "What is the annual population growth, in people, for the country with the lowest infant mortality rate?"}, "evidence": {"before": "Growth population = population_growth * population/100", "after": "population.Population_Growth is an annual percentage rate; country.Population is in people. population.Infant_Mortality is measured per thousand."}}} {"question_id": 8234, "split": "validation", "changes": {"question": {"before": "Calculate the service of GDP for Brazil.", "after": "What is the value of Brazil’s service-sector GDP?"}, "evidence": {"before": "The service of GDP can be computed by service * GDP/100", "after": "economy.GDP records GDP; economy.Service records the percentage attributable to services. Brazil is recorded in country.Name as 'Brazil'."}}} {"question_id": 8273, "split": "train", "changes": {"question": {"before": "Which two countries have the longest border in the world? Give the full name of the country.", "after": "Which two countries share the longest border? Give both countries’ full names."}, "evidence": {"before": null, "after": "borders.Length records border length. borders.Country1 and borders.Country2 link to country.Code, and country.Name provides both full country names."}}} {"question_id": 8288, "split": "train", "changes": {"question": {"before": "Where is the capital of country which has the largest percentage of Malay people?", "after": "What is the capital of the country with the largest percentage of Malay people?"}, "evidence": {"before": "Malay is one of country names", "after": "Malay is an ethnic group recorded in ethnicGroup.Name, and ethnicGroup.Percentage records its share of a country’s population. country.Capital records the capital."}}} {"question_id": 8313, "split": "train", "changes": {"question": {"before": "Please list the name of countries on the European Continent that have a population growth of more than 1%.", "after": "Please list the names of countries on the European continent that have population growth above 1%."}, "evidence": {"before": "population growth of more than 1% refers to population_growth > 1", "after": "population.Population_Growth records population growth as a percentage; encompasses.Continent uses 'Europe'."}}} {"question_id": 8314, "split": "train", "changes": {"question": {"before": "How many countries on the European Continent has an infant mortality rate per thousand of over 100?", "after": "How many countries on the European continent have an infant mortality rate over 100 per thousand?"}, "evidence": {"before": null, "after": "population.Infant_Mortality records infant deaths per thousand; encompasses.Continent uses 'Europe'."}}} {"question_id": 8325, "split": "train", "changes": {"question": {"before": "List the all the cities and its city population for provinces with population more than 1000000.", "after": "List all cities and their populations in provinces with populations over 1,000,000."}, "evidence": {"before": null, "after": "A province is identified by both its name and country in city and province."}}} {"question_id": 8328, "split": "train", "changes": {"question": {"before": "Calculate the percentage of population in Edmonton city to the population of its province.", "after": "Calculate Edmonton’s population as a percentage of the population of its province."}, "evidence": {"before": "Percentage of population in each city = population(city) / population(province) * 100%", "after": "Edmonton refers to city.Name = 'Edmonton'; Edmonton's population as a percentage of the population of its province refers to DIVIDE(city.Population, province.Population) * 100"}}} {"question_id": 8329, "split": "train", "changes": {"question": {"before": "Which are the rivers that flows to Black Sea?", "after": "Which rivers flow into the Black Sea?"}, "evidence": {"before": "Black Sea is a sea located in Eastern Europe and Western Asia", "after": "river.Sea records the sea a river flows into, including 'Black Sea'."}}} {"question_id": 8336, "split": "train", "changes": {"question": {"before": "List all the cities and provinces located at the rivers that flows to Atlantic Ocean.", "after": "List the cities and their provinces located on rivers that flow into the Atlantic Ocean."}, "evidence": {"before": "Atlantic Ocean is the second-largest ocean on Earth, after the Pacific Ocean; Ocean and sea share the same meaning", "after": "located.River records the river a city lies on. river.Sea records its outlet, including the value 'Atlantic Ocean'."}}} {"question_id": 8347, "split": "train", "changes": {"question": {"before": "Which rivers are Belgrade city located at? Please provide their names and lengths.", "after": "Which rivers is Belgrade located on? Give their names and lengths."}, "evidence": {"before": null, "after": "located.River records the river a city lies on."}}} {"question_id": 8356, "split": "train", "changes": {"question": {"before": "How many people in Montenegro speaks Serbian?", "after": "What is the estimated number of Serbian speakers in Montenegro? Round your answer to 4 decimal places."}, "evidence": {"before": "Serbian is one language; Montenegro is a country located in Southeastern Europe", "after": "language.Percentage is the percentage of a country’s population speaking the language; country.Population is in people."}, "SQL": {"before": "SELECT T1.Percentage * T2.Population /100 FROM language AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'Serbian' AND T2.Name = 'Montenegro'", "after": "WITH unrounded(value) AS (\nSELECT T1.Percentage * T2.Population /100 FROM language AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'Serbian' AND T2.Name = 'Montenegro'\n) SELECT ROUND(value, 4) FROM unrounded;"}}} {"question_id": 8368, "split": "train", "changes": {"question": {"before": "What are the names of the sea that can be found on the island with the biggest area?", "after": "What are the names of the seas surrounding the island with the largest area?"}, "evidence": {"before": null, "after": "islandIn records the seas in which an island lies."}}} {"question_id": 8370, "split": "train", "changes": {"question": {"before": "How many people reside in the nation's capital city, which is situated in the nation that attained independence on 8/15/1947?", "after": "How many people live in the capital city of the nation that attained independence on 8/15/1947?"}, "evidence": {"before": null, "after": "politics.Independence records the independence date; August 15, 1947 is represented as '1947-08-15'. country.Capital identifies the capital and city.Population records its population."}}} {"question_id": 8448, "split": "train", "changes": {"question": {"before": "Which United States provinces are homes to the greatest number of corporations' corporate headquarters?", "after": "Which US state or federal district has the most organization headquarters?"}, "evidence": {"before": "Organization refers to corporation", "after": "organization.Province records the headquarters’ state or federal district; organization.Country = 'USA' identifies US headquarters."}}} {"question_id": 8454, "split": "train", "changes": {"question": {"before": "What sea does the Baltic Sea converge with, and how deep is the Baltic Sea?", "after": "Which seas are directly connected to the Baltic Sea, and what is the Baltic Sea’s maximum depth?"}, "evidence": {"before": "Coverage refers to mergesWith", "after": "Sea connections are recorded in mergesWith. The Baltic Sea may appear in either Sea1 or Sea2; the other column gives the connected sea. The Baltic Sea’s maximum depth refers to sea.Depth where Name = 'Baltic Sea'."}, "SQL": {"before": "SELECT T2.Sea2, T1.Depth FROM sea AS T1 INNER JOIN mergesWith AS T2 ON T1.Name = T2.Sea1 WHERE T1.Name = 'Baltic Sea'", "after": "SELECT DISTINCT CASE WHEN T2.Sea1 = T1.Name THEN T2.Sea2 ELSE T2.Sea1 END AS ConnectedSea, T1.Depth FROM sea AS T1 INNER JOIN mergesWith AS T2 ON T1.Name = T2.Sea1 OR T1.Name = T2.Sea2 WHERE T1.Name = 'Baltic Sea'"}}} {"question_id": 8455, "split": "train", "changes": {"question": {"before": "Which constitutional monarchy nations saw the greatest growth in the number of organizations after 1907?", "after": "Which constitutional monarchies saw the greatest growth in the number of organizations after 1907?"}, "evidence": {"before": "Nation refers to country; Information of growth appears in the column Established", "after": "politics.Government uses 'constitutional monarchy'. organization.Country is the headquarters country; organization.Abbreviation identifies an organization. organization.Established is its establishment date, stored as YYYY-MM-DD."}}} {"question_id": 8477, "split": "train", "changes": {"question": {"before": "Among the organizations where headquarters are in the 'USA', what is the percentage of the them are in 'Washington'?", "after": "What percentage of organizations headquartered in the USA are headquartered in Washington?"}, "evidence": {"before": "percentage can be computed by [count(City = 'Washington') / count(all cities)] * 100%", "after": "headquartered in the USA refers to organization.Country = 'USA'; in Washington refers to organization.City = 'Washington'; percentage = DIVIDE(COUNT(those USA organizations with City = 'Washington'), COUNT(City over those USA organizations)) * 100"}}} {"question_id": 8486, "split": "train", "changes": {"question": {"before": "List the full name of its capital of all the countries with parliamentary democracy government.", "after": "List the capital names of all countries with a parliamentary democracy government."}, "evidence": {"before": "Parliamentary democracy is a government form", "after": "politics.Government uses 'parliamentary democracy'."}}} {"question_id": 8489, "split": "train", "changes": {"question": {"before": "When did the United States of America attained it's Independence?", "after": "When did the United States of America gain independence?"}, "evidence": {"before": null, "after": "The United States of America is recorded as country.Name = 'United States'. politics.Independence uses YYYY-MM-DD."}}} {"question_id": 8494, "split": "train", "changes": {"question": {"before": "What river has the 17th-longest length overall? Specify it's length.", "after": "What river has the 17th-longest overall length? Specify its length."}, "evidence": {"before": null, "after": "river.Name and river.Length record the river name and length."}}} {"question_id": 8506, "split": "train", "changes": {"evidence": {"before": "Percentage = count(countries independent 1960) / total num of countries", "after": "became independent during the year 1960 refers to an Independence date in 1960; percentage = DIVIDE(SUM(CASE WHEN Independence is in 1960 THEN 1 ELSE 0 END), COUNT(Country)) * 100 over politics"}}} {"question_id": 8508, "split": "train", "changes": {"question": {"before": "Indicate the coordinates of all the deserts whose area is in more than one country.", "after": "Indicate the coordinates of all deserts that span more than one country."}, "evidence": {"before": "coordinates consists of Latitude, Longitude", "after": "desert.Latitude and desert.Longitude record coordinates; geo_desert.Country records countries containing a desert."}}} {"question_id": 8517, "split": "train", "changes": {"question": {"before": "Please list the occupations of the customers over 40 and have sent a true response to the incentive mailing sent by the marketing department.", "after": "Please list the occupations of customers over 40 who sent a true response to the marketing department’s incentive mailing."}, "evidence": {"before": "over 40 refers to age > 40; RESPONSE = 'true';", "after": "Mailings1_2.RESPONSE and mailings3.RESPONSE use 'true' for a positive response. Customers.OCCUPATION records occupation."}}} {"question_id": 8523, "split": "train", "changes": {"question": {"before": "Of the all customers who sent a true response to the incentive mailing sent by the marketing department, how many of them are divorced males?", "after": "How many divorced male customers responded positively to an incentive mailing from the marketing department?"}, "evidence": {"before": "RESPONSE = 'true'; SEX = 'Male'; MARITAL_STATUS = 'Divorced';", "after": "Mailings1_2.RESPONSE and mailings3.RESPONSE use 'true' for positive responses; REFID identifies the responding customer. Divorced male customers have Customers.SEX = 'Male' and Customers.MARITAL_STATUS = 'Divorced'."}, "SQL": {"before": "WITH AllMailings AS (SELECT * FROM Mailings1_2 UNION SELECT * FROM mailings3) SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN AllMailings AS T2 ON T1.ID = T2.REFID WHERE T1.SEX = 'Male' AND T1.MARITAL_STATUS = 'Divorced' AND T2.RESPONSE = 'true'", "after": "WITH AllMailings AS (\n SELECT * FROM Mailings1_2\n UNION\n SELECT * FROM mailings3\n)\nSELECT COUNT(DISTINCT T1.ID)\nFROM Customers AS T1\nINNER JOIN AllMailings AS T2\n ON T1.ID = T2.REFID\nWHERE T1.SEX = 'Male'\n AND T1.MARITAL_STATUS = 'Divorced'\n AND T2.RESPONSE = 'true';"}}} {"question_id": 8527, "split": "train", "changes": {"question": {"before": "Of the first 60,000 customers, how many of them sent a true response to the incentive mailing sent by the marketing department and are teenagers?", "after": "Among the first 60,000 customers, how many teenagers sent a true response to the marketing department’s incentive mailing?"}, "evidence": {"before": "RESPONSE = 'true'; teenagers are people aged between 13 and 19 years; the first 60,000 customers refers to all customers in the Mailings1_2 table", "after": "The first 60,000 customers are represented in Mailings1_2; RESPONSE = 'true' denotes a positive response. Teenagers are aged 13 through 19."}}} {"question_id": 8547, "split": "train", "changes": {"question": {"before": "In female customers ages from 50 to 60, how many of them has an number of inhabitants ranges from 19000 to 24000?", "after": "How many female customers aged 50 through 60 live in areas with 19,000 through 24,000 inhabitants?"}, "evidence": {"before": "female customers ages from 50 to 60 refer to SEX = 'Female' where age BETWEEN 50 AND 60; number of inhabitants ranges from 19000 to 24000 refers to INHABITANTS_K BETWEEN 19 AND 24;", "after": "Demog.INHABITANTS_K records population in thousands. Customers.GEOID identifies the geographic area."}}} {"question_id": 8571, "split": "train", "changes": {"question": {"before": "List the marital status and response of female customers with an level of education of 8 and above.", "after": "List the marital status and response of female customers with an education level of 8 or above."}, "evidence": {"before": "female customers with an level of education of 8 and above refer to SEX = 'Female' where EDUCATIONNUM ≥ 8;", "after": "Customers.SEX = 'Female' denotes female; Customers.EDUCATIONNUM records education level. Mailings1_2.RESPONSE and mailings3.RESPONSE record mailing responses."}}} {"question_id": 8572, "split": "train", "changes": {"question": {"before": "What is the age of female customers within the number of inhabitants below 30?", "after": "What are the ages of female customers living in areas with fewer than 30,000 inhabitants?"}, "evidence": {"before": "female customers within the number of inhabitants below 30 refer to SEX = 'Female' where INHABITANTS_K < 30;", "after": "Demog.INHABITANTS_K records population in thousands. Customers.GEOID identifies the geographic area."}}} {"question_id": 8576, "split": "train", "changes": {"question": {"before": "List the income and number of inhabitants of customers with a reference ID greater than the 50% of the total number of false responses?", "after": "List the income and number of inhabitants for customers whose reference ID is greater than half the total number of false responses."}, "evidence": {"before": "reference ID greater than the 50% of average of number of false response refers to REFID > DIVIDE(MULTIPLY(0.5, COUNT(RESPONSE = 'false')), COUNT(RESPONSE)); income refers to INCOME_K; number of inhabitants refer to INHABITANTS_K;", "after": "false responses refers to RESPONSE = 'false' in Mailings1_2 and mailings3; half the total number of false responses refers to 0.5 * COUNT(those responses); the customers listed refers to those whose REFID is greater than that; list both Demog.INCOME_K and Demog.INHABITANTS_K"}}} {"question_id": 8588, "split": "train", "changes": {"evidence": {"before": "community area refers to community_area_name; the least population refers to min(population)", "after": "Community_Area.population stores population as text with comma thousands separators, so compare CAST(REPLACE(population, ',', '') AS INTEGER); the least population refers to the MIN of that compared value; return the community_area_name of the community area holding it"}}} {"question_id": 8601, "split": "train", "changes": {"question": {"before": "More crimes happened in which community area in January, 2018, Woodlawn or Lincoln Square?", "after": "Which community area had more reported crimes in January 2018: Woodlawn or Lincoln Square?"}, "evidence": {"before": "in January 2018 refers to date like '1/%/2018%'; Woodlawn or Lincoln Square refers to community_area_name in ('Woodlawn', 'Lincoln Square'); number of crime refers to COUNT(report_no); the higher the report_no, the more crimes happened in the community;", "after": "in January 2018 refers to Crime.date LIKE '1/%/2018%'; reported crimes of a community area refers to the COUNT of Crime rows with that community_area_name; more reported crimes refers to whichever of 'Woodlawn' and 'Lincoln Square' had the larger such count"}}} {"question_id": 8604, "split": "train", "changes": {"question": {"before": "Among the crimes in all the districts in Chicago, what is the percentage of them happening in the Central district?", "after": "Among recorded crime cases assigned to a Chicago district, what percentage occurred in the Central district? Round your answer to 4 decimal places."}, "evidence": {"before": "the Central district refers to district_name = 'Central'; percentage = divide(count(case_number where district_name = 'Central'), count(case_number)) * 100%", "after": "assigned to a Chicago district refers to Crime.district_no matching District.district_no; the Central district refers to District.district_name = 'Central'; crime cases refers to COUNT(DISTINCT case_number); percentage = ROUND(DIVIDE(COUNT(DISTINCT case_number in the Central district), COUNT(DISTINCT case_number)) * 100, 4)"}, "SQL": {"before": "SELECT CAST(SUM(CASE WHEN T2.district_name = 'Central' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.case_number) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * COUNT(DISTINCT CASE WHEN d.district_name='Central' THEN c.case_number END) / COUNT(DISTINCT c.case_number) FROM Crime c JOIN District d ON d.district_no=c.district_no\n) SELECT ROUND(value, 4) FROM unrounded;"}}} {"question_id": 8614, "split": "validation", "changes": {"question": {"before": "Who was the alderman of the legislative district where case No. JB103470 took place? Give the full name.", "after": "What are the first and last names of the alderman for the ward where case JB103470 occurred?"}}} {"question_id": 8619, "split": "train", "changes": {"question": {"before": "What is the percentage of under $500 thefts among all cases that happened in West Englewood?", "after": "Of all cases recorded in West Englewood, what percentage were thefts classified as $500 and under? Round your answer to 2 decimal places."}, "evidence": {"before": "under $500 refers to secondary_description = '$500 AND UNDER'; theft refers to primary_description = 'THEFT'; West Englewood refers to community_area_name = 'West Englewood'; percentage = divide(count(case_number where secondary_description = '$500 AND UNDER'), count(case_number)) where primary_description = 'THEFT' and community_area_name = 'West Englewood' * 100%", "after": "West Englewood refers to community_area_name = 'West Englewood'; a $500-and-under theft refers to IUCR.primary_description = 'THEFT' AND secondary_description = '$500 AND UNDER'; percentage = DIVIDE(COUNT(DISTINCT case_number so classified), COUNT(DISTINCT case_number in West Englewood)) * 100, rounded to 2 decimals"}, "SQL": {"before": "SELECT CAST(SUM(CASE WHEN i.`primary_description` = 'THEFT' AND i.`secondary_description` = '$500 AND UNDER' THEN 1 ELSE 0 END) AS REAL) * 100.0 / COUNT(*) AS pct_under_500_theft_all_cases FROM `Crime` c JOIN `Community_Area` ca ON c.`community_area_no` = ca.`community_area_no` JOIN `IUCR` i ON c.`iucr_no` = i.`iucr_no` WHERE ca.`community_area_name` = 'West Englewood'", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * COUNT(DISTINCT CASE WHEN i.primary_description='THEFT' AND i.secondary_description='$500 AND UNDER' THEN c.case_number END) / COUNT(DISTINCT c.case_number) FROM Crime c JOIN Community_Area ca ON ca.community_area_no=c.community_area_no LEFT JOIN IUCR i ON i.iucr_no=c.iucr_no WHERE ca.community_area_name='West Englewood'\n) SELECT ROUND(value, 2) FROM unrounded;"}}} {"question_id": 8635, "split": "train", "changes": {"evidence": {"before": "short description refers to title; committed the most refers to max(fbi_code_no); the least populated community refers to min(population)", "after": "the least populated community refers to the community with the lowest population after removing commas and converting it to an INTEGER; committed the most refers to the highest COUNT(*) of crime records grouped by FBI_Code.title among criminals in that selected community; short description refers to that FBI_Code.title"}}} {"question_id": 8644, "split": "train", "changes": {"question": {"before": "List down the titles and descriptions of the crimes cases against persons.", "after": "List the titles and descriptions of crime categories classified as crimes against persons."}, "evidence": {"before": "crime case against persons refers to crime_against = 'Persons'", "after": "Crime-category titles and descriptions are recorded in FBI_Code; crime_against = 'Persons' denotes crimes against persons."}}} {"question_id": 8648, "split": "train", "changes": {"question": {"before": "Provide case numbers, aldermen's full names, and district names of the crimes that happened in 0000X N FRANCISCO AVE.", "after": "For crimes on 0000X N FRANCISCO AVE, list the case number, the alderman’s first and last names, and the district name, in that order."}, "evidence": {"before": "aldermen's full name refers to alderman_name_suffix, alderman_first_name, alderman_last_name; 0000X N FRANCISCO AVE refers to block = '0000X N FRANCISCO AVE'", "after": "Crime.block records '0000X N FRANCISCO AVE'. Ward.alderman_first_name and alderman_last_name record the requested name components; District.district_name records the district name."}}} {"question_id": 8679, "split": "train", "changes": {"question": {"before": "Among the crimes, what percentage are severe?", "after": "What percentage of recorded crime cases are classified as severe? Round your answer to 2 decimal places."}, "evidence": {"before": "severe refers to index_code = 'I'; percentage = divide(count(iucr_no where index_code = 'I'), count(iucr_no)) * 100%", "after": "crime cases refers to COUNT(DISTINCT case_number), since repeated rows can describe the same case; severe refers to index_code = 'I' on the matching IUCR classification, with cases that lack one kept in the denominator; percentage = ROUND(DIVIDE(COUNT(DISTINCT severe case_number), COUNT(DISTINCT case_number)) * 100, 2)"}, "SQL": {"before": "SELECT 100.0 * SUM(CASE WHEN i.`index_code` = 'I' THEN 1 ELSE 0 END) / COUNT(*) AS severe_percentage FROM `Crime` c JOIN `IUCR` i ON c.`iucr_no` = i.`iucr_no`", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * COUNT(DISTINCT CASE WHEN i.index_code='I' THEN c.case_number END) / COUNT(DISTINCT c.case_number) FROM Crime c LEFT JOIN IUCR i ON i.iucr_no=c.iucr_no\n) SELECT ROUND(value, 2) FROM unrounded;"}}} {"question_id": 8680, "split": "train", "changes": {"question": {"before": "What kind of location in Austin reported the most number of crimes?", "after": "What type of location in Austin had the most reported crimes?"}, "evidence": {"before": "\"Austin\" is the district_name; the most number of crime refers to Max(Count(case_number)); kind of location refers to location_description", "after": "Austin refers to District.district_name = 'Austin'; type of location refers to Crime.location_description; the most reported crimes refers to the location_description with the highest COUNT(case_number) among Austin crimes, taking the single top one"}}} {"question_id": 8690, "split": "train", "changes": {"question": {"before": "List the name and population of the communities where more than average solicit for prostitutes were reported.", "after": "Which communities had more solicitation-for-prostitution reports than the average across all communities? List their names and populations."}, "evidence": {"before": "\"SOLICIT FOR PROSTITUTE\" is the secondary_description; more than average refers to count(iucr_no) > Divide (Count(secondary_description = 'SOLICIT FOR PROSTITUTE'), Count(iucr_no)); name of community refers to community_area_name", "after": "solicitation-for-prostitution reports refers to crime records whose IUCR.secondary_description = 'SOLICIT FOR PROSTITUTE', counted for each community; the average refers to AVG of those per-community report counts across all communities; list the Community_Area.community_area_name and population of each community whose count is greater than that average"}}} {"question_id": 8695, "split": "train", "changes": {"question": {"before": "What is the first name of the aldermen of wards with more than 50,000 inhabitants?", "after": "What are the first names of aldermen for wards with more than 50,000 inhabitants?"}, "evidence": {"before": "more than 50000 inhabitants refers to Population > 50000; first name of alderman refers to alderman_first_name", "after": "Ward.alderman_first_name records the alderman’s first name."}}} {"question_id": 8705, "split": "train", "changes": {"question": {"before": "What types of domestic crimes have occurred the most in the North Lawndale community?", "after": "Which types of domestic crimes occurred most often in the North Lawndale community?"}, "evidence": {"before": "\"North Lawndale' is the community_area_name; occur the most domestic crime refers to Max(Count(domestic = 'TRUE')); type of a domestic crime refers to IUCR.primary_description", "after": "North Lawndale community refers to Community_Area.community_area_name = 'North Lawndale'; domestic refers to Crime.domestic = 'TRUE'; type of crime refers to IUCR.primary_description; occurred most often refers to the single primary_description with the highest COUNT of such crimes"}}} {"question_id": 8710, "split": "train", "changes": {"question": {"before": "What are the full names of the top 5 most crowded ward aldermen?", "after": "What are the full names of the aldermen for the five most populous wards?"}, "evidence": {"before": "most crowded ward refers to Max(Population); full name of alderman refers to alderman_first_name, alderman_last_name", "after": "the five most populous wards refers to ordering Ward rows by Ward.Population descending and taking the top 5; full name refers to Ward.alderman_first_name and Ward.alderman_last_name; return both name columns"}}} {"question_id": 8741, "split": "train", "changes": {"question": {"before": "Please name three communities that experience the fraud incident.", "after": "Name three communities where a fraud incident occurred."}, "evidence": {"before": "communities refers to community_area_name; 'Fraud' is the title of crime", "after": "Community names are Community_Area.community_area_name. Fraud is identified by FBI_Code.title = 'Fraud'."}}} {"question_id": 8742, "split": "validation", "changes": {"question": {"before": "What were the major types of crime that happened in the Rogers Park community area?", "after": "What types of crime were reported most often in the Rogers Park community area?"}, "evidence": {"before": "\"Rogers Park\" is the community_area_name; major type of crime refers to title", "after": "Identify Rogers Park using Community_Area.community_area_name = 'Rogers Park'. Crime types are stored in FBI_Code.title. Count the Crime records for each type and return all types tied for the highest count."}}} {"question_id": 8753, "split": "train", "changes": {"question": {"before": "List down the report number of crimes associated with the district commander named Jill M. Stevens.", "after": "List the report numbers of crimes associated with district commander Jill M. Stevens."}, "evidence": {"before": "report number refers report_no; 'Jill M. Stevens\" is the commander", "after": "Crime report numbers are Crime.report_no. District commander is District.commander; Jill M. Stevens is stored as 'Jill M. Stevens'."}}} {"question_id": 8757, "split": "train", "changes": {"evidence": {"before": "general description refers to primary_description; 'ASSAULT' is the primary_description; incidents refers to iucr_no", "after": "IUCR.primary_description = 'ASSAULT' identifies the classification. Crime contains incident records; Crime.iucr_no identifies each incident’s IUCR classification."}}} {"question_id": 8767, "split": "train", "changes": {"evidence": {"before": "in January 2018 refers to Substr(date, 1, 1) = '1' AND Substr(date, 5, 4) = '2018'; against property refers to crime_against = 'Property'", "after": "Crime.date stores month/day/year dates with a time component; month and day widths can vary. FBI_Code.crime_against = 'Property' identifies crimes against property."}}} {"question_id": 8780, "split": "train", "changes": {"question": {"before": "Please list the names of the restaurants that had a low risk violation in inspections in 2014.", "after": "Which restaurants had a low-risk violation recorded in 2014? List their names."}, "evidence": {"before": "inspection in 2014 refers to year(date) = 2014; low risk violations refer to risk_category = 'Low Risk';", "after": "violations.date records the violation date; violations.risk_category = 'Low Risk' identifies low-risk violations. businesses.name records the business name."}}} {"question_id": 8788, "split": "train", "changes": {"question": {"before": "What is the average scores of Tiramisu Kitchen in all inspections?", "after": "What is the average score for Tiramisu Kitchen across all inspections?"}, "evidence": {"before": "avg(score);", "after": "Tiramisu Kitchen refers to businesses.name = 'Tiramisu Kitchen'; average score refers to AVG(inspections.score) over that business's inspections, which skips inspections with no recorded score"}}} {"question_id": 8803, "split": "train", "changes": {"evidence": {"before": "DIVIDE(COUNT(risk_category = 'Moderate Risk' where name = 'Melody Lounge'), COUNT(business_id where name = 'Melody Lounge')) as percentage;", "after": "the violations for 'Melody Lounge' refers to the violations of the businesses row whose name = 'Melody Lounge'; moderate risks refers to risk_category = 'Moderate Risk'; percentage = DIVIDE(SUM(CASE WHEN risk_category = 'Moderate Risk' THEN 1 ELSE 0 END), COUNT(those violations)) * 100"}}} {"question_id": 8812, "split": "train", "changes": {"question": {"before": "How many high risks violations did the Tiramisu Kitchen violate?", "after": "How many High Risk violations are recorded for Tiramisu Kitchen?"}, "evidence": {"before": "Tiramisu Kitchen is the name of the business; high risks violations refer to risk_category = 'High Risk';", "after": "violations.risk_category uses 'High Risk'."}}} {"question_id": 8824, "split": "validation", "changes": {"question": {"before": "How many eateries had low risk for violation with unpermitted food facility description?", "after": "How many eateries have a Low Risk violation described as Unpermitted food facility?"}, "evidence": {"before": "eateries represent business; low risk for violation refers to risk_category = 'Low Risk';", "after": "Eateries are businesses. violations.risk_category uses 'Low Risk'; violations.description uses 'Unpermitted food facility'."}}} {"question_id": 8833, "split": "train", "changes": {"question": {"before": "Among violations on 3rd June, 2014, describe any 5 names, located cities and tax codes of the eateries with high risk category.", "after": "For violations on June 3, 2014, list any five high-risk eateries’ names, cities, and tax codes."}, "evidence": {"before": "eateries with high risk category refer to business_id where risk_category = 'High Risk'; 3rd June, 2014 refers to date = '2014-06-03';", "after": "High risk is recorded as violations.risk_category = 'High Risk'; violations.date records the violation date. Eateries’ names, cities and tax codes are businesses.name, businesses.city and businesses.tax_code."}}} {"question_id": 8834, "split": "train", "changes": {"question": {"before": "What was the inspection type when El Aji Peruvian Restaurant got highest inspection score?", "after": "What was the inspection type for El Aji Peruvian Restaurant’s inspection with the highest score?"}, "evidence": {"before": "El Aji Peruvian Restaurant is the name of the business; highest inspection score refers to MAX(score);", "after": "El Aji Peruvian Restaurant refers to businesses.name = 'El Aji Peruvian Restaurant'; the highest inspection score refers to MAX(inspections.score) among that business's inspections; return the DISTINCT inspections.type recorded at that score"}}} {"question_id": 8835, "split": "train", "changes": {"question": {"before": "Who were the owners of eateries which had highest health hazard by improper cooking time or temperatures?", "after": "Who were the owners of eateries with a high-risk violation for improper cooking time or temperatures?"}, "evidence": {"before": "owners of eateries refer to owner_name; highest health hazard by improper cooking time or temperatures refers to risk_category = 'High Risk' and description = 'Improper cooking time or temperatures';", "after": "Owners’ names are businesses.owner_name. High risk is violations.risk_category = 'High Risk'; the violation description is 'Improper cooking time or temperatures'."}}} {"question_id": 8848, "split": "train", "changes": {"question": {"before": "Who are the owner of the business that have a high risk violation of 103109 and are described as unclean or unsanitary food contact surfaces?", "after": "Who are the owners of businesses with a high-risk violation of type 103109 described as unclean or unsanitary food contact surfaces?"}, "evidence": {"before": "owner refers to owner_name; high risk violation of 103109 and described as unclean or unsanitary food contact surfaces refers to risk_category = 'High Risk' where violation_type_id = 103109 and description = 'Unclean or unsanitary food contact surfaces';", "after": "Owners’ names are businesses.owner_name; high risk is violations.risk_category = 'High Risk'. The description is recorded in violations.description as 'Unclean or unsanitary food contact surfaces'."}}} {"question_id": 8850, "split": "validation", "changes": {"question": {"before": "List the violation type ID of business with business ID from 30 to 50 and located at 747 IRVING St, San Francisco.", "after": "List the violation type IDs for businesses with IDs from 30 to 50 located at 747 IRVING St, San Francisco."}, "evidence": {"before": "business ID from 30 to 50 refers to business_id between 30 and 50; address = '747 IRVING St'; city LIKE 'San Francisco';", "after": "Violation type IDs are recorded in violations.violation_type_id; business address and city are businesses.address and businesses.city."}}} {"question_id": 8851, "split": "train", "changes": {"question": {"before": "What is the owner's name of the of the business that violates 103156 on June 12, 2014?", "after": "List the owner names of businesses with violation type 103156 recorded on June 12, 2014."}, "evidence": {"before": "business that violates 103156 on June 12, 2014 refers to business_id where violation_type_id = 103156 and date = '2014-06-12';", "after": "violations.violation_type_id identifies the violation type. violations.date uses YYYY-MM-DD."}}} {"question_id": 8859, "split": "train", "changes": {"question": {"before": "Of all the beers produced by Stevens Point Brewery, how many percent do they allot for American Adjunct Lager?", "after": "What percentage of Stevens Point Brewery’s beers are American Adjunct Lagers?"}, "evidence": {"before": "Percent allotted = count(American Adjunct Lager beer styles) / count(styles) * 100%", "after": "Stevens Point Brewery refers to breweries.name = 'Stevens Point Brewery'; American Adjunct Lager refers to beers.style = 'American Adjunct Lager'; percentage = DIVIDE(COUNT(that brewery's beers with that style), COUNT(all of that brewery's beers)) * 100"}}} {"question_id": 8862, "split": "train", "changes": {"question": {"before": "What is the title of the recipe that is most likely to gain weight?", "after": "Which recipe has the highest total fat content?"}, "evidence": {"before": "most likely to gain weight refers to MAX(total_fat)", "after": "total fat content refers to Nutrition.total_fat; the recipe with the highest total fat content refers to the greatest total_fat; return Recipe.title"}}} {"question_id": 8888, "split": "train", "changes": {"question": {"before": "How many times is the sodium content in Lasagne-Spinach Spirals to Beef and Spinach Pita Pockets?", "after": "What is the ratio of the sodium content in Lasagne-Spinach Spirals to that in Beef and Spinach Pita Pockets?"}, "evidence": {"before": "sodium is a name of an ingredient; calculation = DIVIDE(SUM(title = 'Lasagne-Spinach Spirals' THEN sodium), SUM(title = 'Beef and Spinach Pita Pockets' THEN sodium))", "after": "sodium content refers to Nutrition.sodium for a recipe; ratio = DIVIDE(SUM(CASE WHEN the recipe is 'Lasagne-Spinach Spirals' THEN sodium ELSE 0 END), SUM(CASE WHEN the recipe is 'Beef and Spinach Pita Pockets' THEN sodium ELSE 0 END)), as a plain ratio"}}} {"question_id": 8890, "split": "train", "changes": {"question": {"before": "What are the names of the recipes that will cause stomach pain?", "after": "Which recipes have a recorded iron content greater than 20 mg? List their names."}, "evidence": {"before": "cause stomach pain refers to iron > 20", "after": "Recipe.title records the recipe name. Nutrition.iron records iron content in milligrams."}}} {"question_id": 8893, "split": "train", "changes": {"question": {"before": "How many ingredients are there in the recipes that are best in helping your body's natural defence against illness and infection?", "after": "How many ingredient entries are associated with the recipe or recipes tied for the highest vitamin A content?"}, "evidence": {"before": "best in helping your body's natural defence against illness and infection refers to MAX(vitamin_a);", "after": "the highest vitamin A content refers to Nutrition.vitamin_a = MAX(vitamin_a), with every tied recipe included; ingredient entries refers to COUNT(*) of Quantity rows whose recipe_id is one of those recipes"}}} {"question_id": 8912, "split": "train", "changes": {"evidence": {"before": "The California Tree Fruit Agreement is a source; calculation = MULTIPLY(DIVIDE(COUNT(sodium = 0 THEN recipe_id), COUNT(recipe_id)), 100)", "after": "The California Tree Fruit Agreement is a source; sodium-free follows the definition recorded for Nutrition.sodium, under 5 mg of sodium per serving, and the column already holds a per-serving figure in milligrams; calculation = MULTIPLY(DIVIDE(COUNT(sodium < 5 THEN recipe_id), COUNT(recipe_id)), 100)"}, "SQL": {"before": "SELECT CAST(SUM(CASE WHEN T2.sodium = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.source = 'The California Tree Fruit Agreement'", "after": "SELECT CAST(SUM(CASE WHEN T2.sodium < 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*)\nFROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id\nWHERE T1.source = 'The California Tree Fruit Agreement'"}}} {"question_id": 8949, "split": "validation", "changes": {"question": {"before": "By what percentage is the average salary of Trainees higher than the minimum salary of this postion?", "after": "How much higher, as a percentage, is the average Trainee salary than the minimum salary for the role?"}, "evidence": {"before": "AVG(salary); Trainee is a position title; minimum salary refers to minsalary; calculation = DIVIDE(SUBTRACT(AVG(salary), minsalary), minsalary) * 100", "after": "employee.salary is annual salary; position.minsalary is the position’s minimum salary. Both use currency text such as 'US$69,000.00'. The minimum salary is the baseline for the percentage increase."}}} {"question_id": 8962, "split": "train", "changes": {"evidence": {"before": "performance is poor refers to performance = 'Poor'; salary of over $50,000 refers to salary > '50000'", "after": "employee.performance = 'Poor' denotes poor performance. employee.salary stores annual salary as formatted currency text with comma separators."}}} {"question_id": 8967, "split": "train", "changes": {"question": {"before": "What is the full office location address where most of the employees work at?", "after": "What is the full office address where the most employees work?"}, "evidence": {"before": "full office location address = address, locationcity, state, zipcode; location where most employees work at refers to MAX(locationID)", "after": "the full office address refers to location.address, location.locationcity, location.state and location.zipcode together; where the most employees work refers to the address group with the greatest COUNT of employee rows with that employee.locationID; return that group's address, locationcity, state and zipcode"}}} {"question_id": 8974, "split": "train", "changes": {"question": {"before": "In which state can you find the highest amount of good performing Account Representatives?", "after": "Which state had the highest number of good-performing Account Representatives?"}, "evidence": {"before": "good performing refers to performance = 'Good'; Account Representatives is a positiontitle; highest amount of employee refers to MAX(positionID);", "after": "good-performing Account Representatives refers to employee.performance = 'Good' with position.positiontitle = 'Account Representative'; return the single location.state with the greatest COUNT of such employees, grouped by state"}}} {"question_id": 8975, "split": "train", "changes": {"question": {"before": "Mention the employee's full name and performance status who got the lowest in salary per year.", "after": "Which employees had the lowest annual salary? Give their first names, last names, and performance statuses."}, "evidence": {"before": "full name = firstname, lastname; the lowest salary refers to MIN(salary)", "after": "annual salary refers to employee.salary, which is formatted text, taken as a number; the lowest annual salary refers to the MIN of that number; return firstname, lastname and performance for the employee at that minimum"}}} {"question_id": 8990, "split": "train", "changes": {"question": {"before": "Which trip had the longest duration? State the start and end station.", "after": "For trips tied for the longest duration, list their start and end station names."}, "evidence": {"before": "start station refers to start_station_name; end station refers to end_station_name;", "after": "trip.start_station_name and trip.end_station_name record the start and end stations; trip.duration records trip length."}}} {"question_id": 8992, "split": "train", "changes": {"evidence": {"before": "final station refers to end_station_name where MAX(end_date);", "after": "bike id 13 refers to the trip rows whose bike id is 13; the final station refers to the destination station that trip.end_station_id identifies on the one of those trips with the greatest trip.end_date, where end_date is month/day/year hour:minute text with variable-width fields and so must be compared as a timestamp rather than as text; return that station's name and its city"}}} {"question_id": 8995, "split": "train", "changes": {"question": {"before": "Listt the name and the city of the station with the most borrowed bike.", "after": "Which stations were the starting point for the most bike trips? Give their names and cities, including any ties."}, "evidence": {"before": "the station with the most borrowed bikes refers to MAX(COUNT(start_station));", "after": "the starting point of a trip refers to its start_station, where its bike was borrowed; trips from a start_station refers to COUNT(*) of the trips with that start_station; return the names and cities of each start_station whose count of trips is equal to the MAX such count, including all ties"}}} {"question_id": 9001, "split": "train", "changes": {"question": {"before": "For all trips which took less 5 minutes, state the station name where the bike were borrowed and returned. Indicate mean temperature of the day.", "after": "Which bike trips started in San Jose and lasted less than five minutes? List their trip IDs, start and end stations, and durations in seconds."}, "evidence": {"before": "less than 5 minutes refers to duration<300 in seconds; the station where the bike was borrowed refers to start_station_name; the station where the bike was returned refers to end_station_name; mean temperature refers to mean_temperature_f;", "after": "Trip.duration is measured in seconds. station.city records the city where a station is located."}, "SQL": {"before": "SELECT\n t.start_station_name,\n t.end_station_name,\n w.mean_temperature_f\nFROM trip AS t\nJOIN weather AS w\n ON w.zip_code = t.zip_code\n AND w.date = substr(t.start_date, 1, instr(t.start_date, ' ') - 1)\nWHERE t.duration < 300;", "after": "SELECT\n t.id,\n t.start_station_name,\n t.end_station_name,\n t.duration\nFROM trip AS t\nINNER JOIN station AS s ON t.start_station_id = s.id\nWHERE t.duration < 300\n AND s.city = 'San Jose';"}}} {"question_id": 9003, "split": "train", "changes": {"question": {"before": "Calculate the average usage of each bike in the third quarter of year 2013.", "after": "Among bikes used from July through September 2013, what was the average total riding time per bike, in seconds? Round your answer to two decimal places."}, "evidence": {"before": "the third quarter of year 2013 implies 3 month interval, including July, August, and September of 2013 and refers to date; the average usage of each bike = DIVIDE(SUM(duration), COUNT(bike_id))", "after": "bikes used from July through September 2013 refers to trip.start_date whose month is between 7 and 9 and whose year is 2013; total riding time per bike refers to SUM(duration) in seconds grouped by bike_id; average total riding time per bike = AVG of those per-bike totals, rounded to 2 decimal places"}, "SQL": {"before": "WITH q3_trip AS (\n SELECT SUM(duration) duration\n FROM trip\n WHERE `start_date` LIKE '%7/%/2013 %' OR start_date LIKE '%8/%/2013 %' OR start_date LIKE '%9/%/2013 %' \n GROUP BY bike_id\n)\nSELECT (SELECT AVG(duration) FROM q3_trip) AS avg_bike_usage", "after": "SELECT ROUND(AVG(total_duration), 2) FROM (SELECT bike_id, SUM(duration) AS total_duration FROM trip WHERE CAST(SUBSTR(start_date, 1, INSTR(start_date, '/') - 1) AS INTEGER) BETWEEN 7 AND 9 AND SUBSTR(start_date, INSTR(start_date, ' ') - 4, 4) = '2013' GROUP BY bike_id);"}}} {"question_id": 9005, "split": "train", "changes": {"question": {"before": "What is the longest trip duration that started and ended August 29, 2013?", "after": "What was the longest trip duration among trips that started and ended on August 29, 2013?"}, "evidence": {"before": "started and ended August 29, 2013 refers to start_date = '8/29/2013' and end_date = '8/29/2013';", "after": "Trip duration is recorded in trip.duration. August 29, 2013 appears as '8/29/2013' in trip.start_date and trip.end_date."}}} {"question_id": 9008, "split": "train", "changes": {"question": {"before": "How many stations in San Francico can hold more than 20 bikes?", "after": "How many stations in San Francisco can hold more than 20 bikes?"}}} {"question_id": 9014, "split": "train", "changes": {"question": {"before": "What is the maximum humidity in Powell Street BART when bike 496 was borrowed from the station on 8/29/2013?", "after": "What was the daily maximum humidity in the city where bike ID 496 was borrowed from Powell Street BART on August 29, 2013?"}, "evidence": {"before": "Powell Street refers to start_station_name; bike 496 refers to bike_id = '496'; start_date = '8/29/2013';", "after": "trip.bike_id identifies the bike; trip.start_station_name records 'Powell Street BART'. weather.max_humidity records daily maximum humidity as a percentage. trip.start_station_id identifies station.id. weather.date uses M/D/YYYY; trip.start_date uses M/D/YYYY H:MM. Daily weather for station.city is represented by weather.zip_code: San Francisco 94107, San Jose 95113, Mountain View 94041, Palo Alto 94301, and Redwood City 94063. trip.zip_code records the member’s home ZIP, not the station location."}, "SQL": {"before": "SELECT w.`max_humidity`\nFROM `trip` t\nJOIN `weather` w\n ON w.`zip_code` = t.`zip_code` AND w.`date` = '8/29/2013'\nWHERE t.`start_station_name` = 'Powell Street BART'\n AND t.`bike_id` = 496\n AND t.`start_date` LIKE '8/29/2013%';", "after": "SELECT DISTINCT w.max_humidity\nFROM trip AS t\nJOIN station AS s ON s.id = t.start_station_id\nJOIN weather AS w ON w.zip_code = CASE s.city\n WHEN 'San Francisco' THEN '94107' WHEN 'San Jose' THEN '95113'\n WHEN 'Mountain View' THEN '94041' WHEN 'Palo Alto' THEN '94301'\n WHEN 'Redwood City' THEN '94063' END\n AND w.date = SUBSTR(t.start_date, 1, INSTR(t.start_date, ' ') - 1)\nWHERE t.start_station_name = 'Powell Street BART' AND t.bike_id = 496\n AND w.date = '8/29/2013';"}}} {"question_id": 9015, "split": "train", "changes": {"question": {"before": "Which day in the month of November, 2014 have a foggy weather in the zip code 94301 and in total, how many bikes were borrowed by subscribers from all of the stations in the said day?", "after": "For each day in November 2014 with fog recorded in ZIP code 94301, how many subscriber bike trips started across all stations that day?"}, "evidence": {"before": "day in the month of November, 2014 refers to start_date between '11/1/2014' and '11/30/2014'; foggy weather refers to events = 'Fog'; subscriber refers to subscription_type; all of the stations bikes were borrowed from refer to start_station_name;", "after": "weather.events uses 'Fog'; trip.subscription_type uses 'Subscriber'. weather.date uses M/D/YYYY and trip.start_date uses M/D/YYYY H:MM on a 24-hour clock."}}} {"question_id": 9016, "split": "train", "changes": {"question": {"before": "What are the names of the stations that are less used by customers who borrow bikes from? Indicate when were the stations installed.", "after": "Among stations where customers started at least one trip, which had the fewest customer trips? List their names and installation dates, including ties."}, "evidence": {"before": "less used station where bikes are borrowed from refers to start_station_name which has the least number of customers; subscription_type = 'Customer'; when installed refers to installation_date;", "after": "trip.subscription_type = 'Customer' distinguishes customer trips from subscriber trips. station.installation_date uses M/D/YYYY."}}} {"question_id": 9017, "split": "train", "changes": {"evidence": {"before": "time = '11/3/2013'; which stations are empty refers to bikes_available = '0';", "after": "time LIKE '2013/11/03%'; which stations are empty refers to bikes_available = '0';"}}} {"question_id": 9019, "split": "train", "changes": {"question": {"before": "What is the route that has the longest duration? Indicate the start and end station names and their cities.", "after": "Which trips lasted the longest? Give each trip’s starting station and city, followed by its ending station and city."}, "evidence": {"before": "route implies a course taken in getting from start_station_name to end_station_name; the longest duration refers to MAX(duration);", "after": "the trips that lasted the longest refers to the trips whose duration = MAX(duration) over all trips; for each such trip return its start_station_name and the station.city of that starting station, followed by its end_station_name and the station.city of that ending station"}}} {"question_id": 9023, "split": "train", "changes": {"question": {"before": "List down the trips in which their start and end station are similar. Give me their trip IDs and location coordinates.", "after": "Which trips returned to their starting station? List each trip ID followed by the station’s latitude and longitude."}, "evidence": {"before": "start and end station are similar refers to start_station_name = end_station_name; latitude and longitude coordinates can be used to indicate a location;", "after": "trip.start_station_id and trip.end_station_id identify the stations. station.id is the catalog station identifier; station.lat and station.long record latitude and longitude."}, "SQL": {"before": "SELECT T1.id, T2.lat, T2.long FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.start_station_name = T1.end_station_name", "after": "SELECT t.id, s.lat, s.long FROM trip t LEFT JOIN station s ON s.id=t.start_station_id WHERE t.start_station_id=t.end_station_id"}}} {"question_id": 9024, "split": "train", "changes": {"evidence": {"before": "How many bikes borrowed can be computed as SUBTRACT(SUM(dock_count), bikes_available where name = 'San Jose Diridon Caltrain Station' and time = '2013/08/29 06:14:01');", "after": "Here, \"borrowed bikes\" means the station capacity not accounted for by available bikes; it is a snapshot measure, not a count of departures. station.dock_count records capacity, status.bikes_available records available bikes, and station.name identifies the station. status.time uses YYYY/MM/DD HH:MM:SS in 24-hour time."}}} {"question_id": 9028, "split": "validation", "changes": {"question": {"before": "How many docks were available at the starting station of trip ID 4312 when the trip started?", "after": "How many docks were available at the starting station of trip ID 4312 in the first status reading during its starting minute?"}, "evidence": {"before": null, "after": "trip.start_station_id identifies the starting station. trip.start_date uses M/D/YYYY H:MM; status.time uses YYYY/MM/DD HH:MM:SS. status.docks_available records available docks at that reading."}, "SQL": {"before": "SELECT SUM(T2.docks_available) \nFROM trip AS T1 \nINNER JOIN status AS T2 \nON T2.station_id = T1.start_station_id\nAND (T2.time LIKE SUBSTR(T1.start_date, 6, 4) || '/%' || SUBSTR(T1.start_date, 1, 1) || '/' || SUBSTR(T1.start_date, 3, 2) || ' ' || SUBSTR(T1.start_date, 11) || '%') \nWHERE T1.id = 4312", "after": "SELECT T2.docks_available\nFROM trip AS T1 JOIN status AS T2\nON T2.station_id=T1.start_station_id\nAND T2.time LIKE printf('%04d/%02d/%02d %s:',\n CAST(substr(T1.start_date,instr(T1.start_date,' ')-4,4) AS INTEGER),\n CAST(T1.start_date AS INTEGER),\n CAST(substr(T1.start_date,instr(T1.start_date,'/')+1) AS INTEGER),\n substr(T1.start_date,instr(T1.start_date,' ')+1)) || '%'\nWHERE T1.id=4312\nORDER BY T2.time LIMIT 1;\n"}}} {"question_id": 9030, "split": "train", "changes": {"question": {"before": "In 2014, what is the shortest duration of trips by subscribers which started at 2nd at Folsom and ended in the 5th at Howard stations, and by how much shorter than the average?", "after": "In 2014, what was the shortest duration of subscriber trips from 2nd at Folsom to 5th at Howard, and how much shorter was it than the average?"}, "evidence": {"before": "the shortest duration refers to MIN(duration); subscription_type = 'Subscriber', start_station_name = '2nd at Folsom', end_station_name = '5th at Howard'; in 2014 refers to time period between start_date = '1/1/2014 0:00' and end_date = '12/31/2014 11:59; Average duration = DIVIDE(SUM(duration), COUNT(id));", "after": "Subscribers have trip.subscription_type = 'Subscriber'. The station names '2nd at Folsom' and '5th at Howard' are recorded in trip.start_station_name and trip.end_station_name. trip.start_date records the trip’s starting date and time; trip.duration records its duration."}}} {"question_id": 9032, "split": "train", "changes": {"evidence": {"before": "average maximum temperature = DIVIDE(SUM(max_temperature_f), COUNT(date)); average minimum temperature = DIVIDE(SUM(min_temperature_f), COUNT(date)); May 2015 refers to date BETWEEN '5/1/2015'AND '5/31/2015';", "after": "May 2015 refers to weather.date LIKE '5/%/2015', the date being month/day/year text with unpadded month and day; mean humidity between 65 and 75 refers to mean_humidity BETWEEN 65 AND 75; return both AVG(max_temperature_f) and AVG(min_temperature_f), in Fahrenheit"}}} {"question_id": 9035, "split": "train", "changes": {"question": {"before": "Find the longest ride on foggy day. What were the mean visibility, mean wind speed, and weather event during that ride? Also, list the coordinates and names of the start and end stations.", "after": "Find the longest trips that started on a day when the starting city’s weather was recorded as Fog. Give that day’s mean visibility, mean wind speed and weather category, followed by the starting station’s latitude and longitude, the ending station’s latitude and longitude, and the start and end station names. Include ties."}, "evidence": {"before": "foggy day refers to events LIKE 'fog'; longest ride on a foggy day refers to MAX(duration) where events = 'fog'; mean visibility refers to mean_visibility_miles; mean wind speed refers to mean_wind_speed_mph; weather event refers to events; coordinates refers to (lat, long); start station refers to start_station_id; end station refers to end_station_id;", "after": "trip.duration measures trip length in seconds; trip.start_station_name and trip.end_station_name are the recorded station names. trip.end_station_id identifies the ending station in station.id; station.lat and station.long are latitude and longitude. weather.events = 'Fog' is the requested weather category; weather.mean_visibility_miles and weather.mean_wind_speed_mph record daily mean visibility in miles and wind speed in miles per hour. trip.start_station_id identifies station.id. weather.date uses M/D/YYYY; trip.start_date uses M/D/YYYY H:MM. Daily weather for station.city is represented by weather.zip_code: San Francisco 94107, San Jose 95113, Mountain View 94041, Palo Alto 94301, and Redwood City 94063. trip.zip_code records the member’s home ZIP, not the station location."}, "SQL": {"before": "WITH fog_rides AS (\n SELECT t.*, w.mean_visibility_miles, w.mean_wind_speed_mph, w.events\n FROM trip t\n JOIN weather w ON w.date = substr(t.start_date, 1, instr(t.start_date,' ')-1)\n AND w.zip_code = t.zip_code\n WHERE w.events LIKE 'Fog'\n)\nSELECT fr.mean_visibility_miles, fr.mean_wind_speed_mph, fr.events,\n ss.lat AS start_lat, ss.long AS start_long,\n es.lat AS end_lat, es.long AS end_long,\n fr.start_station_name, fr.end_station_name\nFROM fog_rides fr\nJOIN station ss ON ss.id = fr.start_station_id\nJOIN station es ON es.id = fr.end_station_id\nORDER BY fr.duration DESC\nLIMIT 1;", "after": "WITH fog_rides AS (\n SELECT t.*, w.mean_visibility_miles, w.mean_wind_speed_mph, w.events\n FROM trip AS t\nJOIN station AS s ON s.id = t.start_station_id\nJOIN weather AS w ON w.zip_code = CASE s.city\n WHEN 'San Francisco' THEN '94107' WHEN 'San Jose' THEN '95113'\n WHEN 'Mountain View' THEN '94041' WHEN 'Palo Alto' THEN '94301'\n WHEN 'Redwood City' THEN '94063' END\n AND w.date = SUBSTR(t.start_date, 1, INSTR(t.start_date, ' ') - 1)\n WHERE w.events = 'Fog'\n)\nSELECT fr.mean_visibility_miles, fr.mean_wind_speed_mph, fr.events,\n ss.lat, ss.long, es.lat, es.long,\n fr.start_station_name, fr.end_station_name\nFROM fog_rides AS fr\nJOIN station AS ss ON ss.id = fr.start_station_id\nJOIN station AS es ON es.id = fr.end_station_id\nWHERE fr.duration = (SELECT MAX(duration) FROM fog_rides);"}}} {"question_id": 9038, "split": "train", "changes": {"question": {"before": "Find the average ride duration during the rain of more than 0.8 inches.", "after": "What was the average bike-trip duration, in seconds, for trips starting in a city on a day with rain and more than 0.8 inches of precipitation? Round your answer to 3 decimal places."}, "evidence": {"before": "rain of more than 0.8 inches refers to events = rain where precipitation_inches>0.8; average ride duration = DIVIDE(SUM(duration), COUNT(duration));", "after": "rain refers to lower(weather.events) LIKE '%rain%'; more than 0.8 inches refers to CAST(precipitation_inches AS REAL) > 0.8; match each trip to the weather row for its starting station's city (San Francisco 94107, San Jose 95113, Mountain View 94041, Palo Alto 94301, Redwood City 94063) on the date part of trip.start_date; average duration refers to ROUND(AVG(trip.duration), 3) seconds"}, "SQL": {"before": "SELECT AVG(t.`duration`) \nFROM `trip` AS t\nJOIN `weather` AS w\n ON w.`date` = SUBSTR(t.`start_date`,1,INSTR(t.`start_date`,' ')-1) -- same day\n AND w.`zip_code` = t.`zip_code` -- same location\nWHERE w.`events` LIKE 'Rain'\n AND (CASE WHEN w.`precipitation_inches` IN ('T','0')\n THEN 0\n ELSE CAST(w.`precipitation_inches` AS REAL) END) > 0.8;", "after": "SELECT ROUND(AVG(t.duration), 3)\nFROM trip AS t\nJOIN station AS s ON s.id = t.start_station_id\nJOIN weather AS w ON w.zip_code = CASE s.city\n WHEN 'San Francisco' THEN '94107' WHEN 'San Jose' THEN '95113'\n WHEN 'Mountain View' THEN '94041' WHEN 'Palo Alto' THEN '94301'\n WHEN 'Redwood City' THEN '94063' END\n AND w.date = SUBSTR(t.start_date, 1, INSTR(t.start_date, ' ') - 1)\nWHERE LOWER(w.events) LIKE '%rain%'\n AND CAST(w.precipitation_inches AS REAL) > 0.8;"}}} {"question_id": 9040, "split": "validation", "changes": {"evidence": {"before": "stations refers to name; San Francisco refers to city = 'San Francisco'; installed in 2004 refers to installation_date like'%2014';", "after": "stations refers to name; San Francisco refers to city = 'San Francisco'; installed in 2014 refers to installation_date like'%2014';"}}} {"question_id": 9046, "split": "train", "changes": {"question": {"before": "Which year had the most number of trips that started at stations in San Francisco?", "after": "Which year had the most trips that started at stations in San Francisco?"}, "evidence": {"before": "started at station refers to start_station_name; San Francisco refers to city = 'San Francisco'; year that had the most number of trips refers to MAX(year(start_date));", "after": "started at stations in San Francisco refers to trips whose starting station is a station with station.city = 'San Francisco'; the year of a trip refers to the calendar year of trip.start_date; the most trips refers to the single year with the greatest COUNT of those trips; trip.start_date uses month/day/year hour:minute text with variable-width month and day fields"}}} {"question_id": 9047, "split": "train", "changes": {"question": {"before": "Among trips that started in San Jose, what is the percentage of trips whose durations were longer than 800 seconds?", "after": "What percentage of bike trips starting in San Jose lasted more than 800 seconds? Round your answer to 3 decimal places."}, "evidence": {"before": "percentage of trips = DIVIDE(COUNT(duration>800), COUNT(duration))*100 as percentage; San Jose refers to city = 'San Jose'; duration>800;", "after": "trips starting in San Jose refers to trip.start_station_id joined to station.id where station.city = 'San Jose'; lasted more than 800 seconds refers to trip.duration > 800; percentage = DIVIDE(COUNT(those trips with duration > 800), COUNT(all those trips)) * 100, rounded to 3 decimal places"}, "SQL": {"before": "SELECT CAST(SUM(CASE WHEN T1.duration > 800 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.id) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'San Jose'", "after": "WITH unrounded(value) AS (\nSELECT 100.0 * SUM(CASE WHEN t.duration>800 THEN 1 ELSE 0 END) / COUNT(*) FROM trip t JOIN station s ON s.id=t.start_station_id WHERE s.city='San Jose'\n) SELECT ROUND(value, 3) FROM unrounded;"}}} {"question_id": 9056, "split": "train", "changes": {"question": {"before": "What was the mean humidity of a trip with id 4275?", "after": "What was the daily mean humidity in the starting city of trip ID 4275?"}, "evidence": {"before": "mean humidity refers to mean_humidity;", "after": "trip.id identifies a trip. weather.mean_humidity records daily mean humidity as a percentage. trip.start_station_id identifies station.id. weather.date uses M/D/YYYY; trip.start_date uses M/D/YYYY H:MM. Daily weather for station.city is represented by weather.zip_code: San Francisco 94107, San Jose 95113, Mountain View 94041, Palo Alto 94301, and Redwood City 94063. trip.zip_code records the member’s home ZIP, not the station location."}, "SQL": {"before": "SELECT w.`mean_humidity` FROM `trip` t JOIN `weather` w ON w.`zip_code` = t.`zip_code` AND w.`date` = substr(t.`start_date`, 1, instr(t.`start_date`, ' ') - 1)WHERE t.`id` = 4275", "after": "SELECT w.mean_humidity\nFROM trip AS t\nJOIN station AS s ON s.id = t.start_station_id\nJOIN weather AS w ON w.zip_code = CASE s.city\n WHEN 'San Francisco' THEN '94107' WHEN 'San Jose' THEN '95113'\n WHEN 'Mountain View' THEN '94041' WHEN 'Palo Alto' THEN '94301'\n WHEN 'Redwood City' THEN '94063' END\n AND w.date = SUBSTR(t.start_date, 1, INSTR(t.start_date, ' ') - 1)\nWHERE t.id = 4275;"}}} {"question_id": 9057, "split": "validation", "changes": {"question": {"before": "In 2015, among trips whose the subscription type was Customer, what percentage of trips ended on a rainy day?", "after": "Of the customer trips that ended in 2015 on days with weather recorded for their destination city, what percentage ended on rainy days? Round your answer to 2 decimal places."}, "evidence": {"before": "in 2015 refers to end_date like '%2015%'; percentage = DIVIDE(COUNT(events LIKE '%Rain%'), COUNT(events));", "after": "Customer trips have trip.subscription_type = 'Customer'. trip.end_station_id identifies the destination station in station.id. weather.events contains 'Rain' for rainy days, including combined weather categories. weather.date uses M/D/YYYY; trip.end_date uses M/D/YYYY H:MM. Daily weather for station.city is represented by weather.zip_code: San Francisco 94107, San Jose 95113, Mountain View 94041, Palo Alto 94301, and Redwood City 94063. trip.zip_code records the member’s home ZIP, not the station location."}, "SQL": {"before": "SELECT CAST(SUM(CASE WHEN T2.events LIKE '%Rain%' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.id) \nFROM trip AS T1 INNER JOIN weather AS T2 \nON T2.zip_code = T1.zip_code AND T2.`date` = SUBSTR(T1.`end_date`, 1, INSTR(T1.`end_date`, ' ') - 1) \nWHERE SUBSTR(CAST(T2.date AS TEXT), -4) = '2015' AND T1.subscription_type = 'Customer'", "after": "SELECT ROUND(100.0 * SUM(CASE WHEN w.events LIKE '%Rain%' THEN 1 ELSE 0 END) / COUNT(*), 2)\nFROM trip AS t\nJOIN station AS s ON s.id = t.end_station_id\nJOIN weather AS w ON w.zip_code = CASE s.city\n WHEN 'San Francisco' THEN '94107' WHEN 'San Jose' THEN '95113'\n WHEN 'Mountain View' THEN '94041' WHEN 'Palo Alto' THEN '94301'\n WHEN 'Redwood City' THEN '94063' END\n AND w.date = SUBSTR(t.end_date, 1, INSTR(t.end_date, ' ') - 1)\nWHERE SUBSTR(w.date, -4) = '2015' AND t.subscription_type = 'Customer';"}}} {"question_id": 9058, "split": "train", "changes": {"question": {"before": "How many bike stations are installed after August, 2013 in San Jose?", "after": "How many bike stations were installed after August 2013 in San Jose?"}, "evidence": {"before": "installed after August, 2013 refers to year(installation_date)>2013; in San Jose refers to city = 'San Jose';", "after": "Station installation dates are recorded in station.installation_date; San Jose is recorded as station.city = 'San Jose'."}}} {"question_id": 9061, "split": "train", "changes": {"evidence": {"before": "number of bikes that can be borrowed refers to bikes_available; San Jose Diridon Caltrain Station refers to name = 'San Jose Diridon Caltrain Station'; time = '2013/8/29 12:06:01'", "after": "number of bikes that can be borrowed refers to bikes_available; San Jose Diridon Caltrain Station refers to name = 'San Jose Diridon Caltrain Station'; time = '2013/08/29 12:06:01'"}}} {"question_id": 9064, "split": "train", "changes": {"question": {"before": "Please list the starting stations of the bike trips made on a day with a max humidity over 80 in 2013 in the area where the zip code is 94107.", "after": "Which stations in San Francisco had trips start on days in 2013 when the daily maximum humidity exceeded 80%?"}, "evidence": {"before": "starting stations refers to start_station_name; day with a max humidity over 80 refers to max_humidity>80; in 2013 refers to date LIKE'%2013';", "after": "trip.start_station_name records the starting station name. weather.max_humidity records daily maximum humidity as a percentage. San Francisco’s weather is represented by ZIP code 94107. trip.start_station_id identifies station.id. weather.date uses M/D/YYYY; trip.start_date uses M/D/YYYY H:MM. Daily weather for station.city is represented by weather.zip_code: San Francisco 94107, San Jose 95113, Mountain View 94041, Palo Alto 94301, and Redwood City 94063. trip.zip_code records the member’s home ZIP, not the station location."}, "SQL": {"before": "SELECT DISTINCT t.`start_station_name` FROM `trip` AS t JOIN `weather` AS w ON w.`zip_code`='94107' AND w.`date` = substr(t.`start_date`,1,instr(t.`start_date`,' ')-1) WHERE w.`max_humidity`>80 AND substr(w.`date`,-4)='2013'", "after": "SELECT DISTINCT t.start_station_name\nFROM trip AS t\nJOIN station AS s ON s.id = t.start_station_id\nJOIN weather AS w ON w.zip_code = CASE s.city\n WHEN 'San Francisco' THEN '94107' WHEN 'San Jose' THEN '95113'\n WHEN 'Mountain View' THEN '94041' WHEN 'Palo Alto' THEN '94301'\n WHEN 'Redwood City' THEN '94063' END\n AND w.date = SUBSTR(t.start_date, 1, INSTR(t.start_date, ' ') - 1)\nWHERE s.city = 'San Francisco' AND SUBSTR(w.date, -4) = '2013'\n AND w.max_humidity > 80;"}}} {"question_id": 9066, "split": "train", "changes": {"question": {"before": "What is the location coordinates of the bike station from which the bike for the trip that last the longest was borrowed?", "after": "What are the coordinates of the station where the longest trip started?"}, "evidence": {"before": "location coordinates refers to (lat, long); bike that was borrowed the longest refers to MAX(duration);", "after": "the longest trip refers to duration = MAX(duration); the coordinates refers to the lat and long of the station where that trip started; return both lat and long"}}} {"question_id": 9068, "split": "train", "changes": {"question": {"before": "Among the bike trips started on the days with a fog in 2013, how many of those trips started from the station \"2nd at Townsend\"?", "after": "How many trips started at \"2nd at Townsend\" in 2013 on days when its city’s weather was recorded as Fog?"}, "evidence": {"before": "started on the days with a fog refers to start_date where events = 'fog'; in 2013 refers to date LIKE '%2013'; started from station refers to start_station_name; start_station_name = '2nd at Townsend';", "after": "trip.start_station_name records '2nd at Townsend'; trip.start_station_id identifies station.id. weather.events = 'Fog' is the requested weather category. weather.date uses M/D/YYYY; trip.start_date uses M/D/YYYY H:MM. Daily weather for station.city is represented by weather.zip_code: San Francisco 94107, San Jose 95113, Mountain View 94041, Palo Alto 94301, and Redwood City 94063. trip.zip_code records the member’s home ZIP, not the station location."}, "SQL": {"before": "SELECT COUNT(T1.start_station_name) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.`date` = substr(T1.`start_date`,1, instr(T1.`start_date`,' ') - 1)\nWHERE T2.date LIKE '%2013%' AND T2.events = 'Fog' AND T1.start_station_name = '2nd at Townsend' ", "after": "SELECT COUNT(*)\nFROM trip AS t\nJOIN station AS s ON s.id = t.start_station_id\nJOIN weather AS w ON w.zip_code = CASE s.city\n WHEN 'San Francisco' THEN '94107' WHEN 'San Jose' THEN '95113'\n WHEN 'Mountain View' THEN '94041' WHEN 'Palo Alto' THEN '94301'\n WHEN 'Redwood City' THEN '94063' END\n AND w.date = SUBSTR(t.start_date, 1, INSTR(t.start_date, ' ') - 1)\nWHERE SUBSTR(w.date, -4) = '2013'\n AND w.events = 'Fog'\n AND t.start_station_name = '2nd at Townsend';"}}} {"question_id": 9069, "split": "train", "changes": {"question": {"before": "What is the longest duration for a bike trip starting on a day with a fog in 2013?", "after": "What was the longest bike-trip duration, in seconds, for trips starting in 2013 on days when their starting city’s weather was recorded as Fog?"}, "evidence": {"before": "longest duration refers to MAX(duration); starting on a day with a fog refers to start_date where events = 'fog'; in 2013 refers to date LIKE '%2013';", "after": "the starting city's weather refers to the weather row whose zip_code maps station.city (San Francisco 94107, San Jose 95113, Mountain View 94041, Palo Alto 94301, Redwood City 94063), not trip.zip_code, and whose date is the date part of trip.start_date; Fog refers to events = 'Fog'; in 2013 refers to that date ending in 2013; longest duration in seconds refers to MAX(trip.duration)"}, "SQL": {"before": "SELECT MAX(T1.duration)\n FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.`date` = substr(T1.`start_date`,1, instr(T1.`start_date`,' ') - 1)\n WHERE T2.date LIKE '%2013%' AND T2.events = 'Fog' ", "after": "SELECT MAX(t.duration)\nFROM trip AS t\nJOIN station AS s ON s.id = t.start_station_id\nJOIN weather AS w ON w.zip_code = CASE s.city\n WHEN 'San Francisco' THEN '94107' WHEN 'San Jose' THEN '95113'\n WHEN 'Mountain View' THEN '94041' WHEN 'Palo Alto' THEN '94301'\n WHEN 'Redwood City' THEN '94063' END\n AND w.date = SUBSTR(t.start_date, 1, INSTR(t.start_date, ' ') - 1)\nWHERE SUBSTR(w.date, -4) = '2013' AND w.events = 'Fog';"}}} {"question_id": 9072, "split": "train", "changes": {"question": {"before": "On the day with the hottest temperature ever in 2014, how many bike trips started from the station 2nd at Folsom?", "after": "How many trips started at 2nd at Folsom on dates when any weather location recorded the highest temperature of 2014?"}, "evidence": {"before": "hottest temperature refers to MAX(max_temperatutre_f); in 2014 refers to date LIKE '%2014'; started from station refers to start_station_name; start_station_name = '2nd at Folsom';", "after": "weather.max_temperature_f records daily maximum temperature in Fahrenheit; weather.zip_code identifies the weather location. weather.date uses M/D/YYYY, and trip.start_date uses M/D/YYYY H:MM. trip.start_station_name records '2nd at Folsom'."}, "SQL": {"before": "WITH hottest_date AS (\n SELECT `date`\n FROM `weather`\n WHERE `date` LIKE '%/2014'\n ORDER BY `max_temperature_f` DESC\n LIMIT 1\n)\nSELECT COUNT(*) AS trips\nFROM `trip`\nWHERE `start_station_name` = '2nd at Folsom'\n AND `start_date` LIKE (SELECT `date` || '%' FROM hottest_date);\n", "after": "WITH hottest_dates AS (\n SELECT DISTINCT date FROM weather\n WHERE date LIKE '%/2014' AND max_temperature_f=(SELECT MAX(max_temperature_f) FROM weather WHERE date LIKE '%/2014')\n)\nSELECT COUNT(*) FROM trip\nWHERE start_station_name='2nd at Folsom'\nAND substr(start_date,1,instr(start_date,' ')-1) IN (SELECT date FROM hottest_dates);"}}} {"question_id": 9077, "split": "train", "changes": {"question": {"before": "What is the longest trip duration according? Output the duration in seconds and days.", "after": "What is the longest bike-trip duration, in both seconds and days?"}, "evidence": {"before": "longest trip duration refers to MAX(duration); days conversion = DIVIDE(duration, 86400);", "after": "the longest trip duration in seconds refers to MAX(trip.duration); in days refers to DIVIDE(MAX(duration), 86400) as a real value, which may be fractional; return both the seconds value and the days value"}}} {"question_id": 9079, "split": "train", "changes": {"question": {"before": "What is the ratio for subscriber to customer given that the starting and the ending stations is 2nd at South Park?", "after": "For trips that both started and ended at '2nd at South Park', what is the ratio of subscriber trips to customer trips?"}, "evidence": {"before": "subscriber refers to subscription_type = 'Subscriber'; customer refers to subscription_type = 'Customer';starting station refers to start_station_name; ending station refers to end_statio_name; start_station_name = '2nd at South Park' AND end_station_name = '2nd at South Park'", "after": "trip.subscription_type uses 'Subscriber' and 'Customer'."}}} {"question_id": 9081, "split": "train", "changes": {"question": {"before": "List out all stations name that having a mean temperature 20 degree Celsius in year 2014.", "after": "Which stations had a trip start or end on a day in 2014 when their city’s daily mean temperature was 20°C? List the station names recorded on those trips."}, "evidence": {"before": "mean temperature refers to mean_temperature_f; mean temperature of 20 degree Celsius refers to DIVIDE(SUBTRACT(mean_temperature_f, 32), 1.8) = 20; in 2014 refers to date LIKE'%2015%';", "after": "a trip start or end in 2014 refers to start_date or end_date LIKE '%/2014 %'; that trip's day is the text before the space in the date and matches weather.date; station.id is the trip's start_station_id or end_station_id, and station.city maps to weather.zip_code (San Francisco 94107, San Jose 95113, Mountain View 94041, Palo Alto 94301, Redwood City 94063); a daily mean temperature of 20 Celsius refers to DIVIDE(SUBTRACT(mean_temperature_f, 32), 1.8) = 20; list the DISTINCT start_station_name or end_station_name of those trips"}, "SQL": {"before": "WITH trip_day AS (\n SELECT start_station_name AS station_name,\n CAST(zip_code AS TEXT) AS zip_code,\n substr(start_date, 1, instr(start_date,' ')-1) AS d\n FROM trip\n WHERE start_date LIKE '%/2014 %'\n UNION\n SELECT end_station_name,\n CAST(zip_code AS TEXT),\n substr(end_date, 1, instr(end_date,' ')-1)\n FROM trip\n WHERE end_date LIKE '%/2014 %'\n)\nSELECT DISTINCT td.station_name\nFROM trip_day td\nJOIN weather w\n ON w.zip_code = td.zip_code\n AND w.date = td.d\nWHERE w.mean_temperature_f = 68;", "after": "WITH trip_day AS (\n SELECT start_station_id AS station_id, start_station_name AS station_name,\n SUBSTR(start_date, 1, INSTR(start_date, ' ') - 1) AS d\n FROM trip WHERE start_date LIKE '%/2014 %'\n UNION\n SELECT end_station_id, end_station_name,\n SUBSTR(end_date, 1, INSTR(end_date, ' ') - 1)\n FROM trip WHERE end_date LIKE '%/2014 %'\n)\nSELECT DISTINCT td.station_name\nFROM trip_day AS td\nJOIN station AS s ON s.id = td.station_id\nJOIN weather AS w ON w.zip_code = CASE s.city\n WHEN 'San Francisco' THEN '94107' WHEN 'San Jose' THEN '95113'\n WHEN 'Mountain View' THEN '94041' WHEN 'Palo Alto' THEN '94301'\n WHEN 'Redwood City' THEN '94063' END\n AND w.date = td.d\nWHERE (w.mean_temperature_f - 32) / 1.8 = 20;"}}} {"question_id": 9087, "split": "train", "changes": {"question": {"before": "Which bicycle is the least used bike? Please list the bike id. For each trip traveled with this bike, check if the start and end station are from the same city. Output \"Yes\" if they are from the same city and \"No\" if they are not. For each trip traveled with this bike, Please also calculate the total duration travelled in hours.", "after": "Which bike has been used for the fewest trips? Give me its ID. Did every trip with this bike end at the same station where it started? Answer “Yes” or “No”. Also give its total riding time in hours across all trips."}, "evidence": {"before": "least used bike refers to bike_id with MIN(COUNT(trip.id)); start station refers to start_station_name; end station refers to end_station_name; total duration in hour = DIVIDE(duration, 3600) AS hour;", "after": "fewest trips refers to the bike_id with the lowest COUNT of its trip records, taking one bike; answer 'Yes' when start_station_id = end_station_id on every trip of that bike, otherwise 'No'; total riding time = DIVIDE(SUM of that bike's trip durations, 3600.0) hours; return the bike_id, that answer and the hours"}, "SQL": {"before": "WITH least_used_bike AS (\n SELECT bike_id FROM trip GROUP BY bike_id \n ORDER BY COUNT(*) LIMIT 1\n) SELECT T1.bike_id, \n CASE WHEN start_station_id = end_station_id THEN 'Yes' ELSE 'No' END,\n duration*1.0 / 3600 \nFROM least_used_bike T1 JOIN trip T2 ON T1.bike_id = T2.bike_id", "after": "SELECT bike_id,\n CASE WHEN MIN(CASE WHEN start_station_id = end_station_id THEN 1 ELSE 0 END) = 1\n THEN 'Yes' ELSE 'No' END AS all_trips_returned_to_start,\n SUM(duration) * 1.0 / 3600 AS total_hours\nFROM trip\nGROUP BY bike_id\nORDER BY COUNT(*)\nLIMIT 1;\n"}}} {"question_id": 9094, "split": "train", "changes": {"question": {"before": "What is the average duration of trips for the starting station of Santa Clara at Almaden and what is the latitude and longitude of this station?", "after": "What is the average trip duration for trips starting at Santa Clara at Almaden, and what are the latitude and longitude of that station?"}, "evidence": {"before": "average duration = DIVIDE(SUM(duration), COUNT(id)); starting station refers to start_station_name; start_station_name = 'Santa Clara at Almaden'; latitude refers to lat; longitude refers to long;", "after": "trips starting at Santa Clara at Almaden refers to trip.start_station_name = 'Santa Clara at Almaden'; average trip duration = AVG(trip.duration) over those trips, in the stored unit; the answer pairs that average with station.lat and station.long of that starting station"}}} {"question_id": 9095, "split": "train", "changes": {"question": {"before": "What is the duration of the shortest trip made starting from Franklin at Maple and what is the maximum wind speed in the trip area that day?", "after": "For the shortest trips starting at Franklin at Maple, give the duration in seconds and the daily maximum wind speed in the starting city on the departure date. Include ties."}, "evidence": {"before": "shortest trip refers to MIN(duration); starting from refers to start_station_name; start_station_name = 'Franklin at Maple'; maximum wind speed refers to max_wind_Speed_mph;", "after": "trip.start_station_name records 'Franklin at Maple'; trip.duration is in seconds. weather.max_wind_Speed_mph records daily maximum wind speed in miles per hour. trip.start_station_id identifies station.id. weather.date uses M/D/YYYY; trip.start_date uses M/D/YYYY H:MM. Daily weather for station.city is represented by weather.zip_code: San Francisco 94107, San Jose 95113, Mountain View 94041, Palo Alto 94301, and Redwood City 94063. trip.zip_code records the member’s home ZIP, not the station location."}, "SQL": {"before": "WITH shortest AS (\n SELECT `duration`, `start_date`, `zip_code`\n FROM `trip`\n WHERE `start_station_name` = 'Franklin at Maple'\n ORDER BY `duration`\n LIMIT 1\n)\nSELECT s.`duration` AS shortest_duration_seconds,\n w.`max_wind_Speed_mph` AS max_wind_speed_mph\nFROM shortest s\nJOIN `weather` w\n ON w.`date` = substr(s.`start_date`,1,instr(s.`start_date`,' ')-1)\n AND w.`zip_code` = s.`zip_code`;", "after": "SELECT DISTINCT t.duration, w.max_wind_Speed_mph\nFROM trip AS t\nJOIN station AS s ON s.id = t.start_station_id\nJOIN weather AS w ON w.zip_code = CASE s.city\n WHEN 'San Francisco' THEN '94107' WHEN 'San Jose' THEN '95113'\n WHEN 'Mountain View' THEN '94041' WHEN 'Palo Alto' THEN '94301'\n WHEN 'Redwood City' THEN '94063' END\n AND w.date = SUBSTR(t.start_date, 1, INSTR(t.start_date, ' ') - 1)\nWHERE t.start_station_name = 'Franklin at Maple'\n AND t.duration = (SELECT MIN(duration) FROM trip WHERE start_station_name = 'Franklin at Maple');"}}} {"question_id": 9100, "split": "train", "changes": {"question": {"before": "How many trips have been ended by subscribers at MLK Library and how many docks does that station have?", "after": "How many subscriber trips ended at MLK Library, and how many docks does that station have?"}, "evidence": {"before": "subscribers refers to subscription_type = 'subscribers'; trips have been ended at refers to end_station_name; end_station_name = 'MLK Library'; number of docks a station have refers to dock_count;", "after": "trip.subscription_type uses 'Subscriber'; station.dock_count records the number of docks."}}} {"question_id": 9134, "split": "train", "changes": {"question": {"before": "Please give the full name of the customer that have rented the most films.", "after": "Which customers have the most film rentals? Give their first and last names, including everyone tied for the most rentals."}, "evidence": {"before": "full name refers to first_name, last_name; customer who rented the most film refers to Max(count(rental_id))", "after": "film rentals refers to transactions, so repeat rentals of the same film count separately; the most film rentals refers to the greatest COUNT of rentals among customers; return the first and last names of everyone tied at that greatest count"}}} {"question_id": 9137, "split": "train", "changes": {"question": {"before": "Which customer has rented more movies, RUTH MARTINEZ or LINDA WILLIAMS? Output his first name and last name.", "after": "Who has more film rentals, Ruth Martinez or Linda Williams? Give their first and last name."}, "evidence": {"before": "rented more movie Max(Count(customer_id)); \"RUTH MARTINEZ\" and \"LINDA WILLIAMS\" are both full name of customer", "after": "The stored customer names are 'RUTH' 'MARTINEZ' and 'LINDA' 'WILLIAMS'. Rentals include repeat rentals of the same film."}}} {"question_id": 9170, "split": "train", "changes": {"question": {"before": "How many times is the number of Indian cities than Italian cities?", "after": "What is the ratio of the number of Indian cities to the number of Italian cities in the database?"}, "evidence": {"before": "indian refers to country = 'India'; Italian refers to country = 'Italy'; times = Divide(Count(city where country = 'India), Count(city where country = 'Italy'))", "after": "Indian cities refers to the cities with the Indian country.country and Italian cities to the cities with the Italian country.country; the ratio refers to DIVIDE(COUNT(Indian cities), COUNT(Italian cities)), with no * 100"}}} {"question_id": 9216, "split": "train", "changes": {"question": {"before": "List the films' titles which were rented by Brian Wyman in July, 2005.", "after": "Which films did Brian Wyman rent in July 2005? List their titles."}, "evidence": {"before": "rented in July 2005 refers to year (rental_date) = 2005 and month (rental_date) = 7", "after": "The stored customer name is 'BRIAN' 'WYMAN'. rental.rental_date uses YYYY-MM-DD HH:MM:SS with fractional seconds. Inventory records represent film copies."}}} {"question_id": 9229, "split": "validation", "changes": {"question": {"before": "List the actor's last name that starred the film with the description of \"A Thoughtful Drama of a Composer And a Feminist who must Meet a Secret Agent in The Canadian Rockies\".", "after": "List the last names of actors in the film described as \"A Thoughtful Drama of a Composer And a Feminist who must Meet a Secret Agent in The Canadian Rockies\"."}, "evidence": {"before": null, "after": "The quoted film description is recorded in film.description; actors’ surnames are recorded in actor.last_name."}}} {"question_id": 9235, "split": "train", "changes": {"question": {"before": "In the film with an inventory ID between 20 to 60, how many of the films have a G rating?", "after": "Among films with inventory IDs from 20 to 60, how many have a G rating?"}, "evidence": {"before": "G rating refers to rating = 'G'", "after": "film.rating records the film rating, including 'G'; inventory.inventory_id identifies inventory records."}}} {"question_id": 9240, "split": "train", "changes": {"question": {"before": "In films with rental rate of 4.99, list down the inventory ID of the films starred by Lucille Dee.", "after": "In films with a rental rate of 4.99, list the inventory IDs of films starring Lucille Dee."}, "evidence": {"before": "'Lucille Dee' is a full name of an actor; full name refers to first_name, last_name", "after": "Lucille Dee is recorded as actor.first_name = 'LUCILLE' and actor.last_name = 'DEE'; film.rental_rate records the rental rate."}}} {"question_id": 9246, "split": "train", "changes": {"question": {"before": "Please list the titles of the top ten movies with the most price per day in descending order of price per day.", "after": "List the titles of the 10 films with the highest rental price per day, from highest to lowest."}, "evidence": {"before": "movies with the most price per day refers to MAX(rental_rate / rental_duration)", "after": "film.rental_rate is the dollar charge for a rental period; film.rental_duration is that period’s length in days."}}} {"question_id": 9307, "split": "train", "changes": {"question": {"before": "What is the largest number of films rented per customer?", "after": "What is the largest number of films rented by a single customer?"}, "evidence": {"before": "the largest number of films refers to MAX(rental_id)", "after": "films rented by a customer refers to the COUNT of that customer's rental records, grouped by rental.customer_id; the largest number of films rented by a single customer refers to the greatest of those per-customer counts, returning that count"}}} {"question_id": 9320, "split": "train", "changes": {"evidence": {"before": "actor refers to first_name, last_name; the most film refers to MAX(SUM(film_id))", "after": "actor refers to first_name, last_name; the most film refers to MAX(COUNT(film_id))"}}} {"question_id": 9321, "split": "train", "changes": {"evidence": {"before": "horror' is a name of a category; calculation = DIVIDE(SUM(name = 'Horror'), COUNT(film_id)) * 100", "after": "'horror' is a name of a category; calculation = DIVIDE(SUM(name = 'Horror'), COUNT(film_id)) * 100"}}} {"question_id": 9325, "split": "train", "changes": {"question": {"before": "Give the full name of all actors who appear in at least one film whose rental_rate equals the global maximum.", "after": "Give the full names of all actors who appear in at least one film whose rental rate equals the global maximum."}, "evidence": {"before": "full name refers to first_name, last_name; the highest rental rate refers to max(rental_rate)", "after": "Actor names are recorded in actor.first_name and actor.last_name; film.rental_rate records rental rates."}}} {"question_id": 9340, "split": "train", "changes": {"question": {"before": "List down all of the film IDs with highest rental duration.", "after": "List the film IDs with the highest rental duration."}, "evidence": {"before": "highest rental duration refers to max(rental_duration)", "after": "the highest rental duration refers to film.rental_duration = MAX(rental_duration) over film; list the ID of every film holding that value"}}} {"question_id": 9345, "split": "train", "changes": {"question": {"before": "How many Italian film titles were special featured with deleted scenes?", "after": "How many Italian films had special features consisting of deleted scenes?"}, "evidence": {"before": "Italian is name of language; special featured with deleted scenes refers to special_features LIKE '%deleted scenes%'", "after": "language.name records the language, including 'Italian'; film.special_features records features such as 'deleted scenes'."}}} {"question_id": 9352, "split": "train", "changes": {"question": {"before": "List down all of the customers' first name who were attended by staff with ID 1.", "after": "List the first names of customers whose rentals were handled by the staff member with ID 1."}, "evidence": {"before": null, "after": "rental.staff_id identifies the staff member who handled a rental."}}} {"question_id": 9369, "split": "train", "changes": {"evidence": {"before": "category name refers to category.name; price per day is more than $1 refers to divide(rental_duration, rental_rate) > 1", "after": "price per day is more than $1 refers to DIVIDE(rental_rate, rental_duration) > 1; return the film title, the name of the film's category, and the film's special features"}}} {"question_id": 9393, "split": "train", "changes": {"question": {"before": "Provide the full name of all the actors of the film \"Ending Crowds\".", "after": "Give the first and last names of all actors in the film “Ending Crowds”."}, "evidence": {"before": "full name refers to first_name, last_name; film \"Ending Crowds\" refers to title = 'ENDING CROWDS'", "after": "The film title is recorded as film.title = 'ENDING CROWDS'; actor.first_name and actor.last_name record actor names."}}} {"question_id": 9396, "split": "train", "changes": {"question": {"before": "List all cities under the country of Philippines.", "after": "List all cities in the Philippines."}, "evidence": {"before": null, "after": "city.city records city names; country.country identifies the Philippines, and city.country_id joins to country.country_id."}}} {"question_id": 9397, "split": "train", "changes": {"question": {"before": "What are the films that are least rented by the customers?", "after": "Which films have the fewest rentals, including films that have never been rented? List their titles."}, "evidence": {"before": "film refers to title; least rented refers to count(min(customer_id))", "after": "the rentals of a film refers to the number of rental records of its inventory copies, counting 0 for a film never rented; the fewest rentals refers to the minimum of those per-film counts; list the titles of every film whose count is that minimum"}}} {"question_id": 9399, "split": "train", "changes": {"question": {"before": "Which category is the film \"Beach Heartbreakers\" falls into?", "after": "Which category does the film “Beach Heartbreakers” fall into?"}, "evidence": {"before": "category refers to name; film \"Beach Heartbreakers\" refers to title = 'BEACH HEARTBREAKERS'", "after": "category.name records the film category; the film title is recorded as film.title = 'BEACH HEARTBREAKERS'."}}} {"question_id": 9405, "split": "train", "changes": {"evidence": {"before": "active refers to active = 1", "after": "customer.active = 1 denotes active customers; customer.first_name stores Nina as 'NINA'."}}} {"question_id": 9408, "split": "train", "changes": {"question": {"before": "Give the duration of the film starred by Nick Wahlberg with the highest rental rate.", "after": "Give the duration of the film starring Nick Wahlberg that has the highest rental rate."}, "evidence": {"before": "duration refers to length; the highest rental rate refers to max(rental_rate)", "after": "Nick Wahlberg refers to actor.first_name = 'NICK' AND actor.last_name = 'WAHLBERG'; the highest rental rate refers to MAX(film.rental_rate) over the film rows starring Nick Wahlberg; duration refers to the film.length of the film at that maximum"}}} {"question_id": 9411, "split": "train", "changes": {"SQL": {"before": "SELECT COUNT(T1.film_id)\n FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id \nWHERE T3.rental_rate = 2.99 AND T2.first_name = 'NINA' AND T2.last_name = 'SOTO'", "after": "SELECT COUNT(T1.film_id)\n FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id \nWHERE T3.rental_rate = 2.99 AND T2.first_name = 'UMA' AND T2.last_name = 'WOOD'"}}} {"question_id": 9424, "split": "train", "changes": {"question": {"before": "Please give the full name of the customer who had made the biggest amount of payment in one single film rental.", "after": "Please give the full name of the customer who paid the largest amount for a single film rental."}, "evidence": {"before": "full name refers to first_name, last_name; the biggest amount refers to max(amount)", "after": "the largest amount paid for a single film rental refers to MAX(payment.amount) over all payments; return the distinct customer.first_name and customer.last_name of every customer with a payment equal to that maximum"}}}