[{"id": "train-0", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name movie titles released in year 1945. Sort the listing by the descending order of movie popularity."}, {"from": "gpt", "value": "```sql\nSELECT movie_title FROM movies WHERE movie_release_year = 1945 ORDER BY movie_popularity DESC LIMIT 1\n```"}]}, {"id": "train-1", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the most popular movie? When was it released and who is the director for the movie?"}, {"from": "gpt", "value": "```sql\nSELECT movie_title, movie_release_year, director_name FROM movies ORDER BY movie_popularity DESC LIMIT 1 \n```"}]}, {"id": "train-2", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the longest movie title? When was it released?"}, {"from": "gpt", "value": "```sql\nSELECT movie_title, movie_release_year FROM movies ORDER BY LENGTH(movie_popularity) DESC LIMIT 1\n```"}]}, {"id": "train-3", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the movie with the most ratings."}, {"from": "gpt", "value": "```sql\nSELECT movie_title FROM movies GROUP BY movie_title ORDER BY COUNT(movie_title) DESC LIMIT 1\n```"}]}, {"id": "train-4", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of Mubi users who love movies directed by Stanley Kubrick?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(movie_popularity) FROM movies WHERE director_name = 'Stanley Kubrick'\n```"}]}, {"id": "train-5", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating for movie titled 'When Will I Be Loved'?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.rating_score) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'When Will I Be Loved'\n```"}]}, {"id": "train-6", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the user avatar url for user 41579158? What is the latest movie rated by him / her?"}, {"from": "gpt", "value": "```sql\nSELECT T3.user_avatar_image_url, T3.rating_date_utc FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id INNER JOIN ratings_users AS T3 ON T3.user_id = T2.user_id WHERE T3.user_id = 41579158 ORDER BY T3.rating_date_utc DESC LIMIT 1\n```"}]}, {"id": "train-7", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the ratings were rated by user who was a subcriber?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM ratings\n```"}]}, {"id": "train-8", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all movie title rated in April 2020 from user who was a trialist."}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_trialist = 1 AND T2.rating_timestamp_utc LIKE '2020-04%'\n```"}]}, {"id": "train-9", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List ther users who gave the worst rating for movie 'Love Will Tear Us Apart'."}, {"from": "gpt", "value": "```sql\nSELECT T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Love Will Tear Us Apart' AND T1.rating_score = 1\n```"}]}, {"id": "train-10", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all movies with the best rating score. State the movie title and number of Mubi user who loves the movie."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.movie_title, T2.movie_popularity FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 5\n```"}]}, {"id": "train-12", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all movies where users left a critic, find the movie name, user, rating and critics comments from the user."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title, T1.user_id, T1.rating_score, T1.critic FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.critic IS NOT NULL\n```"}]}, {"id": "train-13", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For movie titled 'Welcome to the Dollhouse', how many percentage of the ratings were rated with highest score."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.rating_score = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'Welcome to the Dollhouse'\n```"}]}, {"id": "train-14", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of rated movies were released in year 2021?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.movie_release_year = 2021 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id\n```"}]}, {"id": "train-15", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the director of the movie Sex, Drink and Bloodshed?"}, {"from": "gpt", "value": "```sql\nSELECT director_name FROM movies WHERE movie_title = 'Sex, Drink and Bloodshed'\n```"}]}, {"id": "train-16", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the most followed list?"}, {"from": "gpt", "value": "```sql\nSELECT list_title FROM lists ORDER BY list_followers DESC LIMIT 1\n```"}]}, {"id": "train-17", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT list_url FROM lists WHERE list_update_timestamp_utc LIKE '2012%' AND list_followers BETWEEN 1 AND 2 ORDER BY list_update_timestamp_utc DESC LIMIT 1\n```"}]}, {"id": "train-18", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the list ID that was first created by user 85981819?"}, {"from": "gpt", "value": "```sql\nSELECT list_id FROM lists_users WHERE user_id = 85981819 ORDER BY list_creation_date_utc ASC LIMIT 1\n```"}]}, {"id": "train-19", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ratings WHERE movie_id = 1269 AND rating_score <= 2 AND user_eligible_for_trial = 1 AND user_has_payment_method = 1\n```"}]}, {"id": "train-20", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the movie popularity of the movies released in 2021 that were directed by Steven Spielberg? List the names of the movies and their corresponding popularity."}, {"from": "gpt", "value": "```sql\nSELECT movie_title, movie_popularity FROM movies WHERE movie_release_year = 2021 AND director_name = 'Steven Spielberg'\n```"}]}, {"id": "train-21", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the first movie released and who directed it?"}, {"from": "gpt", "value": "```sql\nSELECT movie_release_year, director_name FROM movies WHERE movie_release_year IS NOT NULL ORDER BY movie_release_year ASC LIMIT 1\n```"}]}, {"id": "train-22", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the user ID of the user, who was a subscriber when he created the list, who created a list for 10 consecutive years? If there are multiple users, indicate each of their user IDs."}, {"from": "gpt", "value": "```sql\nSELECT user_id FROM lists_users WHERE user_subscriber = 1 GROUP BY user_id HAVING MAX(SUBSTR(list_creation_date_utc, 1, 4)) - MIN(SUBSTR(list_creation_date_utc, 1, 4)) >= 10\n```"}]}, {"id": "train-23", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users gave \"Pavee Lackeen: The Traveller Girl\" movie a rating score of 4?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'Pavee Lackeen: The Traveller Girl' AND T2.rating_score = 4\n```"}]}, {"id": "train-25", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year was the third movie directed by Quentin Tarantino released? Indicate the user ids of the user who gave it a rating score of 4."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_release_year, T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_id = ( SELECT movie_id FROM movies WHERE director_name = 'Quentin Tarantino' ORDER BY movie_release_year ASC LIMIT 2, 1 ) AND T1.rating_score = 4\n```"}]}, {"id": "train-26", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the URL to the movie director page on Mubi of the director whose movie was critic by user 2452551 and was given 39 likes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.director_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 2452551 AND T1.critic_likes = 39\n```"}]}, {"id": "train-27", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating score of the movie \"When Will I Be Loved\" and who was its director?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.rating_score), T2.director_name FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved'\n```"}]}, {"id": "train-28", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies were added to the list with the most number of movies? Indicate whether the user was a paying subscriber or not when he created the list."}, {"from": "gpt", "value": "```sql\nSELECT T1.list_movie_number, T2.user_has_payment_method FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id ORDER BY T1.list_movie_number DESC LIMIT 1\n```"}]}, {"id": "train-29", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the movie whose critic received the highest number of likes related to the critic made by the user rating the movie?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.critic_likes DESC LIMIT 1\n```"}]}, {"id": "train-30", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the popularity of the movie that has the highest popularity between 1920 to 1929 and when did the movie received its first rating score of 1 from the users who were a paying subscriber when they rated the movie ?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.movie_popularity), MIN(T1.rating_timestamp_utc) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1920 AND 1929 AND T1.rating_score = 1 AND T1.user_has_payment_method = 1\n```"}]}, {"id": "train-31", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies directed by Francis Ford Coppola have a popularity of more than 1,000? Indicate what is the highest amount of likes that each critic per movie has received, if there's any."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie_title), T1.critic FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Francis Ford Coppola' AND T2.movie_popularity > 1000\n```"}]}, {"id": "train-33", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the lists created by user 4208563, which one has the highest number of followers? Indicate how many followers it has and whether the user was a subscriber or not when he created the list."}, {"from": "gpt", "value": "```sql\nSELECT 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 ORDER BY T1.list_followers DESC LIMIT 1\n```"}]}, {"id": "train-34", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year has the least number of movies that was released and what is the title of the movie in that year that has the highest number of rating score of 1?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.movie_release_year, T1.movie_title FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_release_year = ( SELECT movie_release_year FROM movies GROUP BY movie_release_year ORDER BY COUNT(movie_id) DESC LIMIT 1 ) AND T2.rating_score = 1\n```"}]}, {"id": "train-35", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users, who were a paying subscriber when they rated the movie, gave the movie that was released in 1924 and directed by Erich von Stroheim a rating score of 5?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_release_year = 1924 AND T1.director_name = 'Erich von Stroheim' AND T2.rating_score = 5 AND T2.user_has_payment_method = 1\n```"}]}, {"id": "train-36", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of movies added to the lists of user 8516503? Give the user profile image URL on Mubi."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.list_movie_number), T2.user_avatar_image_url FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T2.user_id = 8516503\n```"}]}, {"id": "train-37", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users rated the movie \"The Magnificent Ambersons\" gave a rating score of no more than 2? List all the URL to the rating on Mubi."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.user_id), T2.rating_url FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'The Magnificent Ambersons' AND T2.rating_score <= 2\n```"}]}, {"id": "train-38", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users who created a list in the February of 2016 were eligible for trial when they created the list? Indicate the user id of the user who has the most number of followers in his list in February of 2016."}, {"from": "gpt", "value": "```sql\nSELECT 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.list_creation_date_utc BETWEEN '2016-02-01' AND '2016-02-29' AND T2.user_eligible_for_trial = 1\n```"}]}, {"id": "train-39", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the URL to the rating on Mubi of the Riff-Raff movie that was given the highest rating score by user 22030372?"}, {"from": "gpt", "value": "```sql\nSELECT T2.rating_url FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_id = 22030372 AND T2.rating_score = 5 AND T1.movie_title = 'Riff-Raff'\n```"}]}, {"id": "train-40", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many directors have directed atleast 10 movies between 1960 to 1985? Indicate the name of the movie in those years of each director that received the highest amount of 5 rating score."}, {"from": "gpt", "value": "```sql\nSELECT T2.director_name FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1960 AND 1985 GROUP BY T2.director_name HAVING COUNT(T2.movie_id) > 10\n```"}]}, {"id": "train-41", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users, who were not a a trialist when they rated the movie, gave the movie \"The South\" a rating score of not more than 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_trialist = 0 AND T2.rating_score <= 2 AND T1.movie_title = 'The South'\n```"}]}, {"id": "train-43", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating score of the movie \"The Crowd\" and who was its director?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.rating_score), T1.director_name FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_title = 'The Crowd'\n```"}]}, {"id": "train-44", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the first movie of the director who directed the highest number of movies released and what is the user id of the user who received the highest number of comments related to the critic made by the user rating the movie?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(movie_release_year) FROM movies WHERE director_name = ( SELECT T2.director_name FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1960 AND 1985 GROUP BY T2.director_name ORDER BY COUNT(T2.director_name) DESC LIMIT 1 )\n```"}]}, {"id": "train-45", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies have a popularity of more than 400 but less than 500? Indicate the name of the movies and the highest rating score each movie has received."}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title, MAX(T2.rating_score) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_popularity BETWEEN 400 AND 500 GROUP BY T1.movie_title\n```"}]}, {"id": "train-46", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the URL to the rating on Mubi made by user 45579900 for the movie \"The Vertical Ray of the Sun\" that received 20 likes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.rating_url FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_id = 45579900 AND T1.movie_title = 'The Vertical Ray of the Sun' AND T2.critic_likes = 20\n```"}]}, {"id": "train-47", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average popularity of each movie that was directed by Christopher Nolan? Indicate which movie directed by him has received the highest number of 5 rating scores."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.movie_popularity) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Christopher Nolan'\n```"}]}, {"id": "train-48", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the movie that was rated by the user between 1/1/2013 to 12/31/2013 by the user who created the list \"100 Greatest Living American Filmmakers\"? Calculate for the average rating score of those movies in 2013."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists AS T3 ON T3.user_id = T1.user_id WHERE T1.rating_timestamp_utc BETWEEN '2013-01-01' AND '2013-12-31' AND T3.list_title = '100 Greatest Living American Filmmakers'\n```"}]}, {"id": "train-49", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating score of the 'Pavee Lackeen: The Traveller Girl' movie and what year was it released?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.rating_score), T2.movie_release_year FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Pavee Lackeen: The Traveller Girl'\n```"}]}, {"id": "train-50", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movie lists were still updated 10 years after it was created?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM lists WHERE SUBSTR(list_update_timestamp_utc, 1, 4) - SUBSTR(list_creation_timestamp_utc, 1, 4) > 10\n```"}]}, {"id": "train-51", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the description for the movie list \"Short and pretty damn sweet\"?"}, {"from": "gpt", "value": "```sql\nSELECT list_description FROM lists WHERE list_title = 'Short and pretty damn sweet'\n```"}]}, {"id": "train-52", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where can I find the movie list \"Short and pretty damn sweet\"?"}, {"from": "gpt", "value": "```sql\nSELECT list_url FROM lists WHERE list_title = 'Short and pretty damn sweet'\n```"}]}, {"id": "train-53", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the movie lists created after 2010/1/1, how many of them have over 200 followers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM lists WHERE list_followers > 200 AND list_update_timestamp_utc > '2010-01-01'\n```"}]}, {"id": "train-54", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movie lists were created by user 83373278 when he or she was a subscriber?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM lists_users WHERE user_id = 83373278 AND user_subscriber = 1\n```"}]}, {"id": "train-55", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year was the movie \"La Antena\" released?"}, {"from": "gpt", "value": "```sql\nSELECT movie_release_year FROM movies WHERE movie_title = 'La Antena'\n```"}]}, {"id": "train-56", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give me the url of the movie \"La Antena\"."}, {"from": "gpt", "value": "```sql\nSELECT movie_url FROM movies WHERE movie_title = 'La Antena'\n```"}]}, {"id": "train-57", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movie is more popular, \"The General\" or \"Il grido\"?"}, {"from": "gpt", "value": "```sql\nSELECT movie_title FROM movies WHERE movie_title = 'The General' OR movie_title = 'Il grido' ORDER BY movie_popularity DESC LIMIT 1\n```"}]}, {"id": "train-58", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies registered on Mubi are directed by Hong Sang-soo?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movie_id) FROM movies WHERE director_name = 'Hong Sang-soo'\n```"}]}, {"id": "train-59", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Was the user who created the list \"250 Favourite Films\" a trialist when he or she created the list?"}, {"from": "gpt", "value": "```sql\nSELECT T2.user_trialist FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films'\n```"}]}, {"id": "train-60", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of the movie lists user 32172230 created when he or she was eligible for trial."}, {"from": "gpt", "value": "```sql\nSELECT T1.list_title FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 32172230 AND T2.user_eligible_for_trial = 1\n```"}]}, {"id": "train-61", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movie lists with over 100 movies had user 85981819 created when he or she was a paying subscriber?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 85981819 AND T1.list_movie_number > 100 AND T2.user_has_payment_method = 1\n```"}]}, {"id": "train-62", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the description of user 85981819's movie list with the most followers?"}, {"from": "gpt", "value": "```sql\nSELECT T1.list_description FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.user_id = 85981819 ORDER BY T1.list_followers DESC LIMIT 1\n```"}]}, {"id": "train-63", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did the creator of the list \"250 Favourite Films\" last updated a movie list?"}, {"from": "gpt", "value": "```sql\nSELECT T2.list_update_date_utc FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films' ORDER BY T2.list_update_date_utc DESC LIMIT 1\n```"}]}, {"id": "train-64", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the avatar image of the user who created the movie list \"250 Favourite Films\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.user_avatar_image_url FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id AND T1.user_id = T2.user_id WHERE T1.list_title = '250 Favourite Films'\n```"}]}, {"id": "train-65", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more movie lists were created by the user who created the movie list \"250 Favourite Films\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(list_id) FROM lists_users WHERE user_id = ( SELECT user_id FROM lists WHERE list_title = '250 Favourite Films' )\n```"}]}, {"id": "train-66", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users liked the movie \"A Way of Life\" to the highest extent?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.rating_score = 5\n```"}]}, {"id": "train-67", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the critics made by the user rating the movie \"A Way of Life\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.critic FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life'\n```"}]}, {"id": "train-68", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many critics of the movie \"Imitation of Life\" got more than 1 like?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Imitation of Life' AND T1.critic_likes > 1\n```"}]}, {"id": "train-69", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which user made a critic for the film \"When Will I Be Loved\" and got 2 comments for the critic?"}, {"from": "gpt", "value": "```sql\nSELECT T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved' AND T1.critic_comments = 2\n```"}]}, {"id": "train-70", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did user 39115684 rate the movie \"A Way of Life\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.user_id = 39115684\n```"}]}, {"id": "train-71", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the url of user 39115684's rating on the movie 'When Will I Be Loved'?"}, {"from": "gpt", "value": "```sql\nSELECT T1.rating_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.user_id = 39115684\n```"}]}, {"id": "train-72", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Was user 39115684 a trialist when he or she rated the movie \"A Way of Life\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.user_trialist FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.user_id = 39115684\n```"}]}, {"id": "train-73", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users were trialists when they rated the movie \"A Way of Life\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved' AND T1.user_trialist = 1\n```"}]}, {"id": "train-74", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the links to the ratings on the movie \"A Way of Life\" with a critic."}, {"from": "gpt", "value": "```sql\nSELECT T1.rating_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.critic IS NOT NULL\n```"}]}, {"id": "train-75", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users have rated the most popular movie?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(rating_id) FROM ratings WHERE movie_id = ( SELECT movie_id FROM movies ORDER BY movie_popularity DESC LIMIT 1 )\n```"}]}, {"id": "train-76", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: User 58149469's critic on which film got 1 like and 2 comments?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 58149469 AND T1.critic_likes = 1 AND T1.critic_comments = 2\n```"}]}, {"id": "train-77", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users who are trailists when rating the movie \"When Will I Be Loved\", how many of them have rated \"1\" on the movie?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved' AND T1.rating_score = 1 AND T1.user_trialist = 1\n```"}]}, {"id": "train-78", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many ratings on the movie \"A Way of Life\" are made after the year 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.rating_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life' AND T1.rating_timestamp_utc >= '2012-01-01'\n```"}]}, {"id": "train-79", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's of rating on the movie \"Innocence Unprotected\" by the user who created the movie list \"250 Favourite Films\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists AS T3 ON T3.user_id = T1.user_id WHERE T2.movie_title = 'Innocence Unprotected' AND T3.list_title = '250 Favourite Films'\n```"}]}, {"id": "train-80", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the movies rated by the user who created the movie list \"250 Favourite Films\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists AS T3 ON T3.user_id = T1.user_id WHERE T3.list_title = '250 Favourite Films'\n```"}]}, {"id": "train-81", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the average rating score of the movie \"A Way of Life\"?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'A Way of Life'\n```"}]}, {"id": "train-82", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the percentage of the users who have rated \"1\" on the movie \"When Will I Be Loved\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.rating_score = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved'\n```"}]}, {"id": "train-83", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much higher is the average rating score of the movie \"Innocence Unprotected\" than the movie \"When Will I Be Loved\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.movie_title = 'Innocence Unprotected' THEN T1.rating_score ELSE 0 END) / SUM(CASE WHEN T2.movie_title = 'Innocence Unprotected' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.movie_title = 'When Will I Be Loved' THEN T1.rating_score ELSE 0 END) / SUM(CASE WHEN T2.movie_title = 'When Will I Be Loved' THEN 1 ELSE 0 END) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id\n```"}]}, {"id": "train-84", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the director of the movie \"Tokyo Eyes\"\uff1f"}, {"from": "gpt", "value": "```sql\nSELECT director_name FROM movies WHERE movie_title = 'Tokyo Eyes'\n```"}]}, {"id": "train-85", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films were released in 2007?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM movies WHERE movie_release_year = 2007\n```"}]}, {"id": "train-86", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of the films released in 2006 was the most popular among Mubi users?"}, {"from": "gpt", "value": "```sql\nSELECT movie_title FROM movies WHERE movie_release_year = 2006 ORDER BY movie_popularity DESC LIMIT 1\n```"}]}, {"id": "train-87", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films did \u00c5ke Sandgren direct?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movie_title) FROM movies WHERE director_name = '\u00c5ke Sandgren'\n```"}]}, {"id": "train-88", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of the films directed by \u00c1lex de la Iclesia is the most popular among Mubi users?"}, {"from": "gpt", "value": "```sql\nSELECT movie_title FROM movies WHERE director_name = '\u00c5ke Sandgren' ORDER BY movie_popularity DESC LIMIT 1\n```"}]}, {"id": "train-89", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the movie Cops released?"}, {"from": "gpt", "value": "```sql\nSELECT movie_release_year FROM movies WHERE movie_title = 'Cops'\n```"}]}, {"id": "train-90", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the id of the director of the movie \"It's Winter\"."}, {"from": "gpt", "value": "```sql\nSELECT director_id FROM movies WHERE movie_title = 'It''s Winter'\n```"}]}, {"id": "train-91", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the ID of the user with the most followers on the list."}, {"from": "gpt", "value": "```sql\nSELECT user_id FROM lists ORDER BY list_followers DESC LIMIT 1\n```"}]}, {"id": "train-92", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the title of the list with the most comments on the list."}, {"from": "gpt", "value": "```sql\nSELECT list_title FROM lists GROUP BY list_title ORDER BY COUNT(list_comments) DESC LIMIT 1\n```"}]}, {"id": "train-93", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of the film released in 2008 scored the highest?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year = 2008 ORDER BY T1.rating_score DESC LIMIT 1\n```"}]}, {"id": "train-94", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the top three movies in the number of likes related to the critic made by the user rating the movie."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.critic_likes DESC LIMIT 3\n```"}]}, {"id": "train-95", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users have more than 100 followers in the list created by users in 2009?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers > 100 AND T1.list_creation_date_utc LIKE '2009%'\n```"}]}, {"id": "train-96", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users in Mubi give the movie \"White Night Wedding for 5\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 5 AND T2.movie_title = 'White Night Wedding'\n```"}]}, {"id": "train-97", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the cover image of the user who created the movie list 'Georgia related films'?"}, {"from": "gpt", "value": "```sql\nSELECT T1.user_cover_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Georgia related films'\n```"}]}, {"id": "train-98", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many followers does the list created by the user whose user_avatar_image_url is https://assets.mubicdn.net/images/avatars/74983/images-w150.jpg?1523895214 have?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.list_followers) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_avatar_image_url = 'https://assets.mubicdn.net/images/avatars/74983/images-w150.jpg?1523895214'\n```"}]}, {"id": "train-99", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the movies that user 94978 scored as 5."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 5 AND T1.user_id = 94978\n```"}]}, {"id": "train-100", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the films released in 2003 among the films scored by user 2941 ."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year = 2003 AND T1.user_id = 2941\n```"}]}, {"id": "train-101", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users were not trialists when they rated the movie \"Patti Smith: Dream of Life\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Patti Smith: Dream of Life' AND T1.user_trialist = 0\n```"}]}, {"id": "train-102", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movie has the highest average score in Mubi?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id GROUP BY T2.movie_title ORDER BY SUM(T1.rating_score) / COUNT(T1.rating_id) DESC LIMIT 1\n```"}]}, {"id": "train-103", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the top three movies in the number comments related to the critic made by the user rating the movie."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.critic_comments DESC LIMIT 3\n```"}]}, {"id": "train-104", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the title of the first list created by a user 85981819? And please provide the user_avatar_image_url."}, {"from": "gpt", "value": "```sql\nSELECT T2.list_title, T1.user_avatar_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_id = 85981819 ORDER BY T2.list_creation_timestamp_utc LIMIT 1\n```"}]}, {"id": "train-105", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the movies that have been rated the most times in 2020."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_timestamp_utc LIKE '2020%' GROUP BY T2.movie_title ORDER BY COUNT(T2.movie_title) DESC LIMIT 1\n```"}]}, {"id": "train-106", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average score for the movie Versailles Rive-Gauche?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title LIKE 'Versailles Rive-Gauche'\n```"}]}, {"id": "train-107", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which film rated by user 59988436 that received 21 comments?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 59988436 AND T1.critic_comments = 21\n```"}]}, {"id": "train-108", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the movies that received more than 20 likes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.critic_likes > 20\n```"}]}, {"id": "train-109", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average score of the movie \"The Fall of Berlin\" in 2019?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.rating_score) / COUNT(T1.rating_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_timestamp_utc LIKE '2019%' AND T2.movie_title LIKE 'The Fall of Berlin'\n```"}]}, {"id": "train-110", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of users rated the movie \"Patti Smith: Dream of Life\" by more than 3?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.rating_score > 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title LIKE 'Patti Smith: Dream of Life'\n```"}]}, {"id": "train-111", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of the film directed by director Abbas Kiarostami has the highest average score?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Abbas Kiarostami' GROUP BY T2.movie_title ORDER BY SUM(T1.rating_score) / COUNT(T1.rating_id) DESC LIMIT 1\n```"}]}, {"id": "train-112", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year had the most released films?"}, {"from": "gpt", "value": "```sql\nSELECT movie_release_year FROM movies GROUP BY movie_release_year ORDER BY COUNT(movie_id) DESC LIMIT 1\n```"}]}, {"id": "train-113", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the director that made the most movies? Give the director's id."}, {"from": "gpt", "value": "```sql\nSELECT director_id FROM movies GROUP BY director_id ORDER BY COUNT(movie_id) DESC LIMIT 1\n```"}]}, {"id": "train-114", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies did the director of the highest movie popularity make?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movie_id) FROM movies WHERE director_id = ( SELECT director_id FROM movies ORDER BY movie_popularity DESC LIMIT 1 )\n```"}]}, {"id": "train-115", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the number of the paying subscribers when rating a movie after the year 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_subscriber) FROM ratings_users WHERE user_has_payment_method = 1 AND rating_date_utc > '2014%'\n```"}]}, {"id": "train-116", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the earliest user created a list but didn't get any followers? Give the user ID."}, {"from": "gpt", "value": "```sql\nSELECT user_id FROM lists_users WHERE user_subscriber = 0 ORDER BY list_creation_date_utc LIMIT 1\n```"}]}, {"id": "train-117", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of followers for the user who posted the most lists."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.list_followers) FROM lists AS T1 INNER JOIN lists_users AS T2 ON T1.list_id = T2.list_id GROUP BY T1.user_id ORDER BY COUNT(T1.list_id) DESC LIMIT 1\n```"}]}, {"id": "train-118", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many followers did the user who posted the list \"Non-American Films about World War II\" have?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.list_followers) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Non-American Films about World War II'\n```"}]}, {"id": "train-119", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the number of users gave the movie \"Downfall\" a rating of \"4\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Downfall' AND T1.rating_score = 4\n```"}]}, {"id": "train-120", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the movie that got the most \"5\" ratings."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 5\n```"}]}, {"id": "train-121", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movie got the most critic comments? Give the name of the movie."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id GROUP BY T2.movie_title ORDER BY COUNT(T1.critic_comments) DESC LIMIT 1\n```"}]}, {"id": "train-123", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the portrait picture of the user who created the list \"Vladimir Vladimirovich Nabokov\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.user_avatar_image_url FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Vladimir Vladimirovich Nabokov'\n```"}]}, {"id": "train-124", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the user who post the list that contained the most number of the movies, is he/she a paying subscriber when creating that list?"}, {"from": "gpt", "value": "```sql\nSELECT T1.user_has_payment_method FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_movie_number = ( SELECT MAX(list_movie_number) FROM lists )\n```"}]}, {"id": "train-125", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the head portrait of the user who gave the most \"5\" ratings."}, {"from": "gpt", "value": "```sql\nSELECT T2.user_avatar_image_url FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id WHERE T1.rating_score = 5\n```"}]}, {"id": "train-126", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many critics were given to the movie that got the most movie popularity number."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.critic) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_popularity = ( SELECT MAX(movie_popularity) FROM movies )\n```"}]}, {"id": "train-127", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who gave a \"4\" rating to the movie \"Freaks\" at 2013/5/4 6:33:32? Give his/her user id."}, {"from": "gpt", "value": "```sql\nSELECT T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE rating_score = 4 AND rating_timestamp_utc LIKE '2013-05-04 06:33:32' AND T2.movie_title LIKE 'Freaks'\n```"}]}, {"id": "train-128", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the url of movie which was rated 5 on 2013/5/3 5:11:17."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE rating_score = 5 AND rating_timestamp_utc LIKE '2013-05-03 05:11:17'\n```"}]}, {"id": "train-129", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the 1998 movie which got the highest popularity, how many \"4\" rating did the movie get?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie_title) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score = 4 AND T2.movie_release_year = 1998 ORDER BY T2.movie_popularity DESC LIMIT 1\n```"}]}, {"id": "train-130", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From all the movies that got more than 13000 popularity number, which one had the least ratings."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_popularity > 13000 ORDER BY T1.rating_score LIMIT 1\n```"}]}, {"id": "train-131", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many paying subscribers gave a rating to the movie \"One Flew Over the Cuckoo's Nest\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN ratings_users AS T3 ON T1.user_id = T3.user_id WHERE T2.movie_title = 'One Flew Over the Cuckoo''s Nest' AND T3.user_has_payment_method = 1\n```"}]}, {"id": "train-132", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the lists that got more than 3000 followers, how many did the users who created those lists are paying subscribers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers > 3000 AND T1.user_has_payment_method = 1\n```"}]}, {"id": "train-133", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which 1988 movie got the most ratings?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year = 1988 ORDER BY T1.rating_score DESC LIMIT 1\n```"}]}, {"id": "train-134", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the movies that were released in 1995, how many lower than 3 ratings did the most popularity movie had?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.rating_score < 3 AND T2.movie_release_year = 1995 AND T2.movie_popularity = ( SELECT MAX(movie_popularity) FROM movies WHERE movie_release_year = 1995 )\n```"}]}, {"id": "train-135", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of users gave \"5\" to the movie \"Go Go Tales\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.rating_score = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'Go Go Tales'\n```"}]}, {"id": "train-136", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the percentage of subscribers who rated who rated the movie \"G.I. Jane\"."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists_users AS T3 ON T1.user_id = T3.user_id WHERE T2.movie_title = 'G.I. Jane'\n```"}]}, {"id": "train-137", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the users who gave \"A Shot in the Dark\" a rating, how many percent of them is a paying subscriber?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.user_has_payment_method = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN lists_users AS T3 ON T1.user_id = T3.user_id WHERE T2.movie_title = 'A Shot in the Dark'\n```"}]}, {"id": "train-138", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all the list titles created by user 4208563."}, {"from": "gpt", "value": "```sql\nSELECT list_title FROM lists WHERE user_id LIKE 4208563\n```"}]}, {"id": "train-139", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the lists created in 2016, which is the list that was updated most recently."}, {"from": "gpt", "value": "```sql\nSELECT list_title FROM lists WHERE strftime('%Y', list_update_timestamp_utc) = '2016' ORDER BY list_update_timestamp_utc DESC LIMIT 1\n```"}]}, {"id": "train-140", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of list created by user who was a subscriber when he created the list?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN user_subscriber = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(list_id) FROM lists_users\n```"}]}, {"id": "train-141", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all lists created by a user who was a subcriber when created the list."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.list_id FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_subscriber = 1\n```"}]}, {"id": "train-142", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide list titles created by user who are eligible for trial when he created the list."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.list_title FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T1.user_eligible_for_trial = 1\n```"}]}, {"id": "train-143", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the lists with at least one follower, how many were created by user who was subscriber when created the list?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.list_id) FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_followers >= 1 AND T1.user_subscriber = 1\n```"}]}, {"id": "train-144", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all list titles with at least 200 movies in the list, what is their average number of followers?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(list_followers) FROM lists WHERE list_movie_number > 200\n```"}]}, {"id": "train-145", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.list_title FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_movie_number < 50 AND T1.user_subscriber = 1\n```"}]}, {"id": "train-146", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which title list has not been updated for the longest period of time? State how long it has not been updated?"}, {"from": "gpt", "value": "```sql\nSELECT list_title , datetime(CURRENT_TIMESTAMP, 'localtime') - datetime(list_update_timestamp_utc) FROM lists ORDER BY list_update_timestamp_utc LIMIT 1\n```"}]}, {"id": "train-147", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the user who created the list titled 'Sound and Vision'? Was he a subcriber when he created the list?"}, {"from": "gpt", "value": "```sql\nSELECT T1.user_id, T1.user_subscriber FROM lists_users AS T1 INNER JOIN lists AS T2 ON T1.list_id = T2.list_id WHERE T2.list_title LIKE 'Sound and Vision'\n```"}]}, {"id": "train-148", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the list with more than 200 followers, state the title and how long the list has been created?"}, {"from": "gpt", "value": "```sql\nSELECT list_title , 365 * (strftime('%Y', 'now') - strftime('%Y', list_creation_timestamp_utc)) + 30 * (strftime('%m', 'now') - strftime('%m', list_creation_timestamp_utc)) + strftime('%d', 'now') - strftime('%d', list_creation_timestamp_utc) FROM lists WHERE list_followers > 200\n```"}]}, {"id": "train-149", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all movies in the list, calculate the percentage of movies that were never been rated?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.movie_id IS NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.movie_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id\n```"}]}, {"id": "train-150", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all movies rated by user 39115684. State the title, rating date and rating score."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title, T1.rating_timestamp_utc, T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 39115684\n```"}]}, {"id": "train-151", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 1970 to 1980, how many movies with a popularity of more than 11,000 were released?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movie_id) FROM movies WHERE movie_release_year BETWEEN '1970' AND '1980' AND movie_popularity > 11000\n```"}]}, {"id": "train-152", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies directed by Felipe Cazals was realeased on 1976?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movie_id) FROM movies WHERE movie_release_year = 1976 AND director_name LIKE 'Felipe Cazals'\n```"}]}, {"id": "train-153", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the URL to the movie director page on Mubi of the movie titled \"Red Blooded American Girl\""}, {"from": "gpt", "value": "```sql\nSELECT director_url FROM movies WHERE movie_title LIKE 'Red Blooded American Girl'\n```"}]}, {"id": "train-154", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the list that was updated most recently?"}, {"from": "gpt", "value": "```sql\nSELECT list_title FROM lists WHERE list_update_timestamp_utc = ( SELECT list_update_timestamp_utc FROM lists ORDER BY list_update_timestamp_utc DESC LIMIT 1 )\n```"}]}, {"id": "train-155", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who created the list that has 142 comments? Indicate the user id of the user, if there are multiple lists with 142 comments, list the user id of the person who created the list"}, {"from": "gpt", "value": "```sql\nSELECT user_id FROM lists WHERE list_comments = 142\n```"}]}, {"id": "train-156", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is Jeannot Szwarc's most popular movie and what is its average rating score?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title, AVG(T1.rating_score) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Jeannot Szwarc' ORDER BY T2.movie_popularity DESC LIMIT 1\n```"}]}, {"id": "train-157", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT T2.director_name, T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1970 AND 1979 GROUP BY T2.director_id ORDER BY COUNT(T2.movie_id) DESC LIMIT 1\n```"}]}, {"id": "train-158", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 1/1/2010 to 12/31/2020, how many users, who were a trialist when they created the list, gave the movie \"The Secret Life of Words\" a rating score of 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'The Secret Life of Words' AND T1.rating_score = 3 AND T1.user_trialist = 0 AND T1.rating_timestamp_utc BETWEEN '2010%' AND '2020%'\n```"}]}, {"id": "train-159", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the movie whose critic received the highest amount of likes? Indicate the URL to the rating on Mubi."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title, T1.rating_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.critic_likes DESC LIMIT 1\n```"}]}, {"id": "train-160", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 5 most popular movies of the 21st century? Indicate how many users gave it a rating score of 5."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.movie_id, SUM(T1.rating_score = 5) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T2.movie_popularity DESC LIMIT 5\n```"}]}, {"id": "train-161", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of followers of the lists created by the user who rated the movie \"Pavee Lackeen: The Traveller Girl\" on 3/27/2011 at 2:06:34 AM?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T4.list_followers) AS REAL) / COUNT(T2.list_id) FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id INNER JOIN movies AS T3 ON T1.movie_id = T3.movie_id INNER JOIN lists AS T4 ON T2.list_id = T4.list_id WHERE T3.movie_title LIKE 'Pavee Lackeen: The Traveller Girl' AND T1.rating_timestamp_utc LIKE '2011-03-27 02:06:34'\n```"}]}, {"id": "train-162", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 1/1/2017 to 12/31/2017, how many users who were eligible for trial when they rated the movie \"Patti Smith: Dream of Life\"and what is the image URL to the movie on Mubi?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id), T2.movie_image_url FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE datetime(T1.rating_timestamp_utc) BETWEEN '2017-01-01 00:00:00' AND '2017-12-31 00:00:00'\n```"}]}, {"id": "train-163", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.list_movie_number) , SUM(CASE WHEN T1.rating_score = 5 THEN 1 ELSE 0 END) FROM ratings AS T1 INNER JOIN lists_users AS T2 ON T1.user_id = T2.user_id INNER JOIN lists AS T3 ON T2.user_id = T3.user_id WHERE T1.user_id = 8516503\n```"}]}, {"id": "train-164", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the director of the most popular movie of all time and when was it released? Indicate the average rating score of the users who were on a trialist when they rated the movie."}, {"from": "gpt", "value": "```sql\nSELECT T1.director_name, T1.movie_release_year , SUM(T2.rating_score) / COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_trialist = 1 ORDER BY T1.movie_popularity DESC LIMIT 1\n```"}]}, {"id": "train-165", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the movie that was rated recently by user 57756708?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 57756708 ORDER BY T1.rating_timestamp_utc DESC LIMIT 1\n```"}]}, {"id": "train-166", "db_id": "movie_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 10 oldest movies and what are the average rating score for each movie? Indicate the name of the director and when the movies were released."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_id, AVG(T1.rating_score), T2.director_name, T2.movie_release_year FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.rating_timestamp_utc ASC LIMIT 10\n```"}]}, {"id": "train-167", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which date has the most ordered quantity? What is the total order quantity on that day?"}, {"from": "gpt", "value": "```sql\nSELECT ord_date, SUM(qty) FROM sales GROUP BY ord_date ORDER BY SUM(qty) DESC LIMIT 1\n```"}]}, {"id": "train-168", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title with the most ordered quantity in year 1992?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id WHERE STRFTIME('%Y', T1.ord_date) = '1992' ORDER BY T1.qty DESC LIMIT 1\n```"}]}, {"id": "train-169", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the title, price and publication date for all sales with 'ON invoice' payment terms."}, {"from": "gpt", "value": "```sql\nSELECT T2.title, T2.price, T2.pubdate FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id WHERE T1.payterms = 'ON invoice'\n```"}]}, {"id": "train-170", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title that have at least 10% royalty without minimum range amount."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.lorange = 0 AND T2.royalty >= 10\n```"}]}, {"id": "train-171", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the title and royalty percentage for title ID BU2075 between 10000 to 50000 range."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T2.royalty FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.lorange > 10000 AND T2.hirange < 50000 AND T1.title_ID = 'BU2075'\n```"}]}, {"id": "train-172", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the titles with royalty percentage, which title has the greatest royalty percentage. State it's minimum range to enjoy this royalty percentage."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T2.lorange FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id ORDER BY T2.royalty DESC LIMIT 1\n```"}]}, {"id": "train-173", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide a list of titles together with its publisher name for all publishers located in the USA."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country = 'USA'\n```"}]}, {"id": "train-174", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the royalty percentage for the most year to date sale title within the 20000 range."}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.ytd_sales) FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.lorange > 20000 AND T2.hirange < 20000\n```"}]}, {"id": "train-175", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all titles published in year 1991. Also provide notes details of the title and the publisher's name."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T1.notes, T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE STRFTIME('%Y', T1.pubdate) = '1991'\n```"}]}, {"id": "train-176", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all titles with sales of quantity more than 20 and store located in the CA state."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T2.qty FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id INNER JOIN stores AS T3 ON T2.stor_id = T3.stor_id WHERE T2.qty > 20 AND T3.state = 'CA'\n```"}]}, {"id": "train-177", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the store with the highest quantity in sales? What is the least quantity title from the store's sale?"}, {"from": "gpt", "value": "```sql\nSELECT T3.stor_id, T2.title FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id INNER JOIN stores AS T3 ON T3.stor_id = T1.stor_id WHERE T3.stor_id = ( SELECT stor_id FROM sales GROUP BY stor_id ORDER BY SUM(qty) DESC LIMIT 1 ) GROUP BY T3.stor_id, T2.title ORDER BY SUM(T1.qty) ASC LIMIT 1\n```"}]}, {"id": "train-178", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the title and publisher for title ID BU 2075. Provide all the royalty percentage for all ranges."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T3.pub_name, T2.lorange, T2.hirange, T2.royalty FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id INNER JOIN publishers AS T3 ON T1.pub_id = T3.pub_id WHERE T1.title_id = 'BU2075'\n```"}]}, {"id": "train-179", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the store with ID 7066 and calculate the percentage of the the quantity ordered that were on 'Net 30' payment terms."}, {"from": "gpt", "value": "```sql\nSELECT T2.stor_name , CAST(SUM(CASE WHEN payterms = 'Net 30' THEN qty ELSE 0 END) AS REAL) * 100 / SUM(qty) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id WHERE T1.stor_id = '7066' GROUP BY T2.stor_name\n```"}]}, {"id": "train-180", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the publisher name for publisher ID 877? Calculate its average year to date sales."}, {"from": "gpt", "value": "```sql\nSELECT T2.pub_name, AVG(T1.ytd_sales) FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.pub_id = '0877' GROUP BY T2.pub_name\n```"}]}, {"id": "train-181", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all employees who were hired before year 1990."}, {"from": "gpt", "value": "```sql\nSELECT fname, lname FROM employee WHERE STRFTIME('%Y', hire_date) < '1990'\n```"}]}, {"id": "train-182", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which employee has the lowest job level. State the first name, last name and when he /she was hired."}, {"from": "gpt", "value": "```sql\nSELECT fname, lname, hire_date FROM employee ORDER BY job_lvl LIMIT 1\n```"}]}, {"id": "train-183", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year has the most hired employees?"}, {"from": "gpt", "value": "```sql\nSELECT STRFTIME('%Y', hire_date) FROM employee GROUP BY STRFTIME('%Y', hire_date) ORDER BY COUNT(emp_id) DESC LIMIT 1\n```"}]}, {"id": "train-184", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all employees who are at the maximum level in their job designation."}, {"from": "gpt", "value": "```sql\nSELECT T1.fname, T1.lname FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.job_lvl = T2.max_lvl\n```"}]}, {"id": "train-185", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the Chief Executive Officer and when he/she was hired."}, {"from": "gpt", "value": "```sql\nSELECT T1.fname, T1.lname, T1.hire_date FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T2.job_desc = 'Chief Financial Officier'\n```"}]}, {"id": "train-186", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the employees working for publisher not located in USA? State the employee's name and publisher name."}, {"from": "gpt", "value": "```sql\nSELECT T1.fname, T1.lname, T2.pub_name FROM employee AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country != 'USA'\n```"}]}, {"id": "train-187", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all employees working for publisher 'GGG&G'. State their name and job description."}, {"from": "gpt", "value": "```sql\nSELECT T1.fname, T1.lname, T3.job_desc FROM employee AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id INNER JOIN jobs AS T3 ON T1.job_id = T3.job_id WHERE T2.pub_name = 'GGG&G'\n```"}]}, {"id": "train-188", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For each publisher, state the type of titles they published order by the publisher name."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.pub_name, T1.type FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id ORDER BY T2.pub_name\n```"}]}, {"id": "train-189", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the publisher which has the most titles published in 1991."}, {"from": "gpt", "value": "```sql\nSELECT T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE STRFTIME('%Y', T1.pubdate) = '1991' GROUP BY T1.pub_id, T2.pub_name ORDER BY COUNT(T1.title_id) DESC LIMIT 1\n```"}]}, {"id": "train-190", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the title with the highest price published by 'Binnet & Hardley'."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.pub_name = 'Binnet & Hardley' ORDER BY T1.price DESC LIMIT 1\n```"}]}, {"id": "train-191", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all employees, who have job level greater than 200. State the employee name and job description."}, {"from": "gpt", "value": "```sql\nSELECT T1.fname, T1.lname, T2.job_desc FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.job_lvl > 200\n```"}]}, {"id": "train-192", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all the authors for all business titles."}, {"from": "gpt", "value": "```sql\nSELECT T3.au_fname, T3.au_lname FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T1.type = 'business'\n```"}]}, {"id": "train-193", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the titles and year to date sales by author who are not on contract."}, {"from": "gpt", "value": "```sql\nSELECT T1.title_id, T1.ytd_sales FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T3.contract = 0\n```"}]}, {"id": "train-194", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all authors from CA who are not on contract, which title of his/hers has the most year to date sales."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T3.contract = 0 AND T3.state = 'CA' ORDER BY T1.ytd_sales DESC LIMIT 1\n```"}]}, {"id": "train-195", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all the authors for 'Sushi, Anyone?'."}, {"from": "gpt", "value": "```sql\nSELECT T3.au_fname, T3.au_lname FROM titles AS T1 INNER JOIN titleauthor AS T2 ON T1.title_id = T2.title_id INNER JOIN authors AS T3 ON T2.au_id = T3.au_id WHERE T1.title = 'Sushi, Anyone?'\n```"}]}, {"id": "train-196", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of the employees who are Editor or Designer?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.job_desc IN ('Editor', 'Designer') THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.job_id) FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id\n```"}]}, {"id": "train-197", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all titles which have year to date sales higher than the average order by pubisher name."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.ytd_sales > ( SELECT AVG(ytd_sales) FROM titles )\n```"}]}, {"id": "train-198", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many publishers are in the USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(pub_id) FROM publishers WHERE country = 'USA'\n```"}]}, {"id": "train-200", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the first names of the employees who work as Managing Editor."}, {"from": "gpt", "value": "```sql\nSELECT T1.fname FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T2.job_desc = 'Managing Editor'\n```"}]}, {"id": "train-201", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest level of job to get to for the employee who got hired the earliest?"}, {"from": "gpt", "value": "```sql\nSELECT T2.max_lvl FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id ORDER BY T1.hire_date LIMIT 1\n```"}]}, {"id": "train-202", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city is the store with the highest total sales quantity located?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id GROUP BY T2.city ORDER BY SUM(T1.qty) DESC LIMIT 1\n```"}]}, {"id": "train-203", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the price of the book that sells the best?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM sales AS T1 INNER JOIN titles AS T2 ON T1.title_id = T2.title_id ORDER BY T1.qty DESC LIMIT 1\n```"}]}, {"id": "train-204", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the stores that ordered the book \"Life Without Fear\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.stor_name FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id INNER JOIN titles AS T3 ON T1.title_id = T3.title_id WHERE T3.title = 'Life Without Fear'\n```"}]}, {"id": "train-205", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the stores that have ordered the book \"Life Without Fear\", how many of them are located in Massachusetts?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.stor_id) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id INNER JOIN titles AS T3 ON T1.title_id = T3.title_id WHERE T2.state = 'Massachusetts'\n```"}]}, {"id": "train-206", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which country is the publisher of the book \"Life Without Fear\" located?"}, {"from": "gpt", "value": "```sql\nSELECT T2.country FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.title = 'Life Without Fear'\n```"}]}, {"id": "train-207", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the publisher that has published the most expensive book?"}, {"from": "gpt", "value": "```sql\nSELECT T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id ORDER BY T1.price DESC LIMIT 1\n```"}]}, {"id": "train-208", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the publishers in the USA, how many of them have published books that are over $15?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.pub_id) FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country = 'USA' AND T1.price > 15\n```"}]}, {"id": "train-209", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give more detailed information about the first three books that sell the best."}, {"from": "gpt", "value": "```sql\nSELECT T1.notes FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id ORDER BY T2.qty DESC LIMIT 3\n```"}]}, {"id": "train-210", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books on business have the bookstores in Massachusetts ordered?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.qty) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id INNER JOIN titles AS T3 ON T1.title_id = T3.title_id WHERE T2.state = 'Massachusetts' AND T3.type = 'business'\n```"}]}, {"id": "train-211", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average quantity of each order for the book \"Life Without Fear\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.qty) AS REAL) / COUNT(T1.title_id) FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id WHERE T1.title = 'Life Without Fear'\n```"}]}, {"id": "train-212", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average level employees working as Managing Editor are at? How many levels are there between the average level and the highest level?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.job_lvl), T1.max_lvl - AVG(T2.job_lvl) FROM jobs AS T1 INNER JOIN employee AS T2 ON T1.job_id = T2.job_id WHERE T1.job_desc = 'Managing Editor' GROUP BY T2.job_id, T1.max_lvl\n```"}]}, {"id": "train-213", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which one is the cheapest business book?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM titles WHERE type = 'business' ORDER BY price LIMIT 1\n```"}]}, {"id": "train-214", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which type of book had the most pre-paid amount?"}, {"from": "gpt", "value": "```sql\nSELECT type FROM titles ORDER BY advance DESC LIMIT 1\n```"}]}, {"id": "train-215", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the royalty for the bestseller book?"}, {"from": "gpt", "value": "```sql\nSELECT royalty FROM titles ORDER BY ytd_sales DESC LIMIT 1\n```"}]}, {"id": "train-216", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which job level is O'Rourke at?"}, {"from": "gpt", "value": "```sql\nSELECT job_lvl FROM employee WHERE lname = 'O''Rourke'\n```"}]}, {"id": "train-217", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show me the employ id of the highest employee who doesn't have a middle name."}, {"from": "gpt", "value": "```sql\nSELECT emp_id FROM employee WHERE minit = '' ORDER BY job_lvl DESC LIMIT 1\n```"}]}, {"id": "train-218", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is the author of \"Sushi, Anyone?\" on the contract?"}, {"from": "gpt", "value": "```sql\nSELECT T1.contract FROM authors AS T1 INNER JOIN titleauthor AS T2 ON T1.au_id = T2.au_id INNER JOIN titles AS T3 ON T2.title_id = T3.title_id WHERE T3.title = 'Sushi, Anyone?'\n```"}]}, {"id": "train-219", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which publisher had the highest job level? Give his/her full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.fname, T1.minit, T1.lname FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id ORDER BY T1.job_lvl DESC LIMIT 1\n```"}]}, {"id": "train-220", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's Pedro S Afonso's job title?"}, {"from": "gpt", "value": "```sql\nSELECT T2.job_desc FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.fname = 'Pedro' AND T1.minit = 'S' AND T1.lname = 'Afonso'\n```"}]}, {"id": "train-221", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many levels are there left for Diego W Roel to reach if he/she could go to the max level for his/her position?"}, {"from": "gpt", "value": "```sql\nSELECT T2.max_lvl - T1.job_lvl FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.fname = 'Diego' AND T1.minit = 'W' AND T1.lname = 'Roel'\n```"}]}, {"id": "train-222", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's on the notes for the order happened on 1994/9/14?"}, {"from": "gpt", "value": "```sql\nSELECT T1.notes FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id WHERE STRFTIME('%Y-%m-%d', T2.ord_date) = '1994-09-14'\n```"}]}, {"id": "train-223", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the type of the book for the order which was sold on 1993/5/29."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.type FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id WHERE STRFTIME('%Y-%m-%d', T2.ord_date) = '1993-05-29'\n```"}]}, {"id": "train-224", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell me about the information of the French publisher."}, {"from": "gpt", "value": "```sql\nSELECT T1.pr_info FROM pub_info AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.country = 'France'\n```"}]}, {"id": "train-225", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the publisher of the book \"Silicon Valley Gastronomic Treats\"? Give the publisher's name."}, {"from": "gpt", "value": "```sql\nSELECT T2.pub_name FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.title = 'Silicon Valley Gastronomic Treats'\n```"}]}, {"id": "train-226", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city did Victoria P Ashworth work in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM employee AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.fname = 'Victoria' AND T1.minit = 'P' AND T1.lname = 'Ashworth'\n```"}]}, {"id": "train-227", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales did the store in Remulade make?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ord_num) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id WHERE T2.city = 'Remulade'\n```"}]}, {"id": "train-228", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the quantities, what percent more did the store in Fremont sell than the store in Portland in 1993?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.city = 'Fremont' THEN qty END) - SUM(CASE WHEN T2.city = 'Portland' THEN qty END) AS REAL) * 100 / SUM(CASE WHEN T2.city = 'Fremont' THEN qty END) FROM sales AS T1 INNER JOIN stores AS T2 ON T1.stor_id = T2.stor_id WHERE STRFTIME('%Y', T1.ord_date) = '1993'\n```"}]}, {"id": "train-229", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the employees, how many percent more for the publishers than designers?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.job_desc = 'publisher' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.job_desc = 'designer' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.job_id) FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id\n```"}]}, {"id": "train-230", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT fname, minit, lname FROM employee WHERE STRFTIME('%Y', hire_date) BETWEEN '1990' AND '1995' ORDER BY job_lvl DESC\n```"}]}, {"id": "train-231", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which titles has above average royalty rate? Give those title's name, type and price?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title, T1.type, T1.price FROM titles AS T1 INNER JOIN roysched AS T2 ON T1.title_id = T2.title_id WHERE T2.royalty > ( SELECT CAST(SUM(royalty) AS REAL) / COUNT(title_id) FROM roysched )\n```"}]}, {"id": "train-232", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1994 which title had less order quanty than the average order quantity? Find the title name, type and price."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title, T1.type, T1.price FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id WHERE T2.ord_date LIKE '1994%' AND T2.Qty < ( SELECT CAST(SUM(T4.qty) AS REAL) / COUNT(T3.title_id) FROM titles AS T3 INNER JOIN sales AS T4 ON T3.title_id = T4.title_id )\n```"}]}, {"id": "train-233", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the title name, type, and price of the titles published by New Moon Books. Arrange the list in ascending order of price."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T1.type, T1.price FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T2.pub_name = 'New Moon Books' ORDER BY T1.price\n```"}]}, {"id": "train-234", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the books published by US publishers, which book has the highest royalty? List these books in the descending order of royalty."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id INNER JOIN roysched AS T3 ON T1.title_id = T3.title_id WHERE T2.country = 'USA' ORDER BY T1.royalty DESC\n```"}]}, {"id": "train-235", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the difference between the average royalty of titles published by US and non US publishers?"}, {"from": "gpt", "value": "```sql\nSELECT (CAST(SUM(CASE WHEN T2.country = 'USA' THEN T1.royalty ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.country = 'USA' THEN 1 ELSE 0 END)) - (CAST(SUM(CASE WHEN T2.country != 'USA' THEN T1.royalty ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.country != 'USA' THEN 1 ELSE 0 END)) FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id INNER JOIN roysched AS T3 ON T1.title_id = T3.title_id\n```"}]}, {"id": "train-236", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average level difference between the Marketing editors hired by the US and non-US publishers?"}, {"from": "gpt", "value": "```sql\nSELECT (CAST(SUM(CASE WHEN T1.country = 'USA' THEN job_lvl ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.country = 'USA' THEN 1 ELSE 0 END)) - (CAST(SUM(CASE WHEN T1.country != 'USA' THEN job_lvl ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.country != 'USA' THEN 1 ELSE 0 END)) FROM publishers AS T1 INNER JOIN employee AS T2 ON T1.pub_id = T2.pub_id INNER JOIN jobs AS T3 ON T2.job_id = T3.job_id WHERE T3.job_desc = 'Managing Editor'\n```"}]}, {"id": "train-237", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which title is about helpful hints on how to use your electronic resources, which publisher published it and what is the price of this book?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T2.pub_name, T1.price FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.notes = 'Helpful hints on how to use your electronic resources to the best advantage.'\n```"}]}, {"id": "train-238", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the titles, which title is about the Carefully researched study of the effects of strong emotions on the body, which state-based publisher published this book, and what is the year-to-date sale?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T2.pub_name, T1.ytd_sales FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id WHERE T1.notes = 'Carefully researched study of the effects of strong emotions on the body. Metabolic charts included.'\n```"}]}, {"id": "train-239", "db_id": "book_publishing_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the top five titles that sold more than average and list them in descending order of the number of sales in California stores?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM titles AS T1 INNER JOIN sales AS T2 ON T1.title_id = T2.title_id INNER JOIN publishers AS T3 ON T1.pub_id = T3.pub_id WHERE T2.qty > ( SELECT CAST(SUM(qty) AS REAL) / COUNT(title_id) FROM sales ) AND T3.state = 'CA' ORDER BY T2.qty DESC LIMIT 5\n```"}]}, {"id": "train-240", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On which day was the most verbose complaint received?"}, {"from": "gpt", "value": "```sql\nSELECT `Date received` FROM callcenterlogs WHERE ser_time = ( SELECT MAX(ser_time) FROM callcenterlogs )\n```"}]}, {"id": "train-241", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did the earliest complaint start on 2017/3/22?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(ser_time) FROM callcenterlogs WHERE `Date received` = '2017-03-22'\n```"}]}, {"id": "train-242", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which complaint is more urgent, complaint ID CR2400594 or ID CR2405641?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN SUM(CASE WHEN `Complaint ID` = 'CR2400594' THEN priority END) > SUM(CASE WHEN `Complaint ID` = 'CR2405641' THEN priority END) THEN 'CR2400594' ELSE 'CR2405641' END FROM callcenterlogs\n```"}]}, {"id": "train-243", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of all the male clients born after the year 1990."}, {"from": "gpt", "value": "```sql\nSELECT first, middle, last FROM client WHERE year > 1990\n```"}]}, {"id": "train-244", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many complaints have the client Diesel Galloway filed?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Diesel' AND T1.last = 'Galloway'\n```"}]}, {"id": "train-245", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the detailed product of the complaint filed by Diesel Galloway on 2014/7/3?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Sub-product` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Diesel' AND T1.last = 'Galloway' AND T2.`Date received` = '2014-07-03'\n```"}]}, {"id": "train-246", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Was the tag in the complaint filed by Matthew Pierce on 2016/10/28 approved by himself?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T2.`Consumer consent provided?` IN (NULL, 'N/A', 'Empty') THEN 'No' ELSE 'Yes' END FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Matthew' AND T1.last = 'Pierce' AND T2.`Date received` = '2016-10-28'\n```"}]}, {"id": "train-247", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how long was the complaint filed by Matthew Pierce on 2016/10/28 delayed?"}, {"from": "gpt", "value": "```sql\nSELECT 365 * (strftime('%Y', T2.`Date sent to company`) - strftime('%Y', T2.`Date received`)) + 30 * (strftime('%M', T2.`Date sent to company`) - strftime('%M', T2.`Date received`)) + (strftime('%d', T2.`Date sent to company`) - strftime('%d', T2.`Date received`)) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Matthew' AND T1.last = 'Pierce' AND T2.`Date received` = '2016-10-28'\n```"}]}, {"id": "train-248", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the client whose complaint on 2017/3/27 was received by MICHAL?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.`Date received` = '2017-03-27' AND T2.server = 'MICHAL'\n```"}]}, {"id": "train-249", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how long did the complaint filed on 2017/3/27 by Rachel Hicks last?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ser_time FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.first = 'Rachel' AND T1.last = 'Hicks' AND T2.`Date received` = '2017-03-27'\n```"}]}, {"id": "train-250", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the clients from the New York city, how many of them have filed a complaint on the issue of Deposits and withdrawals?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Issue) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Issue = 'Deposits and withdrawals' AND T1.city = 'New York City'\n```"}]}, {"id": "train-251", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of all the clients whose complaints are still in progress."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Company response to consumer` = 'In progress'\n```"}]}, {"id": "train-252", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the clients who did receive a timely response for their complaint, how many of them are from New York?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.city) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Timely response?` = 'No' AND T1.city = 'New York City'\n```"}]}, {"id": "train-253", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many complaints on credit cards in the year 2016 were filed by male clients?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE strftime('%Y', T2.`Date received`) = '2016' AND T1.sex = 'Male' AND T2.Product = 'Credit card'\n```"}]}, {"id": "train-254", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which division is Diesel Galloway in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.division FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.first = 'Diesel' AND T1.last = 'Galloway'\n```"}]}, {"id": "train-255", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of all the male clients in the Pacific division."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Pacific' AND T1.sex = 'Male'\n```"}]}, {"id": "train-256", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of complaints on credit cards filed by clients from New York in the 3 consecutive years starting from 2015?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.`Complaint ID`) AS REAL) / 3 AS average FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE strftime('%Y', T2.`Date received`) BETWEEN '2015' AND '2017' AND T1.city = 'New York City' AND T2.Product = 'Credit card'\n```"}]}, {"id": "train-257", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the increase of complaints filed by the clients from New York from the year 2016 to the year 2017?"}, {"from": "gpt", "value": "```sql\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```"}]}, {"id": "train-258", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the serve time for the complaint call from client \"C00007127\" on 2017/2/22?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ser_time FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.Client_ID = 'C00007127' AND T1.`Date received` = '2017-02-22'\n```"}]}, {"id": "train-259", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which state does the owner of \"wyatt.collins@gmail.com\" live in? Give the full name of the state."}, {"from": "gpt", "value": "```sql\nSELECT T1.state FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.email = 'wyatt.collins@gmail.com'\n```"}]}, {"id": "train-260", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which detailed product did Mr Lennox Oliver Drake complain about?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Sub-product` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Lennox' AND T1.middle = 'Oliver' AND T1.last = 'Drake' AND T1.sex = 'Male'\n```"}]}, {"id": "train-261", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the detailed issue did Mr Gunner Omer Fuller complain about?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Sub-issue` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Gunner' AND T1.middle = 'Omer' AND T1.last = 'Fuller' AND T1.sex = 'Male'\n```"}]}, {"id": "train-262", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Did Ms. Lyric Emely Taylor provide the consent for result of the complaint call on 2016/5/20?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T2.`Consumer consent provided?` IN (NULL, 'N/A', '') THEN 'No' ELSE 'Yes' END FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Lyric' AND T1.middle = 'Emely' AND T1.last = 'Taylor' AND T1.sex = 'Female' AND T2.`Date received` = '2016-05-20'\n```"}]}, {"id": "train-263", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many days delay for the complaint call from Mr. Brantley Julian Stanley on 2012/5/18?"}, {"from": "gpt", "value": "```sql\nSELECT 365 * (strftime('%Y', T2.`Date sent to company`) - strftime('%Y', T2.`Date received`)) + 30 * (strftime('%M', T2.`Date sent to company`) - strftime('%M', T2.`Date received`)) + (strftime('%d', T2.`Date sent to company`) - strftime('%d', T2.`Date received`)) AS days FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2012-05-18' AND T1.sex = 'Male' AND T1.first = 'Brantley' AND T1.middle = 'Julian' AND T1.last = 'Stanley'\n```"}]}, {"id": "train-264", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which district did the review on 2018/9/11 come from? Give the name of the city."}, {"from": "gpt", "value": "```sql\nSELECT T2.district_id, T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Date = '2018-09-11'\n```"}]}, {"id": "train-265", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the review context from Jacksonville on 2017/7/22?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Reviews FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Jacksonville' AND T1.Date = '2017-07-22'\n```"}]}, {"id": "train-266", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product received a review from Indianapolis on 2016/10/7?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Product FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Indianapolis' AND T1.Date = '2016-10-07'\n```"}]}, {"id": "train-267", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stars did \"Eagle Capital\" received from Little Rock on 2013/4/4?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle Capital' AND T2.city = 'Little Rock' AND T1.Date = '2013-04-04'\n```"}]}, {"id": "train-268", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the client who made the complaint call \"CR0217298\", what was his/her birthday\uff1f"}, {"from": "gpt", "value": "```sql\nSELECT T1.month, T1.day FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0217298'\n```"}]}, {"id": "train-269", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the phone of number of the client who made the complaint call \"CR0100432\" \uff1f"}, {"from": "gpt", "value": "```sql\nSELECT T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0100432'\n```"}]}, {"id": "train-270", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the complaint callers on 2017/3/27, what percentage of the clients are females?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.sex = 'Female' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2017-03-27'\n```"}]}, {"id": "train-271", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the complaint calls from Mr Mason Javen Lopez has got the consent provided by the customer?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.`Consumer consent provided?` = 'Consent provided' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.`Consumer consent provided?`) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Male' AND T1.first = 'Mason' AND T1.middle = 'Javen' AND T1.last = 'Lopez'\n```"}]}, {"id": "train-272", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many priority urgent complaints were received in march of 2017? List the complaint ID of these complaints."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(`Complaint ID`) FROM callcenterlogs WHERE `Date received` LIKE '2017-01%' AND priority = ( SELECT MAX(priority) FROM callcenterlogs )\n```"}]}, {"id": "train-273", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full name, date of birth, and email id of the elderly clients in descending order of age."}, {"from": "gpt", "value": "```sql\nSELECT first, middle, last, year, month , day, email FROM client WHERE age > 65 ORDER BY age DESC\n```"}]}, {"id": "train-274", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product got the most five stars, and how many?"}, {"from": "gpt", "value": "```sql\nSELECT T.Product, MAX(T.num) FROM ( SELECT Product, COUNT(Stars) AS num FROM reviews WHERE Stars = 5 GROUP BY Product ) T\n```"}]}, {"id": "train-275", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the states in the South region."}, {"from": "gpt", "value": "```sql\nSELECT state FROM state WHERE Region = 'South'\n```"}]}, {"id": "train-277", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average age of clients from the Midwest region."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.age) AS REAL) / COUNT(T3.Region) AS average FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Midwest'\n```"}]}, {"id": "train-278", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name and phone number of clients who submitted the complaint via fax."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last, T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Submitted via` = 'Fax'\n```"}]}, {"id": "train-279", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find and list the names of districts which has below-average stars for Eagle Capital."}, {"from": "gpt", "value": "```sql\nSELECT T2.division FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle Capital' AND T1.Stars > ( SELECT AVG(Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id )\n```"}]}, {"id": "train-280", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the calls from the mountain division, how many are from teenage clients?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.age) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.age BETWEEN 12 AND 20 AND T2.division = 'Mountain'\n```"}]}, {"id": "train-281", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of complaints related to Credit cards came from female clients?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Female' AND T2.Product = 'Credit card'\n```"}]}, {"id": "train-282", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the clients born between 1980 and 2000, list the name of male clients who complained through referral."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.year BETWEEN 1980 AND 2000 AND T1.sex = 'Male' AND T2.`Submitted via` = 'Referral'\n```"}]}, {"id": "train-283", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the medium through which most complaints are registered in Florida?"}, {"from": "gpt", "value": "```sql\nSELECT T3.`Submitted via` FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN events AS T3 ON T1.`Complaint ID` = T3.`Complaint ID` WHERE T2.state = 'FL' GROUP BY T1.`Complaint ID` ORDER BY COUNT(T1.`Complaint ID`) DESC LIMIT 1\n```"}]}, {"id": "train-284", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of complaints received from New Bedford each year which are closed with explanation."}, {"from": "gpt", "value": "```sql\nSELECT STRFTIME('%Y', T3.`Date received`) , CAST(SUM(CASE WHEN T3.`Company response to consumer` = 'Closed with explanation' THEN 1 ELSE 0 END) AS REAL) / COUNT(T3.`Complaint ID`) AS average FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN events AS T3 ON T1.`Complaint ID` = T3.`Complaint ID` WHERE T2.city = 'New Bedford' GROUP BY strftime('%Y', T3.`Date received`)\n```"}]}, {"id": "train-285", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of consumers from Houston disputed complaints?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.`Consumer disputed?` = 'Yes' AND T1.city = 'Houston' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID\n```"}]}, {"id": "train-286", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the number of service members who complained in Syracuse."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Tags = 'Servicemember' AND T1.city = 'Syracuse'\n```"}]}, {"id": "train-287", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the calls from California, what percentage are priority 1?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.priority = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.priority) FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN district AS T3 ON T2.district_id = T3.district_id INNER JOIN state AS T4 ON T3.state_abbrev = T4.StateCode WHERE T4.State = 'California'\n```"}]}, {"id": "train-288", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference in the average age of elderly and middle-aged clients in the Northeast region."}, {"from": "gpt", "value": "```sql\nSELECT (CAST(SUM(CASE WHEN T1.age BETWEEN 35 AND 55 THEN T1.age ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age BETWEEN 35 AND 55 THEN 1 ELSE 0 END)) - (CAST(SUM(CASE WHEN T1.age > 65 THEN T1.age ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END)) AS difference FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Northeast'\n```"}]}, {"id": "train-289", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List by their ID number the 3 longest complaints."}, {"from": "gpt", "value": "```sql\nSELECT `Complaint ID` FROM callcenterlogs ORDER BY ser_time DESC LIMIT 3\n```"}]}, {"id": "train-290", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many clients have an email account other than gmail.com?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(email) FROM client WHERE email NOT LIKE '%@gmail.com'\n```"}]}, {"id": "train-291", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify by their ID all clients who did not give their consent permission."}, {"from": "gpt", "value": "```sql\nSELECT Client_ID FROM events WHERE `Consumer consent provided?` = 'N/A' OR 'Consumer consent provided?' IS NULL OR 'Consumer consent provided?' = ''\n```"}]}, {"id": "train-292", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List by their ID the complaints received by the company on 25/09/2014 that took the longest."}, {"from": "gpt", "value": "```sql\nSELECT `Complaint ID` FROM events WHERE strftime('%J', `Date sent to company`) - strftime('%J', `Date received`) = ( SELECT MAX(strftime('%J', `Date sent to company`) - strftime('%J', `Date received`)) FROM events WHERE `Date sent to company` = '2014-09-25' ) AND `Date sent to company` = '2014-09-25'\n```"}]}, {"id": "train-293", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List priority 2 complaints by date received."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT `Complaint ID` FROM callcenterlogs WHERE priority = 2 ORDER BY `Date received` DESC\n```"}]}, {"id": "train-294", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many complaints are not in process with an agent?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(outcome) FROM callcenterlogs WHERE outcome != 'AGENT'\n```"}]}, {"id": "train-295", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Credit Card complaints did Sharon handle?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.Product = 'Credit card' AND T1.server = 'SHARON'\n```"}]}, {"id": "train-296", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which region have the most 1-star reviews been done?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Region FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T1.Stars = 1 GROUP BY T3.Region ORDER BY COUNT(T3.Region) DESC LIMIT 1\n```"}]}, {"id": "train-297", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In what years were the clients who demanded more problems with Certificate of deposit born?"}, {"from": "gpt", "value": "```sql\nSELECT T1.year FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Sub-product` = '(CD) Certificate of deposit' GROUP BY T1.year ORDER BY COUNT(T1.year) DESC LIMIT 1\n```"}]}, {"id": "train-298", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cases of billing dispute issues occurred in the Mountain division?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Issue) FROM events AS T1 INNER JOIN client AS T2 ON T1.Client_ID = T2.client_id INNER JOIN district AS T3 ON T2.district_id = T3.district_id WHERE T1.Issue = 'Billing disputes' AND T3.division = 'Mountain'\n```"}]}, {"id": "train-299", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male clients are from the state of Massachusetts?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.sex) FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN client AS T3 ON T2.district_id = T3.district_id WHERE T1.state = 'Massachusetts' AND T3.sex = 'Male'\n```"}]}, {"id": "train-300", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Lists the last name of all clients who made a PS-type complaint and were served by TOVA."}, {"from": "gpt", "value": "```sql\nSELECT t1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.type = 'PS' AND T2.server = 'TOVA'\n```"}]}, {"id": "train-301", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many clients under the age of 35 gave Eagle National Mortgage 1 star?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.age) FROM reviews AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle National Mortgage' AND T1.Stars = 1 AND T2.age < 35\n```"}]}, {"id": "train-302", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male clients born in the year 1977 were given priority 0 in their complaints?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.sex = 'Male' AND T2.priority = 0 AND T1.year = 1997\n```"}]}, {"id": "train-303", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List by name all customers who provided consent for the tag Older American."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Tags = 'Older American' AND T2.`Consumer consent provided?` != 'N/A' AND T2.`Consumer consent provided?` IS NOT NULL AND T2.`Consumer consent provided?` != ''\n```"}]}, {"id": "train-304", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the state in which there have been the largest number of complaints with priority 0?"}, {"from": "gpt", "value": "```sql\nSELECT T2.state FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN district AS T3 ON T2.district_id = T3.district_id INNER JOIN state AS T4 ON T3.state_abbrev = T4.StateCode WHERE T1.priority = 0 GROUP BY T2.state ORDER BY COUNT(T2.state) DESC LIMIT 1\n```"}]}, {"id": "train-305", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many complaints made by women and served after 3 pm received a timely response from the company?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN client AS T2 ON T1.`rand client` = T2.client_id INNER JOIN events AS T3 ON T1.`Complaint ID` = T3.`Complaint ID` WHERE T2.sex = 'Female' AND T1.ser_start BETWEEN '15:00:01' AND '23:59:59' AND T3.`Timely response?` = 'Yes'\n```"}]}, {"id": "train-306", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many complaints were served in 5 minutes or less by DORIT and responded to the customer with an explanation, were made by phone?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.ser_time < '00:05:00' AND T1.server = 'DORIT' AND T2.`Submitted via` = 'Phone' AND T2.`Company response to consumer` = 'Closed with explanation'\n```"}]}, {"id": "train-307", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many clients with the last name Alvarado are from Maryland?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.client_id) FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T1.state_abbrev = T3.StateCode WHERE T2.last = 'Alvarado' AND T2.state = 'MD'\n```"}]}, {"id": "train-308", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many reviews by people between 30 and 50 years include the word 'great'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Reviews) FROM reviews AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T2.age BETWEEN 30 AND 50 AND T1.Reviews LIKE '%great%'\n```"}]}, {"id": "train-309", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full address of the customers who, having received a timely response from the company, have dispute about that response?"}, {"from": "gpt", "value": "```sql\nSELECT T1.address_1, T1.address_2 FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Timely response?` = 'Yes' AND T2.`Consumer disputed?` = 'Yes'\n```"}]}, {"id": "train-310", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many complaints from female clients born in the year 2000 were not sent through the web?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.`Submitted via`) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Female' AND T1.year = 2000 AND T2.`Submitted via` != 'Web'\n```"}]}, {"id": "train-311", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the complaints narratives made by the customer named Brenda and last name Mayer."}, {"from": "gpt", "value": "```sql\nSELECT T2.`Consumer complaint narrative` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Brenda' AND T1.last = 'Mayer'\n```"}]}, {"id": "train-312", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many complaints from customers with a gmail.com email were received by the company in February 2017?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.email) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE (T2.`Date received` LIKE '2017-02%' OR T2.`Date received` LIKE '2017-01%') AND T1.email LIKE '%@gmail.com'\n```"}]}, {"id": "train-313", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of stars given by Oregon clients in their reviews?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T3.Stars) AS REAL) / COUNT(T3.Stars) AS average FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN reviews AS T3 ON T2.district_id = T3.district_id WHERE T1.State = 'Oregon'\n```"}]}, {"id": "train-314", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of clients who sent their complaints by postal mail are age 50 and older?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.age > 50 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.`Submitted via`) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Submitted via` = 'Postal mail'\n```"}]}, {"id": "train-315", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of Norwalk clients?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.age) AS REAL) / COUNT(T1.age) AS average FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Norwalk'\n```"}]}, {"id": "train-316", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many clients who live in Kansas City provided a 1-star review?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Kansas City' AND T1.Stars = 1\n```"}]}, {"id": "train-317", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which state has the highest number of clients who gave a 5-star review?"}, {"from": "gpt", "value": "```sql\nSELECT T2.state_abbrev FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Stars = 5 GROUP BY T2.state_abbrev ORDER BY COUNT(T2.state_abbrev) DESC LIMIT 1\n```"}]}, {"id": "train-318", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region does Noah Thompson live in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.division FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.first = 'Noah' AND T1.last = 'Thompson'\n```"}]}, {"id": "train-319", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How did Kyran Muller submit his complaint?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Submitted via` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Kyran' AND T1.last = 'Muller'\n```"}]}, {"id": "train-320", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the products that people who were born after 2005 complain about?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Product FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.year > 2005\n```"}]}, {"id": "train-321", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long was Kendall Allen's complaint about her credit card?"}, {"from": "gpt", "value": "```sql\nSELECT T3.ser_time FROM events AS T1 INNER JOIN client AS T2 ON T1.Client_ID = T2.client_id INNER JOIN callcenterlogs AS T3 ON T1.`Complaint ID` = T3.`Complaint ID` WHERE T2.first = 'Kendall' AND T2.last = 'Allen' AND T2.sex = 'Female' AND T1.Product = 'Credit card'\n```"}]}, {"id": "train-322", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the issue that the client with the longest server time faced?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Issue FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.ser_time = ( SELECT MAX(ser_time) FROM callcenterlogs )\n```"}]}, {"id": "train-323", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many clients who live in New York City submitted their complaints via fax?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'New York City' AND T2.`Submitted via` = 'Fax'\n```"}]}, {"id": "train-324", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of male clients complaining about their credit cards?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.sex = 'Male' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.sex) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Product = 'Credit card'\n```"}]}, {"id": "train-325", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any two clients with their full names who have been tagged as \"Older American\" by the company without seeking their permission."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Tags = 'Older American' AND T2.`Consumer consent provided?` IN (NULL, 'N/A', '') LIMIT 2\n```"}]}, {"id": "train-326", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the birth date of the youngest client?"}, {"from": "gpt", "value": "```sql\nSELECT day, month, year FROM client ORDER BY year DESC, month DESC, day DESC LIMIT 1\n```"}]}, {"id": "train-327", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times does the consumer have no dispute over a non-timely response from the company?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(`Timely response?`) FROM events WHERE `Timely response?` = 'No' AND `Consumer disputed?` = 'No'\n```"}]}, {"id": "train-328", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the complaints are longer than 15 minutes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ser_time) FROM callcenterlogs WHERE strftime('%M', ser_time) > '15'\n```"}]}, {"id": "train-329", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common issue for the highest priority complaints?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Issue FROM events AS T1 INNER JOIN callcenterlogs AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.priority = 2 GROUP BY T1.Issue ORDER BY COUNT(T1.Issue) DESC LIMIT 1\n```"}]}, {"id": "train-330", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full names of all clients who live in the Pacific division."}, {"from": "gpt", "value": "```sql\nSELECT T2.first, T2.middle, T2.last FROM district AS T1 INNER JOIN client AS T2 ON T1.district_id = T2.district_id WHERE T1.division = 'Pacific'\n```"}]}, {"id": "train-331", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the social number of the person who made the most complaints?"}, {"from": "gpt", "value": "```sql\nSELECT T1.social FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID GROUP BY T1.client_id ORDER BY COUNT(T1.client_id) DESC LIMIT 1\n```"}]}, {"id": "train-332", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which is the city where most of the 1 star reviews come from?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Stars = 1 GROUP BY T2.city ORDER BY COUNT(T2.city) DESC LIMIT 1\n```"}]}, {"id": "train-333", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the address of the client who made a complaint via postal mail on March 14, 2012?"}, {"from": "gpt", "value": "```sql\nSELECT T1.address_1, T1.address_2 FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2012-03-14' AND T2.`Submitted via` = 'Postal mail'\n```"}]}, {"id": "train-334", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the female clients, how many of them have a complaint with a priority of 1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.sex = 'Female' AND T2.priority = 1\n```"}]}, {"id": "train-335", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the server of the phone complaints with a late response from the company."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.server FROM events AS T1 INNER JOIN callcenterlogs AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.`Submitted via` = 'Phone' AND T1.`Timely response?` = 'No'\n```"}]}, {"id": "train-336", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the issues of the complaints made by Kaitlyn Eliza Elliott."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Kaitlyn' AND T1.middle = 'Eliza' AND T1.last = 'Elliott'\n```"}]}, {"id": "train-337", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the state that the client with the email \"skylar.ramirez@gmail.com\" lives in?"}, {"from": "gpt", "value": "```sql\nSELECT T3.state FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN client AS T3 ON T2.district_id = T3.district_id WHERE T3.email = 'skylar.ramirez@gmail.com'\n```"}]}, {"id": "train-338", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region has the second most clients?"}, {"from": "gpt", "value": "```sql\nSELECT T2.division FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id GROUP BY T2.division ORDER BY COUNT(T2.division) DESC LIMIT 1, 1\n```"}]}, {"id": "train-339", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the owner of the final phone number for the complaints on server \"MORIAH\" on 9/11/2013?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.server = 'MORIAH' AND T2.`Date received` = '2013-09-11'\n```"}]}, {"id": "train-340", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compute the average time in minute for each age group"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 60 * strftime('%H', ser_time) + strftime('%M', ser_time) + strftime('%S', ser_time) / 60 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 1 ELSE 0 END) AS teenagerAverageMins, CAST(SUM(CASE WHEN T1.age > 19 AND T1.age <= 65 THEN 60 * strftime('%H', ser_time) + strftime('%M', ser_time) + strftime('%S', ser_time) / 60 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age > 19 AND T1.age <= 65 THEN 1 ELSE 0 END) AS adultAverageMins , CAST(SUM(CASE WHEN T1.age > 65 THEN 60 * strftime('%H', ser_time) + strftime('%M', ser_time) + strftime('%S', ser_time) / 60 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END) AS elderAverageMins FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client`\n```"}]}, {"id": "train-341", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of complaints are from the elderly?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.age) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID\n```"}]}, {"id": "train-342", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of male clients from Indianapolis City."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN sex = 'Male' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(client_id) FROM client WHERE city = 'Indianapolis'\n```"}]}, {"id": "train-343", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the teenager clients who use Google account and Microsoft account, which group of client is more than the other?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN SUM(CASE WHEN email LIKE '%@gmail.com' THEN 1 ELSE 0 END) > SUM(CASE WHEN email LIKE '%@outlook.com' THEN 1 ELSE 0 END) THEN 'Google account' ELSE 'Microsoft account' END FROM client WHERE age BETWEEN 13 AND 19\n```"}]}, {"id": "train-344", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of client whose email address is emily.garcia43@outlook.com?"}, {"from": "gpt", "value": "```sql\nSELECT first, middle, last FROM client WHERE email = 'emily.garcia43@outlook.com'\n```"}]}, {"id": "train-345", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the first name of clients who have the highest priority?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.priority = ( SELECT MAX(priority) FROM callcenterlogs )\n```"}]}, {"id": "train-346", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the email of client whose complaint is type \"PS\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.email FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.type = 'PS'\n```"}]}, {"id": "train-347", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the elderlies, state the last name of whose complaint is handled in server YIFAT?"}, {"from": "gpt", "value": "```sql\nSELECT T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.age > 65 AND T2.server = 'YIFAT'\n```"}]}, {"id": "train-348", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many clients who live in New York City have the complaint outcome as \"AGENT\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.`rand client`) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.city = 'New York City' AND T2.outcome = 'AGENT'\n```"}]}, {"id": "train-349", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the full name of clients who have disputed the response from company."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Consumer disputed?` = 'Yes'\n```"}]}, {"id": "train-351", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of complaints made by Google account client in server ZOHARI."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.email LIKE '%@gmail.com' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.email) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.server = 'ZOHARI'\n```"}]}, {"id": "train-352", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the full name of clients with server time of 20 minutes and above."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE strftime('%M', T2.ser_time) > '20'\n```"}]}, {"id": "train-353", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Pick 5 clients with 0 priority and write down their last name."}, {"from": "gpt", "value": "```sql\nSELECT T1.last FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.priority = 0 LIMIT 5\n```"}]}, {"id": "train-354", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the call id of clients whose first name start with alphabet \"B\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.call_id FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T1.first LIKE 'B%'\n```"}]}, {"id": "train-355", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the product complained by Alexander Bronx Lewis?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Product FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.first = 'Alexander' AND T1.middle = 'Bronx' AND T1.last = 'Lewis'\n```"}]}, {"id": "train-356", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the first name of male clients who did not receive timely response from the call center."}, {"from": "gpt", "value": "```sql\nSELECT T1.first FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Timely response?` = 'No' AND T1.sex = 'Male'\n```"}]}, {"id": "train-357", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product received the most complaints from elder clients?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Product FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.age > 65 ORDER BY T1.client_id DESC LIMIT 1\n```"}]}, {"id": "train-358", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Complaint about Credit Card mostly came from clients of which age group?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 1 ELSE 0 END), SUM(CASE WHEN T1.age > 19 AND T1.age <= 65 THEN 1 ELSE 0 END) AS adult , SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END) AS elder FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Product = 'Credit card'\n```"}]}, {"id": "train-359", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the issues for complaint with server time of below 10 minutes."}, {"from": "gpt", "value": "```sql\nSELECT T2.Issue FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE strftime('%M', T1.ser_time) < '10'\n```"}]}, {"id": "train-361", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of clients who have issue about balance transfer?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Issue = 'Balance transfer'\n```"}]}, {"id": "train-362", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the email address of clients who submitted their complaints via postal mail?"}, {"from": "gpt", "value": "```sql\nSELECT T1.email FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Submitted via` = 'Postal mail'\n```"}]}, {"id": "train-363", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average age of clients whose response is \"Closed with relief\"."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.age) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Company response to consumer` = 'Closed with relief'\n```"}]}, {"id": "train-364", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of clients whose complaint type is \"TT\"?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.age) FROM client AS T1 INNER JOIN callcenterlogs AS T2 ON T1.client_id = T2.`rand client` WHERE T2.type = 'TT'\n```"}]}, {"id": "train-365", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the complaint ID, call ID, and final phone number of complaints through AVIDAN server from 1/1/2014 to 12/30/2014."}, {"from": "gpt", "value": "```sql\nSELECT `Complaint ID`, call_id, phonefinal FROM callcenterlogs WHERE strftime('%Y', `Date received`) = '2014' AND server = 'AVIDAN'\n```"}]}, {"id": "train-366", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 1/1/2017 and 4/1/2017, what is the average server time of calls under the server DARMON?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(CAST(SUBSTR(ser_time, 4, 2) AS REAL)) FROM callcenterlogs WHERE `Date received` BETWEEN '2017-01-01' AND '2017-04-01'\n```"}]}, {"id": "train-367", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times per year does a credit card customer complain about overlimit fees?"}, {"from": "gpt", "value": "```sql\nSELECT strftime('%Y', `Date received`), COUNT(`Date received`) FROM events WHERE product = 'Credit card' AND issue = 'Overlimit fee' GROUP BY strftime('%Y', `Date received`) HAVING COUNT(`Date received`)\n```"}]}, {"id": "train-368", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the clients in Middle Atlantic, how many are them are female and no more than 18 years old?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.sex) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Middle Atlantic' AND T1.sex = 'Female' AND T1.age < 18\n```"}]}, {"id": "train-369", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give me the full birthdate, email and phone number of the youngest client in Indianapolis ."}, {"from": "gpt", "value": "```sql\nSELECT T1.year, T1.month, T1.day, T1.email, T1.phone FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.city = 'Indianapolis' ORDER BY T1.year DESC, T1.month DESC, T1.day DESC LIMIT 1\n```"}]}, {"id": "train-370", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the top five cities in terms of the number of 5-star ratings in 2016 reviews, in descending order."}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Stars = 5 AND T1.Date LIKE '2016%' ORDER BY T1.Date DESC LIMIT 5\n```"}]}, {"id": "train-371", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the longest server time when the call is about the issue of arbitration?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.ser_time) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.issue = 'Arbitration'\n```"}]}, {"id": "train-372", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give me the social number and state of the client whose phone number is 100-121-8371."}, {"from": "gpt", "value": "```sql\nSELECT T1.social, T1.state FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T1.phone = '100-121-8371'\n```"}]}, {"id": "train-373", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full names and phone numbers of clients that were from the Pacific."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.middle, T1.last, T1.phone FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Pacific'\n```"}]}, {"id": "train-374", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the social number of the client who has the longest delay in his/her complaint? Calculate the days of delay and state the company's response to the consumer."}, {"from": "gpt", "value": "```sql\nSELECT T1.social , 365 * (strftime('%Y', T2.`Date sent to company`) - strftime('%Y', T2.`Date received`)) + 30 * (strftime('%M', T2.`Date sent to company`) - strftime('%M', T2.`Date received`)) + (strftime('%d', T2.`Date sent to company`) - strftime('%d', T2.`Date received`)), T2.`Company response to consumer` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID ORDER BY 365 * (strftime('%Y', T2.`Date sent to company`) - strftime('%Y', T2.`Date received`)) + 30 * (strftime('%M', T2.`Date sent to company`) - strftime('%M', T2.`Date received`)) + (strftime('%d', T2.`Date sent to company`) - strftime('%d', T2.`Date received`)) DESC LIMIT 1\n```"}]}, {"id": "train-375", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female clients are there older than 30?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(sex) FROM client WHERE sex = 'Female' AND age > 30\n```"}]}, {"id": "train-376", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all first and last names of clients who live in New York city."}, {"from": "gpt", "value": "```sql\nSELECT first, last FROM client WHERE city = 'New York City'\n```"}]}, {"id": "train-377", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the oldest age of male clients?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(age) FROM client WHERE sex = 'Male'\n```"}]}, {"id": "train-378", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate the number of clients by each division."}, {"from": "gpt", "value": "```sql\nSELECT T2.division, COUNT(T2.division) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id GROUP BY T2.division\n```"}]}, {"id": "train-379", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of female clients in the Middle Atlantic?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.sex = 'Female' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.sex) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'South Atlantic'\n```"}]}, {"id": "train-380", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of clients in South Atlantic?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.age) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'South Atlantic'\n```"}]}, {"id": "train-381", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city in the Midwest region has the least number of clients?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Midwest' GROUP BY T2.city ORDER BY COUNT(T2.city) LIMIT 1\n```"}]}, {"id": "train-382", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers in the Northeast use Microsoft email?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.email) FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Northeast' AND T1.email LIKE '%@outlook.com'\n```"}]}, {"id": "train-383", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city in West North Central has the highest number of customers over the age of 60?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'West North Central' AND T1.age > 60 GROUP BY T2.city ORDER BY COUNT(T2.city) DESC LIMIT 1\n```"}]}, {"id": "train-384", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of complaints about the late fee issue whose priority is 2 in 2017?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.priority = 2 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE strftime('%Y', T1.`Date received`) = '2017'\n```"}]}, {"id": "train-385", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which state has the most cities?"}, {"from": "gpt", "value": "```sql\nSELECT state_abbrev FROM district GROUP BY state_abbrev ORDER BY COUNT(city) DESC LIMIT 1\n```"}]}, {"id": "train-386", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the first name and phone number of the client whose complaint id is CR0922485."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Complaint ID` = 'CR0922485'\n```"}]}, {"id": "train-387", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the emails of the clients whose complaint date received is 7/3/2014."}, {"from": "gpt", "value": "```sql\nSELECT T1.email FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Date received` = '2014-07-03'\n```"}]}, {"id": "train-388", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2012, how many complaints about Credit card product came from clients in Omaha?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'Omaha' AND strftime('%Y', T2.`Date received`) = '2012' AND T2.Product = 'Credit card'\n```"}]}, {"id": "train-389", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 2012 to 2015, how many complaints were submitted via email from female clients?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE strftime('%Y', T2.`Date received`) BETWEEN '2012' AND '2015' AND T2.`Submitted via` = 'Email' AND T1.sex = 'Male'\n```"}]}, {"id": "train-390", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all clients' phone numbers and complaint IDs which are still in progress."}, {"from": "gpt", "value": "```sql\nSELECT T1.phone, T2.`Complaint ID` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Company response to consumer` = 'In progress'\n```"}]}, {"id": "train-391", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2015, how many complaints about Billing disputes were sent by clients in Portland?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'Portland' AND T2.`Date received` LIKE '2015%' AND T2.Issue = 'Billing disputes'\n```"}]}, {"id": "train-392", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2014, what is the percentage of complaints from consumers in Houston that the delay was over 5 days?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(CASE WHEN strftime('%J', T2.`Date sent to company`) - strftime('%J', T2.`Date received`) > 5 THEN 1 ELSE 0 END)) AS REAL) * 100 / COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'Houston' AND strftime('%Y', T2.`Date received`) = '2014'\n```"}]}, {"id": "train-393", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the complains received in 2012, how many of them are submitted through email?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(`Submitted via`) FROM events WHERE strftime('%Y', `Date received`) = '2012' AND `Submitted via` = 'Email'\n```"}]}, {"id": "train-395", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List date of the review of the Eagle Capital from Indianapolis, Indiana."}, {"from": "gpt", "value": "```sql\nSELECT T2.Date FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Product = 'Eagle Capital' AND T1.city = 'Indianapolis' AND T1.state_abbrev = 'IN'\n```"}]}, {"id": "train-396", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the complaints received in year 2015, what is total number of complaints timely response and closed with an explanation?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE strftime('%Y', T1.`Date received`) = '2015' AND T2.`Timely response?` = 'Yes' AND T2.`Company response to consumer` = 'Closed with explanation'\n```"}]}, {"id": "train-397", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the female clients that age between 20 to 40, list the date when their complaints were received."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.`Date received` FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID INNER JOIN callcenterlogs AS T3 ON T2.`Complaint ID` = T3.`Complaint ID` WHERE T1.age BETWEEN 20 AND 40 AND T1.sex = 'Female'\n```"}]}, {"id": "train-398", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the product reviewed with 1 star on March 14, 2016 from Newton, Massachusetts."}, {"from": "gpt", "value": "```sql\nSELECT T2.Product FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T1.city = 'Newton' AND T1.state_abbrev = 'MA' AND T2.Date = '2016-03-14' AND T2.Stars = 1\n```"}]}, {"id": "train-399", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In reviews for the Eagle National Bank product, how many of the 5 star reviews where from Nashville, Tennessee?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Stars) FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T1.city = 'Nashville' AND T1.state_abbrev = 'TN' AND T2.Product = 'Eagle National Mortgage' AND T2.Stars = 5\n```"}]}, {"id": "train-400", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the issues of the complains of male clients and products from age 25 and below?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Male' AND T1.age < 25\n```"}]}, {"id": "train-401", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the reviews from midwest region, what are the products that received 1 star?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.Product FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN reviews AS T3 ON T2.district_id = T3.district_id WHERE T1.Region = 'Midwest' AND T3.Stars = 1\n```"}]}, {"id": "train-402", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the products involved in the complaints received on March 2017 via TOVA server."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Product FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.server = 'TOVA' AND T2.`Date received` LIKE '2017-03%'\n```"}]}, {"id": "train-403", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the division of the review of 5 stars received on December 17, 2017 for the product Eagle National Mortgage?"}, {"from": "gpt", "value": "```sql\nSELECT T1.division FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Stars = 5 AND T2.Date = '2017-12-17' AND T2.Product = 'Eagle National Mortgage'\n```"}]}, {"id": "train-404", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In complaints about the credit card product, list the phone number of the oldest client."}, {"from": "gpt", "value": "```sql\nSELECT T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Product = 'Credit card' ORDER BY T1.age DESC LIMIT 1\n```"}]}, {"id": "train-405", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In complaints received in 2014, how many of them were submitted via call?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.`Submitted via` = 'Phone' AND strftime('%Y', T1.`Date received`) = '2014'\n```"}]}, {"id": "train-406", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the product and its issues of the complains of clients with age greater than the 60% of average age of all clients."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Product, T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.age * 100 > ( SELECT AVG(age) * 60 FROM client )\n```"}]}, {"id": "train-407", "db_id": "retail_complains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In reviews of product with 5 stars, what is the percentage of the reviews coming from the division of East North Central?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.division = 'East North Central' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.division) FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Stars = 5\n```"}]}, {"id": "train-408", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the production company of the movie \"Four Rooms\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T3.title = 'Four Rooms'\n```"}]}, {"id": "train-409", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many production companies does the movie \"Four Rooms\" have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CNAME) FROM ( SELECT T1.company_name AS CNAME FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T3.title = 'Four Rooms' )\n```"}]}, {"id": "train-410", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the movie produced by production company \"Universal Pictures\"."}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Universal Pictures'\n```"}]}, {"id": "train-411", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the latest released movie produced by production company \"Universal Pictures\"?"}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Universal Pictures' ORDER BY T3.release_date DESC LIMIT 1\n```"}]}, {"id": "train-412", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the director of photography of the movie \"Pirates of the Caribbean: At World's End\"?"}, {"from": "gpt", "value": "```sql\nSELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T2.job = 'Director of Photography'\n```"}]}, {"id": "train-413", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the job of Dariusz Wolski in the movie \"Pirates of the Caribbean: At World's End\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.job FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T3.person_name = 'Dariusz Wolski'\n```"}]}, {"id": "train-414", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the crew members of the movie \"Pirates of the Caribbean: At World's End\"."}, {"from": "gpt", "value": "```sql\nSELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End'\n```"}]}, {"id": "train-415", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crew members worked as producer in the movie \"Pirates of the Caribbean: At World's End\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.person_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T2.job = 'Producer'\n```"}]}, {"id": "train-416", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the producers in the movie \"Pirates of the Caribbean: At World's End\"."}, {"from": "gpt", "value": "```sql\nSELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T2.job = 'Producer'\n```"}]}, {"id": "train-417", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In how many movie does Dariusz Wolski work as the director of photography?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie_id) FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography'\n```"}]}, {"id": "train-418", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the movie in which Dariusz Wolski works as the director of photography, what is the title of the one with the highest average vote?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography' ORDER BY T1.vote_average DESC LIMIT 1\n```"}]}, {"id": "train-419", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the release date of the latest movie in which Dariusz Wolski worked as a crew member?"}, {"from": "gpt", "value": "```sql\nSELECT T1.release_date FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' ORDER BY T1.release_date DESC LIMIT 1\n```"}]}, {"id": "train-420", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.vote_average > 5 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.vote_average) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography'\n```"}]}, {"id": "train-421", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average revenue of the movie in which Dariusz Wolski works as the director of photography?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.revenue) AS REAL) / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography'\n```"}]}, {"id": "train-422", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the movie with a revenue of 559852396."}, {"from": "gpt", "value": "```sql\nSELECT title FROM movie WHERE revenue = 559852396\n```"}]}, {"id": "train-423", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was David Rubin's job in the movie \"Days of Thunder\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.job FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'David Rubin' AND T1.title = 'Days of Thunder'\n```"}]}, {"id": "train-424", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies were directed by Michael Bay?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie_id) FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Michael Bay' AND T2.job = 'Director'\n```"}]}, {"id": "train-425", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the total number of keywords of the movie \"I Hope They Serve Beer in Hell\"."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.keyword_id) FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'I Hope They Serve Beer in Hell'\n```"}]}, {"id": "train-426", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the movie \"Land of the Dead\", who is its director?"}, {"from": "gpt", "value": "```sql\nSELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title = 'Land of the Dead' AND T2.job = 'Director'\n```"}]}, {"id": "train-427", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of movies made by Paramount Animation."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie_id) FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id WHERE T1.company_name = 'Paramount Animation'\n```"}]}, {"id": "train-428", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female characters are there in the movie \"Spider-Man 3\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Spider-Man 3' AND T3.gender = 'Female'\n```"}]}, {"id": "train-429", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the most used keyword in the movies."}, {"from": "gpt", "value": "```sql\nSELECT T1.keyword_name FROM keyword AS T1 INNER JOIN movie_keywords AS T2 ON T1.keyword_id = T2.keyword_id GROUP BY T1.keyword_name ORDER BY COUNT(T1.keyword_name) DESC LIMIT 1\n```"}]}, {"id": "train-430", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many producers does the movie \"The Amityville Horror\" have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'The Amityville Horror' AND T2.job = 'Producer'\n```"}]}, {"id": "train-431", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the production company of the movie \"Crazy Heart\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T3.title = 'Crazy Heart'\n```"}]}, {"id": "train-432", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of movies with \"saving the world\" as the keyword."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie_id) FROM keyword AS T1 INNER JOIN movie_keywords AS T2 ON T1.keyword_id = T2.keyword_id WHERE keyword_name = 'saving the world'\n```"}]}, {"id": "train-433", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the movies which were produced by Cruel and Unusual Films, which one has the most popularity?"}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Cruel and Unusual Films' ORDER BY T3.popularity DESC LIMIT 1\n```"}]}, {"id": "train-434", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the movie \"Reign of Fire\", which department was Marcia Ross in?"}, {"from": "gpt", "value": "```sql\nSELECT T4.department_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id INNER JOIN department AS T4 ON T2.department_id = T4.department_id WHERE T3.person_name = 'Marcia Ross' AND T1.title = 'Reign of Fire'\n```"}]}, {"id": "train-435", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average budget of the movies directed by Jaume Collet-Serra."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.budget) AS REAL) / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Jaume Collet-Serra' AND T2.job = 'Director'\n```"}]}, {"id": "train-436", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of male characters in the movie \"Bride Wars\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.gender = 'Male' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T3.gender) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Bride Wars'\n```"}]}, {"id": "train-437", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the movie that was made with the most money and resources?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM movie ORDER BY budget DESC LIMIT 1\n```"}]}, {"id": "train-438", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies have made at least 1 Billion at the box office?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movie_id) FROM movie WHERE revenue > 1000000000\n```"}]}, {"id": "train-439", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the first movie released?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(release_date) FROM movie WHERE movie_status = 'Released'\n```"}]}, {"id": "train-440", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crew are named John Young?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(person_id) FROM person WHERE person_name = 'John Young'\n```"}]}, {"id": "train-441", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the title of the movie that is most-liked by a large number of people."}, {"from": "gpt", "value": "```sql\nSELECT title FROM movie ORDER BY popularity DESC LIMIT 1\n```"}]}, {"id": "train-442", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the person associated with the crew id 1325273?"}, {"from": "gpt", "value": "```sql\nSELECT person_name FROM person WHERE person_id = 1325273\n```"}]}, {"id": "train-443", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the production company that made the most movies?"}, {"from": "gpt", "value": "```sql\nSELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id ORDER BY COUNT(T2.movie_id) DESC LIMIT 1\n```"}]}, {"id": "train-444", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who played Captain Jack Sparrow in all of the Pirates of the Caribbean movies?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.person_name FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T2.character_name = 'Captain Jack Sparrow' AND T1.title LIKE 'Pirates of the Caribbean%'\n```"}]}, {"id": "train-445", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is Walt Disney Pictures' most popular movie?"}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Walt Disney Pictures' ORDER BY T3.popularity DESC LIMIT 1\n```"}]}, {"id": "train-446", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies did Universal Studios release?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie_id) FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id WHERE T1.company_name = 'Universal Studios'\n```"}]}, {"id": "train-447", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which production company produced the movie that made the most money at the box office?"}, {"from": "gpt", "value": "```sql\nSELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id GROUP BY T1.company_id ORDER BY SUM(T3.revenue) DESC LIMIT 1\n```"}]}, {"id": "train-448", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female crews are in the movie \"Mr. Smith Goes to Washington\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.gender) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Mr. Smith Goes to Washington' AND T3.gender = 'Female'\n```"}]}, {"id": "train-449", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the production companies that made at least 200 movies."}, {"from": "gpt", "value": "```sql\nSELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(T2.movie_id) > 200\n```"}]}, {"id": "train-450", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies did Harrison Ford appear in total?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie_id) FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Harrison Ford'\n```"}]}, {"id": "train-451", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of Jamie Foxx's most recent movie?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Jamie Foxx' ORDER BY T1.release_date DESC LIMIT 1\n```"}]}, {"id": "train-452", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies released in 1995 did Quentin Tarantino appear in?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Quentin Tarantino' AND CAST(STRFTIME('%Y', T1.release_date) AS INT) = 1995\n```"}]}, {"id": "train-453", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the first crime movie ever released?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title 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 WHERE T3.genre_name = 'Crime' ORDER BY T1.release_date LIMIT 1\n```"}]}, {"id": "train-454", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many horror movies are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movie_id) FROM movie_genres AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.genre_id WHERE T2.genre_name = 'Horror'\n```"}]}, {"id": "train-455", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the person IDs of the second film editors in Movie No. 12."}, {"from": "gpt", "value": "```sql\nSELECT person_id FROM movie_crew WHERE movie_id = 12 AND job = 'Second Film Editor'\n```"}]}, {"id": "train-456", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many animators does Movie No. 129 have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movie_id) FROM movie_crew WHERE movie_id = 129 AND job = 'Animation'\n```"}]}, {"id": "train-457", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Movie No. 19, how many people are there in Department No. 7? Please give me their job."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT job) FROM movie_crew WHERE movie_id = 19 AND department_id = 7\n```"}]}, {"id": "train-458", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the person ID and character name of casts between order numbers 1 and 10 in Movie No. 285."}, {"from": "gpt", "value": "```sql\nSELECT person_id, character_name FROM movie_cast WHERE movie_id = 285 AND cast_order BETWEEN 1 AND 10\n```"}]}, {"id": "train-459", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did Bob Peterson appear in the movie credits?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie_id) FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Bob Peterson'\n```"}]}, {"id": "train-460", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tally the movie ID and character name in the movie starring Jim Carrey."}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_id, T2.character_name FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Jim Carrey'\n```"}]}, {"id": "train-461", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the names of the female cast in Movie No. 1865."}, {"from": "gpt", "value": "```sql\nSELECT T2.person_name FROM movie_cast AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.person_id INNER JOIN gender AS T3 ON T1.gender_id = T3.gender_id WHERE T1.movie_id = 1865 AND T3.gender = 'Female'\n```"}]}, {"id": "train-462", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write me the titles of the movies starring Jim Carrey."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Jim Carrey'\n```"}]}, {"id": "train-463", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the director's name of the movies released between 1/01/1916 and 12/31/1925."}, {"from": "gpt", "value": "```sql\nSELECT T2.person_name FROM movie_cast AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.person_id INNER JOIN movie AS T3 ON T1.movie_id = T3.movie_id INNER JOIN movie_crew AS T4 ON T1.movie_id = T4.movie_id WHERE T4.job = 'Director' AND T3.release_date BETWEEN '1916-01-01' AND '1925-12-31'\n```"}]}, {"id": "train-464", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films released between 1/2/1990 and 12/30/2000 starred Uma Thurman?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Uma Thurman' AND T1.release_date BETWEEN '1990-01-01' AND '2000-12-31'\n```"}]}, {"id": "train-465", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the titles of horror films with a vote average of more than 7."}, {"from": "gpt", "value": "```sql\nSELECT T1.title 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 WHERE T3.genre_name = 'Horror' AND vote_average > 7\n```"}]}, {"id": "train-466", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the genre and popularity of movies whose revenue is at least 120,000,000 between 2012 and 2015."}, {"from": "gpt", "value": "```sql\nSELECT T3.genre_name, T1.popularity 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 WHERE T1.revenue > 120000000 AND T1.release_date BETWEEN '2012-01-01' AND '2015-12-31'\n```"}]}, {"id": "train-467", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Indian movies between 1/2/1990 and 12/30/2003 have revenue of more than 75,000,000 and popularity of no less than 20?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie_id) FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id WHERE T1.revenue > 75000000 AND T1.popularity >= 20 AND T1.release_date BETWEEN '1990-01-01' AND '2003-12-31'\n```"}]}, {"id": "train-468", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the highest-budget film to date? Please include the revenue and name the country."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T1.revenue, T3.COUNTry_name FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id ORDER BY T1.budget DESC LIMIT 1\n```"}]}, {"id": "train-469", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the title of movies in Latin released between 1/01/1990 and 12/31/1995."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Latin' AND T1.release_date BETWEEN '1990-01-01' AND '1995-12-31'\n```"}]}, {"id": "train-470", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average revenue of American movies in 2006?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.revenue) FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T3.COUNTry_name = 'United States of America' AND CAST(STRFTIME('%Y', T1.release_date) AS INT) = 2006\n```"}]}, {"id": "train-471", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the 2016 gap between the average revenue for Indian and American films."}, {"from": "gpt", "value": "```sql\nSELECT AVG(CASE WHEN T3.COUNTry_name = 'United States of America' THEN T1.revenue END) - AVG(CASE WHEN T3.COUNTry_name = 'India' THEN T1.revenue END) AS CALCULATE FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE CAST(STRFTIME('%Y', T1.release_date) AS INT) = 2016\n```"}]}, {"id": "train-472", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of romance films among films produced in India in 2015?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Romance' THEN T1.movie_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_COUNTry AS T3 ON T1.movie_id = T3.movie_id INNER JOIN genre AS T4 ON T2.genre_id = T4.genre_id INNER JOIN COUNTry AS T5 ON T3.COUNTry_id = T5.COUNTry_id WHERE T5.COUNTry_name = 'India' AND T1.release_date BETWEEN '2015-01-01' AND '2015-12-31'\n```"}]}, {"id": "train-473", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which actor plays Optimus Prime?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.person_name FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T2.character_name = 'Optimus Prime (voice)'\n```"}]}, {"id": "train-474", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the gender of the character 'USAF Master Sgt. Epps?'"}, {"from": "gpt", "value": "```sql\nSELECT T2.gender FROM movie_cast AS T1 INNER JOIN gender AS T2 ON T1.gender_id = T2.gender_id WHERE T1.character_name = 'USAF Master Sgt. Epps'\n```"}]}, {"id": "train-475", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all companies who worked in the movie 'Ultramarines: A Warhammer 40,000 Movie.'"}, {"from": "gpt", "value": "```sql\nSELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T3.title = 'Ultramarines: A Warhammer 40,000 Movie'\n```"}]}, {"id": "train-476", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movie did the company 'Radiant Film GmbH' work on?"}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Radiant Film GmbH'\n```"}]}, {"id": "train-477", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the genres of Sky Captain and the World of Tomorrow?"}, {"from": "gpt", "value": "```sql\nSELECT T3.genre_name 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 WHERE T1.title = 'Sky Captain and the World of Tomorrow'\n```"}]}, {"id": "train-478", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write all the keywords belonging to the movie 'Sky Captain and the World of Tomorrow.'"}, {"from": "gpt", "value": "```sql\nSELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T1.title = 'Sky Captain and the World of Tomorrow'\n```"}]}, {"id": "train-479", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The movie 'Gojira ni-sen mireniamu' is from which country?"}, {"from": "gpt", "value": "```sql\nSELECT T3.COUNTry_name FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T1.title = 'Gojira ni-sen mireniamu'\n```"}]}, {"id": "train-480", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movie has the keyword 'extremis?'"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'extremis'\n```"}]}, {"id": "train-481", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List 10 movie titles that were produced in France."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T3.COUNTry_name = 'France' LIMIT 10\n```"}]}, {"id": "train-482", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the director for the movie 'Transformers?'"}, {"from": "gpt", "value": "```sql\nSELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title = 'Transformers' AND T2.job = 'Director'\n```"}]}, {"id": "train-483", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List 10 crews alongside their jobs who worked on the movie 'Mad Max: Fury Road.'"}, {"from": "gpt", "value": "```sql\nSELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title = 'Mad Max: Fury Road' LIMIT 10\n```"}]}, {"id": "train-484", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of movies that came from Japan belong in the 'animation' genre?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Animation' THEN T1.movie_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_COUNTry AS T3 ON T1.movie_id = T3.movie_id INNER JOIN genre AS T4 ON T2.genre_id = T4.genre_id INNER JOIN COUNTry AS T5 ON T3.COUNTry_id = T5.COUNTry_id WHERE T5.COUNTry_name = 'Japan'\n```"}]}, {"id": "train-485", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio between male and female cast members of the movie 'Iron Man?' Count how many have unspecified genders."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.gender = 'Male' THEN 1 ELSE NULL END) AS REAL) / COUNT(CASE WHEN T3.gender = 'Female' THEN 1 ELSE NULL END) AS RATIO , COUNT(CASE WHEN T3.gender = 'Unspecified' THEN 1 ELSE NULL END) AS UNGENDERS FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Iron Man'\n```"}]}, {"id": "train-486", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down five movie titles that were released before 2000."}, {"from": "gpt", "value": "```sql\nSELECT title FROM movie WHERE CAST(STRFTIME('%Y', release_date) AS INT) < 2000 LIMIT 5\n```"}]}, {"id": "train-487", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the keyword ID of the movie with the title of \"Sin City\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword_id FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Sin City'\n```"}]}, {"id": "train-488", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Look for the movie title with the keyword of \"angel\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'angel'\n```"}]}, {"id": "train-489", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which keywords belong to the movie titles with the highest popularity?"}, {"from": "gpt", "value": "```sql\nSELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id ORDER BY T1.popularity DESC LIMIT 1\n```"}]}, {"id": "train-490", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the genre ID of the movie with the title of \"The Dark Knight\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_id FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'The Dark Knight'\n```"}]}, {"id": "train-491", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the movie titles within the genre of thriller."}, {"from": "gpt", "value": "```sql\nSELECT T1.title 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 WHERE T3.genre_name = 'Thriller'\n```"}]}, {"id": "train-492", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down five rumoured movie titles within the genre of Drama."}, {"from": "gpt", "value": "```sql\nSELECT T1.title 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 WHERE T1.movie_status = 'Rumored' AND T3.genre_name = 'Drama' LIMIT 5\n```"}]}, {"id": "train-493", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre of the movie title with the lowest revenue generated?"}, {"from": "gpt", "value": "```sql\nSELECT T3.genre_name 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 ORDER BY T1.revenue LIMIT 1\n```"}]}, {"id": "train-494", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the genre of the movie title with a runtime of only 14 minutes."}, {"from": "gpt", "value": "```sql\nSELECT T3.genre_name 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 WHERE T1.runtime = 14\n```"}]}, {"id": "train-495", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre of the movie title which was well-received by the audiences but made the lowest revenue?"}, {"from": "gpt", "value": "```sql\nSELECT T3.genre_name 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 ORDER BY T1.vote_average DESC, T1.revenue LIMIT 1\n```"}]}, {"id": "train-496", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the genre of a movie title with a tagline of \"A long time ago in a galaxy far, far away\u2026\"."}, {"from": "gpt", "value": "```sql\nSELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T3.genre_id = T2.genre_id WHERE T1.tagline = 'A long time ago in a galaxy far, far away...'\n```"}]}, {"id": "train-497", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the country ID of the movie with the title of \"Pirates of the Caribbean: Dead Man's Chest\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.COUNTry_id FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title LIKE 'Pirates of the Caribbean: Dead Man%s Chest'\n```"}]}, {"id": "train-498", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the movie titles that were produced in Canada."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T3.COUNTry_name = 'Canada'\n```"}]}, {"id": "train-499", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Accumulate the budget of the movie titles with the keyword of \"video game\"."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.budget) FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'video game'\n```"}]}, {"id": "train-500", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For movies with the keyword of \"civil war\", calculate the average revenue generated by these movies."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.revenue) FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'civil war'\n```"}]}, {"id": "train-501", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find out the popularity of the movies with the highest vote count."}, {"from": "gpt", "value": "```sql\nSELECT popularity FROM movie ORDER BY vote_COUNT DESC LIMIT 1\n```"}]}, {"id": "train-502", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the zero-budget movie titles, which one has made the highest revenue?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM movie WHERE budget = 0 ORDER BY revenue DESC LIMIT 1\n```"}]}, {"id": "train-503", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of the production company which produced the movie \"Gladiator\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.company_id FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Gladiator'\n```"}]}, {"id": "train-504", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the IDs of the production companies that released the movies in 1916."}, {"from": "gpt", "value": "```sql\nSELECT T2.company_id FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id WHERE CAST(STRFTIME('%Y', T1.release_date) AS INT) = 1916\n```"}]}, {"id": "train-505", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the movies produced by Lucasfilm."}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Lucasfilm'\n```"}]}, {"id": "train-506", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among Warner Bros. Pictures' movies, which title made the highest revenue?"}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Warner Bros. Pictures' ORDER BY T3.revenue DESC LIMIT 1\n```"}]}, {"id": "train-507", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the release date of the movies produced by Twentieth Century Fox Film Corporation."}, {"from": "gpt", "value": "```sql\nSELECT T3.release_date FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Twentieth Century Fox Film Corporation'\n```"}]}, {"id": "train-508", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the language ID of the movie \"Walk the Line\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.language_id FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Walk the Line'\n```"}]}, {"id": "train-509", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find out the language ID of the movie with the highest popularity."}, {"from": "gpt", "value": "```sql\nSELECT T2.language_id FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id ORDER BY T1.popularity DESC LIMIT 1\n```"}]}, {"id": "train-510", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the language of the movie \"C'era una volta il West\"."}, {"from": "gpt", "value": "```sql\nSELECT T3.language_name FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T1.title LIKE 'C%era una volta il West'\n```"}]}, {"id": "train-511", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Are there any post-production movies in Nederlands?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT CASE WHEN T1.movie_status = 'Post Production' THEN 'YES' ELSE 'NO' END AS YORN FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Nederlands'\n```"}]}, {"id": "train-512", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the tagline of the Polski movies."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.tagline FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Polski'\n```"}]}, {"id": "train-513", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the homepage of the Bahasa Indonesia movies."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.homepage FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Bahasa indonesia'\n```"}]}, {"id": "train-514", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Work out the difference in revenues made between the English and Latin movies."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.language_name = 'English' THEN T1.revenue ELSE 0 END) - SUM(CASE WHEN T3.language_name = 'Latin' THEN T1.revenue ELSE 0 END) AS DIFFERENCE FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id\n```"}]}, {"id": "train-515", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the revenues made by Fantasy Films and Live Entertainment."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.revenue) FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name IN ('Fantasy Films', 'Live Entertainment')\n```"}]}, {"id": "train-516", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average revenue made by Latin movies?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.revenue) FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Latin'\n```"}]}, {"id": "train-517", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common first name?"}, {"from": "gpt", "value": "```sql\nSELECT person_name FROM person GROUP BY person_name ORDER BY COUNT(person_name) DESC LIMIT 1\n```"}]}, {"id": "train-518", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of crews for a movie?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CD) AS REAL) / COUNT(movie_id) FROM ( SELECT movie_id, COUNT(person_id) AS CD FROM movie_crew GROUP BY movie_id )\n```"}]}, {"id": "train-519", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the keywords with \"christmas\" in them."}, {"from": "gpt", "value": "```sql\nSELECT keyword_name FROM keyword WHERE keyword_name LIKE '%christmas%'\n```"}]}, {"id": "train-520", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the longest runtime of all movies?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(runtime) FROM movie\n```"}]}, {"id": "train-521", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the iso code of \"Kyrgyz Republic\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNTry_iso_code FROM COUNTry WHERE COUNTry_name = 'Kyrgyz Republic'\n```"}]}, {"id": "train-522", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the overview for the movie \"The Pacifier\"."}, {"from": "gpt", "value": "```sql\nSELECT overview FROM movie WHERE title = 'The Pacifier'\n```"}]}, {"id": "train-523", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies were produced by \"Eddie Murphy Productions\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movie_id) FROM movie_company AS T1 INNER JOIN production_company AS T2 ON T1.company_id = T2.company_id WHERE T2.company_name = 'Eddie Murphy Productions'\n```"}]}, {"id": "train-524", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the actors who have played characters with \"captain\" in their names."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.person_name FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T2.character_name LIKE '%captain%'\n```"}]}, {"id": "train-525", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common keyword among all the movies released in 2006?"}, {"from": "gpt", "value": "```sql\nSELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T1.release_date LIKE '2006%' GROUP BY T3.keyword_name ORDER BY COUNT(T3.keyword_name) DESC LIMIT 1\n```"}]}, {"id": "train-526", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies have \"vi\" as their language code?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movie_id) FROM movie_languages AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_code = 'vi'\n```"}]}, {"id": "train-527", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the third least common genre?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_name FROM movie_genres AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.genre_id GROUP BY T2.genre_id ORDER BY COUNT(T1.movie_id) LIMIT 2, 1\n```"}]}, {"id": "train-528", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the original language of the movie with the tagline \"An offer you can't refuse.\"?"}, {"from": "gpt", "value": "```sql\nSELECT T3.language_name FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id INNER JOIN language_role AS T4 ON T2.language_role_id = T4.role_id WHERE T4.language_role = 'Original' AND T1.tagline LIKE 'An offer you can%t refuse.'\n```"}]}, {"id": "train-529", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the average revenue of all the French movies."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.revenue) FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T3.COUNTry_name = 'France'\n```"}]}, {"id": "train-530", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the unspecified gender characters."}, {"from": "gpt", "value": "```sql\nSELECT T1.character_name FROM movie_cast AS T1 INNER JOIN gender AS T2 ON T1.gender_id = T2.gender_id WHERE T2.gender = 'Unspecified'\n```"}]}, {"id": "train-531", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 5 most popular movie directors?"}, {"from": "gpt", "value": "```sql\nSELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T2.job = 'Director' ORDER BY T1.popularity DESC LIMIT 5\n```"}]}, {"id": "train-532", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the film with the highest budget in each genre."}, {"from": "gpt", "value": "```sql\nSELECT T3.genre_name, MAX(T1.budget) 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 GROUP BY T3.genre_name\n```"}]}, {"id": "train-533", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the movie with the most keywords?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id GROUP BY T1.title ORDER BY COUNT(T2.keyword_id) DESC LIMIT 1\n```"}]}, {"id": "train-534", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which department has the most people?"}, {"from": "gpt", "value": "```sql\nSELECT T1.department_name FROM department AS T1 INNER JOIN movie_crew AS T2 ON T1.department_id = T2.department_id GROUP BY T1.department_id ORDER BY COUNT(T2.department_id) DESC LIMIT 1\n```"}]}, {"id": "train-535", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of films are made in the US?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.COUNTry_iso_code = 'US' THEN T1.movie_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id\n```"}]}, {"id": "train-536", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average ratio between female and male actors in a movie?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.gender = 'Female' THEN T1.person_id ELSE NULL END) AS REAL) / COUNT(CASE WHEN T2.gender = 'Male' THEN T1.person_id ELSE NULL END) FROM movie_cast AS T1 INNER JOIN gender AS T2 ON T1.gender_id = T2.gender_id\n```"}]}, {"id": "train-537", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the movies released in 1945."}, {"from": "gpt", "value": "```sql\nSELECT title FROM movie WHERE CAST(STRFTIME('%Y', release_date) AS INT) = 1945\n```"}]}, {"id": "train-538", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ID and ISO code of Belgium."}, {"from": "gpt", "value": "```sql\nSELECT COUNTry_id, COUNTry_iso_code FROM COUNTry WHERE COUNTry_name = 'Belgium'\n```"}]}, {"id": "train-539", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the character names played by Catherine Deneuve."}, {"from": "gpt", "value": "```sql\nSELECT T2.character_name FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Catherine Deneuve'\n```"}]}, {"id": "train-540", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the movies in the Somali language."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Somali'\n```"}]}, {"id": "train-541", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the release date and language of the most popular movie."}, {"from": "gpt", "value": "```sql\nSELECT T1.release_date, T3.language_name FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id ORDER BY T1.popularity DESC LIMIT 1\n```"}]}, {"id": "train-542", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the original language of the \"Four Rooms\" movie?"}, {"from": "gpt", "value": "```sql\nSELECT T3.language_name FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id INNER JOIN language_role AS T4 ON T2.language_role_id = T4.role_id WHERE T4.language_role = 'Original' AND T1.title = 'Four Rooms'\n```"}]}, {"id": "train-543", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the character names in the \"Open Water\" movie."}, {"from": "gpt", "value": "```sql\nSELECT T2.character_name FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Open Water'\n```"}]}, {"id": "train-544", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the main actor in the \"Pirates of the Caribbean: At World's End\" movie?"}, {"from": "gpt", "value": "```sql\nSELECT T3.person_name FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' ORDER BY T2.cast_order LIMIT 1\n```"}]}, {"id": "train-545", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of camera supervisors in the crew."}, {"from": "gpt", "value": "```sql\nSELECT T1.person_name FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T2.job = 'Camera Supervisor'\n```"}]}, {"id": "train-546", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the job titles of Sally Menke in the crew."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.job FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Sally Menke'\n```"}]}, {"id": "train-547", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names and departments of the person who worked as a music editor in the \"Pirates of the Caribbean: At World's End\" movie."}, {"from": "gpt", "value": "```sql\nSELECT T3.person_name, T4.department_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id INNER JOIN department AS T4 ON T2.department_id = T4.department_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T2.job = 'Music Editor'\n```"}]}, {"id": "train-548", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the titles and revenues of the movies produced by the DreamWorks company."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T1.revenue FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_company AS T3 ON T2.company_id = T3.company_id WHERE T3.company_name = 'DreamWorks'\n```"}]}, {"id": "train-549", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies were produced in Canada?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie_id) FROM COUNTry AS T1 INNER JOIN production_COUNTry AS T2 ON T1.COUNTry_id = T2.COUNTry_id WHERE T1.COUNTry_name = 'Canada'\n```"}]}, {"id": "train-550", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the genres of Forrest Gump movie."}, {"from": "gpt", "value": "```sql\nSELECT T3.genre_name 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 WHERE T1.title = 'Forrest Gump'\n```"}]}, {"id": "train-551", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the production companies of the movie that has over 35% average running time per movie in 2016."}, {"from": "gpt", "value": "```sql\nSELECT T.company_name FROM ( SELECT DISTINCT T3.company_name, T1.runtime FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_company AS T3 ON T3.company_id = T2.company_id WHERE T1.release_date LIKE '2016%' ) T WHERE T.runtime * 100 > (0.35 * ( SELECT AVG(T1.runtime) FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_company AS T3 ON T3.company_id = T2.company_id WHERE T1.release_date LIKE '2016%' ) + ( SELECT AVG(T1.runtime) FROM movie AS T1 INNER JOIN movie_company AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_company AS T3 ON T3.company_id = T2.company_id WHERE T1.release_date LIKE '2016%' )) * 100\n```"}]}, {"id": "train-552", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the difference in percentage of the movies under keywords of \"woman director\" and \"independent film\"."}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(CASE WHEN T1.keyword_name = 'woman director' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.keyword_name = 'independent film' THEN 1 ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T1.keyword_name = 'independent film' THEN 1 ELSE 0 END) FROM keyword AS T1 INNER JOIN movie_keywords AS T2 ON T1.keyword_id = T2.keyword_id\n```"}]}, {"id": "train-553", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which genre does the movie Dancer in the Dark belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T3.genre_name 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 WHERE T1.title = 'Dancer in the Dark'\n```"}]}, {"id": "train-554", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many adventure movies are there that were released in 2000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(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 WHERE T3.genre_name = 'Adventure' AND CAST(STRFTIME('%Y', T1.release_date) AS INT) = 2000\n```"}]}, {"id": "train-555", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movies did the company Paramount Pictures produce in 2000?"}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Paramount Pictures' AND CAST(STRFTIME('%Y', T3.release_date) AS INT) = 2000\n```"}]}, {"id": "train-556", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What keyword can the user use to search for the movie Finding Nemo?"}, {"from": "gpt", "value": "```sql\nSELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T1.title = 'Finding Nemo'\n```"}]}, {"id": "train-557", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the horror movies with positive ratings greater than 7."}, {"from": "gpt", "value": "```sql\nSELECT T1.title 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 WHERE T3.genre_name = 'Horror' AND T1.vote_average > 7\n```"}]}, {"id": "train-558", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many production companies made more than 150 movies?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT T1.company_name AS CNAME FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(T1.company_name) > 150 )\n```"}]}, {"id": "train-559", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the role of Mark Hammel?"}, {"from": "gpt", "value": "```sql\nSELECT T2.job FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Mark Hammel'\n```"}]}, {"id": "train-560", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many main actors are there in the movie Pirates of the Caribbean: At World's End?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.cast_order) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T3.gender_id = T2.gender_id WHERE T3.gender = 'Male' OR T3.gender = 'Female' AND T1.title = 'Pirates of the Caribbean: At World''s End' AND T2.cast_order = ( SELECT MIN(T2.cast_order) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T3.gender_id = T2.gender_id WHERE T3.gender = 'Male' OR T3.gender = 'Female' AND T1.title = 'Pirates of the Caribbean: At World''s End' )\n```"}]}, {"id": "train-561", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movies have the participation of actor Harrison Ford?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Harrison Ford'\n```"}]}, {"id": "train-562", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which character did Orlando Bloom play in the movie Pirates of the Caribbean: The Curse of the Black Pearl?"}, {"from": "gpt", "value": "```sql\nSELECT T2.character_name FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title = 'Pirates of the Caribbean: The Curse of the Black Pearl' AND T3.person_name = 'Orlando Bloom'\n```"}]}, {"id": "train-563", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of horror movies among all movies genre?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.genre_name = 'Horror' THEN T1.movie_id ELSE NULL END) AS REAL) / COUNT(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\n```"}]}, {"id": "train-564", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of all the producers in the movie \"Pirates of the Caribbean: At World's End\"."}, {"from": "gpt", "value": "```sql\nSELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title = 'Pirates of the Caribbean: The Curse of the Black Pearl' AND T2.job = 'Producer'\n```"}]}, {"id": "train-565", "db_id": "movies_4", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average income made by movies using the keyword \"paris\". List the title of the movies."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.revenue), T1.title FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'paris'\n```"}]}, {"id": "train-566", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many English language codes whose comments for the method are in the XML format?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Lang) FROM Method WHERE Lang = 'en' AND CommentIsXml = 1\n```"}]}, {"id": "train-567", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the task of the method whose tokenized name is \"online median filter test median window filling\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE NameTokenized = 'online median filter test median window filling'\n```"}]}, {"id": "train-568", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the time of sampling of the solution with the highest sampling time? Indicate the id number of the solution."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT SampledAt, SolutionId FROM Method WHERE SampledAt = ( SELECT MAX(SampledAt) FROM Method )\n```"}]}, {"id": "train-569", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many followers do the most followed repository on Github have? Give the github address of the repository."}, {"from": "gpt", "value": "```sql\nSELECT Forks, Url FROM Repo WHERE Forks = ( SELECT MAX(Forks) FROM Repo )\n```"}]}, {"id": "train-570", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the id of the repository with the highest number of solution path?"}, {"from": "gpt", "value": "```sql\nSELECT RepoId FROM solution GROUP BY RepoId ORDER BY COUNT(Path) DESC LIMIT 1\n```"}]}, {"id": "train-571", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most liked repository? Indicate its github address and the amount of stars it has received."}, {"from": "gpt", "value": "```sql\nSELECT Url, Stars FROM Repo WHERE Stars = ( SELECT MAX(Stars) FROM Repo )\n```"}]}, {"id": "train-572", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the solution path with the highest processed time?"}, {"from": "gpt", "value": "```sql\nSELECT Path FROM Solution WHERE ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Solution )\n```"}]}, {"id": "train-573", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the processed time of downloading the most popular repository?"}, {"from": "gpt", "value": "```sql\nSELECT ProcessedTime FROM Repo WHERE Watchers = ( SELECT MAX(Watchers) FROM Repo )\n```"}]}, {"id": "train-575", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.id, T2.WasCompiled FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Repo )\n```"}]}, {"id": "train-577", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the repositories whose number of stars received are between 6,000 to 9,000, which repository has the highest number of solution paths and many of those solution paths needs to be compiled if user wants to implement it?"}, {"from": "gpt", "value": "```sql\nSELECT T2.RepoId, COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars BETWEEN 6000 AND 9000 AND T2.WasCompiled = 0 GROUP BY T2.RepoId ORDER BY COUNT(T2.RepoId) DESC LIMIT 1\n```"}]}, {"id": "train-578", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the \"https://github.com/wallerdev/htmlsharp.git\", give all the linearized sequenced of API calls."}, {"from": "gpt", "value": "```sql\nSELECT T3.ApiCalls FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T1.Url = 'https://github.com/wallerdev/htmlsharp.git'\n```"}]}, {"id": "train-579", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many solution paths are there inside the 2nd most popular repository?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = ( SELECT Watchers FROM Repo ORDER BY Watchers DESC LIMIT 1, 1 )\n```"}]}, {"id": "train-580", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average processed time of the solution paths inside the \"https://github.com/zphingphong/DiscardCustomerApp.git\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.ProcessedTime) AS REAL) / COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/zphingphong/DiscardCustomerApp.git'\n```"}]}, {"id": "train-583", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many solution paths that needs to be compiled if user wants to implement it in \"https://github.com/jeffdik/tachy.git\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/jeffdik/tachy.git' AND T2.WasCompiled = 0\n```"}]}, {"id": "train-584", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the processed time of the method whose tokenized name is \"about box1 dispose\"? Indicate the language of the method."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.ProcessedTime, T2.Lang FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 'about box1 dispose'\n```"}]}, {"id": "train-587", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the task of the method whose tokenized name is \"html parser feed\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE NameTokenized = 'html parser feed'\n```"}]}, {"id": "train-588", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Are the comments for the method \"HtmlSharp.HtmlParser.Feed\" in XML format?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN CommentIsXml = 0 THEN 'No' WHEN CommentIsXml = 1 THEN 'Yes' END isXMLFormat FROM Method WHERE Name = 'HtmlSharp.HtmlParser.Feed'\n```"}]}, {"id": "train-589", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which method has the summary \"Write a command to the log\"?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Method WHERE Summary = 'Write a command to the log'\n```"}]}, {"id": "train-590", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many solutions contain files found within the repository most people like?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = ( SELECT MAX(Stars) FROM Repo )\n```"}]}, {"id": "train-591", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the path of the solution that contains files found within the repository most people like."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = ( SELECT MAX(Stars) FROM Repo )\n```"}]}, {"id": "train-592", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the github address of the repository that contains files used by solution ID12?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 12\n```"}]}, {"id": "train-593", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT 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\n```"}]}, {"id": "train-594", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which solution contains files within a more popular repository, the solution ID18 or solution ID19?"}, {"from": "gpt", "value": "```sql\nSELECT 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 'SolutionID18' 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 'SolutionID19' END isMorePopular FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId\n```"}]}, {"id": "train-595", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the solutions that contain files within the repository needing the longest processed time to download, how many of them doesn't need to be\ncompiled if user wants to implement it?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Repo ) AND T2.WasCompiled = 1\n```"}]}, {"id": "train-597", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the url of the repository whose files are contained in solution ID 9?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 9\n```"}]}, {"id": "train-598", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the paths of the solutions containing files within the repository whose url is \"https://github.com/maxild/playground.git\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/maxild/playground.git'\n```"}]}, {"id": "train-599", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the repositories with over 200 likes, how many of them have files contained by solutions with a processed time of under 636439500080712000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.ProcessedTime < 636439500080712000 AND T1.Stars > 200\n```"}]}, {"id": "train-600", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the solutions that contain files within the top 3 followed repositories."}, {"from": "gpt", "value": "```sql\nSELECT T2.Id FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId ORDER BY T1.Forks DESC LIMIT 3\n```"}]}, {"id": "train-601", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average time needed for the solutions containing files within the repository whose url is \"https://github.com/jeffdik/tachy.git\" to be processd?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.ProcessedTime) AS REAL) / COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/jeffdik/tachy.git'\n```"}]}, {"id": "train-602", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more followers in percentage are there for the repository used by solution ID 18 than solution ID19?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(CASE WHEN T2.Id = 18 THEN T1.Forks ELSE 0 END) - SUM(CASE WHEN T2.Id = 19 THEN T1.Forks ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 19 THEN T1.Forks ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId\n```"}]}, {"id": "train-603", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the language of the method ''PixieTests.SqlConnectionLayerTests.TestSqlCreateGuidColumn\"?"}, {"from": "gpt", "value": "```sql\nSELECT Lang FROM Method WHERE Name = 'PixieTests.SqlConnectionLayerTests.TestSqlCreateGuidColumn'\n```"}]}, {"id": "train-604", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the full Comment of the method \"DE2_UE_Fahrradkurier.de2_uebung_fahrradkurierDataSet1TableAdapters.TableAdapterManager.UpdateInsertedRows\"."}, {"from": "gpt", "value": "```sql\nSELECT FullComment FROM Method WHERE Name = 'DE2_UE_Fahrradkurier.de2_uebung_fahrradkurierDataSet1TableAdapters.TableAdapterManager.UpdateInsertedRows'\n```"}]}, {"id": "train-605", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the summary of the method \"Castle.MonoRail.Framework.Test.StubViewComponentContext.RenderSection\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT Summary FROM Method WHERE Name = 'Castle.MonoRail.Framework.Test.StubViewComponentContext.RenderSection'\n```"}]}, {"id": "train-606", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the tokenized name for the method \"Supay.Irc.Messages.KnockMessage.GetTokens\"."}, {"from": "gpt", "value": "```sql\nSELECT NameTokenized FROM Method WHERE Name = 'Supay.Irc.Messages.KnockMessage.GetTokens'\n```"}]}, {"id": "train-607", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stars does the repository of the solution No. 45997 have?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Stars FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 45997\n```"}]}, {"id": "train-608", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the repository which got '8094' Stars, how many solutions does it contain?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 8094\n```"}]}, {"id": "train-609", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the solution path for the method \"IQ.Data.DbQueryProvider.CanBeEvaluatedLocally\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'IQ.Data.DbQueryProvider.CanBeEvaluatedLocally'\n```"}]}, {"id": "train-610", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the method which got the tokenized name as 'interp parser expr', what is the processed time for its solution?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ProcessedTime FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 'interp parser expr'\n```"}]}, {"id": "train-611", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the repository number for the solution of method \"SCore.Poisson.ngtIndex\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.RepoId FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'SCore.Poisson.ngtIndex'\n```"}]}, {"id": "train-612", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the path of the solution for the method \"ExportToRTF.RTFStyleSheet.H6Write\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'ExportToRTF.RTFStyleSheet.H6Write'\n```"}]}, {"id": "train-613", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the repository with '8094' watchers , how many solutions does it contain?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = 8094\n```"}]}, {"id": "train-614", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the repository Url of the one with most solutions."}, {"from": "gpt", "value": "```sql\nSELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId GROUP BY T2.RepoId ORDER BY COUNT(T2.RepoId) DESC LIMIT 1\n```"}]}, {"id": "train-615", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many solutions does the repository which has 1445 Forks contain?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = 1445\n```"}]}, {"id": "train-616", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the solution of the 'zh-cn' methods, which path is most often used?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'zh-cn' GROUP BY T1.Path ORDER BY COUNT(T1.Path) DESC LIMIT 1\n```"}]}, {"id": "train-617", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of watchers that the repository of the solution No. 338082 have."}, {"from": "gpt", "value": "```sql\nSELECT T1.Watchers FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 338082\n```"}]}, {"id": "train-618", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the repository which got '189' Stars, how many solutions which needs to be compiled does it contain?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 189 AND T2.WasCompiled = 0\n```"}]}, {"id": "train-619", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the solution path for the method \"Mosa.Platform.x86.Instructions.IMul.EmitLegacy\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'Mosa.Platform.x86.Instructions.IMul.EmitLegacy'\n```"}]}, {"id": "train-620", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the method which got the tokenized name as 't jadwal entity get single mpic', what is the path time for its solution?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.ProcessedTime FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 't jadwal entity get single mpic'\n```"}]}, {"id": "train-621", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the repository ID for the solution of method \"Kalibrasi.Data.EntityClasses.THistoryJadwalEntity.GetSingleTjadwal\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.RepoId FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'Kalibrasi.Data.EntityClasses.THistoryJadwalEntity.GetSingleTjadwal'\n```"}]}, {"id": "train-623", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of solutions that the repository which has 3060 Stars contains."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 3060\n```"}]}, {"id": "train-624", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the solution of the most 'sw' methods, what is its path?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'sw'\n```"}]}, {"id": "train-625", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent more of the watchers for the repository of solution No.83855 than No.1502?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Id = 83855 THEN T1.Watchers ELSE 0 END) - SUM(CASE WHEN T2.Id = 1502 THEN T1.Watchers ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 1502 THEN T1.Watchers ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId\n```"}]}, {"id": "train-626", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent more of the stars for the repository of solution No.51424 than No.167053?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Id = 51424 THEN T1.Stars ELSE 0 END) - SUM(CASE WHEN T2.Id = 167053 THEN T1.Stars ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 167053 THEN T1.Stars ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId\n```"}]}, {"id": "train-627", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent more of the Forks for the repository of solution No.53546 than No.1502?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Id = 53546 THEN T1.Forks ELSE 0 END) - SUM(CASE WHEN T2.Id = 1502 THEN T1.Forks ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 1502 THEN T1.Forks ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId\n```"}]}, {"id": "train-629", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many solutions are in \"https://github.com/derickbailey/presentations-and-training.git\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/derickbailey/presentations-and-training.git'\n```"}]}, {"id": "train-630", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total processed time of all solutions from the repository with the most forks?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.ProcessedTime) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = ( SELECT MAX(Forks) FROM Repo )\n```"}]}, {"id": "train-631", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the path of solution from all the \"it\" lang code method."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'it'\n```"}]}, {"id": "train-632", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the path of solution of \"spinachLexer.mT__55\" method?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'spinachLexer.mT__55'\n```"}]}, {"id": "train-633", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the \"en\" methods with solutions from repository \"1093\""}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.id FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.RepoId = 1093 AND T2.Lang = 'en'\n```"}]}, {"id": "train-634", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the paths of solutions in repository \"https://github.com/ecoffey/Bebop.git\""}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/ecoffey/Bebop.git'\n```"}]}, {"id": "train-635", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the ids of repositories for solutions with \"ro\" methods."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.RepoId FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'ro'\n```"}]}, {"id": "train-636", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the repository id of the method with tokenized name \"crc parameters get hash code\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.RepoId FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 'crc parameters get hash code'\n```"}]}, {"id": "train-637", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many methods with solutions with path 'maravillas_linq-to-delicious\\tasty.sln'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'maravillas_linq-to-delicious\\tasty.sln'\n```"}]}, {"id": "train-639", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the url for repository that has the longest processed time solution?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Solution )\n```"}]}, {"id": "train-640", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the solutions of repositories with the Forks higher than half of the watchers."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Id FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks > T1.Watchers / 2\n```"}]}, {"id": "train-641", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of Forks to Stars of repository for solution \"104086\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.Forks AS REAL) * 100 / T1.Stars FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 104086\n```"}]}, {"id": "train-642", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the id of the respository that the most people like."}, {"from": "gpt", "value": "```sql\nSELECT Id FROM Repo WHERE Stars = ( SELECT MAX(Stars) FROM Repo )\n```"}]}, {"id": "train-643", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the solution's path of method \"HtmlSharp.HtmlParser.Feed\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'HtmlSharp.HtmlParser.Feed'\n```"}]}, {"id": "train-644", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the number of forks that the repository of the solution 35 have."}, {"from": "gpt", "value": "```sql\nSELECT T1.Forks FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 35\n```"}]}, {"id": "train-645", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the id of the solution whose repository has the most watchers."}, {"from": "gpt", "value": "```sql\nSELECT T2.Id FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = ( SELECT MAX(Watchers) FROM Repo )\n```"}]}, {"id": "train-646", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the number of stars that the repository of the solution 20 have."}, {"from": "gpt", "value": "```sql\nSELECT T1.Stars FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 20\n```"}]}, {"id": "train-647", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many methods does solution 1 have? And please tell me if solution 1 needs to be compiled."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.SolutionId) , CASE WHEN T1.WasCompiled = 0 THEN 'Needs' ELSE 'NoNeeds' END needToCompile FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.SolutionId = 1\n```"}]}, {"id": "train-648", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the methods' solutions that need to be compiled among the methods whose comments is XML format?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.WasCompiled = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.CommentIsXml = 1\n```"}]}, {"id": "train-650", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of respositories that receive more than 2,000 stars?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN Stars > 2000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Stars) FROM Repo\n```"}]}, {"id": "train-651", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the url of solution 1?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 1\n```"}]}, {"id": "train-652", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the id of the respository that received the most forks among the respositories that receive 21 stars."}, {"from": "gpt", "value": "```sql\nSELECT Id FROM Repo WHERE Stars = 21 AND Forks = ( SELECT MAX(Forks) FROM Repo WHERE Stars = 21 )\n```"}]}, {"id": "train-653", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What the percentage of the english methods among the methods whose comments is XML format?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN Lang = 'en' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Name) FROM Method WHERE CommentIsXml = 1\n```"}]}, {"id": "train-654", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the path of solution of method whose tokenized name is html parser feed."}, {"from": "gpt", "value": "```sql\nSELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 'html parser feed'\n```"}]}, {"id": "train-655", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the solution id of the respository among the respository that receive 238 forks."}, {"from": "gpt", "value": "```sql\nSELECT T2.Id FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = 238\n```"}]}, {"id": "train-657", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many solutions whose repository's stars are a third more than forks?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks < T1.Stars * 1 / 3\n```"}]}, {"id": "train-658", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the path of solution of method whose full comment is Feeds data into the parser."}, {"from": "gpt", "value": "```sql\nSELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.FullComment = 'Feeds data into the parser'\n```"}]}, {"id": "train-659", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the repository \"3\", how many methods whose comments is XML format?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.RepoId = 3 AND T2.CommentIsXml = 1\n```"}]}, {"id": "train-660", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of solutions for the method that needs to be compiled in the English methods?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.WasCompiled = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Lang) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'en'\n```"}]}, {"id": "train-661", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more stars in percentage are there for the repository of solution \"1\" than solution \"2\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Id = 1 THEN T1.Stars ELSE 0 END) - SUM(CASE WHEN T2.Id = 2 THEN T1.Stars ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 2 THEN T1.Stars ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId\n```"}]}, {"id": "train-662", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many solutions are there whose respositories received the number of stars more than one third of the number of forks?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.Id) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars > CAST(T1.Forks AS REAL) / 3\n```"}]}, {"id": "train-663", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the task of method number 2?"}, {"from": "gpt", "value": "```sql\nSELECT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE Id = 2\n```"}]}, {"id": "train-664", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What format does the method number 8's comment have?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN CommentIsXml = 0 THEN 'isNotXMLFormat' WHEN CommentIsXml = 1 THEN 'isXMLFormat' END format FROM Method WHERE Id = 8\n```"}]}, {"id": "train-665", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide a link to the most well-known repository's Github address."}, {"from": "gpt", "value": "```sql\nSELECT Url FROM Repo WHERE Watchers = ( SELECT MAX(Watchers) FROM Repo )\n```"}]}, {"id": "train-666", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the task of the method that is in the Czech language?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE Lang = 'cs'\n```"}]}, {"id": "train-667", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the solution path for method number 3?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Id = 3\n```"}]}, {"id": "train-668", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the language of method number 28 that can be found in the repository number 3?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Lang FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Id = 28 AND T1.RepoId = 3\n```"}]}, {"id": "train-669", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is solution 1's processing time and how many methods have been using this solution?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ProcessedTime, COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.SolutionId = 1\n```"}]}, {"id": "train-670", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many methods in the same repository share a tokenized name that begins with \"query language...\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized LIKE 'query language%'\n```"}]}, {"id": "train-671", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please state the API calls for method number 10 and its intended course of action."}, {"from": "gpt", "value": "```sql\nSELECT T2.ApiCalls, T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Id = 10\n```"}]}, {"id": "train-672", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many methods in repository 150 did not have a comment and a summary?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.RepoId = 150 AND T2.FullComment IS NULL AND T2.Summary IS NULL\n```"}]}, {"id": "train-674", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the task method of the tokenized name \"string extensions to pascal case\n\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE NameTokenized = 'string extensions to pascal case'\n```"}]}, {"id": "train-675", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the tokenized name of the method \"Sky.Excel.ExcelBook.TypeConvert\"."}, {"from": "gpt", "value": "```sql\nSELECT NameTokenized FROM Method WHERE Name = 'Sky.Excel.ExcelBook.TypeConvert'\n```"}]}, {"id": "train-676", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many path does the github address \"https://github.com/jeffdik/tachy.git\" have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/jeffdik/tachy.git'\n```"}]}, {"id": "train-678", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List 5 github address that the solutions can be implemented without the need of compilation."}, {"from": "gpt", "value": "```sql\nSELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.WasCompiled = 1 LIMIT 5\n```"}]}, {"id": "train-679", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the solution path of the tokenized name \"matrix multiply\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 'matrix multiply'\n```"}]}, {"id": "train-680", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many XML format does the github address \"https://github.com/dogeth/vss2git.git\" have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.CommentIsXml) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T1.Url = 'https://github.com/dogeth/vss2git.git' AND T3.CommentIsXml = 1\n```"}]}, {"id": "train-685", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the github address with the summary of method \"A test for Decompose\n\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T3.Summary = 'A test for Decompose'\n```"}]}, {"id": "train-687", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many solution path does the repository with 111 stars, 58 forks, and 111 watchers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 111 AND T1.Forks = 58 AND T1.Watchers = 111\n```"}]}, {"id": "train-688", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average processed time of the solution with a repository of 254 likes, 88 followers, and 254 watchers?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.ProcessedTime) AS REAL) / COUNT(T2.ProcessedTime) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 254 AND T1.Forks = 88 AND T1.Watchers = 254\n```"}]}, {"id": "train-689", "db_id": "codebase_comments", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many language code of method is used for the github address \"https://github.com/managedfusion/managedfusion.git\n\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.Lang) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T1.Url = 'https://github.com/managedfusion/managedfusion.git'\n```"}]}, {"id": "train-690", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many trains are there that run in the east direction?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM trains WHERE direction = 'east'\n```"}]}, {"id": "train-691", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cars are there on train no.1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM cars WHERE train_id = 1\n```"}]}, {"id": "train-692", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the shape of the tail car on train no.1?"}, {"from": "gpt", "value": "```sql\nSELECT shape FROM cars WHERE train_id = 1 AND position = 4\n```"}]}, {"id": "train-693", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of all the trains with at least one car in a non-regular shape."}, {"from": "gpt", "value": "```sql\nSELECT train_id FROM cars WHERE shape IN ('elipse', 'bucket') GROUP BY train_id\n```"}]}, {"id": "train-694", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cars on train no.1 have the roof open?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM cars WHERE train_id = 1 AND roof = 'none'\n```"}]}, {"id": "train-695", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of all the cars on train no.1 that have 2 wheels."}, {"from": "gpt", "value": "```sql\nSELECT id FROM cars WHERE train_id = 1 AND wheels = 2\n```"}]}, {"id": "train-696", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the trains that run in the east direction, how many of them have at least one car in a non-regular shape?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.shape IN ('bucket', 'elipse') THEN 1 ELSE 0 end)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'\n```"}]}, {"id": "train-697", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of all the trains that run in the east direction and have less than 4 cars."}, {"from": "gpt", "value": "```sql\nSELECT T1.id FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS carsNum FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T1.direction = 'east' AND T2.carsNum < 4\n```"}]}, {"id": "train-698", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of all the cars with double sides on trains that run in the west direction."}, {"from": "gpt", "value": "```sql\nSELECT T1.id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.sides = 'double'\n```"}]}, {"id": "train-699", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the trains that run in the east direction, how many of them have more than 2 long cars?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.longCarsNum > 2 THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS longCarsNum FROM cars WHERE len = 'long' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T1.direction = 'west'\n```"}]}, {"id": "train-700", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the directions in which the trains with at least one empty-loaded car run."}, {"from": "gpt", "value": "```sql\nSELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0\n```"}]}, {"id": "train-701", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which direction does the train with an ellipse-shape car run?"}, {"from": "gpt", "value": "```sql\nSELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.shape = 'ellipse'\n```"}]}, {"id": "train-702", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of short cars on all the trains that run in the east direction?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.len = 'short' then 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'\n```"}]}, {"id": "train-703", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the shapes of all the head cars on the trains that run in the east direction."}, {"from": "gpt", "value": "```sql\nSELECT T1.shape FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.position = 1 GROUP BY T1.shape\n```"}]}, {"id": "train-704", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cars on a train that runs in the east direction have a flat roof?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.roof = 'flat' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'\n```"}]}, {"id": "train-705", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cars on a train that runs in the east direction, how many of them have a flat roof and a circle load shape?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.load_shape = 'circle' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.roof = 'flat' \n```"}]}, {"id": "train-706", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Trains that run in which direction have more rectangle-shaped cars in total?"}, {"from": "gpt", "value": "```sql\nSELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS rectCarsNum FROM cars WHERE shape = 'rectangle' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id ORDER BY T2.rectCarsNum DESC\n```"}]}, {"id": "train-707", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the directions in which the trains with 4 short cars run."}, {"from": "gpt", "value": "```sql\nSELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.len = 'short' AND T1.position = 4\n```"}]}, {"id": "train-708", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of cars on trains that run in the east direction?"}, {"from": "gpt", "value": "```sql\nSELECT 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'\n```"}]}, {"id": "train-709", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the trains that have at least one non-regular shaped car, what is the percentage of it running in the east direction?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(DISTINCT CASE WHEN T2.direction = 'east' THEN T1.train_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.shape IN ('bucket', 'ellipse')\n```"}]}, {"id": "train-710", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many short cars are in the shape of hexagon?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM cars WHERE shape = 'hexagon' AND len = 'short'\n```"}]}, {"id": "train-711", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many trains are running west?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM trains WHERE direction = 'west'\n```"}]}, {"id": "train-712", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the load shapes of all the short ellipse cars?"}, {"from": "gpt", "value": "```sql\nSELECT load_shape FROM cars WHERE shape = 'ellipse' AND len = 'short'\n```"}]}, {"id": "train-713", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the ids of the train running east?"}, {"from": "gpt", "value": "```sql\nSELECT id FROM trains WHERE direction = 'east'\n```"}]}, {"id": "train-714", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many wheels do the long cars have?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(wheels) FROM cars WHERE len = 'long'\n```"}]}, {"id": "train-715", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which direction do the majority of the trains are running?"}, {"from": "gpt", "value": "```sql\nSELECT direction FROM trains GROUP BY direction ORDER BY COUNT(id) DESC\n```"}]}, {"id": "train-716", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the trains running east, how many trains have at least 4 cars?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.direction = 'east' THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T2.carsNum >= 4\n```"}]}, {"id": "train-717", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which direction do most of the trains with rectangle-shaped second cars run?"}, {"from": "gpt", "value": "```sql\nSELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 2 AND T1.shape = 'rectangle' GROUP BY T2.direction ORDER BY COUNT(T2.id) DESC LIMIT 1\n```"}]}, {"id": "train-718", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many trains running west have double sided cars in 3rd position?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 3 AND T2.direction = 'west' AND T1.sides = 'double' GROUP BY T1.train_id)as T\n```"}]}, {"id": "train-719", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many eastbound trains have rectangular-shaped head cars?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T2.direction = 'east' AND T1.shape = 'rectangle' GROUP BY T1.train_id)as T\n```"}]}, {"id": "train-720", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the trains running west, how many trains have no more than one car with an open roof?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.direction = 'west' THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) FROM cars WHERE roof = 'none' GROUP BY train_id HAVING COUNT(id) = 1 ) AS T2 ON T1.id = T2.train_id \n```"}]}, {"id": "train-721", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which direction does the majority of the trains that have 3 cars are running?"}, {"from": "gpt", "value": "```sql\nSELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id HAVING carsNum = 3 ) AS T2 ON T1.id = T2.train_id GROUP BY T1.direction\n```"}]}, {"id": "train-722", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many trains with fully loaded head cars are running east?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T1.load_num = 3\n```"}]}, {"id": "train-723", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cars running east have double-sided tail cars?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM trains AS T1 INNER JOIN cars AS T2 ON T1.id = T2.train_id INNER JOIN ( SELECT train_id, MAX(position) AS trailPosi FROM cars GROUP BY train_id ) AS T3 ON T1.id = T3.train_id WHERE T1.direction = 'east' AND T2.position = T3.trailPosi AND T2.sides = 'double'\n```"}]}, {"id": "train-724", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the directions of the trains that have empty cars."}, {"from": "gpt", "value": "```sql\nSELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0\n```"}]}, {"id": "train-726", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the trains running west, how many trains have three-wheeled, jagged roof cars?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.direction = 'west' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.wheels = 3 AND T1.roof = 'jagged'\n```"}]}, {"id": "train-727", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the directions for all the trains that have 2 or less cars."}, {"from": "gpt", "value": "```sql\nSELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS trailPosi FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T2.trailPosi <= 2\n```"}]}, {"id": "train-728", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of all the trains with at least 4 cars? List the directions of the said trains."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.trailPosi >= 4 THEN T1.id ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS trailPosi FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id UNION ALL SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS trailPosi FROM cars t GROUP BY train_id ) AS T2 ON T1.id = T2.train_id AND T2.trailPosi >= 4\n```"}]}, {"id": "train-729", "db_id": "trains", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the load shapes of all head cars of each train and identify which load shape has the highest number. Calculate the percentage of the trains with the said head car that are running eas"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.load_shape FROM ( SELECT load_shape, train_id FROM cars WHERE position = 1 ORDER BY train_id DESC ) AS T3 UNION ALL SELECT T4.load_shape FROM ( SELECT load_shape, train_id FROM cars WHERE position = 1 ORDER BY train_id DESC LIMIT 1 ) AS T4 UNION ALL SELECT (CAST(COUNT(DISTINCT CASE WHEN T2.direction = 'east' THEN T2.id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.id)) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T1.load_shape = ( SELECT T4.load_shape FROM ( SELECT load_shape, train_id FROM cars AS T WHERE position = 1 ORDER BY train_id DESC LIMIT 1 ) AS T4 )\n```"}]}, {"id": "train-730", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the characters in the movie Look Who's Talking."}, {"from": "gpt", "value": "```sql\nSELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'Look Who''s Talking'\n```"}]}, {"id": "train-731", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which character has the longest screen time in the movie Batman?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'Batman' ORDER BY T2.screentime DESC LIMIT 1\n```"}]}, {"id": "train-732", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which actor played the role of Joker in the movie Batman?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Batman' AND T2.`Character Name` = 'Joker'\n```"}]}, {"id": "train-733", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the actors who played a role in the movie Batman."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Batman'\n```"}]}, {"id": "train-734", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movie is the character Dr. Archibald 'Moonlight' Graham from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Title FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.`Character Name` = 'Dr. Archibald ''Moonlight'' Graham'\n```"}]}, {"id": "train-735", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the movies starring Tom Cruise."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise'\n```"}]}, {"id": "train-736", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies starring Morgan Freeman are suggested by parental guidance?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Morgan Freeman' AND T1.`MPAA Rating` = 'PG'\n```"}]}, {"id": "train-737", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the movies starring Tom Cruise, which one of them has the best quality?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Title FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise' ORDER BY T1.Rating DESC LIMIT 1\n```"}]}, {"id": "train-738", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the character played by Tom Cruise in the movie Born on the Fourth of July?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise' AND T1.Title = 'Born on the Fourth of July'\n```"}]}, {"id": "train-739", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the characters played by Tom Cruise."}, {"from": "gpt", "value": "```sql\nSELECT T1.`Character Name` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T2.Name = 'Tom Cruise'\n```"}]}, {"id": "train-740", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the actors who starred in the movie Batman, which one of them is the tallest?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Batman' ORDER BY T3.`Height (Inches)` DESC LIMIT 1\n```"}]}, {"id": "train-741", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies star a male African American actor?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T2.Gender = 'Male' AND T2.Ethnicity = 'African American'\n```"}]}, {"id": "train-742", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating of all the movies starring Tom Cruise?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.Rating) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise'\n```"}]}, {"id": "train-743", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much longer in percentage is the screen time of the most important character in Batman than the least important one?"}, {"from": "gpt", "value": "```sql\nSELECT (MAX(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL)) - MIN(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL))) * 100 / MIN(CAST(SUBSTR(T2.screentime, 3, 2) AS REAL)) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'Batman'\n```"}]}, {"id": "train-744", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movie had the biggest budget? Give the name of the movie."}, {"from": "gpt", "value": "```sql\nSELECT Title FROM movie ORDER BY Budget DESC LIMIT 1\n```"}]}, {"id": "train-745", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the MPAA rating for the movie with the character named \"Peter Quill\" in it?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`MPAA Rating` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.`Character Name` = 'Peter Quill'\n```"}]}, {"id": "train-746", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the No.1 character in the credit list from the highest rating thriller movie."}, {"from": "gpt", "value": "```sql\nSELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.creditOrder = '1' AND T1.Genre = 'Thriller' ORDER BY T1.Rating DESC LIMIT 1\n```"}]}, {"id": "train-747", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the actor that played in the movie \"Batman\" with the longest screentime?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID INNER JOIN movie AS T3 ON T3.MovieID = T1.MovieID WHERE T3.Title = 'Batman' ORDER BY T1.screentime DESC LIMIT 1\n```"}]}, {"id": "train-748", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies has the highest networth actor acted in?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE CAST(REPLACE(REPLACE(T2.NetWorth, ',', ''), '$', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(REPLACE(NetWorth, ',', ''), '$', '') AS REAL)) FROM actor)\n```"}]}, {"id": "train-749", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who played the character named \"Chanice Kobolowski\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Chanice Kobolowski'\n```"}]}, {"id": "train-750", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When is the birthday of the actor who played \"Sully\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Date of Birth` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Sully'\n```"}]}, {"id": "train-751", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the birth city of the actor who played \"Gabriel Martin\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.`Birth City` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Gabriel Martin'\n```"}]}, {"id": "train-752", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the biography of the actor who played \"Michael Moscovitz\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.Biography FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Michael Moscovitz'\n```"}]}, {"id": "train-753", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How tall is the actor who played \"Lurch\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Height (Inches)` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Lurch'\n```"}]}, {"id": "train-754", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the No.3 character name in the credit list of the movie \"G.I. Joe: The Rise of Cobra\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'G.I. Joe: The Rise of Cobra' AND T2.creditOrder = '3'\n```"}]}, {"id": "train-755", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who played the No.2 character in the credit list of the movie \"American Hustle\"?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'American Hustle' AND T2.creditOrder = '2'\n```"}]}, {"id": "train-757", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the USA actors that showed up in the credit list of movie \"Mrs. Doubtfire\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.`Birth Country` = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.`Birth Country`) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Mrs. Doubtfire'\n```"}]}, {"id": "train-758", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the actors that showed up in the credit list of movie \"Dawn of the Planet of the Apes\" that were born after \"1970/1/1\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.`Date of Birth` > '1970-01-01' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.`Date of Birth`) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Dawn of the Planet of the Apes'\n```"}]}, {"id": "train-759", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the movie ID of movie with a budget of 15000000 and a rating between 7 to 8."}, {"from": "gpt", "value": "```sql\nSELECT MovieID FROM movie WHERE Rating BETWEEN 7 AND 8 AND Budget = 15000000\n```"}]}, {"id": "train-760", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In rated PG movies, how many of them released in June 1990?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM movie WHERE `MPAA Rating` = 'PG' AND `Release Date` LIKE '1990-06%'\n```"}]}, {"id": "train-761", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of male and white actor with actor ID 439?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM actor WHERE ActorID = 439 AND Gender = 'Male' AND Ethnicity = 'White'\n```"}]}, {"id": "train-762", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the actors born in New York City, list the genre of their movie with a rating greater than 5."}, {"from": "gpt", "value": "```sql\nSELECT T1.Genre FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.`Birth City` = 'New York City' AND T1.Rating > 5\n```"}]}, {"id": "train-763", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In romantic movies, how many of them starred by John Travolta?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Genre = 'Romance' AND T3.Name = 'John Travolta'\n```"}]}, {"id": "train-765", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre of PG rated movie starred by the actor with highest net worth?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Genre FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.`MPAA Rating` = 'PG' ORDER BY CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) DESC LIMIT 1\n```"}]}, {"id": "train-766", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the net worth of the actor starred in Misery who has a height ranging from 60 to 70 inches tall?"}, {"from": "gpt", "value": "```sql\nSELECT T3.NetWorth FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Misery' AND T3.`Height (Inches)` BETWEEN 60 AND 70 AND T3.Gender = 'Male'\n```"}]}, {"id": "train-767", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the male actors born in USA that starred in Ghost."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Ghost' AND T3.Gender = 'Male' AND T3.`Birth Country` = 'USA'\n```"}]}, {"id": "train-768", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the MPAA rating and title of the movie starred by Leonardo DiCaprio with highest budget?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`MPAA Rating`, T1.Title FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Leonardo DiCaprio' ORDER BY T1.Budget DESC LIMIT 1\n```"}]}, {"id": "train-769", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the actors starred in Die Hard 2, list their net worth and birth date of actors with a height between 60 to 65."}, {"from": "gpt", "value": "```sql\nSELECT T3.NetWorth, T3.`Date of Birth` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Die Hard 2' AND T3.`Height (Inches)` BETWEEN 60 AND 65\n```"}]}, {"id": "train-770", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the runtime of movies starred by an African-American actor born on December 28, 1954."}, {"from": "gpt", "value": "```sql\nSELECT T1.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Ethnicity = 'African American' AND T3.`Date of Birth` = '1954-12-28'\n```"}]}, {"id": "train-771", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the actor's name that played as Don Altobello in a drama movie that has a gross of 136766062."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Gross = 136766062 AND T2.`Character Name` = 'Don Altobello' AND T1.Genre = 'Drama'\n```"}]}, {"id": "train-772", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the gross of a comedy movie with a rating lower than 7 and starred by an actor with a net worth greater than $375,000,000.00?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Gross) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 375000000 AND T1.Rating < 7 AND T1.Genre = 'Comedy'\n```"}]}, {"id": "train-773", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the runtime of the movie starred by Jackie Chan with a rating greater than 7?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Jackie Chan' AND T1.Rating > 7\n```"}]}, {"id": "train-774", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the movies with drama genre, what is the percentage of the actors with net worth greater than $400,000,000.00?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) > 400000000 THEN 1 ELSE 0 END) - SUM(CASE WHEN CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) < 400000000 THEN 1 ELSE 0 END) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Genre = 'Drama'\n```"}]}, {"id": "train-775", "db_id": "movie", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the character's name of actress born in Sherman Oaks and starred in the movie Bruce Almighty with height greater than the 50% of average height of all actors listed."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Gender = 'Female' AND T1.Title = 'Godzilla' AND T3.`Birth City` = 'Sherman Oaks' AND T3.`Height (Inches)` * 100 > ( SELECT AVG(`Height (Inches)`) FROM actor ) * 50\n```"}]}, {"id": "train-776", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many tweets are in English?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Lang = 'en'\n```"}]}, {"id": "train-777", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the texts of all the tweets that are reshared."}, {"from": "gpt", "value": "```sql\nSELECT text FROM twitter WHERE IsReshare = 'TRUE'\n```"}]}, {"id": "train-778", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many tweets are seen by more than 1000 unique users?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Reach > 1000\n```"}]}, {"id": "train-779", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the tweets that have a positive sentiment, how many of them are posted on Thursday?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Sentiment > 0 AND Weekday = 'Thursday'\n```"}]}, {"id": "train-780", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the text of the tweet that got the most `likes`?"}, {"from": "gpt", "value": "```sql\nSELECT text FROM twitter WHERE Likes = ( SELECT MAX( Likes) FROM twitter )\n```"}]}, {"id": "train-781", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the cities in Argentina."}, {"from": "gpt", "value": "```sql\nSELECT City FROM location WHERE City IS NOT NULL AND Country = 'Argentina'\n```"}]}, {"id": "train-782", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many tweets in total were posted by a user in Argentina?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' LIMIT 1\n```"}]}, {"id": "train-783", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Users in which city of Argentina post the most tweets?"}, {"from": "gpt", "value": "```sql\nSELECT T2.City FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' GROUP BY T2.City ORDER BY COUNT(T1.TweetID) DESC LIMIT 1\n```"}]}, {"id": "train-784", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the tweets that are reshared, how many of them are posted by a user in Buenos Aires?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.City = 'Buenos Aires' AND T1.IsReshare = 'TRUE'\n```"}]}, {"id": "train-785", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the texts of all the tweets posted from Buenos Aires with a positive sentiment."}, {"from": "gpt", "value": "```sql\nSELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Sentiment > 0 AND T2.City = 'Buenos Aires'\n```"}]}, {"id": "train-786", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From which country is the tweet with the most likes posted?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID ORDER BY T1.Likes DESC LIMIT 1\n```"}]}, {"id": "train-787", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Users in which country has posted more numbers of positive tweets, Argentina or Australia?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country IN ('Argentina', 'Australia') AND T1.Sentiment > 0 GROUP BY T2.Country ORDER BY COUNT(T1.TweetID) DESC LIMIT 1\n```"}]}, {"id": "train-788", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the tweets posted from Buenos Aires, how many of them were posted on Thursdays?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.City = 'Buenos Aires' AND T1.Weekday = 'Thursday'\n```"}]}, {"id": "train-789", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the users that have posted a tweet with over 1000 likes, how many of them are male?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Likes > 10 AND T2.Gender = 'Male'\n```"}]}, {"id": "train-790", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many tweets have the male users posted in total?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male'\n```"}]}, {"id": "train-791", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the gender of the user who has posted the tweet that is seen by the most number of unique users?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Reach DESC LIMIT 1\n```"}]}, {"id": "train-792", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many tweets are posted by male users in Argentina?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T3 ON T1.UserID = T3.UserID WHERE T3.Gender = 'Male' AND T2.Country = 'Argentina'\n```"}]}, {"id": "train-793", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the texts of all the tweets posted by male users from Buenos Aires."}, {"from": "gpt", "value": "```sql\nSELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T2 ON T2.UserID = T1.UserID INNER JOIN user AS T3 ON T1.UserID = T3.UserID WHERE T2.City = 'Buenos Aires' AND T3.Gender = 'Male'\n```"}]}, {"id": "train-794", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of tweets posted by the users in a city in Argentina?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.City = 'Buenos Aires' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS avg FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina'\n```"}]}, {"id": "train-795", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the tweets with a positive sentiment, what is the percentage of those posted by a male user?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Gender = 'Male' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS per FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Sentiment > 0\n```"}]}, {"id": "train-796", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of users who do not show their genders."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(UserID) AS user_number FROM user WHERE Gender = 'Unknown'\n```"}]}, {"id": "train-797", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of states in the United Kingdom."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(State) AS State_number FROM location WHERE Country = 'United Kingdom'\n```"}]}, {"id": "train-798", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the code of Gwynedd State?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT StateCode FROM location WHERE State = 'Gwynedd'\n```"}]}, {"id": "train-799", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the location id of West Sussex State."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT LocationID FROM location WHERE State = 'West Sussex'\n```"}]}, {"id": "train-800", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many reshared tweets are there in Texas?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.State = 'Texas' AND T1.IsReshare = 'TRUE'\n```"}]}, {"id": "train-801", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the tweet which got a reach number of 547851, which country did it come from?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Reach = 547851\n```"}]}, {"id": "train-802", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of positive tweets from Ha Noi."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Sentiment > 0 AND T2.State = 'Ha Noi'\n```"}]}, {"id": "train-803", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the text of the tweet with the highest klout from Connecticut."}, {"from": "gpt", "value": "```sql\nSELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.State = 'Connecticut' ORDER BY T1.Klout DESC LIMIT 1\n```"}]}, {"id": "train-804", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female Twitter users are there from Wisconsin?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Likes) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T3 ON T3.UserID = T1.UserID WHERE T2.State = 'Wisconsin' AND T3.Gender = 'Female'\n```"}]}, {"id": "train-805", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the gender of the user who tweeted `tw-715909161071091712`?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.TweetID = 'tw-715909161071091712'\n```"}]}, {"id": "train-806", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the city of the user who tweeted `One of our favorite stories is @FINRA_News's move to the cloud with AWS Enterprise Support! https://amp.twimg.com/v/991837f1-4815-4edc-a88f-e68ded09a02a`."}, {"from": "gpt", "value": "```sql\nSELECT T2.City FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.text = 'One of our favorite stories is @FINRA_News''s move to the cloud with AWS Enterprise Support! https://amp.twimg.com/v/991837f1-4815-4edc-a88f-e68ded09a02a'\n```"}]}, {"id": "train-807", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the gender of the user whose tweet got 535 retweets?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.RetweetCount = 535\n```"}]}, {"id": "train-808", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the gender of the user who made the highest klout tweet on Wednesdays."}, {"from": "gpt", "value": "```sql\nSELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Weekday = 'Wednesday' ORDER BY T1.Klout DESC LIMIT 1\n```"}]}, {"id": "train-809", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the tweet which got the most likes, state the gender of the user who tweeted it."}, {"from": "gpt", "value": "```sql\nSELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Likes DESC LIMIT 1\n```"}]}, {"id": "train-810", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of tweets from Michigan on Thursdays."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Weekday = 'Thursday' AND T2.State = 'Michigan'\n```"}]}, {"id": "train-811", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which state was the tweet `tw-685681052912873473` from? Give the state code."}, {"from": "gpt", "value": "```sql\nSELECT T2.StateCode FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.TweetID = 'tw-685681052912873473'\n```"}]}, {"id": "train-812", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of male Twitter users from Florida?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.Gender = 'Male' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS percentage FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T3 ON T3.UserID = T1.UserID WHERE T2.State = 'Florida'\n```"}]}, {"id": "train-813", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the tweets from California are positive?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Sentiment > 0 THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS percentage FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE State = 'California'\n```"}]}, {"id": "train-814", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the day of the week that tweet with ID tw-682712873332805633 was posted?"}, {"from": "gpt", "value": "```sql\nSELECT Weekday FROM twitter WHERE TweetID = 'tw-682712873332805633'\n```"}]}, {"id": "train-815", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unique users have seen tweet with text `Happy New Year to all those AWS instances of ours!`?"}, {"from": "gpt", "value": "```sql\nSELECT Reach FROM twitter WHERE text = 'Happy New Year to all those AWS instances of ours!'\n```"}]}, {"id": "train-816", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the total number of tweet IDs in `en`."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT TweetID) FROM twitter WHERE Lang = 'en'\n```"}]}, {"id": "train-817", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is 3751 the location ID for tweet with ID tw-682714048199311366?"}, {"from": "gpt", "value": "```sql\nSELECT LocationID FROM twitter WHERE TweetID = 'tw-682714048199311366'\n```"}]}, {"id": "train-818", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many tweets have been posted on Wednesday?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(TweetID) FROM twitter WHERE Weekday = 'Wednesday'\n```"}]}, {"id": "train-819", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all of the texts posted on Twitter on Thursday."}, {"from": "gpt", "value": "```sql\nSELECT text FROM twitter WHERE Weekday = 'Thursday'\n```"}]}, {"id": "train-820", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the gender of the user who posted a tweet with ID tw-682714583044243456?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.TweetID = 'tw-682714583044243456'\n```"}]}, {"id": "train-821", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the text of tweets posted by unknown gender users."}, {"from": "gpt", "value": "```sql\nSELECT T1.text FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Unknown'\n```"}]}, {"id": "train-822", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total number of male tweet IDs."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male'\n```"}]}, {"id": "train-823", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What gender of users posted the most tweets in `en`?"}, {"from": "gpt", "value": "```sql\nSELECT T.Gender FROM ( SELECT T2.Gender, COUNT( text) AS num FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Lang = 'en' GROUP BY T2.Gender ) T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-824", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What gender of users retweet more than 30 times?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.RetweetCount > 30\n```"}]}, {"id": "train-825", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female users reshared their tweets?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.UserID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Female' AND T1.IsReshare = 'TRUE'\n```"}]}, {"id": "train-826", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country's tweets collected the most likes?"}, {"from": "gpt", "value": "```sql\nSELECT T.Country FROM ( SELECT T2.Country, SUM(T1.Likes) AS num FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID GROUP BY T2.Country ) T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-827", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tweet with ID tw-682723090279841798 was posted from which country?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.TweetID = 'tw-682723090279841798'\n```"}]}, {"id": "train-828", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all the tweet text posted from Australia."}, {"from": "gpt", "value": "```sql\nSELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.Country = 'Australia'\n```"}]}, {"id": "train-829", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the tweet text posted from Rawang, Selangor, Malaysia."}, {"from": "gpt", "value": "```sql\nSELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.City = 'Rawang' AND T2.State = 'Selangor' AND T2.Country = 'Malaysia'\n```"}]}, {"id": "train-830", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tweets that were posted from Brazil are in what languague?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Lang FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.Country = 'Brazil'\n```"}]}, {"id": "train-831", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the country where the most positive sentiment tweets were posted."}, {"from": "gpt", "value": "```sql\nSELECT T.Country FROM ( SELECT T2.Country, SUM(T1.Sentiment) AS num FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.Sentiment > 0 GROUP BY T2.Country ) T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-832", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total likes collected by tweets in `ru` posted by male users."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Likes) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Lang = 'ru' AND T2.Gender = 'Male'\n```"}]}, {"id": "train-833", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of male users who posted tweets in a week."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.TweetID) / COUNT(DISTINCT T1.UserID) / 7 AS avg FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male' AND T1.Day BETWEEN 1 AND 31\n```"}]}, {"id": "train-834", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many tweets have a klout of over 50?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT TweetID) FROM twitter WHERE Klout > 50\n```"}]}, {"id": "train-835", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the texts of all the tweets that are not in English."}, {"from": "gpt", "value": "```sql\nSELECT text FROM twitter WHERE Lang != 'en'\n```"}]}, {"id": "train-836", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the user ID of the user who has posted the most tweets."}, {"from": "gpt", "value": "```sql\nSELECT UserID FROM twitter GROUP BY UserID ORDER BY COUNT(DISTINCT TweetID) DESC LIMIT 1\n```"}]}, {"id": "train-837", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the tweets posted on Mondays, how many of them are reshared?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT TweetID) FROM twitter WHERE Weekday = 'Monday' AND IsReshare = 'TRUE'\n```"}]}, {"id": "train-838", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the texts of the top 3 tweets with the most number of unique users seeing the tweet."}, {"from": "gpt", "value": "```sql\nSELECT text FROM twitter ORDER BY Reach DESC LIMIT 3\n```"}]}, {"id": "train-839", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many reshared tweets have over 100 likes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT TweetID) FROM twitter WHERE IsReshare = 'TRUE' AND Likes > 100\n```"}]}, {"id": "train-840", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of tweets sent by male users on Mondays?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male' AND T1.Weekday = 'Monday'\n```"}]}, {"id": "train-841", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the gender of the user who has posted the tweet that got the most likes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Likes DESC LIMIT 1\n```"}]}, {"id": "train-842", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the texts of all the tweets in French posted by male users."}, {"from": "gpt", "value": "```sql\nSELECT T1.text FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male' AND T1.Lang = 'fr'\n```"}]}, {"id": "train-843", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many tweets in French were posted from Australia?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.Lang = 'fr' AND T2.Country = 'Australia'\n```"}]}, {"id": "train-844", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the tweets with a positive sentiment, how many of them were posted by male users in Australia?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T3 ON T3.UserID = T1.UserID WHERE T2.Country = 'Australia' AND T3.Gender = 'Male' AND T1.Sentiment > 0\n```"}]}, {"id": "train-845", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more tweets with a positive sentiment than the tweets with a neutral sentiment were posted by male users?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Sentiment > 0 THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.Sentiment = 0 THEN 1 ELSE 0 END) AS diff FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male'\n```"}]}, {"id": "train-846", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From which city was the tweet with the most number of retweets posted?"}, {"from": "gpt", "value": "```sql\nSELECT T2.City FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID ORDER BY T1.RetweetCount DESC LIMIT 1\n```"}]}, {"id": "train-847", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From which city were more tweets posted, Bangkok or Chiang Mai?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.City = 'Bangkok' THEN 1 ELSE 0 END) AS bNum , SUM(CASE WHEN T2.City = 'Chiang Mai' THEN 1 ELSE 0 END) AS cNum FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.City IN ('Bangkok', 'Chiang Mai')\n```"}]}, {"id": "train-848", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the tweets posted from Santa Fe state in Argentina, how many of them were posted on 31st?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.Day = 31 AND T2.State = 'Santa' AND T2.Country = 'Argentina'\n```"}]}, {"id": "train-849", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top 3 cities with the most number of tweets posted in Canada."}, {"from": "gpt", "value": "```sql\nSELECT T.City FROM ( SELECT T2.City, COUNT(T1.TweetID) AS num FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.Country = 'Canada' GROUP BY T2.City ) T ORDER BY T.num DESC LIMIT 3\n```"}]}, {"id": "train-850", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the cities from where tweets with neutral sentiments were posted."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.City FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE Sentiment = 0\n```"}]}, {"id": "train-851", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the tweets sent by male users in Argentina, what is the text of the one with the most number of likes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.text FROM user AS T1 INNER JOIN twitter AS T2 ON T1.UserID = T2.UserID INNER JOIN location AS T3 ON T2.LocationID = T3.LocationID WHERE T3.Country = 'Argentina' AND T1.Gender = 'Male' ORDER BY T2.Likes DESC LIMIT 1\n```"}]}, {"id": "train-852", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of likes for a tweet posted by a male user on Mondays?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Likes) / COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Male' AND T1.Weekday = 'Monday'\n```"}]}, {"id": "train-853", "db_id": "social_media", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tweets posted from which city has a higher number of average likes, Bangkok or Chiang Mai?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.City = 'Bangkok' THEN Likes ELSE NULL END) / COUNT(CASE WHEN T2.City = 'Bangkok' THEN 1 ELSE 0 END) AS bNum , SUM(CASE WHEN City = 'Chiang Mai' THEN Likes ELSE NULL END) / COUNT(CASE WHEN City = 'Chiang Mai' THEN TweetID ELSE NULL END) AS cNum FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.City IN ('Bangkok', 'Chiang Mai')\n```"}]}, {"id": "train-854", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which course is more difficult, Intro to BlockChain or Computer Network?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM course WHERE name = 'Intro to BlockChain' OR name = 'Computer Network' ORDER BY diff DESC LIMIT 1\n```"}]}, {"id": "train-855", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the courses that are less important than Machine Learning Theory."}, {"from": "gpt", "value": "```sql\nSELECT name FROM course WHERE credit < ( SELECT credit FROM course WHERE name = 'Machine Learning Theory' )\n```"}]}, {"id": "train-856", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many professors are more popular than Zhou Zhihua?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(prof_id) FROM prof WHERE popularity > ( SELECT popularity FROM prof WHERE first_name = 'Zhihua' AND last_name = 'Zhou' )\n```"}]}, {"id": "train-857", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the phone number of Kerry Pryor?"}, {"from": "gpt", "value": "```sql\nSELECT phone_number FROM student WHERE l_name = 'Pryor' AND f_name = 'Kerry'\n```"}]}, {"id": "train-858", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which professor advised Faina Mallinar to become a research assistant? Please give his or her full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Faina' AND T3.l_name = 'Mallinar'\n```"}]}, {"id": "train-859", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many research assistants does Sauveur Skyme have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.first_name = 'Sauveur' AND T2.last_name = 'Skyme'\n```"}]}, {"id": "train-860", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of all the students who are research assistants with the highest research capability."}, {"from": "gpt", "value": "```sql\nSELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN RA AS T2 ON T1.student_id = T2.student_id WHERE T2.capability = 5\n```"}]}, {"id": "train-861", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many research assistants of Ogdon Zywicki have an average salary?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.prof_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.first_name = 'Ogdon' AND T1.salary = 'med' AND T2.last_name = 'Zywicki'\n```"}]}, {"id": "train-862", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of all the students who took the course Machine Learning Theory."}, {"from": "gpt", "value": "```sql\nSELECT 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 = 'Machine Learning Theory'\n```"}]}, {"id": "train-863", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students who got a B in the course Machine Learning Theory, how many of them have a gpa of over 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(student_id) FROM registration WHERE grade = 'B' AND student_id IN ( SELECT student_id FROM student WHERE gpa > 3 AND course_id IN ( SELECT course_id FROM course WHERE name = 'Machine Learning Theory' ) )\n```"}]}, {"id": "train-864", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the courses taken by Laughton Antonio."}, {"from": "gpt", "value": "```sql\nSELECT T3.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 T1.f_name = 'Laughton' AND T1.l_name = 'Antonio'\n```"}]}, {"id": "train-865", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which student failed the course Intro to Database 2? Please give his or her full name."}, {"from": "gpt", "value": "```sql\nSELECT 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 T2.grade IS NULL AND T3.name = 'Intro to Database 2'\n```"}]}, {"id": "train-866", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which student is more satisfied with the course Machine Learning Theory, Willie Rechert or Laughton Antonio?"}, {"from": "gpt", "value": "```sql\nSELECT 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 (T1.f_name = 'Laughton' OR T1.f_name = 'Willie') AND (T1.l_name = 'Antonio' OR T1.l_name = 'Rechert') AND T3.name = 'Machine Learning Theory' ORDER BY T2.sat DESC LIMIT 1\n```"}]}, {"id": "train-867", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the professors who have more than 3 research assistants, how many of them are male?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT T2.prof_id FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.gender = 'Male' GROUP BY T1.prof_id HAVING COUNT(T1.student_id) > 3 )\n```"}]}, {"id": "train-868", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students who took the course Machine Learning Theory, how many of them are undergraduates?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) 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 = 'Machine Learning Theory' AND T1.type = 'UG'\n```"}]}, {"id": "train-869", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which professor advised Willie Rechert to work as a research assistant? Please give his or her full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Willie' AND T3.l_name = 'Rechert'\n```"}]}, {"id": "train-870", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average gpa of Ogdon Zywicki's research assistants?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.gpa) / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'\n```"}]}, {"id": "train-871", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average satisfying degree of the course Machine Learning Theory?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.sat) AS REAL) / COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.name = 'Machine Learning Theory'\n```"}]}, {"id": "train-872", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of research postgraduate students."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(student_id) FROM student WHERE type = 'RPG'\n```"}]}, {"id": "train-873", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which student has the highest gpa? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT f_name, l_name FROM student WHERE gpa = ( SELECT MAX(gpa) FROM student )\n```"}]}, {"id": "train-874", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the 3-credit course with the easiest difficulty, how many students get an \"A\" in that course?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.grade = 'A' AND T2.credit = '3' AND T2.diff = 1\n```"}]}, {"id": "train-875", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students took the hardest course?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.diff = 5\n```"}]}, {"id": "train-876", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which professor is Oliy Spratling working with? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Oliy' AND T3.l_name = 'Spratling'\n```"}]}, {"id": "train-877", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the professor who is working with Harrietta Lydford, how is his popularity?"}, {"from": "gpt", "value": "```sql\nSELECT T1.popularity FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Harrietta' AND T3.l_name = 'Lydford'\n```"}]}, {"id": "train-878", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many research assistants does the female professor with the lowest teaching ability have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability = '1' AND T2.gender = 'Female'\n```"}]}, {"id": "train-879", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the professors who advise more than 2 students, which professor has a higher teaching ability? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, T2.teachingability FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id HAVING COUNT(student_id) > 2 ) T ORDER BY T.teachingability DESC LIMIT 1\n```"}]}, {"id": "train-880", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the grade score for Rik Unsworth in \"Computer Network\"."}, {"from": "gpt", "value": "```sql\nSELECT CASE grade WHEN 'A' THEN 4 WHEN 'B' THEN 3 WHEN 'C' THEN 2 ELSE 1 END AS result FROM registration WHERE student_id IN ( SELECT student_id FROM student WHERE f_name = 'Rik' AND l_name = 'Unsworth' AND course_id IN ( SELECT course_id FROM course WHERE name = 'Computer Network' ) )\n```"}]}, {"id": "train-881", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many courses does Alvera McQuillin take?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.course_id) FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.f_name = 'Alvera' AND T2.l_name = 'McQuillin'\n```"}]}, {"id": "train-882", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of research postgraduate student among Professor Zhihua Zhou's research assistants."}, {"from": "gpt", "value": "```sql\nSELECT T3.f_name, T3.l_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T1.first_name = 'Zhihua' AND T3.type = 'RPG' AND T1.last_name = 'Zhou'\n```"}]}, {"id": "train-883", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of students enrolled in the \"Statistical Learning\" course."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.student_id) FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T1.name = 'Statistical learning'\n```"}]}, {"id": "train-884", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who were the students who failed the course \"Applied Deep Learning\"? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT 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 IS NULL\n```"}]}, {"id": "train-885", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the phone number of the only student who obtained \"A\" in the course \"Intro to BlockChain\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.phone_number 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 = 'Intro to BlockChain' AND T2.grade = 'A'\n```"}]}, {"id": "train-886", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of Professor Ogdon Zywicki's research assistants are taught postgraduate students?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.type = 'TPG' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'\n```"}]}, {"id": "train-887", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of students who get a \"B\" in the course \"Computer Network\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.grade = 'B' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.name = 'Computer Network'\n```"}]}, {"id": "train-888", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many courses have the highest difficulty?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(course_id) FROM course WHERE diff = 5\n```"}]}, {"id": "train-889", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the professor who graduated from an Ivy League School?"}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM prof WHERE graduate_from IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' )\n```"}]}, {"id": "train-890", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the most important courses, what is the name of the most difficult course?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM course WHERE credit = ( SELECT MAX(credit) FROM course ) AND diff = ( SELECT MAX(diff) FROM course )\n```"}]}, {"id": "train-891", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students have the highest intelligence among those taking a bachelor's degree?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(student_id) FROM student WHERE type = 'UG' AND intelligence = ( SELECT MAX(intelligence) FROM student )\n```"}]}, {"id": "train-892", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the most popular professors, how many are females?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(prof_id) FROM prof WHERE gender = 'Female' AND popularity = ( SELECT MAX(popularity) FROM prof )\n```"}]}, {"id": "train-893", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many research postgraduate students are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(student_id) FROM student WHERE type = 'RPG'\n```"}]}, {"id": "train-894", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students got an A in Applied Deep Learning?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.student_id) FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T2.grade = 'A' AND T1.name = 'Applied Deep Learning '\n```"}]}, {"id": "train-895", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the GPAs of the unpaid Research Assistants?"}, {"from": "gpt", "value": "```sql\nSELECT T2.gpa FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free'\n```"}]}, {"id": "train-896", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the easiest courses, what is the name of the course where most students got an A?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.grade = 'A' AND T2.diff = 1 GROUP BY T2.name ORDER BY COUNT(T1.student_id) DESC LIMIT 1\n```"}]}, {"id": "train-897", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many courses does the student with the highest GPA this semester take?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(course_id) FROM registration WHERE student_id IN ( SELECT student_id FROM student WHERE gpa = ( SELECT MAX(gpa) FROM student ) )\n```"}]}, {"id": "train-898", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students does Ogdon Zywicki advise?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'\n```"}]}, {"id": "train-899", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the course with the highest satisfaction from students?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.sat = 5\n```"}]}, {"id": "train-900", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the courses that the students with the lowest intelligence are least satisfied with?"}, {"from": "gpt", "value": "```sql\nSELECT T3.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 T2.sat = 1 AND T1.intelligence = 1\n```"}]}, {"id": "train-901", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of the two courses, \"Advanced Operating System\" or \"Intro to BlockChain', did most of the students receive an A in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.grade = 'A' AND T2.name IN ('Advanced Operating System', 'Intro to BlockChain') GROUP BY T2.name ORDER BY COUNT(T1.student_id) DESC LIMIT 1\n```"}]}, {"id": "train-902", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the popularity of the professor who advises the highest number of students with the highest research ability?"}, {"from": "gpt", "value": "```sql\nSELECT T2.popularity FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id, T1.capability ORDER BY COUNT(T1.student_id) DESC, T1.capability DESC LIMIT 1\n```"}]}, {"id": "train-903", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of students who registered for the courses with a difficulty of 4?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.student_id) AS REAL) / COUNT(DISTINCT T2.course_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.diff = 4\n```"}]}, {"id": "train-904", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students, who have a GPA between 3 to 4, failed a course?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.student_id) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T2.grade IS NULL AND T1.gpa BETWEEN 3 AND 4\n```"}]}, {"id": "train-905", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students taking a bachelor's degree received an A in all of the courses that they took?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.student_id) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T2.grade = 'A' AND T1.type = 'UG'\n```"}]}, {"id": "train-906", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average GPA of the students with the highest research capability and high salary? List the full names of the students."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.gpa), T2.f_name, T2.l_name FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high' AND T1.capability = 5 GROUP BY T2.student_id\n```"}]}, {"id": "train-907", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the professors' IDs and students' IDs with the lowest research ability."}, {"from": "gpt", "value": "```sql\nSELECT prof_id, student_id FROM RA WHERE capability = ( SELECT MIN(capability) FROM RA )\n```"}]}, {"id": "train-908", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the professor who got graduation from the University of Boston."}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM prof WHERE graduate_from = 'University of Boston'\n```"}]}, {"id": "train-909", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the courses' IDs and students' IDs who failed to pass the course."}, {"from": "gpt", "value": "```sql\nSELECT course_id, student_id FROM registration WHERE grade IS NULL OR grade = ''\n```"}]}, {"id": "train-910", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the male and female ratio among the professors?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN gender = 'Male' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender = 'Female' THEN 1 ELSE 0 END) FROM prof\n```"}]}, {"id": "train-911", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the names and credits of the least difficult courses."}, {"from": "gpt", "value": "```sql\nSELECT name, credit FROM course WHERE diff = ( SELECT MIN(diff) FROM course )\n```"}]}, {"id": "train-912", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the students' full names and GPAs under the supervision of the most popular professor."}, {"from": "gpt", "value": "```sql\nSELECT T3.f_name, T3.l_name, T3.gpa FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id ORDER BY T1.popularity DESC LIMIT 1\n```"}]}, {"id": "train-913", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the full names and emails of unpaid research assistants."}, {"from": "gpt", "value": "```sql\nSELECT T2.f_name, T2.l_name, T2.email FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free'\n```"}]}, {"id": "train-914", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the research assistants' full names, capabilities and GPAs who were under the supervision of Merwyn Conkay."}, {"from": "gpt", "value": "```sql\nSELECT T3.f_name, T3.l_name, T2.capability, T3.gpa FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T1.first_name = 'Merwyn' AND T1.last_name = 'Conkay'\n```"}]}, {"id": "train-915", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the students' full names and grades in Intro to BlockChain course."}, {"from": "gpt", "value": "```sql\nSELECT T1.f_name, T1.l_name, T2.grade 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 = 'Intro to BlockChain'\n```"}]}, {"id": "train-916", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among students registered for the most difficult course, list the students' full names who got grade A."}, {"from": "gpt", "value": "```sql\nSELECT 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 T2.grade = 'A' ORDER BY T3.diff DESC LIMIT 1\n```"}]}, {"id": "train-917", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the full names and graduated universities of the professors who advised Olia Rabier."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name, T1.graduate_from FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Olia' AND T3.l_name = 'Rabier'\n```"}]}, {"id": "train-918", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the students of the Advanced Database Systems course with the highest satisfaction."}, {"from": "gpt", "value": "```sql\nSELECT 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 = 'Advanced Database Systems' ORDER BY T2.sat DESC LIMIT 1\n```"}]}, {"id": "train-919", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the GPA of the semester for Laughton Antonio."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T3.credit * CASE T1.grade WHEN 'A' THEN 4 WHEN 'B' THEN 3 WHEN 'C' THEN 2 WHEN 'D' THEN 1 ELSE 1 END) AS REAL) / COUNT(T3.credit) FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T2.f_name = 'Laughton' AND T2.l_name = 'Antonio'\n```"}]}, {"id": "train-920", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the registered courses' names by undergraduate students with GPA of 3.7 and above."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.f_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 T1.type = 'UG' AND T1.gpa > 3.7\n```"}]}, {"id": "train-921", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the names and capability of the students who were advised by professors from the University of Washington."}, {"from": "gpt", "value": "```sql\nSELECT T3.f_name, T3.l_name, T2.capability FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T1.graduate_from = 'University of Washington'\n```"}]}, {"id": "train-922", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the full names, emails and intelligence of the students with the highest capability and salary."}, {"from": "gpt", "value": "```sql\nSELECT f_name, l_name, email, intelligence FROM student WHERE student_id IN ( SELECT student_id FROM RA WHERE salary = 'high' AND capability = ( SELECT MAX(capability) FROM RA ) )\n```"}]}, {"id": "train-923", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the names and credits of course registered by the students who were under the supervision of female professor with the highest teaching ability."}, {"from": "gpt", "value": "```sql\nSELECT T5.name, T5.credit FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id INNER JOIN registration AS T4 ON T3.student_id = T4.student_id INNER JOIN course AS T5 ON T4.course_id = T5.course_id WHERE T2.gender = 'Female' ORDER BY T2.teachingability DESC LIMIT 1\n```"}]}, {"id": "train-924", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the professors are female?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(prof_id) FROM prof WHERE gender = 'Female'\n```"}]}, {"id": "train-925", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the most difficult course?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM course WHERE diff = ( SELECT MAX(diff) FROM course )\n```"}]}, {"id": "train-926", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students with a gpa of 3.1 to 3.7, how many of them are undergraduate students?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(student_id) FROM student WHERE gpa BETWEEN 3.1 AND 3.7 AND type = 'UG'\n```"}]}, {"id": "train-927", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the credit of the course named \"Computer Vision\"?"}, {"from": "gpt", "value": "```sql\nSELECT credit FROM course WHERE name = 'Computer Vision'\n```"}]}, {"id": "train-929", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the student's last name that gave the highest student satisfaction for the course \"Intro to Database 2\"."}, {"from": "gpt", "value": "```sql\nSELECT 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 = 'Intro to Database 2' ORDER BY T2.sat DESC LIMIT 1\n```"}]}, {"id": "train-930", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students with high salary, what is total number of students with a GPA higher than 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high' AND T2.gpa > 3\n```"}]}, {"id": "train-931", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among undergraduate students, list the name of the course with the highest student satisfaction."}, {"from": "gpt", "value": "```sql\nSELECT T3.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 T1.type = 'UG' ORDER BY T2.sat DESC LIMIT 1\n```"}]}, {"id": "train-932", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the capability of research postgraduate students with an intellegence level of 4 and above."}, {"from": "gpt", "value": "```sql\nSELECT T1.capability FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.type = 'RPG' AND T2.intelligence >= 4\n```"}]}, {"id": "train-933", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In students with a grade of B, how many of them have an intellegence level of 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.grade = 'B' AND T2.intelligence = 3\n```"}]}, {"id": "train-934", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difficulty of the course in which a student with level of intellengence of 5 got an A grade?"}, {"from": "gpt", "value": "```sql\nSELECT T3.diff 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 T2.grade = 'A' AND T1.intelligence = 5\n```"}]}, {"id": "train-935", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among professors with the highest popularity, how many of their students have research capability of 5?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T1.capability = 5 ORDER BY T2.popularity DESC LIMIT 1\n```"}]}, {"id": "train-936", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the course's name where students acquired a grade of D."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T2.grade = 'D'\n```"}]}, {"id": "train-937", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the capability on research of the student named Alvera McQuillin?"}, {"from": "gpt", "value": "```sql\nSELECT T2.capability FROM student AS T1 INNER JOIN RA AS T2 ON T1.student_id = T2.student_id WHERE T1.f_name = 'Alvera' AND T1.l_name = 'McQuillin'\n```"}]}, {"id": "train-938", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of courses with 3 credit, how many students have GPA of 3.2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) 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.credit = 3 AND T1.gpa = 3.2\n```"}]}, {"id": "train-939", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among students with low salary, how many of them have a gpa of 3.5?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.gpa = 3.5 AND T1.salary = 'low'\n```"}]}, {"id": "train-940", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the student's email with grade of B in a course with difficulty greater than the 80% of average difficulty of all courses."}, {"from": "gpt", "value": "```sql\nSELECT T2.email FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T1.grade = 'B' GROUP BY T3.diff HAVING T3.diff > AVG(T3.diff) * 0.8\n```"}]}, {"id": "train-941", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the professors with a teachability of 3 and below, what is the percentage of their student advisees with a low salary?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.salary = 'low' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.salary) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability < 3\n```"}]}, {"id": "train-942", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the most important and most difficult courses."}, {"from": "gpt", "value": "```sql\nSELECT name FROM course WHERE credit = ( SELECT MAX(credit) FROM course ) AND diff = ( SELECT MAX(diff) FROM course )\n```"}]}, {"id": "train-943", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average teaching ability of the most popular professors?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(teachingability) AS REAL) / COUNT(prof_id) FROM prof WHERE popularity = ( SELECT MAX(popularity) FROM prof )\n```"}]}, {"id": "train-944", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average satisfaction of the good students with their courses."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(sat) AS REAL) / COUNT(course_id) FROM registration WHERE grade = 'B'\n```"}]}, {"id": "train-945", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students with less than four intelligence, list the full name and phone number of students with a greater than 3 GPA."}, {"from": "gpt", "value": "```sql\nSELECT f_name, l_name, phone_number FROM student WHERE gpa > 3 AND intelligence < 4\n```"}]}, {"id": "train-946", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the students with above-average capability."}, {"from": "gpt", "value": "```sql\nSELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN RA AS T2 ON T1.student_id = T2.student_id WHERE T2.capability > ( SELECT AVG(capability) FROM RA )\n```"}]}, {"id": "train-947", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the students with an intelligence of 5, list the full name and courses taken by them who have less than a 3 GPA."}, {"from": "gpt", "value": "```sql\nSELECT T1.f_name, T1.l_name, T3.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 T1.intelligence = 5 AND T1.gpa < 3\n```"}]}, {"id": "train-948", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average capability of students with less than a 2.5 GPA?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.capability) AS REAL) / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.gpa < 2.5\n```"}]}, {"id": "train-949", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name of the professors who advised students with intelligence 1."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.intelligence = 1\n```"}]}, {"id": "train-950", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in the average GPA of students who took the hardest and easiest courses?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.gpa) 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.diff IN (2, 1) GROUP BY T3.diff\n```"}]}, {"id": "train-951", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name and capability of students who failed in any courses."}, {"from": "gpt", "value": "```sql\nSELECT T2.f_name, T2.l_name, T1.capability FROM RA AS T1 INNER JOIN student AS T2 ON T2.student_id = T1.student_id INNER JOIN registration AS T3 ON T2.student_id = T3.student_id WHERE T3.grade IS NULL OR T3.grade = ''\n```"}]}, {"id": "train-952", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the students with high salaries, how many took the computer vision course?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN registration AS T2 ON T2.student_id = T1.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T1.salary = 'high' AND T3.name = 'Computer Vision'\n```"}]}, {"id": "train-953", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the full name and popularity of the professor who advises the most number of students."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name, T1.popularity FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id ORDER BY COUNT(T2.student_id) DESC LIMIT 1\n```"}]}, {"id": "train-954", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the name of the course in which most numbers of the students got an A. Also, list the full name of the students who got an A in this course."}, {"from": "gpt", "value": "```sql\nSELECT T3.name, T2.f_name, T2.l_name FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T1.course_id = T3.course_id WHERE T1.grade = 'A' GROUP BY T3.name ORDER BY COUNT(T1.student_id) DESC LIMIT 1\n```"}]}, {"id": "train-955", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference between the average satisfaction of the students with high salaries and no salary."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.sat) - ( SELECT AVG(T2.sat) FROM RA AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free' ) AS diff FROM RA AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'high'\n```"}]}, {"id": "train-956", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the university from which the professor who advised most undergraduate students graduated."}, {"from": "gpt", "value": "```sql\nSELECT T1.graduate_from FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.type = 'UG' GROUP BY T1.prof_id ORDER BY COUNT(T2.student_id) DESC LIMIT 1\n```"}]}, {"id": "train-957", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the professors with more than average teaching ability, list the full name and email address of the professors who advise two or more students."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name, T2.email FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability > ( SELECT AVG(teachingability) FROM prof ) GROUP BY T2.prof_id HAVING COUNT(T1.student_id) >= 2\n```"}]}, {"id": "train-958", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of students are highly satisfied with the Intro to Database 2 course?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(( SELECT COUNT(*) FROM course WHERE name = 'Intro to Database 2' AND course_id IN ( SELECT course_id FROM registration WHERE sat = ( SELECT MAX(sat) FROM registration ) ) ) AS REAL) * 100 / COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.name = 'Intro to Database 2'\n```"}]}, {"id": "train-959", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the first and last name of students with highest gpa?"}, {"from": "gpt", "value": "```sql\nSELECT f_name, l_name FROM student WHERE gpa = ( SELECT MAX(gpa) FROM student )\n```"}]}, {"id": "train-960", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among professors with the highest teachability, how many of their students have high salary?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T1.salary = 'high' ORDER BY T2.teachingability DESC LIMIT 1\n```"}]}, {"id": "train-961", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the salary range of the student with an email of grosellg@hku.hk?"}, {"from": "gpt", "value": "```sql\nSELECT T1.salary FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.email = 'grosellg@hku.hk'\n```"}]}, {"id": "train-962", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among students that gave satisfaction of value 4 for the course named \"Statistical Learning\", how many of them have a gpa of 3.8?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) 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 = 'Statistical learning' AND T2.sat = 4 AND T1.gpa = 3.8\n```"}]}, {"id": "train-963", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among courses with difficulty of 3, how many students have intellegence level of 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.student_id) 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.diff = 3 AND T1.intelligence = 2\n```"}]}, {"id": "train-964", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the student's first and last name that got a C in the course named \"Applied Deep Learning\"."}, {"from": "gpt", "value": "```sql\nSELECT 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'\n```"}]}, {"id": "train-965", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among research postgraduate students, give the name of the course with the student satisfaction value of 1."}, {"from": "gpt", "value": "```sql\nSELECT T3.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 T2.sat = 1 AND T1.type = 'RPG'\n```"}]}, {"id": "train-966", "db_id": "cs_semester", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students with a capability below 3, what is the difference of undergraduate students from research postgraduate students?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.type = 'UG' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.type = 'RPG' THEN 1 ELSE 0 END) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.capability < 3\n```"}]}, {"id": "train-967", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of students for each advisor?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(p_id) AS REAL) / COUNT(DISTINCT p_id_dummy) AS avgnum FROM advisedBy GROUP BY p_id_dummy\n```"}]}, {"id": "train-968", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many professors are teaching course ID 18?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT p_id) FROM taughtBy WHERE course_id = 18\n```"}]}, {"id": "train-969", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the course IDs for professional or master/graduate courses."}, {"from": "gpt", "value": "```sql\nSELECT course_id FROM course WHERE courseLevel = 'Level_500'\n```"}]}, {"id": "train-970", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many courses are there for basic or medium undergraduate courses?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(course_id) FROM course WHERE courseLevel = 'Level_300'\n```"}]}, {"id": "train-971", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ID of all professors who are not faculty member along with the courses taught by him/her."}, {"from": "gpt", "value": "```sql\nSELECT T2.p_id, T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.professor = 1 AND T1.hasPosition <> 0\n```"}]}, {"id": "train-972", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ID of professors who are teaching high-level or harder undergraduate course."}, {"from": "gpt", "value": "```sql\nSELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_400'\n```"}]}, {"id": "train-973", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the courses taught by the advisors who gave advice to student with ID 376?"}, {"from": "gpt", "value": "```sql\nSELECT T3.course_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN taughtBy AS T3 ON T2.p_id = T3.p_id WHERE T1.p_id = 141\n```"}]}, {"id": "train-974", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the advisors for students in Year 3 of the program."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_3'\n```"}]}, {"id": "train-975", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which level of courses is taught by professor ID 297?"}, {"from": "gpt", "value": "```sql\nSELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 297\n```"}]}, {"id": "train-976", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What level is course 165? List the professors who teach the course."}, {"from": "gpt", "value": "```sql\nSELECT T1.courseLevel, T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.course_id = 165\n```"}]}, {"id": "train-977", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ID and years in program for students taught by advisor with ID 5."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_id, T2.yearsInProgram FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.p_id_dummy = 5\n```"}]}, {"id": "train-978", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the courses and level of courses by professors who are faculty employees."}, {"from": "gpt", "value": "```sql\nSELECT T3.course_id, T3.courseLevel FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T1.course_id WHERE T2.hasPosition = 'Faculty_eme'\n```"}]}, {"id": "train-979", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the ID of advisor of student ID 80 and state the level of courses taught by him/her."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_id_dummy, T2.courseLevel FROM advisedBy AS T1 INNER JOIN course AS T2 ON T1.p_id = T2.course_id INNER JOIN taughtBy AS T3 ON T2.course_id = T3.course_id WHERE T1.p_id = 80\n```"}]}, {"id": "train-980", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ID of professors who teach in both harder undergraduate course and master/graduate courses."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_400' OR T1.courseLevel = 'Level_500'\n```"}]}, {"id": "train-981", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the professors who gave advice to students in the 12th years of program?"}, {"from": "gpt", "value": "```sql\nSELECT T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_12'\n```"}]}, {"id": "train-982", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which are the courses with the most number of professors? State the course ID and the level of the course."}, {"from": "gpt", "value": "```sql\nSELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id, T1.courseLevel ORDER BY COUNT(T1.course_id) DESC LIMIT 1\n```"}]}, {"id": "train-983", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many basic and medium undergraduate courses are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM course WHERE courseLevel = 'Level_300'\n```"}]}, {"id": "train-984", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people teaches course no.11?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM taughtBy WHERE course_id = 11\n```"}]}, {"id": "train-985", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which course has more teachers, course no.16 or course no.18?"}, {"from": "gpt", "value": "```sql\nSELECT course_id FROM taughtBy WHERE course_id = 11 OR course_id = 18 GROUP BY course_id ORDER BY COUNT(course_id) DESC LIMIT 1\n```"}]}, {"id": "train-986", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teachers are faculty employees?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM person WHERE hasPosition = 'Faculty_eme'\n```"}]}, {"id": "train-987", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the teachers who have advised more than 4 others to teach."}, {"from": "gpt", "value": "```sql\nSELECT p_id_dummy FROM advisedBy GROUP BY p_id_dummy HAVING COUNT(p_id_dummy) > 4\n```"}]}, {"id": "train-988", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many basic or medium undergraduate courses are taught by a professor?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T1.courseLevel = 'Level_300' AND T3.professor = 1\n```"}]}, {"id": "train-989", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of all the faculty employees who teaches a basic or medium undergraduate course."}, {"from": "gpt", "value": "```sql\nSELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T3.p_id = T2.p_id WHERE T1.courseLevel = 'Level_300' AND T3.hasPosition = 'Faculty_eme'\n```"}]}, {"id": "train-990", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is the teacher who teaches course no.9 a faculty member?"}, {"from": "gpt", "value": "```sql\nSELECT T2.hasPosition FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.course_id = 9\n```"}]}, {"id": "train-991", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the levels of the all courses taught by teacher no.79."}, {"from": "gpt", "value": "```sql\nSELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 79\n```"}]}, {"id": "train-992", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the advisors of the students who are in the 5th year of their program."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_5'\n```"}]}, {"id": "train-993", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are advised to teach by a professor teaching basic or medium undergraduate courses?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T4.p_id) 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 INNER JOIN advisedBy AS T4 ON T4.p_id = T1.p_id WHERE T1.professor = 1 AND T3.courseLevel = 'Level_300'\n```"}]}, {"id": "train-994", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the courses that are basic or medium undergraduate courses, how many of them are taught by a faculty member?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id INNER JOIN person AS T3 ON T2.p_id = T3.p_id WHERE T3.professor = 1 AND T1.courseLevel = 'Level_300'\n```"}]}, {"id": "train-995", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the professor who advised student no.6, please list the IDs of the courses he or she teaches."}, {"from": "gpt", "value": "```sql\nSELECT T2.course_id FROM taughtBy AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id INNER JOIN advisedBy AS T3 ON T3.p_id = T1.p_id WHERE T1.p_id = 9\n```"}]}, {"id": "train-996", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the level of the course with the most number of teachers?"}, {"from": "gpt", "value": "```sql\nSELECT T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id ORDER BY COUNT(T2.p_id) DESC LIMIT 1\n```"}]}, {"id": "train-997", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the professors that teaches more than 3 courses."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1 GROUP BY T1.p_id HAVING COUNT(DISTINCT T1.course_id) > 3\n```"}]}, {"id": "train-998", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the top 3 professors that teaches the most courses."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1 GROUP BY T1.p_id ORDER BY COUNT(*) DESC LIMIT 3\n```"}]}, {"id": "train-999", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In total, all the students in the 3rd year of their program are advised by how many professors?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.p_id_dummy) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_3'\n```"}]}, {"id": "train-1000", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of courses taught by a professor?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.course_id) AS REAL) / COUNT(DISTINCT T2.p_id) AS num FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1\n```"}]}, {"id": "train-1001", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of professors and students?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN professor = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN student = 1 THEN 1 ELSE 0 END) AS per FROM person\n```"}]}, {"id": "train-1002", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of high-level undergraduate course."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN courseLevel = 'Level_400' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) AS per FROM course\n```"}]}, {"id": "train-1003", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all the person IDs who taught course ID of 18."}, {"from": "gpt", "value": "```sql\nSELECT p_id FROM taughtBy WHERE course_id = 18\n```"}]}, {"id": "train-1004", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the position status and IDs of professor who advised student ID \"303\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.hasPosition, T1.p_id_dummy FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id_dummy = T2.p_id WHERE T1.p_id = 303\n```"}]}, {"id": "train-1005", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the person IDs and course levels of the affiliated professors in faculty."}, {"from": "gpt", "value": "```sql\nSELECT 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 T1.hasPosition = 'Faculty_aff'\n```"}]}, {"id": "train-1006", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the year in program and in phase status for the student with most number in advisor."}, {"from": "gpt", "value": "```sql\nSELECT T2.yearsInProgram, T2.inPhase FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-1007", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the advised student IDs and IDs of employing professor in faculty."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_id, T2.p_id FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id_dummy = T2.p_id WHERE hasPosition = 'Faculty_eme'\n```"}]}, {"id": "train-1008", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the course IDs and levels of person IDs from 40 to 50."}, {"from": "gpt", "value": "```sql\nSELECT T1.course_id, T1.courseLevel FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id BETWEEN 40 AND 50\n```"}]}, {"id": "train-1009", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the course level and list of person IDs who taught course ID of 147."}, {"from": "gpt", "value": "```sql\nSELECT T1.courseLevel, T1.course_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T2.p_id = 141\n```"}]}, {"id": "train-1010", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the person ID of faculty professor who taught course ID 104 and the course level."}, {"from": "gpt", "value": "```sql\nSELECT 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\n```"}]}, {"id": "train-1011", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the professor ID and position in faculty who taught high-level undergraduate course of less than 10 in ID."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_id, T1.hasPosition 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.courseLevel = 'Level_400' AND T2.course_id < 10\n```"}]}, {"id": "train-1012", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the professor ID who taught the course ID from 121 to 130 of basic undergraduate courses."}, {"from": "gpt", "value": "```sql\nSELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_300' AND T1.course_id > 121 AND T1.course_id < 130\n```"}]}, {"id": "train-1013", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the advisor IDs for students with eighth year of program and position status in faculty of those professors."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_id_dummy, T2.hasPosition FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_8'\n```"}]}, {"id": "train-1014", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List any five of course IDs with professor IDs who taught master courses."}, {"from": "gpt", "value": "```sql\nSELECT T1.course_id, T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500' LIMIT 5\n```"}]}, {"id": "train-1015", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are under advisor 415?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM advisedBy WHERE p_id_dummy = 415\n```"}]}, {"id": "train-1016", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many professional or master/graduate courses are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM course WHERE courseLevel = 'Level_500'\n```"}]}, {"id": "train-1017", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many non-faculty members are not undergoing the phase of qualifications?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM person WHERE hasPosition = 0 AND inPhase = 0\n```"}]}, {"id": "train-1018", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which professor taught the least amount of courses?"}, {"from": "gpt", "value": "```sql\nSELECT p_id FROM taughtBy GROUP BY p_id ORDER BY COUNT(course_id) ASC LIMIT 1\n```"}]}, {"id": "train-1019", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students being advised by Advisor 5, how many students are in the 5th year?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T1.p_id_dummy = 5 AND T2.student = 1 AND T2.yearsInProgram = 'Year_5'\n```"}]}, {"id": "train-1020", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which professor teaches the highest number of professional or master/graduate courses?"}, {"from": "gpt", "value": "```sql\nSELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500' GROUP BY T2.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1\n```"}]}, {"id": "train-1021", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the faculty affiliated professor, how many professors teaches professional or master/undergraduate courses?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) 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 T1.hasPosition = 'Faculty_aff' AND T1.professor = 1 AND T3.courseLevel = 'Level_500'\n```"}]}, {"id": "train-1022", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the top 5 professors who teaches the highest number of professional or master/undergraduate courses?"}, {"from": "gpt", "value": "```sql\nSELECT T2.p_id FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500' GROUP BY T2.p_id ORDER BY COUNT(T2.p_id) DESC LIMIT 5\n```"}]}, {"id": "train-1023", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many advisors are in charge of advising all the students in 1st year?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.p_id_dummy) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.yearsInProgram = 'Year_1' AND T2.student = 1\n```"}]}, {"id": "train-1024", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many professors teaches no more than two high-level or harder undergraduate courses?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT COUNT(T2.p_id) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_400' GROUP BY T2.p_id HAVING COUNT(DISTINCT T1.course_id) <= 2 )\n```"}]}, {"id": "train-1025", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between the faculty employee professors, how many teaches high-level or harder undergraduate courses? Indicate each of the professors unique identifying number."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) 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 T1.hasPosition = 'Faculty_eme' AND T1.professor = 1 AND T3.courseLevel = 'Level_400'\n```"}]}, {"id": "train-1026", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the position in the faculty of the professor who teaches the highest number of courses?"}, {"from": "gpt", "value": "```sql\nSELECT T1.hasPosition FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.professor = 1 GROUP BY T1.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1\n```"}]}, {"id": "train-1027", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What year in the program do the students with more than 2 advisors are in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.yearsInProgram FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1 GROUP BY T2.p_id HAVING COUNT(T2.p_id) > 2\n```"}]}, {"id": "train-1028", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many professors teaches basic or medium undergraduate courses?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_300'\n```"}]}, {"id": "train-1029", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students being advised by advisors, which students' year in the program do the advisors advise the majority of?"}, {"from": "gpt", "value": "```sql\nSELECT T2.yearsInProgram FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.student = 1 GROUP BY T2.yearsInProgram ORDER BY COUNT(T1.p_id_dummy) DESC LIMIT 1\n```"}]}, {"id": "train-1030", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students that are undergoing the pre-phase of qualification have advisors?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.p_id_dummy) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.inPhase = 'Pre_Quals' AND T2.student = 1\n```"}]}, {"id": "train-1031", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of professional or master/undergraduate courses being taught by each professor?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.course_id) AS REAL) / COUNT(DISTINCT T2.p_id) FROM course AS T1 INNER JOIN taughtBy AS T2 ON T1.course_id = T2.course_id WHERE T1.courseLevel = 'Level_500'\n```"}]}, {"id": "train-1032", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many courses were taught by more than 4 people?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT COUNT(course_id) FROM taughtBy GROUP BY course_id HAVING COUNT(course_id) > 4 )\n```"}]}, {"id": "train-1033", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total of professional courses available at the university? List out all the course id."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(course_id) FROM course WHERE courseLevel = 'Level_500'\n```"}]}, {"id": "train-1034", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the sum of year 1 and year 2 students?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM person WHERE yearsInProgram = 'Year_1' OR yearsInProgram = 'Year_2'\n```"}]}, {"id": "train-1035", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many courses were taught by a professor who is currently the member of faculty?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.professor = 1 AND T1.hasPosition <> 0\n```"}]}, {"id": "train-1036", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which professor taught the most courses and what is the position of this person in the university?"}, {"from": "gpt", "value": "```sql\nSELECT T1.p_id, T1.hasPosition FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id GROUP BY T1.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1\n```"}]}, {"id": "train-1037", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which courses were taught by a professor who is not a faculty member?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.course_id FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id WHERE T1.professor = 1 AND T1.hasPosition = 0\n```"}]}, {"id": "train-1038", "db_id": "computer_student", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which member of the faculty are teaching the most courses and what is his/her general course level?"}, {"from": "gpt", "value": "```sql\nSELECT 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 GROUP BY T1.p_id ORDER BY COUNT(T2.course_id) DESC LIMIT 1\n```"}]}, {"id": "train-1039", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the device id of the oldest user?"}, {"from": "gpt", "value": "```sql\nSELECT device_id FROM gender_age WHERE age = ( SELECT MAX(age) FROM gender_age )\n```"}]}, {"id": "train-1040", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many events were held at coordinate 97,40?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(event_id) FROM `events` WHERE latitude = 40 AND longitude = 97\n```"}]}, {"id": "train-1041", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male users are in the age group of M32-38?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(gender) FROM gender_age WHERE gender = 'M' AND `group` = 'M32-38'\n```"}]}, {"id": "train-1042", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female users over the age of 50 are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(gender) FROM gender_age WHERE age > 50 AND gender = 'F'\n```"}]}, {"id": "train-1043", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many active users were there in the event id 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(is_active) FROM app_events WHERE event_id = 2 AND is_active = 1\n```"}]}, {"id": "train-1044", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the gender of the youngest user?"}, {"from": "gpt", "value": "```sql\nSELECT gender FROM gender_age WHERE age = ( SELECT MIN(age) FROM gender_age )\n```"}]}, {"id": "train-1045", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the category which most users belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T.category FROM ( SELECT T2.category, COUNT(T1.app_id) AS num FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T2.label_id = T1.label_id GROUP BY T1.app_id, T2.category ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-1046", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the model of the oldest user's device?"}, {"from": "gpt", "value": "```sql\nSELECT T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id ORDER BY T2.age DESC LIMIT 1\n```"}]}, {"id": "train-1047", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users are there in the Home Decoration category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T2.label_id = T1.label_id WHERE T2.category = 'Home Decoration'\n```"}]}, {"id": "train-1048", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male users are active in the events held on 5/1/2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.gender) FROM app_events AS T1 INNER JOIN events_relevant AS T2 ON T2.event_id = T1.event_id INNER JOIN gender_age AS T3 ON T3.device_id = T2.device_id WHERE T1.is_active = 1 AND T3.gender = 'M' AND T2.timestamp LIKE '2016-05-01%'\n```"}]}, {"id": "train-1049", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female users use ZenFone 5 devices?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.gender) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T2.device_id = T1.device_id WHERE T1.gender = 'F' AND T2.device_model = 'ZenFone 5'\n```"}]}, {"id": "train-1051", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common device model among female users between the ages 27 to 28?"}, {"from": "gpt", "value": "```sql\nSELECT T2.device_model FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'F27-28' AND T1.gender = 'F' ORDER BY T2.device_id DESC LIMIT 1\n```"}]}, {"id": "train-1052", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the categories of the top 2 oldest events?"}, {"from": "gpt", "value": "```sql\nSELECT T4.category FROM events_relevant AS T1 INNER JOIN app_events_relevant AS T2 ON T1.event_id = T2.event_id INNER JOIN app_labels AS T3 ON T3.app_id = T2.app_id INNER JOIN label_categories AS T4 ON T3.label_id = T4.label_id ORDER BY T1.timestamp LIMIT 2\n```"}]}, {"id": "train-1053", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the gender of the majority of Vivo phone users?"}, {"from": "gpt", "value": "```sql\nSELECT T.gender FROM ( SELECT T2.gender, COUNT(T2.gender) AS num FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'vivo' GROUP BY T2.gender ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-1054", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which category has the highest number of users?"}, {"from": "gpt", "value": "```sql\nSELECT T.category FROM ( SELECT T2.category, COUNT(T1.app_id) AS num FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T2.label_id = T1.label_id GROUP BY T1.app_id, T2.category ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-1055", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users belong to the MOBA category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T2.label_id = T1.label_id WHERE T1.category = 'MOBA'\n```"}]}, {"id": "train-1056", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of female OPPO users against the male OPPO users?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T2.gender = 'F', 1, 0)) * 100 / COUNT(T2.device_id) AS perFemale , SUM(IIF(T2.gender = 'M', 1, 0)) * 100 / COUNT(T2.device_id) AS perMale FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'OPPO'\n```"}]}, {"id": "train-1057", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What were the locations of the events on 8th May, 2016?"}, {"from": "gpt", "value": "```sql\nSELECT longitude, latitude FROM `events` WHERE SUBSTR(`timestamp`, 1, 10) = '2016-05-08'\n```"}]}, {"id": "train-1058", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the app users IDs and installed status for the event ID of 844."}, {"from": "gpt", "value": "```sql\nSELECT app_id , IIF(is_installed = 1, 'YES', 'NO') AS status FROM app_events WHERE event_id = 844\n```"}]}, {"id": "train-1059", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many events were there on 30th April, 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(event_id) FROM events WHERE SUBSTR(`timestamp`, 1, 10) = '2016-04-30'\n```"}]}, {"id": "train-1060", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users used Vivo Xplay3S model?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE device_model = 'Xplay3S' AND phone_brand = 'vivo'\n```"}]}, {"id": "train-1061", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of male and female users in 27-28 age group?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(gender = 'M' AND `group` = 'M27-28', 1, 0)) / SUM(IIF(gender = 'F' AND `group` = 'F27-28', 1, 0)) AS r FROM gender_age\n```"}]}, {"id": "train-1062", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the labels' IDs of online shopping and online malls categories?"}, {"from": "gpt", "value": "```sql\nSELECT label_id FROM label_categories WHERE category IN ('online shopping', 'online malls')\n```"}]}, {"id": "train-1064", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the app users IDs and time for the event ID of 82."}, {"from": "gpt", "value": "```sql\nSELECT T1.app_id, T2.timestamp FROM app_events AS T1 INNER JOIN events AS T2 ON T2.event_id = T1.event_id WHERE T2.event_id = 82\n```"}]}, {"id": "train-1065", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the device user gender and age of the event ID of 15251."}, {"from": "gpt", "value": "```sql\nSELECT T1.gender, T1.age FROM gender_age AS T1 INNER JOIN events AS T2 ON T2.device_id = T1.device_id WHERE T2.event_id = 15251\n```"}]}, {"id": "train-1066", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many events did the 88-years-old male users participate on 4th May,2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.event_id) FROM gender_age AS T1 INNER JOIN events AS T2 ON T2.device_id = T1.device_id WHERE T1.gender = 'M' AND SUBSTR(`timestamp`, 1, 10) = '2016-05-04' AND T1.age = 88\n```"}]}, {"id": "train-1067", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the ages, genders and numbers of events participated by the users at coordinates of (-102,38)."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.age, T1.gender, COUNT(T2.event_id) FROM gender_age AS T1 INNER JOIN `events` AS T2 ON T2.device_id = T1.device_id WHERE T2.longitude = -102 AND T2.latitude = 38 GROUP BY T1.age, T1.gender, T2.longitude, T2.latitude\n```"}]}, {"id": "train-1068", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the phone brands and models of the users who were at the coordinates of (80,44)."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.phone_brand, T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN events AS T2 ON T2.device_id = T1.device_id WHERE T2.longitude = 80 AND T2.latitude = 44\n```"}]}, {"id": "train-1069", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the included categories in the event ID of 155."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T2.label_id = T1.label_id INNER JOIN app_events AS T3 ON T3.app_id = T2.app_id WHERE T3.event_id = 155\n```"}]}, {"id": "train-1070", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among HTC Butterfly phone users, list any five devices' IDs used by females."}, {"from": "gpt", "value": "```sql\nSELECT T2.device_id FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.device_model = 'Butterfly' AND T2.gender = 'F' AND T1.phone_brand = 'HTC' LIMIT 5\n```"}]}, {"id": "train-1071", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many app IDs were included under science fiction category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T2.label_id = T1.label_id WHERE T1.category = 'science fiction'\n```"}]}, {"id": "train-1072", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the ages and genders of the LG L70 users?"}, {"from": "gpt", "value": "```sql\nSELECT T2.age, T2.gender FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'LG' AND T1.device_model = 'L70'\n```"}]}, {"id": "train-1073", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of the app user IDs under Industry tag category."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.category = 'Industry tag', 1, 0)) * 100 / COUNT(T2.app_id) AS per FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T2.label_id = T1.label_id\n```"}]}, {"id": "train-1074", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the LG brand users, calculate the percentage of the Nexus 5 model user. What is the ratio of male and female users of it?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.device_model = 'Nexus 5', 1, 0)) * 100 / COUNT(T1.device_id) AS per , SUM(IIF(T1.device_model = 'Nexus 5' AND T2.gender = 'M', 1, 0)) / SUM(IIF(T1.device_model = 'Nexus 5' AND T2.gender = 'F', 1, 0)) AS r FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'LG'\n```"}]}, {"id": "train-1075", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users of the app were not active when event no.2 happened?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(event_id) FROM app_events WHERE event_id = 2 AND is_active = 0\n```"}]}, {"id": "train-1076", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many events in total have happened on the devices in 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(event_id) FROM `events` WHERE SUBSTR(`timestamp`, 1, 4) = '2016'\n```"}]}, {"id": "train-1077", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many events have happened on device no.29182687948017100 in 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(event_id) FROM `events` WHERE SUBSTR(`timestamp`, 1, 4) = '2016' AND device_id = 29182687948017100\n```"}]}, {"id": "train-1078", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many device users are male?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(device_id) FROM gender_age WHERE gender = 'M'\n```"}]}, {"id": "train-1079", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the age of the oldest device user?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(age) FROM gender_age\n```"}]}, {"id": "train-1080", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the female users of the devices, how many of them are under 30?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(device_id) FROM gender_age WHERE age < 30 AND gender = 'F'\n```"}]}, {"id": "train-1081", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users who use a Galaxy Note 2, how many of them are female?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T2.gender = 'F' AND T1.device_model = 'Galaxy Note 2'\n```"}]}, {"id": "train-1082", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the ages of all the users who use a Galaxy Note 2."}, {"from": "gpt", "value": "```sql\nSELECT T2.age FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.device_model = 'Galaxy Note 2'\n```"}]}, {"id": "train-1083", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the device model of the device used by the oldest user?"}, {"from": "gpt", "value": "```sql\nSELECT device_model FROM phone_brand_device_model2 WHERE device_id IN ( SELECT device_id FROM gender_age WHERE age = ( SELECT MAX(age) FROM gender_age ) )\n```"}]}, {"id": "train-1084", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which user group do most of the users who uses a vivo device belong?"}, {"from": "gpt", "value": "```sql\nSELECT T.`group` FROM ( SELECT T2.`group`, COUNT(`group`) AS num FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'vivo' GROUP BY T2.`group` ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-1085", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many app users belong to the category of Securities?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T2.label_id = T1.label_id WHERE T2.category = 'Securities'\n```"}]}, {"id": "train-1087", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the categories of the app users who are not active when event no.2 happened."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id INNER JOIN app_events AS T3 ON T2.app_id = T3.app_id WHERE T3.event_id = 2 AND T3.is_active = 0\n```"}]}, {"id": "train-1088", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the location coordinates of all the devices with an inactive app user when event no.2 happened."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.longitude, T2.latitude FROM app_events AS T1 INNER JOIN events AS T2 ON T2.event_id = T1.event_id WHERE T2.event_id = 2 AND T1.is_active = 0\n```"}]}, {"id": "train-1089", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the times event no.2 happened when the app user was not active, when was the earliest time this situation happened?"}, {"from": "gpt", "value": "```sql\nSELECT T2.timestamp FROM app_events AS T1 INNER JOIN events AS T2 ON T2.event_id = T1.event_id WHERE T1.is_active = 0 AND T2.event_id = 2 ORDER BY T2.timestamp LIMIT 1\n```"}]}, {"id": "train-1090", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the events happened on all the vivo devices."}, {"from": "gpt", "value": "```sql\nSELECT T2.event_id FROM phone_brand_device_model2 AS T1 INNER JOIN events AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'vivo'\n```"}]}, {"id": "train-1091", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the devices with event no.2 happening, how many of them are vivo devices?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM phone_brand_device_model2 AS T1 INNER JOIN events AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'vivo' AND T2.event_id = 2\n```"}]}, {"id": "train-1093", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many events in total have happened on all the vivo devices in the year 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.event_id) FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.event_id = T2.device_id WHERE STRFTIME('%Y', T1.timestamp) = '2016' AND T2.phone_brand = 'vivo'\n```"}]}, {"id": "train-1094", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users who uses a vivo device, how many of them are female and under 30?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' AND T2.phone_brand = 'vivo' AND T1.age < 30\n```"}]}, {"id": "train-1095", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the category that the most app users belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T.category FROM ( SELECT T1.category, COUNT(T2.app_id) AS num FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id GROUP BY T1.label_id ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-1097", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users in user group M23-26 use a vivo device?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'M23-26' AND T2.phone_brand = 'vivo'\n```"}]}, {"id": "train-1098", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the users who use a vivo device, what is the percentage of the users in the M23-26 user group?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.`group` = 'M23-26', 1.0, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo'\n```"}]}, {"id": "train-1099", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the devices with event no.2 happening, what is the percentage of the device being a vivo phone?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T2.phone_brand = 'vivo', 1, 0)) / COUNT(T1.device_id) AS per FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.event_id = T2.device_id WHERE T1.event_id = '2'\n```"}]}, {"id": "train-1100", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of all the vivo device users?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(age) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo'\n```"}]}, {"id": "train-1101", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female users belong to the age group of 27 to 28?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(device_id) FROM gender_age WHERE `group` = 'F27-28' AND gender = 'F'\n```"}]}, {"id": "train-1102", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the age of the oldest male user of the app?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(age) FROM gender_age WHERE gender = 'M'\n```"}]}, {"id": "train-1103", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users installed the app but are not active?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(app_id) FROM app_events WHERE is_installed = 1 AND is_active = 0\n```"}]}, {"id": "train-1104", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the age of the youngest female user of the app?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(age) FROM gender_age WHERE gender = 'F'\n```"}]}, {"id": "train-1105", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many models does the VIVO phone brand released?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'vivo'\n```"}]}, {"id": "train-1106", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 15 phone models released under the OPPO brand."}, {"from": "gpt", "value": "```sql\nSELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 15\n```"}]}, {"id": "train-1107", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 10 device models that male users over the age of 39 usually use."}, {"from": "gpt", "value": "```sql\nSELECT T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T2.`group` = 'M39+' AND T2.gender = 'M' LIMIT 10\n```"}]}, {"id": "train-1109", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users belong to \"Financial Information\" category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T2.category = 'Financial Information'\n```"}]}, {"id": "train-1110", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users belong to \"game-Art Style\" category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T2.category = 'game-Art Style'\n```"}]}, {"id": "train-1111", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the total number of the male users that use OPPO as their phone brand."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'OPPO' AND T1.gender = 'M'\n```"}]}, {"id": "train-1113", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 3 categories with the lowest number of users."}, {"from": "gpt", "value": "```sql\nSELECT T1.category FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id ORDER BY T2.label_id LIMIT 3\n```"}]}, {"id": "train-1114", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male users use the Galaxy Ace Plus model?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Ace Plus' AND T1.gender = 'M'\n```"}]}, {"id": "train-1115", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the age group of most OPPO users?"}, {"from": "gpt", "value": "```sql\nSELECT T.`group` FROM ( SELECT T1.`group`, COUNT(T1.`group`) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'OPPO' GROUP BY T1.`group` ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-1116", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 5 device models that are commonly used by female users."}, {"from": "gpt", "value": "```sql\nSELECT T.device_model FROM ( SELECT T2.device_model, COUNT(T2.device_model) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' GROUP BY T2.device_model ) AS T ORDER BY T.num DESC LIMIT 5\n```"}]}, {"id": "train-1117", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the ratio in percentage between the average number of app users belonging to \"80s Japanese comic\" and \"90s Japanese comic\"."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.category = '80s Japanese comic', 1, 0)) / COUNT(T1.label_id) AS J8 , SUM(IIF(T1.category = '90s Japanese comic', 1, 0)) / COUNT(T1.label_id) AS J9 FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id\n```"}]}, {"id": "train-1118", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the female users that uses OPPO as their phone brand, what is the percentage of them of the user that uses R815T model to install the app?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.phone_brand = 'OPPO', 1, 0)) / SUM(IIF(T1.device_id = 'R815T', 1, 0)) AS num FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T2.gender = 'F'\n```"}]}, {"id": "train-1119", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the phone brand of the device model \"\u575a\u679c\u624b\u673a\"?"}, {"from": "gpt", "value": "```sql\nSELECT phone_brand FROM phone_brand_device_model2 WHERE device_model = '\u575a\u679c\u624b\u673a'\n```"}]}, {"id": "train-1120", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of device models for \"\u4e2d\u5174\" phone brand."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE device_model = '\u4e2d\u5174'\n```"}]}, {"id": "train-1121", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which group does age 24 belong to?"}, {"from": "gpt", "value": "```sql\nSELECT `group` FROM gender_age WHERE age = '24'\n```"}]}, {"id": "train-1122", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the time stamp for event No.887711."}, {"from": "gpt", "value": "```sql\nSELECT timestamp FROM events WHERE event_id = '887711'\n```"}]}, {"id": "train-1123", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of events that happened on 2016/5/6."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(event_id) FROM events WHERE SUBSTR(`timestamp`, 1, 10) = '2016-05-06'\n```"}]}, {"id": "train-1125", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of \"game-Fishing\" apps."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'game-Fishing'\n```"}]}, {"id": "train-1126", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of the \"\u9b45\u84ddNote 2\" users who are in the \"F29-32\" group."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'F29-32' AND T2.device_model = '\u9b45\u84ddNote 2'\n```"}]}, {"id": "train-1127", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of 30-year-old users who were active in the events on 2016/5/2."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.device_id) FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id INNER JOIN gender_age AS T3 ON T2.device_id = T3.device_id WHERE SUBSTR(`timestamp`, 1, 10) = '2016-05-02' AND T1.is_active = 1 AND T3.age = '30'\n```"}]}, {"id": "train-1128", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the event which happened at 23:33:34 on 2016/5/6, how many installed apps were involved?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.event_id) FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE SUBSTR(T2.`timestamp`, 1, 10) = '2016-05-06' AND T1.is_installed = '1'\n```"}]}, {"id": "train-1129", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of female users of \"E\u6d3e\" brand devices."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' AND T2.phone_brand = 'E\u6d3e'\n```"}]}, {"id": "train-1130", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male users of the \"Galaxy S5\" device model?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T1.device_model = 'Galaxy S5' AND T2.gender = 'M'\n```"}]}, {"id": "train-1131", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users from the group \"F29-32\" who were active in the events on 2016/5/7?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.app_id) FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id INNER JOIN gender_age AS T3 ON T2.event_id = T3.device_id WHERE SUBSTR(T2.`timestamp`, 1, 10) = '2016-05-07' AND T1.is_active = '1' AND T3.`group` = 'F29-32'\n```"}]}, {"id": "train-1133", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the event which happened at 14:09:49 on 2016/5/6, in the location coordinate(116, 40), how many apps were active?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.app_id) FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE T2.timestamp = '2016-05-06 14:09:49' AND T1.is_active = '1' AND T2.longitude = '116' AND T2.latitude = '40'\n```"}]}, {"id": "train-1134", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times is the number of active apps in the event that happened at 7:50:28 on 2016/5/2 than in the event that happened at 7:41:03 on 2016/5/2?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(timestamp = '2016-05-02 7:50:28', 1, 0)) / SUM(IIF(timestamp = '2016-05-02 7:41:03', 1, 0)) AS num FROM events AS T1 INNER JOIN app_events AS T2 ON T1.event_id = T2.event_id WHERE T2.is_active = '1'\n```"}]}, {"id": "train-1135", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many devices are of the brand vivo?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'vivo'\n```"}]}, {"id": "train-1136", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more devices are there of the brand vivo than of the brand LG?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(phone_brand = 'vivo', 1, 0)) - SUM(IIF(phone_brand = 'LG', 1, 0)) AS num FROM phone_brand_device_model2\n```"}]}, {"id": "train-1137", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of the device used by the youngest user?"}, {"from": "gpt", "value": "```sql\nSELECT device_id FROM gender_age WHERE age = ( SELECT MIN(age) FROM gender_age )\n```"}]}, {"id": "train-1138", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the female users of the devices, how many of them are over 30?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(device_id) FROM gender_age WHERE age > 30 AND gender = 'F'\n```"}]}, {"id": "train-1139", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is the oldest device user male or female?"}, {"from": "gpt", "value": "```sql\nSELECT gender FROM gender_age WHERE age = ( SELECT MAX(age) FROM gender_age )\n```"}]}, {"id": "train-1140", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the age of the youngest female device user?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(age) FROM gender_age WHERE gender = 'F'\n```"}]}, {"id": "train-1141", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the users who use a vivo device, what is the age of the youngest user?"}, {"from": "gpt", "value": "```sql\nSELECT T1.age FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo' ORDER BY T1.age LIMIT 1\n```"}]}, {"id": "train-1142", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the app IDs of all the users in the Securities category."}, {"from": "gpt", "value": "```sql\nSELECT T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'Securities'\n```"}]}, {"id": "train-1144", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the devices with an event occurring in 2016, how many of them are owned by a user in the M23-26 user group?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.device_id WHERE STRFTIME('%Y', T2.timestamp) = '2016' AND T1.`group` = 'M23-26'\n```"}]}, {"id": "train-1145", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the brand of the device used by the most users in the M23-26 user group?"}, {"from": "gpt", "value": "```sql\nSELECT T.phone_brand FROM ( SELECT T2.phone_brand, COUNT(T1.device_id) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'M23-26' GROUP BY T2.phone_brand ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-1146", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the location coordinates of all the Galaxy Note 2 devices when an event happened."}, {"from": "gpt", "value": "```sql\nSELECT T1.longitude, T1.latitude FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 2'\n```"}]}, {"id": "train-1147", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the models of the devices used by a female user."}, {"from": "gpt", "value": "```sql\nSELECT T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T2.gender = 'F'\n```"}]}, {"id": "train-1149", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the app users who were not active when event no.2 happened, how many of them belong to the category Property Industry 1.0?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id INNER JOIN app_events AS T3 ON T2.app_id = T3.app_id WHERE T3.is_active = 0 AND T1.category = 'Property Industry 1.0' AND T3.event_id = 2\n```"}]}, {"id": "train-1150", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many categories in total do the app users who were not active when event no.2 happened belong to?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT COUNT(DISTINCT T1.category) AS result FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id INNER JOIN app_events AS T3 ON T2.app_id = T3.app_id WHERE T3.event_id = 2 AND T3.is_active = 0 GROUP BY T1.category ) T\n```"}]}, {"id": "train-1151", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the device model used by the most female users over 30?"}, {"from": "gpt", "value": "```sql\nSELECT T.device_model FROM ( SELECT T2.device_model, COUNT(T2.device_model) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age > 30 AND T1.gender = 'F' GROUP BY T2.device_model ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-1152", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the models of all the devices with an event under the location coordinates (121, 31)."}, {"from": "gpt", "value": "```sql\nSELECT T2.device_model FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.longitude = 121 AND T1.latitude = 31\n```"}]}, {"id": "train-1153", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 3 categories with the most app users?"}, {"from": "gpt", "value": "```sql\nSELECT T.category FROM ( SELECT T2.category, COUNT(T1.app_id) AS num FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id GROUP BY T2.category ) AS T ORDER BY T.num DESC LIMIT 3\n```"}]}, {"id": "train-1154", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the event IDs of the events that have happened on the device of the oldest user."}, {"from": "gpt", "value": "```sql\nSELECT T2.event_id FROM gender_age AS T1 INNER JOIN events AS T2 ON T1.device_id = T2.device_id ORDER BY T1.age DESC LIMIT 1\n```"}]}, {"id": "train-1155", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many events have happened on the device of the youngest female user?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.event_id) FROM events AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T2.gender = 'F' GROUP BY T1.event_id, T2.age ORDER BY T2.age LIMIT 1\n```"}]}, {"id": "train-1156", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the devices on which an event happened on 2016/5/1, how many of them are used by a male user?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM events AS T1 INNER JOIN gender_age AS T2 ON T1.device_id = T2.device_id WHERE T1.timestamp = '2016-05-01' AND T2.gender = 'M'\n```"}]}, {"id": "train-1157", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which category has more app users, Securities or Finance?"}, {"from": "gpt", "value": "```sql\nSELECT IIF(SUM(IIF(T2.category = 'Securities', 1, 0)) - SUM(IIF(T2.category = 'Finance', 1, 0)) > 0, 'Securities', 'Finance') AS diff FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id\n```"}]}, {"id": "train-1158", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the device models of all the devices used by a user in the M23-26 user group."}, {"from": "gpt", "value": "```sql\nSELECT T2.device_model FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'M23-26'\n```"}]}, {"id": "train-1159", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of the female users who uses a vivo device?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.age) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo' AND T1.gender = 'F'\n```"}]}, {"id": "train-1160", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of female users to male users who uses a vivo device?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.gender = 'M', 1, 0)) / SUM(IIF(T1.gender = 'F', 1, 0)) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo'\n```"}]}, {"id": "train-1161", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of the number of app users that belong to the Securities category to the number of app users that belong to the Finance category?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T2.category = 'Securities', 1, 0)) / SUM(IIF(T2.category = 'Finance', 1, 0)) AS per FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id\n```"}]}, {"id": "train-1162", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the label ID of \"Third-party card management\" category?"}, {"from": "gpt", "value": "```sql\nSELECT label_id FROM label_categories WHERE category = 'Third-party card management'\n```"}]}, {"id": "train-1163", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of active and inactive app users of the event ID \"58\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(is_active = 1, 1, 0)) / SUM(IIF(is_active = 0, 1, 0)) AS per FROM app_events WHERE event_id = 58\n```"}]}, {"id": "train-1164", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many events did the device ID \"3915082290673130000\" join?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(event_id) FROM events WHERE device_id = 3915082290673130000\n```"}]}, {"id": "train-1165", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of male users among all device users."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(gender = 'M', 1, 0)) / COUNT(device_id) AS per FROM gender_age\n```"}]}, {"id": "train-1166", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many events were participated by the users at longitude of \"-156\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(event_id) FROM events WHERE longitude = -156\n```"}]}, {"id": "train-1167", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many app users belong to label ID of \"48\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(app_id) FROM app_labels WHERE label_id = 48\n```"}]}, {"id": "train-1168", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many category names start with the word \"game\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(label_id) FROM label_categories WHERE category LIKE 'game%'\n```"}]}, {"id": "train-1169", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of events participated by the device users at coordinates of (80,37)."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(event_id) FROM events WHERE longitude = 80 AND latitude = 37\n```"}]}, {"id": "train-1171", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the app IDs under the category of game-Rowing ."}, {"from": "gpt", "value": "```sql\nSELECT T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'game-Rowing'\n```"}]}, {"id": "train-1172", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the label IDs and app IDs of the Chinese Classical Mythology category?"}, {"from": "gpt", "value": "```sql\nSELECT T1.label_id, T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'Chinese Classical Mythology'\n```"}]}, {"id": "train-1173", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the number of app IDs and location of the event ID \"79641\"."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.app_id), T2.longitude, T2.latitude FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE T1.event_id = 79641 GROUP BY T2.longitude, T2.latitude\n```"}]}, {"id": "train-1175", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many OPPO users participated in events which were held around 12 AM on 1st May,2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'OPPO' AND STRFTIME('%Y-%m-%d', T1.`timestamp`) = '2016-05-01'\n```"}]}, {"id": "train-1176", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of male and female users of vivo X5pro model?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.gender = 'M', 1, 0)) / SUM(IIF(T1.gender = 'F', 1, 0)) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo' AND T2.device_model = 'X5Pro'\n```"}]}, {"id": "train-1177", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many females use ZUK Z1 phones in the age group under 23?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' AND T2.device_model = 'Z1' AND T1.`group` = 'F23-' AND T2.phone_brand = 'ZUK'\n```"}]}, {"id": "train-1178", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the phone brands and models of the users under 10 years of age."}, {"from": "gpt", "value": "```sql\nSELECT T2.phone_brand, T2.device_model FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age < 10\n```"}]}, {"id": "train-1179", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the HTC users, calculate the percentage of female users who are over 80."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.gender = 'F' AND T1.age > 80, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'HTC'\n```"}]}, {"id": "train-1180", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which phone brand and model was used for event ID \"6701\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.phone_brand, T2.device_model FROM events AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.event_id = 6701\n```"}]}, {"id": "train-1182", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the time of the event id 12."}, {"from": "gpt", "value": "```sql\nSELECT timestamp FROM events WHERE event_id = 12\n```"}]}, {"id": "train-1183", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many active users are there in the event?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(app_id) FROM app_events WHERE is_active = 1\n```"}]}, {"id": "train-1184", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many devices belong to model \"A51\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE device_model = 'A51'\n```"}]}, {"id": "train-1186", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many labels belong to the game-card category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(label_id) FROM label_categories WHERE category = 'game-card'\n```"}]}, {"id": "train-1187", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the age group of users who use phone brand of vivo?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`group` FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo'\n```"}]}, {"id": "train-1188", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users who are under 30 years old use device model of Galaxy Note 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 2' AND T1.age < 30\n```"}]}, {"id": "train-1189", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users who use OPPO, calculate the percentage of those who are under 50 years old."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.age < 50, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'OPPO'\n```"}]}, {"id": "train-1190", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of the users who use model device of R7?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.age) / COUNT(T1.device_id) AS avg FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'R7'\n```"}]}, {"id": "train-1192", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the group of age of users who use phone brand of LG."}, {"from": "gpt", "value": "```sql\nSELECT T1.`group` FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'LG'\n```"}]}, {"id": "train-1194", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female users use device model of MI 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'F' AND T2.device_model = 'MI 3'\n```"}]}, {"id": "train-1195", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the male users, how many users use device model of Desire 820?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Desire 820' AND T1.gender = 'M'\n```"}]}, {"id": "train-1196", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users who are above 20, how many users use device model of ELIFE E7 Mini?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'ELIFE E7 Mini' AND T1.age > 20\n```"}]}, {"id": "train-1197", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of users who are under 50 and above 20 use device model of Galaxy Premier."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 50 AND T2.device_model = 'Galaxy Premier'\n```"}]}, {"id": "train-1198", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of male users who use phone branded HTC."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.gender = 'M' AND T2.phone_brand = 'HTC'\n```"}]}, {"id": "train-1199", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users who are between 20 and 60 use phone brand of TCL?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 60 AND T2.phone_brand = 'TCL'\n```"}]}, {"id": "train-1200", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users who use SUGAR, calculate the percentage of those who are above 20 years old."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.age > 20, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'SUGAR'\n```"}]}, {"id": "train-1201", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the location of all the events that occurred on April 30, 2016."}, {"from": "gpt", "value": "```sql\nSELECT longitude, latitude FROM events WHERE date(timestamp) = '2016-04-30'\n```"}]}, {"id": "train-1202", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different models does the HTC brand have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(device_model) FROM phone_brand_device_model2 WHERE phone_brand = 'HTC'\n```"}]}, {"id": "train-1203", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify all installed and activated apps by their id."}, {"from": "gpt", "value": "```sql\nSELECT app_id FROM app_events WHERE is_active = 1 AND is_installed = 1\n```"}]}, {"id": "train-1204", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many apps are labeled 7?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(app_id) FROM app_labels WHERE label_id = 7\n```"}]}, {"id": "train-1205", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify by their id all the devices that are used by women who are in the age range of 29 to 31 years."}, {"from": "gpt", "value": "```sql\nSELECT device_id FROM gender_age_train WHERE age BETWEEN 29 AND 31 AND gender = 'F'\n```"}]}, {"id": "train-1206", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify by their id all the apps that belong to the game-stress reliever category."}, {"from": "gpt", "value": "```sql\nSELECT T2.app_id FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'game-stress reliever'\n```"}]}, {"id": "train-1209", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many men under the age of 23 have apps installed but are not active on their devices?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T1.gender = 'M' AND T3.is_active = 0 AND T1.age < 23\n```"}]}, {"id": "train-1210", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many women have apps from the game-Finding fault category installed on their device?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T1.age < 23 AND T1.gender = 'F' AND T3.is_active = 0 AND T3.is_installed = 1\n```"}]}, {"id": "train-1212", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What age group is the most using SM-T2558 model phones?"}, {"from": "gpt", "value": "```sql\nSELECT T.`group` FROM ( SELECT T1.`group`, COUNT(T1.device_id) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'SM-T2558' GROUP BY T1.`group` ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-1213", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people over the age of 50 do not have HTC One M8 Eye phones?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age > 50 AND T2.device_model != 'One M8 Eye' AND T2.phone_brand != 'HTC'\n```"}]}, {"id": "train-1215", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of women do not have applications installed on their mobile with respect to men?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.gender = 'F', 1, 0)) / SUM(IIF(T1.gender = 'M', 1, 0)) AS per FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T3.is_installed = 0\n```"}]}, {"id": "train-1216", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average age of people who have apps installed but are not active on their devices."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.age) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id INNER JOIN app_events_relevant AS T3 ON T2.event_id = T3.event_id WHERE T3.is_installed = 1 AND T3.is_active = 0\n```"}]}, {"id": "train-1217", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three events that happened on the 1st of May 2016 that have the same latitude of 31."}, {"from": "gpt", "value": "```sql\nSELECT event_id FROM events WHERE timestamp LIKE '2016-05-01%' AND latitude = 31 LIMIT 3\n```"}]}, {"id": "train-1218", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three events that have the longitude and latitude of 0."}, {"from": "gpt", "value": "```sql\nSELECT event_id FROM events WHERE longitude = 0 AND latitude = 0 LIMIT 3\n```"}]}, {"id": "train-1219", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference between the events of device number -9222956879900150000 that can be located and those that are unable to be located?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(latitude != 0 AND longitude != 0, 1, 0)) - SUM(IIF(latitude = 0 AND longitude = 0, 1, 0)) AS diff FROM events WHERE device_id = '-922956879900150000'\n```"}]}, {"id": "train-1220", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three devices that are owned by female users."}, {"from": "gpt", "value": "```sql\nSELECT device_id FROM gender_age WHERE gender = 'F' LIMIT 3\n```"}]}, {"id": "train-1221", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any five app categories that are related to games, along with their label ID."}, {"from": "gpt", "value": "```sql\nSELECT category, label_id FROM label_categories WHERE category LIKE '%game%' LIMIT 5\n```"}]}, {"id": "train-1222", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three OPPO device models."}, {"from": "gpt", "value": "```sql\nSELECT device_model FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO' LIMIT 3\n```"}]}, {"id": "train-1223", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of users who experienced event number 6 who have the app installed but do not use the app?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(is_installed = 1 AND is_active = 0, 1, 0)) / COUNT(app_id) AS perrcent FROM app_events WHERE event_id = 6\n```"}]}, {"id": "train-1224", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which gender owned more of the Galaxy Note 2 device model?"}, {"from": "gpt", "value": "```sql\nSELECT IIF(SUM(IIF(T1.gender = 'M', 1, 0)) - SUM(IIF(T1.gender = 'F', 1, 0)) > 0, 'M', 'F') AS gender FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 2'\n```"}]}, {"id": "train-1225", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did event number 2 happen and how many users were active?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.app_id) AS num FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id WHERE T1.event_id = 2 AND T1.is_active = 1 GROUP BY T2.timestamp\n```"}]}, {"id": "train-1227", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users belong to the same behavior category as comics?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id WHERE T1.category = 'comics'\n```"}]}, {"id": "train-1229", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male users have the log of events at the same longitude of 114?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T2.longitude = 114 AND T1.gender = 'M'\n```"}]}, {"id": "train-1232", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the age group of any LG Nexus 4 device users."}, {"from": "gpt", "value": "```sql\nSELECT T1.`group` FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'LG' AND T2.device_model = 'Nexus 4'\n```"}]}, {"id": "train-1233", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the gender of at least one user who owns an HTC Desire 826 device."}, {"from": "gpt", "value": "```sql\nSELECT T1.gender FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Desire 826' AND T2.phone_brand = 'HTC'\n```"}]}, {"id": "train-1234", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of users who are in the same behavior category as \"Academic Information\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.category = 'Academic Information', 1.0, 0)) / COUNT(T2.app_id) AS per FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id\n```"}]}, {"id": "train-1235", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of device users in the F27-28 age group who experienced an event on the 3rd of May 2016?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.`group` = 'F27-28', 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE SUBSTR(T2.timestamp, 1, 10) = '2016-05-03'\n```"}]}, {"id": "train-1236", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many OPPO devices are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO'\n```"}]}, {"id": "train-1237", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common age group among all device users?"}, {"from": "gpt", "value": "```sql\nSELECT T.num FROM ( SELECT `group`, COUNT(`group`) AS num FROM gender_age GROUP BY `group` ) T\n```"}]}, {"id": "train-1238", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many events does the device \"4069764298338760000\" have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(event_id) FROM events WHERE device_id = 4069764298338760000\n```"}]}, {"id": "train-1239", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the apps belong in the \"Equity Fund\" category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T2.category = 'Equity Fund'\n```"}]}, {"id": "train-1241", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male users have a Galaxy Note 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 3' AND T1.gender = 'M'\n```"}]}, {"id": "train-1243", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which brand is most common among people in their twenties?"}, {"from": "gpt", "value": "```sql\nSELECT T.phone_brand FROM ( SELECT T2.phone_brand, COUNT(T2.phone_brand) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 30 GROUP BY T2.phone_brand ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-1244", "db_id": "talkingdata", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of vivo devices belong to users with no information?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.gender IS NULL AND T1.age IS NULL AND T1.`group` IS NULL, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo'\n```"}]}, {"id": "train-1245", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the keywords of the episode \"Refuge: Part 1\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Refuge: Part 1'\n```"}]}, {"id": "train-1246", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many keywords are there for season 9, episode 23 of law_and_order?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.season = 9 AND T1.episode = 23\n```"}]}, {"id": "train-1247", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the episode with the keyword \"laundering money\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = 'laundering money'\n```"}]}, {"id": "train-1248", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the keywords for the episodes with a rating of over 8."}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.rating > 8\n```"}]}, {"id": "train-1249", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 10-star votes were given to the episode titled \"Cherished\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.votes FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished' AND T2.stars = 10\n```"}]}, {"id": "train-1250", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many votes did the episode titled \"Cherished\" get in total?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished'\n```"}]}, {"id": "train-1251", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the episode that got the most 10-star votes?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 ORDER BY T2.votes DESC LIMIT 1\n```"}]}, {"id": "train-1252", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Park Dietz was credited in which role in the episode titled \"Cherished\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.role FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Cherished' AND T3.name = 'Park Dietz' AND T2.credited = 'true'\n```"}]}, {"id": "train-1253", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people had filled a role in the episode titled \"Cherished\", but did not show up in the on-screen credits?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished' AND T2.credited = 'false'\n```"}]}, {"id": "train-1254", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was credited as \"technical advisor\" in the episode titled \"Cherished\"?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Cherished' AND T2.credited = 'true' AND T2.role = 'technical advisor'\n```"}]}, {"id": "train-1255", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many times was Park Dietz credited?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'true' AND T3.name = 'Park Dietz'\n```"}]}, {"id": "train-1256", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the episodes in which Park Dietz was credited."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'true' AND T3.name = 'Park Dietz'\n```"}]}, {"id": "train-1257", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Was Anthony Azzara's role in episode tt0629204 displayed in the credits at the end of the episode?"}, {"from": "gpt", "value": "```sql\nSELECT T1.credited FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Anthony Azzara' AND T1.episode_id = 'tt0629204'\n```"}]}, {"id": "train-1258", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many keywords are there in the episode Disciple?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Disciple'\n```"}]}, {"id": "train-1259", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode got the most 1 star votes? Give its title."}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 1 ORDER BY T1.votes DESC LIMIT 1\n```"}]}, {"id": "train-1260", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many nominations did Law and Order season 9, episode 20 get?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.award_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.series = 'Law and Order' AND T1.season = 9 AND T1.episode = 20\n```"}]}, {"id": "train-1261", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For season 9, episode 17 of the show Law and Order, how many roles have been included in the credit?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.role) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.series = 'Law and Order' AND T1.season = 9 AND T1.episode = 17 AND T2.credited = 'true'\n```"}]}, {"id": "train-1262", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe what happened in the episode of award no.296."}, {"from": "gpt", "value": "```sql\nSELECT T1.summary FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.award_id = 296\n```"}]}, {"id": "train-1263", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which role did Joseph Blair play in the show?"}, {"from": "gpt", "value": "```sql\nSELECT T1.role FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Joseph Blair'\n```"}]}, {"id": "train-1264", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many awards has Rene Balcer been nominated for?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.award_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Rene Balcer'\n```"}]}, {"id": "train-1265", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the episode with the most votes, give its air date."}, {"from": "gpt", "value": "```sql\nSELECT T2.air_date FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id GROUP BY T2.episode_id ORDER BY SUM(T1.votes) DESC LIMIT 1\n```"}]}, {"id": "train-1266", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was nominated for award no.313? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award_id = 313\n```"}]}, {"id": "train-1267", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many episodes did J.K. Simmons' role appear on the show?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.role) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'J.K. Simmons'\n```"}]}, {"id": "train-1268", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Display the number of 9-star votes the episode Sideshow received."}, {"from": "gpt", "value": "```sql\nSELECT T2.votes FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 9 AND T1.title = 'Sideshow'\n```"}]}, {"id": "train-1269", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times is the number of keywords in \"Refuge: Part 1\" episode than \"Shield\" episode?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.title = 'Refuge: Part 1' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.title = 'Shield' THEN 1 ELSE 0 END) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id\n```"}]}, {"id": "train-1270", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of cast members that appeared in the credit from the 185th to the 193rd episode."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.episode_id) AS REAL) / (193 - 185 + 1) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Cast' AND T1.credited = 'true' AND T2.number_in_series BETWEEN 185 AND 193\n```"}]}, {"id": "train-1271", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the person that were not credited at the end of episode tt0629391?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.credited = 'false' AND T1.episode_id = 'tt0629391'\n```"}]}, {"id": "train-1272", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people have won at least 3 awards?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.result = 'Winner' GROUP BY T1.person_id HAVING COUNT(T2.award_id) >= 3\n```"}]}, {"id": "train-1273", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the script supervisor of the series in episode tt0629204?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.episode_id = 'tt0629204' AND T1.role = 'script supervisor'\n```"}]}, {"id": "train-1274", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many awards has Julia Roberts been nominated for?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.award_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Julia Roberts' AND T2.result = 'Nominee'\n```"}]}, {"id": "train-1275", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the tallest camera operator?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'camera operator' ORDER BY T2.height_meters DESC LIMIT 1\n```"}]}, {"id": "train-1276", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people, who were born in Canada, won an award in 1999?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.year = 1999 AND T1.birth_country = 'Canada'\n```"}]}, {"id": "train-1277", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people gave the most enjoyed episode a 10-star rating?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10\n```"}]}, {"id": "train-1278", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the keywords of the \"Shield\" episode?"}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Shield'\n```"}]}, {"id": "train-1279", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of people who gave the \"True North\" episode a 1-star rating?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.stars = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'True North' AND T1.episode_id = 'tt0629477'\n```"}]}, {"id": "train-1280", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the episode with the highest number of keywords?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.episode_id ORDER BY COUNT(T2.keyword) DESC LIMIT 1\n```"}]}, {"id": "train-1281", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the episodes that were aired in 1998, how many won an International Monitor Awards?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE strftime('%Y', T1.air_date) = '1998' AND T2.organization = 'International Monitor Awards' AND T2.result = 'Winner'\n```"}]}, {"id": "train-1282", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did the episode titled \"Agony\" win an award?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.award_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Agony' AND T2.result = 'Winner'\n```"}]}, {"id": "train-1283", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many episodes are there in the 9th season of Law and Order? Calculate the average number of casts per season of the said series."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.season = 9 THEN 1 ELSE 0 END) AS num , CAST(SUM(CASE WHEN T2.season = 9 THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.episode_id) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Cast' AND T2.series = 'Law and Order'\n```"}]}, {"id": "train-1284", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the keywords of the episode which received the 2nd-highest number of votes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.votes NOT IN ( SELECT MAX(T1.votes) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id ) ORDER BY T1.votes DESC LIMIT 1\n```"}]}, {"id": "train-1285", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many awards did the \"Agony\" win?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.award) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Agony' AND T2.result = 'Winner'\n```"}]}, {"id": "train-1286", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the narrator of the \"Flight\" episode?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Flight' AND T2.role = 'Narrator'\n```"}]}, {"id": "train-1287", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which organization did Constantine Makris win the most awards?"}, {"from": "gpt", "value": "```sql\nSELECT T2.organization FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Constantine Makris' AND T2.result = 'Winner' GROUP BY T2.organization ORDER BY COUNT(T2.award_id) DESC LIMIT 1\n```"}]}, {"id": "train-1288", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the stunt coordinator in episode 3?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.episode = 3 AND T2.role = 'stunt coordinator'\n```"}]}, {"id": "train-1289", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people were not credited at the end of the \"Admissions\" episode?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Admissions' AND T2.credited = 'false'\n```"}]}, {"id": "train-1290", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the episode that has the highest number of crews in the Art Department?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Art Department' GROUP BY T2.episode_id ORDER BY COUNT(T1.category) DESC LIMIT 1\n```"}]}, {"id": "train-1291", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many roles did Julia Roberts play in the series?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.role) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Julia Roberts'\n```"}]}, {"id": "train-1292", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the titles of the top 3 episodes that received no less than 30 votes in its 10-star rating?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.votes >= 30 AND T1.stars = 10 ORDER BY T1.votes DESC LIMIT 3\n```"}]}, {"id": "train-1293", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the youngest person to ever play a \"clerk\" role in the series?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'Clerk' AND T2.birthdate IS NOT NULL ORDER BY T2.birthdate LIMIT 1\n```"}]}, {"id": "train-1294", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people did not enjoy the finale episode?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 24 AND T2.stars = 1\n```"}]}, {"id": "train-1295", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of all the cast members in the series."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.category = 'Cast'\n```"}]}, {"id": "train-1296", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the person who appeared the most in the series? Calculate in percentage how many times he or she appeared."}, {"from": "gpt", "value": "```sql\nSELECT T2.person_id, CAST(COUNT(T2.person_id) AS REAL) * 100 / ( SELECT COUNT(T2.person_id) AS num FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id ) AS per FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id GROUP BY T2.person_id ORDER BY COUNT(T2.person_id) DESC LIMIT 1\n```"}]}, {"id": "train-1297", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episodes of the Law & Order have been nominated for the Primetime Emmy Awards?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT episode_id FROM Award WHERE award_category = 'Primetime Emmy'\n```"}]}, {"id": "train-1298", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many episodes have not won any Law & Order series awards?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(award_id) FROM Award WHERE Result = 'Nominee'\n```"}]}, {"id": "train-1299", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What roles have not been credited at the end of the episodes?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT role FROM Credit WHERE credited = 'false'\n```"}]}, {"id": "train-1300", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the 3 worst rated episodes?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM Episode ORDER BY rating LIMIT 3\n```"}]}, {"id": "train-1301", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full place of birth of Rene Chenevert Balcer?"}, {"from": "gpt", "value": "```sql\nSELECT birth_place, birth_region FROM Person WHERE birth_name = 'Rene Chenevert Balcer'\n```"}]}, {"id": "train-1302", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the actors born in the USA?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM Person WHERE birth_country = 'USA'\n```"}]}, {"id": "train-1303", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the episodes that were least enjoyed?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 1\n```"}]}, {"id": "train-1304", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the two people who won an award for their role as directors?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.Result = 'Winner' AND T2.role = 'director'\n```"}]}, {"id": "train-1305", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many votes did the episode titled Juvenile get?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Juvenile'\n```"}]}, {"id": "train-1306", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which episodes was Anthony Azzara not credited?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'false' AND T3.name = 'Anthony Azzara'\n```"}]}, {"id": "train-1307", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In what year did the episodes titled DWB get an award?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.year FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.title = 'DWB' AND T1.result = 'Winner'\n```"}]}, {"id": "train-1308", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which region were the assistant location managers born?"}, {"from": "gpt", "value": "```sql\nSELECT T2.birth_region FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'president of NBC West Coast'\n```"}]}, {"id": "train-1309", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stars did the episodes in which Donna Villella worked?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T3.name = 'Donna Villella'\n```"}]}, {"id": "train-1310", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What role was Julia Roberts nominated for?"}, {"from": "gpt", "value": "```sql\nSELECT T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.Result = 'Nominee' AND T1.name = 'Julia Roberts'\n```"}]}, {"id": "train-1311", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What role does the tallest person play?"}, {"from": "gpt", "value": "```sql\nSELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id INNER JOIN Award AS T3 ON T2.episode_id = T3.episode_id ORDER BY T1.height_meters DESC LIMIT 1\n```"}]}, {"id": "train-1312", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the episode with the most nominations?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.result = 'Nominee' GROUP BY T2.episode_id ORDER BY COUNT(T1.result) DESC LIMIT 1\n```"}]}, {"id": "train-1313", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the rating of the episodes that Jace Alexander worked on?"}, {"from": "gpt", "value": "```sql\nSELECT T1.rating FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T3.name = 'Jace Alexander'\n```"}]}, {"id": "train-1314", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of all the people who worked on episode 19 of season 9?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.episode = 19 AND T1.season = 9\n```"}]}, {"id": "train-1315", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average star rating of the episodes Jim Bracchitta has worked on?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T3.stars) AS REAL) / COUNT(T2.episode_id) FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id INNER JOIN Vote AS T3 ON T2.episode_id = T3.episode_id WHERE T3.stars = 1 AND T1.name = 'Jim Bracchitta'\n```"}]}, {"id": "train-1316", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of people have worked on the True North episode as additional crew?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.role = 'Additional Crew' THEN 1 ELSE 0 END) AS REAL ) * 100 / COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'True North'\n```"}]}, {"id": "train-1317", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the title, summary, and air date of the episode that garnered 72 10-star votes."}, {"from": "gpt", "value": "```sql\nSELECT T2.title, T2.summary, T2.air_date FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 10 AND T1.votes = 72\n```"}]}, {"id": "train-1318", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 6-star votes did episode 12 get? Please include the air date and rating."}, {"from": "gpt", "value": "```sql\nSELECT T2.air_date, T2.rating FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 6 AND T2.episode = 12\n```"}]}, {"id": "train-1319", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the winner of the Best Television Episode award for the Edgar category in 2000? Include his or her name and role."}, {"from": "gpt", "value": "```sql\nSELECT T1.name, T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.year = 2000 AND T2.award_category = 'Edgar' AND T2.award = 'Best Television Episode'\n```"}]}, {"id": "train-1320", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the organization, year, award, and award category in which Rene Balcer is the winner."}, {"from": "gpt", "value": "```sql\nSELECT T2.organization, T2.year, T2.award, T2.award_category FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Rene Balcer' AND T2.result = 'Winner'\n```"}]}, {"id": "train-1321", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give me the years and episode IDs in which Constantine Makris was the winner of the Television Silver Gavel Award at the American Bar Association Silver Gavel Awards for Media and the Arts for two consecutive years."}, {"from": "gpt", "value": "```sql\nSELECT t3.years, t3.episode_id FROM ( SELECT DISTINCT T2.year AS years, T2.episode_id, row_number() OVER (PARTITION BY T2.episode_id ORDER BY T2.year) AS rm FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award = 'Television' AND T2.award_category = 'Silver Gavel Award' AND T1.name = 'Constantine Makris' AND T2.result = 'Winner' AND T2.organization = 'American Bar Association Silver Gavel Awards for Media and the Arts' ) AS T3 GROUP BY t3.episode_id HAVING COUNT(t3.years - t3.rm) >= 2\n```"}]}, {"id": "train-1322", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the Law and Order series writer who also won the Television Silver Gavel Award at the American Bar Association Silver Gavel Awards for Media and the Arts for two consecutive years?"}, {"from": "gpt", "value": "```sql\nSELECT t3.name FROM ( SELECT DISTINCT T2.year AS years, T1.name, row_number() OVER (PARTITION BY T1.name ORDER BY T2.year) AS rm FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award = 'Television' AND T2.award_category = 'Silver Gavel Award' AND T2.series = 'Law and Order' AND T2.result = 'Winner' AND T2.organization = 'American Bar Association Silver Gavel Awards for Media and the Arts' ) AS T3 GROUP BY t3.name HAVING COUNT(t3.years - t3.rm) >= 2\n```"}]}, {"id": "train-1323", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times was episode 20 of the Law and Order series nominated for the Primetime Emmy Awards in 1999?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.award_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.year = 1999 AND T2.result = 'Nominee' AND T1.episode = 20 AND T2.organization = 'Primetime Emmy Awards' AND T1.series = 'Law and Order'\n```"}]}, {"id": "train-1324", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On what episode did Julia Roberts win the \"Outstanding Guest Actress in a Drama Series\" award during the 1999 Primetime Emmy Awards? Tell me her role."}, {"from": "gpt", "value": "```sql\nSELECT T3.episode_id, T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id INNER JOIN Episode AS T3 ON T2.episode_id = T3.episode_id WHERE T2.year = 1999 AND T2.award = 'Outstanding Guest Actress in a Drama Series' AND T2.organization = 'Primetime Emmy Awards' AND T1.name = 'Julia Roberts' AND T2.result = 'Nominee'\n```"}]}, {"id": "train-1325", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the titles and air dates of episodes that were produced by Billy Fox."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T1.air_date FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.category = 'Produced by' AND T2.role = 'producer' AND T3.name = 'Billy Fox'\n```"}]}, {"id": "train-1326", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the American casts, how many were uncredited on episode ID tt0629228?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.person_id) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.episode_id = 'tt0629228' AND T1.category = 'Cast' AND T1.credited = 'false' AND T2.birth_country = 'USA'\n```"}]}, {"id": "train-1327", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the role of Jason Kuschner in episode 9?"}, {"from": "gpt", "value": "```sql\nSELECT T1.role FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE T3.episode = 9 AND T2.name = 'Jason Kuschner'\n```"}]}, {"id": "train-1328", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who played the role of the \"president of NBC West Coast\" in the first episode?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE T3.episode = 1 AND T1.role = 'president of NBC West Coast'\n```"}]}, {"id": "train-1329", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the titles of the top 3 episodes, from highest to lowest, in terms of their weighted stars."}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars BETWEEN 1 AND 10 GROUP BY T2.title ORDER BY CAST(SUM(T1.stars * T1.percent) AS REAL) / 100 DESC LIMIT 3\n```"}]}, {"id": "train-1330", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of American casts on episode 2 of the series? Please include their roles."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.category = 'Cast' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.category), T1.role FROM Award AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Episode AS T3 ON T2.episode_id = T3.episode_id INNER JOIN Person AS T4 ON T2.person_id = T4.person_id WHERE T3.episode = 2 AND T4.birth_country = 'USA'\n```"}]}, {"id": "train-1331", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people from Canada are nominated for an award?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.birth_country = 'Canada'\n```"}]}, {"id": "train-1332", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many episodes are credited to Jerry Orbach?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Jerry Orbach'\n```"}]}, {"id": "train-1333", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out all the credit names for episode 9."}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.episode = 9\n```"}]}, {"id": "train-1334", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out all award titles nominated for episode 20."}, {"from": "gpt", "value": "```sql\nSELECT T2.award FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 20 AND T2.result IN ('Winner', 'Nominee')\n```"}]}, {"id": "train-1335", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which role have won at least two awards for the entire season and list out the name?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id GROUP BY T2.role HAVING COUNT(T2.award_id) > 1\n```"}]}, {"id": "train-1336", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out director names that received an award along with the episode number."}, {"from": "gpt", "value": "```sql\nSELECT T3.name, T1.episode_id FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T2.person_id = T3.person_id WHERE T2.role = 'director' AND T2.result = 'Winner'\n```"}]}, {"id": "train-1337", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episodes are nominated for an awards but not win?"}, {"from": "gpt", "value": "```sql\nSELECT T1.episode FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.result = 'Nominee'\n```"}]}, {"id": "train-1338", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating for each episode in season 9?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(rating) / COUNT(episode_id) FROM Episode WHERE season = 9\n```"}]}, {"id": "train-1339", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference of 10 stars votes between the first episode and the last episode?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.episode = 24 THEN T1.votes ELSE 0 END) - SUM(CASE WHEN T2.episode = 1 THEN T1.votes ELSE 0 END) FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 10\n```"}]}, {"id": "train-1340", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the episode rating with the most award won?"}, {"from": "gpt", "value": "```sql\nSELECT T1.rating FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.result = 'Winner' GROUP BY T1.episode_id ORDER BY COUNT(T2.award_id) DESC LIMIT 1\n```"}]}, {"id": "train-1341", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many credits have been displayed from episode 1 until 10?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.person_id) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.credited = 'true' AND T2.episode BETWEEN 1 AND 10\n```"}]}, {"id": "train-1342", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the episode that has mafia keyword?"}, {"from": "gpt", "value": "```sql\nSELECT T1.episode FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.Keyword = 'mafia'\n```"}]}, {"id": "train-1343", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average star with highest percentage for episodes that have received award?"}, {"from": "gpt", "value": "```sql\nSELECT T2.person_id FROM Vote AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id ORDER BY T1.percent DESC LIMIT 1\n```"}]}, {"id": "train-1344", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average ranking episodes that are nominated for an award?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.rating) / COUNT(T1.episode) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id\n```"}]}, {"id": "train-1345", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many winners have been awarded a Television award by the \"American Bar Association Silver Gavel Awards for Media and the Arts\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(award_id) FROM Award WHERE result = 'Winner' AND award = 'Television' AND organization = 'American Bar Association Silver Gavel Awards for Media and the Arts'\n```"}]}, {"id": "train-1346", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which continent was Michael Preston born on?"}, {"from": "gpt", "value": "```sql\nSELECT birth_country FROM Person WHERE name = 'Michael Preston'\n```"}]}, {"id": "train-1347", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the nominee playing the role of Katrina Ludlow in the Law & Order series?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.result = 'Nominee' AND T1.role = 'Katrina Ludlow' AND T1.series = 'Law and Order'\n```"}]}, {"id": "train-1348", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who played the role of a teleplay in the episode that won \"Best Television Episode\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.result = 'Winner' AND T1.award = 'Best Television Episode'\n```"}]}, {"id": "train-1349", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the date of birth of the actor who played the role of a \"writer\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.birthdate FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.role = 'writer'\n```"}]}, {"id": "train-1350", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode was nominated for the award for \"Outstanding Costume Design for a Series\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Outstanding Costume Design for a Series'\n```"}]}, {"id": "train-1351", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode has the highest total number of viewer votes?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.title ORDER BY SUM(T1.votes) DESC LIMIT 1\n```"}]}, {"id": "train-1352", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the actor who was portraying \"Alex Brown\" and has been credited?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id WHERE T2.role = 'Alex Brown' AND T2.credited = 'true'\n```"}]}, {"id": "train-1353", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where is the place of birth of the actor with the number nm0007064 who has not been credited for playing the role of a \"Narrator\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.birth_place FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id WHERE T1.person_id = 'nm0007064' AND T2.role = 'Narrator' AND T2.credited = 'false'\n```"}]}, {"id": "train-1354", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the keywords of the episode \"Shield\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Shield'\n```"}]}, {"id": "train-1355", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the actors with a height of over 1.80m in an episode that won an award?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.result = 'Winner' AND T2.height_meters > 1.80\n```"}]}, {"id": "train-1356", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode has the two keywords \"nun\" and \"priest\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword IN ('nun', 'priest')\n```"}]}, {"id": "train-1357", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode number has the second highest positive viewer comments and has been awarded \"Best Television Episode\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.episode_id FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Best Television Episode' AND T1.result = 'Winner' ORDER BY T2.rating DESC LIMIT 2\n```"}]}, {"id": "train-1358", "db_id": "law_episode", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three episodes that were most enjoyed by the viewers."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 LIMIT 3\n```"}]}, {"id": "train-1359", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: According to the observation on 2008/3/11, what was the height of Elly Koss?"}, {"from": "gpt", "value": "```sql\nSELECT T2.value, T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.date = '2008-03-11' AND T2.description = 'Body Height'\n```"}]}, {"id": "train-1360", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: By how much did Elly Koss's weight increase from the observation in 2008 to the observation in 2009?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN strftime('%Y', T2.date) = '2009' THEN T2.VALUE END) - SUM(CASE WHEN strftime('%Y', T2.date) = '2008' THEN T2.VALUE END) AS increase , T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Body Height'\n```"}]}, {"id": "train-1361", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: During all the observations of Elly Koss, what was the highest Systolic Blood Pressure observed?"}, {"from": "gpt", "value": "```sql\nSELECT T2.value, T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Systolic Blood Pressure' ORDER BY T2.VALUE DESC LIMIT 1\n```"}]}, {"id": "train-1362", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many times had Elly Koss have her Systolic Blood Pressure observed?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.description) FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Systolic Blood Pressure'\n```"}]}, {"id": "train-1363", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The highest Systolic Blood Pressure was observed in which patient? Please give his or her full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.last FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.VALUE = ( SELECT MAX(VALUE) FROM observations WHERE description = 'Systolic Blood Pressure' ) LIMIT 1\n```"}]}, {"id": "train-1364", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how long was Elly Koss required to take Acetaminophen?"}, {"from": "gpt", "value": "```sql\nSELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description LIKE 'Acetaminophen%'\n```"}]}, {"id": "train-1365", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the medication that are prescribed to Elly Koss."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.description FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss'\n```"}]}, {"id": "train-1366", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Why did Elly Koss need to take Acetaminophen?"}, {"from": "gpt", "value": "```sql\nSELECT T2.REASONDESCRIPTION FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description LIKE 'Acetaminophen%'\n```"}]}, {"id": "train-1367", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What medication did Elly Koss take when she had Streptococcal sore throat?"}, {"from": "gpt", "value": "```sql\nSELECT T2.description FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.reasondescription = 'Streptococcal sore throat (disorder)'\n```"}]}, {"id": "train-1368", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the full names of all the patients who had been prescribed with Acetaminophen."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.description LIKE 'Acetaminophen%'\n```"}]}, {"id": "train-1369", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the condition of Elly Koss on 2009/1/8?"}, {"from": "gpt", "value": "```sql\nSELECT T2.description FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.START = '2009-01-08'\n```"}]}, {"id": "train-1370", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how long did Elly Koss's cystitis last?"}, {"from": "gpt", "value": "```sql\nSELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Cystitis'\n```"}]}, {"id": "train-1371", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: According to all the observations of Elly Koss, what was her average weight?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.VALUE), T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Body Weight'\n```"}]}, {"id": "train-1372", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the patients who once had cystitis, what was the percentage of them being married?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.marital = 'M' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.description = 'Cystitis'\n```"}]}, {"id": "train-1373", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the body height status of Mr. Vincent Wyman on 2010/8/2."}, {"from": "gpt", "value": "```sql\nSELECT T2.description, T2.VALUE, T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mr.' AND T1.first = 'Vincent' AND T1.last = 'Wyman' AND T2.date = '2010-08-02' AND T2.description = 'Body Height'\n```"}]}, {"id": "train-1374", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many care plans has Mrs. Norman Berge taken?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.PATIENT) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Norman' AND T1.last = 'Berge'\n```"}]}, {"id": "train-1375", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Why did Mrs. Annabelle Pouros take leucovorin 100 mg injection on 1970/12/19? State the reason."}, {"from": "gpt", "value": "```sql\nSELECT T2.reasondescription FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Annabelle' AND T1.last = 'Pouros' AND T2.start = '1970-12-19' AND T2.description = 'Leucovorin 100 MG Injection'\n```"}]}, {"id": "train-1376", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the prevalence percentage of condition no. 64859006?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.\"PREVALENCE PERCENTAGE\" FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON lower(T1.ITEM) = lower(T2.DESCRIPTION) WHERE T2.code = '64859006'\n```"}]}, {"id": "train-1377", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the prevalence rate of condition no. 368581000119106."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.\"PREVALENCE RATE\" FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON lower(T1.ITEM) = lower(T2.DESCRIPTION) WHERE T2.code = '368581000119106'\n```"}]}, {"id": "train-1378", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the procedure description of Ms. Jacquelyn Shanahan on 2009/8/9."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.description FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Jacquelyn' AND T1.last = 'Shanahan' AND T2.DATE = '2009-08-09'\n```"}]}, {"id": "train-1379", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of claims did Ms. Abbie Cole have in the year of 2011."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.BILLABLEPERIOD) FROM patients AS T1 INNER JOIN claims AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Abbie' AND T1.last = 'Cole' AND T2.BILLABLEPERIOD BETWEEN '2010-12-31' AND '2012-01-01'\n```"}]}, {"id": "train-1380", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many allergies does Mrs. Saundra Monahan have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.code) FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Saundra' AND T1.last = 'Monahan'\n```"}]}, {"id": "train-1381", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of the patient who had a claim on 1947/9/11."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.last FROM patients AS T1 INNER JOIN claims AS T2 ON T1.patient = T2.PATIENT WHERE T2.billableperiod = '1947-09-11'\n```"}]}, {"id": "train-1382", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the encounter of Mr. Hubert Baumbach on 2008/10/25."}, {"from": "gpt", "value": "```sql\nSELECT T2.description FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mr.' AND T1.first = 'Hubert' AND T1.last = 'Baumbach' AND T2.date = '2008-10-25'\n```"}]}, {"id": "train-1383", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What kind of condition did Keven Kuhn have from 2016/9/24 to 2016/10/10? Describe the condition."}, {"from": "gpt", "value": "```sql\nSELECT T2.description FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Keven' AND T1.last = 'Kuhn' AND T2.start = '2016-09-24' AND T2.stop = '2016-10-10'\n```"}]}, {"id": "train-1384", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Mrs. Ira Deckow have the standard pregnancy test?"}, {"from": "gpt", "value": "```sql\nSELECT T2.date FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Ira' AND T1.last = 'Deckow' AND T2.description = 'Standard pregnancy test'\n```"}]}, {"id": "train-1385", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average period of Mr. Wesley Lemke's care plans."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(strftime('%J', T2.STOP) - strftime('%J', T2.START)) AS REAL) / COUNT(T1.patient) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mr.' AND T1.first = 'Wesley' AND T1.last = 'Lemke'\n```"}]}, {"id": "train-1386", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the average period of Ms. Angelena Kertzmann's several normal pregnancies."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(strftime('%J', T2.STOP) - strftime('%J', T2.START)) AS REAL) / COUNT(T2.PATIENT) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Angelena' AND T1.last = 'Kertzmann' AND T2.description = 'Normal pregnancy'\n```"}]}, {"id": "train-1387", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the id of the patient who has the longest allergy period?"}, {"from": "gpt", "value": "```sql\nSELECT PATIENT FROM allergies WHERE STOP IS NOT NULL GROUP BY PATIENT ORDER BY CASE WHEN SUBSTR(STOP, -2, 1) != '9' THEN SUBSTR(STOP, LENGTH(STOP) - 1) + 2000 END - CASE WHEN SUBSTR(START, -2, 1) = '9' THEN SUBSTR(START, LENGTH(START) - 1) + 1900 ELSE SUBSTR(START, LENGTH(START) - 1) + 2000 END LIMIT 1\n```"}]}, {"id": "train-1388", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients have diabetes that started in 1988?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(PATIENT) FROM conditions WHERE DESCRIPTION = 'Diabetes' AND strftime('%Y', START) = '1988'\n```"}]}, {"id": "train-1389", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients are allergic to eggs?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(PATIENT) FROM allergies WHERE DESCRIPTION = 'Allergy to eggs'\n```"}]}, {"id": "train-1390", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the id of the patient whose hypertension started most recently?"}, {"from": "gpt", "value": "```sql\nSELECT PATIENT FROM conditions WHERE START = ( SELECT MAX(START) FROM conditions WHERE DESCRIPTION = 'Hypertension' )\n```"}]}, {"id": "train-1391", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common allergy among patients?"}, {"from": "gpt", "value": "```sql\nSELECT DESCRIPTION FROM allergies GROUP BY DESCRIPTION ORDER BY COUNT(DESCRIPTION) DESC LIMIT 1\n```"}]}, {"id": "train-1392", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is/are the ids of the tallest patient/s?"}, {"from": "gpt", "value": "```sql\nSELECT PATIENT FROM observations WHERE DESCRIPTION = 'Body Height' AND UNITS = 'cm' ORDER BY VALUE DESC LIMIT 1\n```"}]}, {"id": "train-1393", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common condition among the female Americans?"}, {"from": "gpt", "value": "```sql\nSELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.gender = 'F' AND T1.ethnicity = 'american' GROUP BY T2.DESCRIPTION ORDER BY COUNT(T2.DESCRIPTION) DESC LIMIT 1\n```"}]}, {"id": "train-1394", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the patients that started taking Ibuprofen 200mg Oral Tablet in 2016, how many Dominican patients stopped taking the medicine after exactly one month?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Ibuprofen 200 MG Oral Tablet' AND T1.ethnicity = 'dominican' AND strftime('%Y', T2.START) = '2016' AND strftime('%m', T2.STOP) - strftime('%m', T2.START) = 1\n```"}]}, {"id": "train-1395", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the patients born in 1920s had pneumonia?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE DESCRIPTION = 'Pneumonia' AND strftime('%Y', T1.birthdate) LIKE '192%'\n```"}]}, {"id": "train-1396", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the full names of the patients who started taking Yaz 28 Day Pack in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first, T1.last, T1.suffix FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Yaz 28 Day Pack' AND strftime('%Y', T2.START) = '2011'\n```"}]}, {"id": "train-1397", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Black patients were immunized with DTaP in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T1.race = 'black' AND T2.DESCRIPTION = 'DTaP' AND strftime('%Y', T2.DATE) = '2013'\n```"}]}, {"id": "train-1398", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many immunizations did the patient with the most prevalent condition that started recently get?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.patient) FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON lower(T1.ITEM) = lower(T2.DESCRIPTION) INNER JOIN immunizations AS T3 ON T2.PATIENT = T3.PATIENT GROUP BY T2.PATIENT ORDER BY T2.START DESC, T1.\"PREVALENCE RATE\" DESC LIMIT 1\n```"}]}, {"id": "train-1399", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients have the most prevalent conditions?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.patient) FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON lower(T1.ITEM) = lower(T2.DESCRIPTION) ORDER BY T1.\"PREVALENCE RATE\" DESC LIMIT 1\n```"}]}, {"id": "train-1400", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common condition among the patients who received influenza seasonal injectable preservative free immunization?"}, {"from": "gpt", "value": "```sql\nSELECT T2.DESCRIPTION FROM immunizations AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.DESCRIPTION = 'Influenza seasonal injectable preservative free' GROUP BY T2.DESCRIPTION ORDER BY COUNT(T2.DESCRIPTION) DESC LIMIT 1\n```"}]}, {"id": "train-1401", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ids of all the patients with condition that has a prevalence percentage of 18.8%."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.PATIENT FROM conditions AS T1 INNER JOIN all_prevalences AS T2 ON lower(T2.ITEM) = lower(T1.DESCRIPTION) WHERE T2.\"PREVALENCE PERCENTAGE\" = CAST(18.8 AS float)\n```"}]}, {"id": "train-1402", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many conditions did Tyree Eichmann have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.DESCRIPTION) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Tyree' AND T1.last = 'Eichmann'\n```"}]}, {"id": "train-1403", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the patients who were immunized with meningococcal MCV4P, how many have viral sinusitis disorder after getting the immunization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM immunizations AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.DESCRIPTION = 'meningococcal MCV4P' AND T2.DESCRIPTION = 'Viral sinusitis (disorder)'\n```"}]}, {"id": "train-1404", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the patients with prediabetes, how many are female?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.patient) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.gender = 'F' AND T1.DESCRIPTION = 'Prediabetes'\n```"}]}, {"id": "train-1405", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the patient's full name with the lowest body mass index in kg/m2."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.last FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Body Mass Index' AND T2.UNITS = 'kg/m2' ORDER BY T2.VALUE LIMIT 1\n```"}]}, {"id": "train-1406", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the age of the patient with hypertension named Giovanni Russel?"}, {"from": "gpt", "value": "```sql\nSELECT strftime('%Y', T2.deathdate) - strftime('%Y', T2.birthdate) AS age FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.first = 'Giovanni' AND T2.last = 'Russel' AND T1.DESCRIPTION = 'Hypertension'\n```"}]}, {"id": "train-1407", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Asian female patients take oxaliplatin 5 MG/ML [Eloxatin]?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.patient) FROM medications AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'oxaliplatin 5 MG/ML [Eloxatin]' AND T2.race = 'asian' AND T2.gender = 'F'\n```"}]}, {"id": "train-1408", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count all of the living patients that had a stroke."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.patient) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.description = 'Stroke' AND T2.deathdate IS NULL\n```"}]}, {"id": "train-1409", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of Asian patients who are allergic to peanuts?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.patient) FROM allergies AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Allergy to peanuts' AND T2.race = 'asian'\n```"}]}, {"id": "train-1410", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the patients with hypertension, what is the average of their diastolic blood pressure?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.VALUE) FROM observations AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient INNER JOIN conditions AS T3 ON T2.patient = T3.PATIENT WHERE T3.DESCRIPTION = 'Hypertension' AND T1.DESCRIPTION = 'Diastolic Blood Pressure'\n```"}]}, {"id": "train-1411", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the medicine prescribed for the patient with social security number 999-94-3751?"}, {"from": "gpt", "value": "```sql\nSELECT T1.DESCRIPTION FROM medications AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.ssn = '999-94-3751'\n```"}]}, {"id": "train-1412", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the social security number of the female Irish patient allergic to grass pollen."}, {"from": "gpt", "value": "```sql\nSELECT T2.ssn FROM allergies AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Allergy to grass pollen' AND T2.ethnicity = 'irish' AND T2.gender = 'F'\n```"}]}, {"id": "train-1413", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the patient involved in the care plan with code 311791003?"}, {"from": "gpt", "value": "```sql\nSELECT T2.first, T2.last FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.CODE = 315043002\n```"}]}, {"id": "train-1414", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the patients that died, what is the condition of the oldest patient?"}, {"from": "gpt", "value": "```sql\nSELECT T1.DESCRIPTION FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.deathdate IS NOT NULL ORDER BY strftime('%Y', T2.deathdate) - strftime('%Y', T2.birthdate) DESC LIMIT 1\n```"}]}, {"id": "train-1415", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the code of the prevalent disease with the highest occurrences?"}, {"from": "gpt", "value": "```sql\nSELECT T2.code FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON T1.ITEM = T2.DESCRIPTION ORDER BY T1.OCCURRENCES DESC LIMIT 1\n```"}]}, {"id": "train-1416", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the glucose level of the patient that lives at 365 Della Crossroad Suite 202, Deerfield, MA 01342 US?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.DESCRIPTION, T2.VALUE, T2.UNITS FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Glucose' AND T1.address = '365 Della Crossroad Suite 202 Deerfield MA 01342 US'\n```"}]}, {"id": "train-1418", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the patients with acute bronchitis, what is the percentage of Asian women?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.gender = 'F' AND T2.race = 'asian' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.gender) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Acute bronchitis (disorder)'\n```"}]}, {"id": "train-1419", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of encounters for Major D'Amore."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ID) FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Major' AND T1.last = 'D''Amore'\n```"}]}, {"id": "train-1420", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the procedures received by Emmy Waelchi."}, {"from": "gpt", "value": "```sql\nSELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Emmy' AND T1.last = 'Waelchi'\n```"}]}, {"id": "train-1421", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the patients' full names who received the extraction of wisdom tooth."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.last FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Extraction of wisdom tooth'\n```"}]}, {"id": "train-1422", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the body weight of Elly Koss in every observation."}, {"from": "gpt", "value": "```sql\nSELECT T2.DESCRIPTION, T2.VALUE, T2.UNITS FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.DESCRIPTION = 'Body Weight'\n```"}]}, {"id": "train-1423", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the patients who had an allergy to soy."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.last FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Allergy to soya'\n```"}]}, {"id": "train-1424", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did Keven Kuhn receive DTaP immunization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.CODE) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Keven' AND T1.last = 'Kuhn' AND T2.DESCRIPTION = 'DTaP'\n```"}]}, {"id": "train-1425", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who had to take Clopidogrel 75 MG Oral Tablet for over 10 years?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.last FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Clopidogrel 75 MG Oral Tablet' AND strftime('%Y', T2.STOP) - strftime('%Y', T2.START) > 10\n```"}]}, {"id": "train-1426", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which procedures and medications were received by the patient with the third-degree burn?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.DESCRIPTION, T3.DESCRIPTION FROM procedures AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT INNER JOIN medications AS T3 ON T2.patient = T3.PATIENT WHERE T2.DESCRIPTION = 'Third degree burn'\n```"}]}, {"id": "train-1427", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide medications received by patients with an allergy to mould on 6th June 2016."}, {"from": "gpt", "value": "```sql\nSELECT T2.DESCRIPTION FROM allergies AS T1 INNER JOIN medications AS T2 ON T1.PATIENT = T2.PATIENT WHERE T1.START = '6/6/16' AND T1.DESCRIPTION = 'Allergy to mould'\n```"}]}, {"id": "train-1428", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the care plans received by the patient with secondary malignant neoplasm of the colon."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.DESCRIPTION FROM careplans AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Secondary malignant neoplasm of colon'\n```"}]}, {"id": "train-1429", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the prevalence rate of the patients' diseases started on 9th May 2014?"}, {"from": "gpt", "value": "```sql\nSELECT T2.\"PREVALENCE RATE\" FROM conditions AS T1 INNER JOIN all_prevalences AS T2 ON lower(T1.DESCRIPTION) = lower(T2.ITEM) WHERE T1.START = '2014-05-09'\n```"}]}, {"id": "train-1430", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among observations in 2011, provide the names and ages of patients whose Systolic Blood Pressures are 200mmHg."}, {"from": "gpt", "value": "```sql\nSELECT T2.first, T2.last , CASE WHEN T2.deathdate IS NULL THEN strftime('%Y', T1.DATE) - strftime('%Y', T2.birthdate) ELSE strftime('%Y', T2.deathdate) - strftime('%Y', T2.birthdate) END AS age FROM observations AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Systolic Blood Pressure' AND T1.VALUE = 200 AND T1.UNITS = 'mmHg' AND strftime('%Y', T1.DATE) = '2011'\n```"}]}, {"id": "train-1431", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the immunizations in 2017, calculate the percentage of patients who received the Influenza seasonal injectable preservative free. Among them, how many patients are English?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.DESCRIPTION = 'Influenza seasonal injectable preservative free' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.patient), SUM(CASE WHEN T1.ethnicity = 'english' THEN 1 ELSE 0 END) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE strftime('%Y', T2.DATE) = '2017'\n```"}]}, {"id": "train-1432", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the first name of patients who encountered normal pregnancy."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T2.REASONDESCRIPTION = 'Normal pregnancy'\n```"}]}, {"id": "train-1433", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the birth date of patients who took outpatient encounter care plan?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.birthdate FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Outpatient Encounter'\n```"}]}, {"id": "train-1434", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the first name of patients who have cystitis condition."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Cystitis'\n```"}]}, {"id": "train-1435", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stroke patients have married?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Stroke' AND T1.marital = 'M'\n```"}]}, {"id": "train-1436", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the address of patients who have billable period in 2010."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.address FROM patients AS T1 INNER JOIN claims AS T2 ON T1.patient = T2.PATIENT WHERE T2.BILLABLEPERIOD LIKE '2010%'\n```"}]}, {"id": "train-1437", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the last name of patients who are allergic to dairy products."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.last FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Allergy to dairy product'\n```"}]}, {"id": "train-1438", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When the allergy starts for Angelo Buckridge."}, {"from": "gpt", "value": "```sql\nSELECT T2.START FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Adolfo' AND T1.last = 'Schmitt' AND T2.STOP IS NOT NULL\n```"}]}, {"id": "train-1439", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the male patients are allergic to house dust mites?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'House dust mite allergy' AND T1.gender = 'M'\n```"}]}, {"id": "train-1440", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What kind of allergy is most common among white people?"}, {"from": "gpt", "value": "```sql\nSELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.race = 'white' GROUP BY T2.DESCRIPTION ORDER BY COUNT(T2.DESCRIPTION) DESC LIMIT 1\n```"}]}, {"id": "train-1441", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the first name of patients who received \"Influenza seasonal injectable preservative free\" immunization."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Influenza seasonal injectable preservative free'\n```"}]}, {"id": "train-1442", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the number of female patients who accepted \"HPV quadrivalent\" immunization."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'HPV quadrivalent' AND T1.gender = 'F'\n```"}]}, {"id": "train-1443", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the encounter descriptions of patients who were born in Pittsfield MA US."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.DESCRIPTION FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.birthplace = 'Pittsfield MA US'\n```"}]}, {"id": "train-1444", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total type of allergies for German people."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.DESCRIPTION) FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.ethnicity = 'german'\n```"}]}, {"id": "train-1445", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average age of patients with prediabetes care plan."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.deathdate IS NULL THEN strftime('%Y', T2.STOP) - strftime('%Y', T1.birthdate) ELSE strftime('%Y', T1.deathdate) - strftime('%Y', T1.birthdate) END) AS REAL) / COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T2.REASONDESCRIPTION = 'Prediabetes'\n```"}]}, {"id": "train-1446", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the patients who have stopped taking medication for 'coronary heart disease' are still alive?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.patient) FROM medications AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.REASONDESCRIPTION = 'Coronary Heart Disease' AND T1.STOP IS NOT NULL AND T2.deathdate IS NULL\n```"}]}, {"id": "train-1447", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the patients who underwent a 'bone immobilization' procedure have a driver's license?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Bone immobilization' AND T1.drivers IS NOT NULL\n```"}]}, {"id": "train-1448", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the full name of the patients who have 3 different allergies."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.last FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT GROUP BY T1.patient ORDER BY COUNT(DISTINCT T2.DESCRIPTION) > 3\n```"}]}, {"id": "train-1449", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients with 'allergy to eggs' have been immunized with 'Td (adult) preservative free'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.patient) FROM allergies AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient INNER JOIN immunizations AS T3 ON T2.patient = T3.PATIENT WHERE T1.DESCRIPTION = 'Allergy to eggs' AND T3.DESCRIPTION = 'Td (adult) preservative free'\n```"}]}, {"id": "train-1450", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients with a body weight of more than 100 kg have a 'diabetes self-management plan' care plan?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.patient) FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient INNER JOIN observations AS T3 ON T2.patient = T3.PATIENT WHERE T3.DESCRIPTION = 'Body Weight' AND T1.DESCRIPTION = 'Diabetes self management plan' AND T3.VALUE > 100 AND T3.UNITS = 'kg'\n```"}]}, {"id": "train-1451", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What gender is more prone to 'dander (animal) allergy'?"}, {"from": "gpt", "value": "```sql\nSELECT T1.gender FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Dander (animal) allergy' GROUP BY T1.gender ORDER BY COUNT(T1.gender) DESC LIMIT 1\n```"}]}, {"id": "train-1452", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On what dates did the billable period begin for patients with the last name Dickinson?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.BILLABLEPERIOD FROM patients AS T1 INNER JOIN claims AS T2 ON T1.patient = T2.PATIENT WHERE T1.last = 'Dickinson'\n```"}]}, {"id": "train-1453", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name of all patients with 'otitis media'."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Otitis media'\n```"}]}, {"id": "train-1454", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients of Irish ethnicity take medication for 'myocardial infarction'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.REASONDESCRIPTION = 'Myocardial Infarction' AND T1.ethnicity = 'irish'\n```"}]}, {"id": "train-1455", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients with care plan for 'concussion with loss of consciousness' are married?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.marital = 'M' AND T2.REASONDESCRIPTION = 'Concussion with loss of consciousness'\n```"}]}, {"id": "train-1456", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients immunized against 'monovalent rotavirus' ceased their care plan on 11/23/2013?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM careplans AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'rotavirus monovalent' AND T1.STOP = '2013-11-23'\n```"}]}, {"id": "train-1457", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many women need to take 'Nitroglycerin 0.4 MG/ACTUAT [Nitrolingual]'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Nitroglycerin 0.4 MG/ACTUAT [Nitrolingual]' AND T1.gender = 'F'\n```"}]}, {"id": "train-1458", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of patients born in 'Pembroke MA US' have 'allergy to grass pollen'?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.DESCRIPTION = 'Allergy to grass pollen' THEN 1 ELSE 0 END) AS REL) * 100 / COUNT(T1.patient) FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.birthplace = 'Pembroke MA US'\n```"}]}, {"id": "train-1459", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average body weight of Asian patients?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.VALUE) / COUNT(T1.patient) FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.race = 'asian' AND T2.DESCRIPTION = 'Body Weight' AND T2.UNITS = 'kg'\n```"}]}, {"id": "train-1460", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the Social Security numbers of patients who have latex allergies."}, {"from": "gpt", "value": "```sql\nSELECT T1.ssn FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Latex allergy'\n```"}]}, {"id": "train-1461", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long did Isadora Moen's allergy last? Tell me what kind of allergy she has."}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN SUBSTR(T1.STOP, -2, 1) != '9' THEN SUBSTR(T1.STOP, LENGTH(T1.STOP) - 1) + 2000 END - CASE WHEN SUBSTR(T1.START, -2, 1) = '9' THEN SUBSTR(T1.START, LENGTH(T1.START) - 1) + 1900 ELSE SUBSTR(T1.START, LENGTH(T1.START) - 1) + 2000 END AS years , T1.DESCRIPTION FROM allergies AS T1 INNER JOIN patients AS T2 ON T2.patient = T1.PATIENT WHERE T1.STOP IS NOT NULL AND T1.START IS NOT NULL AND T2.first = 'Isadora' AND T2.last = 'Moen'\n```"}]}, {"id": "train-1462", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times was Elly Koss given a care plan between 1/11/2009 and 10/23/2010?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.PATIENT) FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.START BETWEEN '2009-01-11' AND '2010-10-23'\n```"}]}, {"id": "train-1463", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2009, who among the married patients had undergone a care plan for more than 60 days?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.marital = 'M' AND strftime('%J', T2.STOP) - strftime('%J', T2.START) > 60\n```"}]}, {"id": "train-1464", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the dates on which Elly Koss was immunized with the influenza seasonal injectable preservative-free vaccine."}, {"from": "gpt", "value": "```sql\nSELECT T2.DATE FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Influenza seasonal injectable preservative free' AND T1.first = 'Elly' AND T1.last = 'Koss'\n```"}]}, {"id": "train-1465", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 7/9/2010 to 10/29/2013, how many black patients were immunized with the meningococcal MCV4P vaccine?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'meningococcal MCV4P' AND T2.DATE BETWEEN '2010-07-09' AND '2013-10-29' AND T1.race = 'black'\n```"}]}, {"id": "train-1466", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give me the immunization codes and dates on which Ms. Jacquelyn Shanahan was immunized with influenza seasonal injectable preservative-free vaccine."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.CODE, T2.DATE FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Jacquelyn' AND T1.last = 'Shanahan' AND T2.DESCRIPTION = 'Influenza seasonal injectable preservative free'\n```"}]}, {"id": "train-1467", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long did Berry Keebler take the Acetaminophen 160 MG when he was admitted due to acute bronchitis?"}, {"from": "gpt", "value": "```sql\nSELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS takenDays FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Berry' AND T1.last = 'Keebler' AND T2.REASONDESCRIPTION = 'Acute bronchitis (disorder)' AND T2.DESCRIPTION = 'Acetaminophen 160 MG'\n```"}]}, {"id": "train-1468", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2010, how many single patients took Nitrofurantoin 5 mg/ML [Furadantin] to cure cystitis?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.marital = 'S' AND T2.REASONDESCRIPTION = 'Cystitis' AND T2.DESCRIPTION = 'Nitrofurantoin 5 MG/ML [Furadantin]' AND strftime('%Y', T2.START) = '2010'\n```"}]}, {"id": "train-1469", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell me the reason for Lavelle Vandervort's encounter on 11/20/2013?"}, {"from": "gpt", "value": "```sql\nSELECT T2.REASONDESCRIPTION FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T2.DATE = '2013-11-20' AND T1.first = 'Lavelle' AND T1.last = 'Vandervort'\n```"}]}, {"id": "train-1470", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1/9/2011 to 8/29/2012, how many German patients have their outpatient encounters?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.ethnicity = 'german' AND T2.DATE BETWEEN '2011-01-09' AND '2012-08-29' AND T2.DESCRIPTION = 'Outpatient Encounter'\n```"}]}, {"id": "train-1471", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the social security number and address of the patient who encountered viral sinusitis symptoms on 6/13/2008?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ssn, T1.address FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T2.DATE = '2008-06-13' AND T2.REASONDESCRIPTION = 'Viral sinusitis (disorder)' AND T2.DESCRIPTION = 'Encounter for symptom'\n```"}]}, {"id": "train-1472", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give me the reason, name of the drug, and duration of medication under encounter ID 23c293ec-dbae-4a22-896e-f12cf3c8bac3. Tell me if the patient is still alive."}, {"from": "gpt", "value": "```sql\nSELECT T2.REASONDESCRIPTION, T2.DESCRIPTION , strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days , CASE WHEN T1.deathdate IS NULL THEN 'alive' ELSE 'dead' END FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.ENCOUNTER = '23c293ec-dbae-4a22-896e-f12cf3c8bac3'\n```"}]}, {"id": "train-1473", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients with shellfish allergies died when they were under 12 years old? Please give their full names."}, {"from": "gpt", "value": "```sql\nSELECT T1.first, T1.last FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Shellfish allergy' AND CAST((strftime('%J', T1.deathdate) - strftime('%J', T1.birthdate)) AS REAL) / 365 < 12\n```"}]}, {"id": "train-1474", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long was Mr. Major D'Amore prescribed with Amoxicillin 250 MG / Clavulanate 125 MG [Augmentin]?"}, {"from": "gpt", "value": "```sql\nSELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = ' Amoxicillin 250 MG / Clavulanate 125 MG [Augmentin]' AND T1.first = 'Major' AND T1.last = 'D''Amore'\n```"}]}, {"id": "train-1475", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many types of medication have been prescribed to Mr. Major D'Amore since his visit to the hospital?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.DESCRIPTION) FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Major' AND T1.last = 'D''Amore'\n```"}]}, {"id": "train-1476", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out all the observation information collected for the patient named Bella Rolfson."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.DESCRIPTION, T2.VALUE, T2.UNITS FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Bella' AND T1.last = 'Rolfson'\n```"}]}, {"id": "train-1477", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out patient names with calcium deficiency."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Calcium' AND T2.VALUE < 8.6\n```"}]}, {"id": "train-1478", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out 5 most common conditions for underweight patient."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.DESCRIPTION, T2.VALUE, T2.UNITS FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Body Mass Index' GROUP BY T2.VALUE ORDER BY COUNT(T2.VALUE) LIMIT 5\n```"}]}, {"id": "train-1479", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many mothers have taken immunization during prenatal visit?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.PATIENT) FROM encounters AS T1 INNER JOIN immunizations AS T2 ON T1.PATIENT = T2.PATIENT WHERE T1.REASONDESCRIPTION = 'Normal pregnancy' AND T1.DATE = T2.DATE\n```"}]}, {"id": "train-1480", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What care plans have been received by Mrs. Elly Koss during year 1970?"}, {"from": "gpt", "value": "```sql\nSELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND strftime('%Y', T2.START) = '2013'\n```"}]}, {"id": "train-1481", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the care plan, procedure, medication and the patient's full name for encounter 6f2e3935-b203-493e-a9c0-f23e847b9798?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.DESCRIPTION, T4.DESCRIPTION, T5.DESCRIPTION, T1.first, T1.last FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT INNER JOIN careplans AS T3 ON T1.patient = T3.PATIENT INNER JOIN procedures AS T4 ON T1.patient = T4.PATIENT INNER JOIN medications AS T5 ON T1.patient = T5.PATIENT WHERE T2.ID = '6f2e3935-b203-493e-a9c0-f23e847b9798'\n```"}]}, {"id": "train-1482", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male patients are diagnosed with hypertension as compared to female patients?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT CASE WHEN T2.gender = 'M' THEN T2.patient END) AS Male , COUNT(DISTINCT CASE WHEN T2.gender = 'F' THEN T2.patient END) AS Female FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Hypertension'\n```"}]}, {"id": "train-1483", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unmarried women were checked for normal pregnancy?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.patient) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Normal pregnancy' AND T2.gender = 'F' AND T2.marital = 'S'\n```"}]}, {"id": "train-1484", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the procedure and medicine prescribed for drug overdose patients."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.DESCRIPTION, T3.DESCRIPTION FROM encounters AS T1 INNER JOIN procedures AS T2 ON T1.PATIENT = T2.PATIENT INNER JOIN medications AS T3 ON T1.PATIENT = T3.PATIENT WHERE T1.REASONDESCRIPTION = 'Drug overdose'\n```"}]}, {"id": "train-1485", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average body mass index for patients with higher total cholesterol?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.VALUE) / COUNT(T1.PATIENT) FROM observations AS T1 INNER JOIN ( SELECT DISTINCT PATIENT FROM observations WHERE DESCRIPTION = 'Total Cholesterol' AND VALUE > 200 ) AS T2 ON T1.PATIENT = T2.PATIENT WHERE T1.DESCRIPTION = 'Body Mass Index'\n```"}]}, {"id": "train-1486", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference between average glucose reading for patients in the 20s and 50s?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 20 AND 30 THEN T2.VALUE ELSE 0 END) / COUNT(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 20 AND 30 THEN T2.PATIENT END) - SUM(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 50 AND 60 THEN T2.VALUE ELSE 0 END) / COUNT(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 50 AND 60 THEN T2.PATIENT END) AS difference FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Glucose'\n```"}]}, {"id": "train-1487", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the most common conditions for patients age 60 and above?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T5.DESCRIPTION = T3.DESCRIPTION THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.patient) FROM ( SELECT T2.DESCRIPTION, T1.patient FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE ROUND((strftime('%J', T2.START) - strftime('%J', T1.birthdate)) / 365) > 60 GROUP BY T2.DESCRIPTION ORDER BY COUNT(T2.DESCRIPTION) DESC LIMIT 1 ) AS T3 INNER JOIN patients AS T4 ON T3.patient = T4.patient INNER JOIN conditions AS T5 ON T4.patient = T5.PATIENT WHERE ROUND((strftime('%J', T5.START) - strftime('%J', T4.birthdate)) / 365) > 60\n```"}]}, {"id": "train-1488", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the reason Walter Bahringer visited medical professionals in July 2009."}, {"from": "gpt", "value": "```sql\nSELECT T2.REASONDESCRIPTION FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Walter' AND T1.last = 'Bahringer' AND T2.DATE LIKE '2009-07%'\n```"}]}, {"id": "train-1489", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How old was Mr. Stacy Morar at the time of his first emergency room admission due to a drug overdose?"}, {"from": "gpt", "value": "```sql\nSELECT T2.DATE - T1.birthdate AS age FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Stacy' AND T1.last = 'Morar' AND T2.DESCRIPTION = 'Emergency Room Admission' AND T2.REASONDESCRIPTION = 'Drug overdose' ORDER BY T2.DATE LIMIT 1\n```"}]}, {"id": "train-1490", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What drug is administered more often to treat child attention deficit disorder?"}, {"from": "gpt", "value": "```sql\nSELECT DESCRIPTION FROM medications WHERE REASONDESCRIPTION = 'Child attention deficit disorder' GROUP BY DESCRIPTION ORDER BY COUNT(DESCRIPTION) DESC LIMIT 1\n```"}]}, {"id": "train-1491", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please include the full name of the patient who received a lung transplant."}, {"from": "gpt", "value": "```sql\nSELECT T2.first, T2.last FROM procedures AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Transplant of lung (procedure)'\n```"}]}, {"id": "train-1492", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients on average receive combined chemotherapy and radiation therapy procedures each year?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(PATIENT) AS REAL) / COUNT(DISTINCT strftime('%Y', DATE)) FROM procedures WHERE DESCRIPTION = 'Combined chemotherapy and radiation therapy (procedure)'\n```"}]}, {"id": "train-1493", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the time frame and details of the most recent care plan suggested to Jacquelyn Shanahan."}, {"from": "gpt", "value": "```sql\nSELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS timeFrame , T2.DESCRIPTION FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Jacquelyn' AND T1.last = 'Shanahan' ORDER BY T2.START DESC LIMIT 1\n```"}]}, {"id": "train-1494", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the allergy period for Isadora Moen and what triggered it."}, {"from": "gpt", "value": "```sql\nSELECT T2.START, T2.STOP, T2.DESCRIPTION FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Isadora' AND T1.last = 'Moen'\n```"}]}, {"id": "train-1495", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How old was Mrs. Laronda Bernier at the time of her most recent medical encounter?"}, {"from": "gpt", "value": "```sql\nSELECT T2.DATE - T1.birthdate AS age FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Laronda' AND T1.last = 'Bernier' ORDER BY T2.DATE DESC LIMIT 1\n```"}]}, {"id": "train-1496", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What condition forced Mrs. Joye Homenick to seek medical attention in 2017?"}, {"from": "gpt", "value": "```sql\nSELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Joye' AND T1.last = 'Homenick' AND strftime('%Y', T2.START) = '2017'\n```"}]}, {"id": "train-1497", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Mrs. Joye Homenick receive her most recent influenza seasonal vaccine?"}, {"from": "gpt", "value": "```sql\nSELECT T2.DATE FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Influenza seasonal injectable preservative free' AND T1.first = 'Joye' AND T1.last = 'Homenick' ORDER BY T2.DATE DESC LIMIT 1\n```"}]}, {"id": "train-1498", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long did Elly Koss have to take Acetaminophen 160 MG?"}, {"from": "gpt", "value": "```sql\nSELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND last = 'Koss' AND T2.DESCRIPTION = 'Acetaminophen 160 MG'\n```"}]}, {"id": "train-1499", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients sought medical attention due to a second-degree burn? Describe the care plan recommended to them."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.PATIENT), T2.DESCRIPTION FROM encounters AS T1 INNER JOIN careplans AS T2 ON T1.PATIENT = T2.PATIENT WHERE T2.REASONDESCRIPTION = 'Second degree burn'\n```"}]}, {"id": "train-1500", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all patients who sought medical attention in 2010 due to contact dermatitis, identify the percentage of females."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.gender = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.PATIENT) FROM encounters AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE strftime('%Y', T1.DATE) = '2010' AND T1.REASONDESCRIPTION = 'Contact dermatitis'\n```"}]}, {"id": "train-1501", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many interactions did Lorri Simons have with medical professionals between 2010 and 2017? What percentage of encounters are attributed to prenatal visits?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.patient) , CAST(SUM(CASE WHEN T2.DESCRIPTION = 'Prenatal visit' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.patient) FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Lorri' AND T1.last = 'Simonis' AND strftime('%Y', T2.DATE) BETWEEN '2010' AND '2017'\n```"}]}, {"id": "train-1502", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State description of medication taken by Joe Homenick."}, {"from": "gpt", "value": "```sql\nSELECT T1.DESCRIPTION FROM medications AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.first = 'Joye' AND T2.last = 'Homenick'\n```"}]}, {"id": "train-1503", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the start date of the care plan of the patient whose maiden name is Adams?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.START FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.maiden = 'Adams'\n```"}]}, {"id": "train-1504", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the male patients, who has the earliest starting date of the care plan?"}, {"from": "gpt", "value": "```sql\nSELECT T2.first, T2.last FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.gender = 'M' ORDER BY T1.START LIMIT 1\n```"}]}, {"id": "train-1505", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of Hispanic patients who stopped their care plan in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.race = 'hispanic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.PATIENT) FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE strftime('%Y', T1.stop) = '2011'\n```"}]}, {"id": "train-1506", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the description of the reason why Angelo Buckridge needs the care plan."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.REASONDESCRIPTION FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.first = 'Angelo' AND T2.last = 'Buckridge'\n```"}]}, {"id": "train-1507", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the description of the care plan of American patients."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.DESCRIPTION FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.ethnicity = 'american'\n```"}]}, {"id": "train-1508", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the medical encounter ids of patients who were born in Pembroke MA US?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.ENCOUNTER FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.birthplace = 'Pembroke MA US'\n```"}]}, {"id": "train-1509", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the start date of the care plan of alive patients."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.START FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.deathdate IS NULL\n```"}]}, {"id": "train-1510", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many white patients have the reason code of 10509002?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.PATIENT) FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.race = 'white' AND T1.REASONCODE = '10509002'\n```"}]}, {"id": "train-1511", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out full name of patients who have \"Diabetic diet\" in the description of the care plan."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.first, T2.last FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Diabetic diet'\n```"}]}, {"id": "train-1512", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the stop date of the care plan of dead patients."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.STOP FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.deathdate IS NOT NULL AND T1.STOP IS NOT NULL\n```"}]}, {"id": "train-1513", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Italian patients have the care plan code of 304510005?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.patient) FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.ethnicity = 'italian' AND T1.CODE = '304510005'\n```"}]}, {"id": "train-1514", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of female patients who started the care plan in 2010?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.gender = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.PATIENT) AS percentage FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE strftime('%Y', T1.START) = '2010'\n```"}]}, {"id": "train-1515", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many black patients stopped their care plan in 2017?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.patient) FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.race = 'black' AND strftime('%Y', T1.STOP) = '2017'\n```"}]}, {"id": "train-1516", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male patients have prediabetes condition?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN conditions AS T2 WHERE T2.DESCRIPTION = 'Prediabetes' AND T1.gender = 'M'\n```"}]}, {"id": "train-1517", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full names of patients with nut allergy."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Allergy to nut'\n```"}]}, {"id": "train-1518", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the condition of patient Wilmer Koepp."}, {"from": "gpt", "value": "```sql\nSELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Wilmer' AND T1.last = 'Koepp'\n```"}]}, {"id": "train-1519", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the patients with viral sinusitis condition, which patient's gender is most affected? Provide the number for each respectively."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.gender = 'F' THEN 1 ELSE 0 END), SUM(CASE WHEN T1.gender = 'M' THEN 1 ELSE 0 END) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Viral sinusitis (disorder)'\n```"}]}, {"id": "train-1520", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the full names of patients who have been taking Penicillin V Potassium 250 MG since 1948."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Penicillin V Potassium 250 MG' AND strftime('%Y', T2.START) >= '1948'\n```"}]}, {"id": "train-1521", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many white patients whose birth year is 1935 have a stroke?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.patient WHERE strftime('%Y', T1.birthdate) = '1935' AND T1.race = 'white' AND T2.DESCRIPTION = 'Stroke'\n```"}]}, {"id": "train-1522", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which conditions the patient has when receiving the IPV immunization?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.DESCRIPTION FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT INNER JOIN immunizations AS T3 ON T1.patient = T3.PATIENT WHERE T3.DESCRIPTION = 'IPV'\n```"}]}, {"id": "train-1523", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the patient ids whose disease has the most occurrences."}, {"from": "gpt", "value": "```sql\nSELECT T1.patient FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT INNER JOIN all_prevalences AS T3 ON T3.ITEM = T2.DESCRIPTION ORDER BY T3.OCCURRENCES DESC LIMIT 1\n```"}]}, {"id": "train-1524", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the full names of patients with a condition described as cystitis."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.patient WHERE T2.DESCRIPTION = 'Cystitis'\n```"}]}, {"id": "train-1525", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male patients have been described as immune to quadrivalent HPV?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'HPV quadrivalent' AND T1.gender = 'M'\n```"}]}, {"id": "train-1526", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the start date of patient Walter Bahringer's care plan."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.start FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Walter' AND T1.last = 'Bahringer'\n```"}]}, {"id": "train-1527", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the care plans of patient Major D'Amore's plan of care."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.DESCRIPTION FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Major' AND T1.last = 'D''Amore'\n```"}]}, {"id": "train-1528", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of male patients with viral sinusitis condition."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.gender = 'M' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.patient) FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Viral sinusitis (disorder)'\n```"}]}, {"id": "train-1529", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the patients who have been using Penicillin V Potassium 250 MG, what percentage of patients are female?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.gender = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.patient) FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Penicillin V Potassium 250 MG'\n```"}]}, {"id": "train-1530", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the white patients, what is the average body height of the patients?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.VALUE) FROM observations AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.race = 'white' AND T1.DESCRIPTION = 'Body Height'\n```"}]}, {"id": "train-1531", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the care plan needed for the patient living at 179 Sydni Roads, Taunton, MA 02780 US."}, {"from": "gpt", "value": "```sql\nSELECT T1.DESCRIPTION FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.address = '179 Sydni Roads Taunton MA 02780 US'\n```"}]}, {"id": "train-1532", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the allergen of the Dominican patient named Dirk Languish."}, {"from": "gpt", "value": "```sql\nSELECT T1.DESCRIPTION FROM allergies AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.first = 'Dirk' AND T2.last = 'Langosh' AND T2.ethnicity = 'dominican'\n```"}]}, {"id": "train-1533", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many patients who are allergic to peanuts have asthma?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.patient) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient INNER JOIN allergies AS T3 ON T2.patient = T3.PATIENT WHERE T1.DESCRIPTION = 'Asthma' AND T3.DESCRIPTION = 'Allergy to peanuts'\n```"}]}, {"id": "train-1534", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the 44-year-old patient diagnosed with drug overdose?"}, {"from": "gpt", "value": "```sql\nSELECT T2.first, T2.last FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Drug overdose' AND ROUND((strftime('%J', T2.deathdate) - strftime('%J', T2.birthdate)) / 365) = 44\n```"}]}, {"id": "train-1535", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the social security number of the patient with the highest systolic blood pressure."}, {"from": "gpt", "value": "```sql\nSELECT T2.ssn FROM observations AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Systolic Blood Pressure' ORDER BY T1.VALUE DESC LIMIT 1\n```"}]}, {"id": "train-1536", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the care plan description of the prevalent disease with the highest prevalence percentage?"}, {"from": "gpt", "value": "```sql\nSELECT T4.DESCRIPTION FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON T2.DESCRIPTION = T1.ITEM INNER JOIN encounters AS T3 ON T2.ENCOUNTER = T3.ID INNER JOIN careplans AS T4 ON T4.ENCOUNTER = T3.ID ORDER BY T1.\"PREVALENCE PERCENTAGE\" DESC LIMIT 1\n```"}]}, {"id": "train-1537", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the care plan for the patient with social security number 999-15-3685?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.DESCRIPTION FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.ssn = '999-15-3685'\n```"}]}, {"id": "train-1538", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average age of the male patients that have hypertension."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.deathdate IS NULL THEN ROUND((strftime('%J', date('now')) - strftime('%J', T2.birthdate)) / 365) ELSE ROUND((strftime('%J', T2.deathdate) - strftime('%J', T2.birthdate)) / 365) END) / COUNT(T2.patient) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Hypertension' AND T2.gender = 'M'\n```"}]}, {"id": "train-1539", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List 5 patients' name that need medication due to streptococcal sore throat disorder."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.first, T2.last FROM medications AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.REASONDESCRIPTION = 'Streptococcal sore throat (disorder)' LIMIT 5\n```"}]}, {"id": "train-1540", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the patient with a body weight of 61.97 kg?"}, {"from": "gpt", "value": "```sql\nSELECT T2.first, T2.last FROM observations AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Body Weight' AND T1.UNITS = 'kg' AND T1.VALUE = 61.97\n```"}]}, {"id": "train-1541", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the male patients, list down 5 birth dates of patients taking the medication \"Penicillin V Potassium 250 MG\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.birthdate FROM medications AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Penicillin V Potassium 250 MG' AND T2.gender = 'M' LIMIT 5\n```"}]}, {"id": "train-1542", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the full name of Irish patients diagnosed with the prevalent diseases that have an occurrence greater than the 96% of the average occurrences of all conditions."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.first, T2.last FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient INNER JOIN all_prevalences AS T3 ON T1.DESCRIPTION = T3.ITEM WHERE T2.ethnicity = 'irish' AND 100 * CAST(T3.OCCURRENCES AS REAL) / ( SELECT AVG(OCCURRENCES) FROM all_prevalences ) > 96\n```"}]}, {"id": "train-1543", "db_id": "synthea", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference between the number of married patients and the number of single patients with diabetes?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.marital = 'M' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.marital = 'S' THEN 1 ELSE 0 END) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.DESCRIPTION = 'Diabetes'\n```"}]}, {"id": "train-1544", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the country and how many customers are there."}, {"from": "gpt", "value": "```sql\nSELECT country, COUNT(customerNumber) FROM customers GROUP BY country\n```"}]}, {"id": "train-1545", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which different vendor has the most amount of orders? Calculate the total estimated earnings."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.productVendor, T1.MSRP - T1.buyPrice FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode GROUP BY T1.productVendor, T1.MSRP, T1.buyPrice ORDER BY COUNT(T2.quantityOrdered) DESC LIMIT 1\n```"}]}, {"id": "train-1546", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the sales agent of the distinct customer who paid the highest amount in the year 2004?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.lastName, T3.firstName FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber INNER JOIN employees AS T3 ON T2.salesRepEmployeeNumber = T3.employeeNumber WHERE STRFTIME('%Y', T1.paymentDate) = '2004' ORDER BY T1.amount DESC LIMIT 1\n```"}]}, {"id": "train-1547", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the total price of the products shipped to Rovelli Gifts Distributors Ltd. between 1/1/2003 and 12/31/2003?"}, {"from": "gpt", "value": "```sql\nSELECT T3.priceEach * T3.quantityOrdered FROM customers AS T1 INNER JOIN orders AS T2 ON T1.customerNumber = T2.customerNumber INNER JOIN orderdetails AS T3 ON T2.orderNumber = T3.orderNumber WHERE T1.customerName = 'Rovelli Gifts' AND T2.status = 'Shipped' AND STRFTIME('%Y', T2.shippedDate) = '2003'\n```"}]}, {"id": "train-1548", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees are there in Sydney?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(employeeNumber) FROM employees WHERE officeCode = ( SELECT officeCode FROM offices WHERE city = 'Sydney' )\n```"}]}, {"id": "train-1549", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which sales representatives in New York city whose leader is Anthony Bow with the employee number is 1143? Indicate their employee numbers."}, {"from": "gpt", "value": "```sql\nSELECT T1.employeeNumber FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T1.reportsTo = 1143 AND T2.city = 'NYC'\n```"}]}, {"id": "train-1550", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average, highest and lowest annual payments collected between 1/1/2003 to 12/31/2005?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.amount) AS REAL) / 3, MAX(T1.amount) , MIN(T1.amount) FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.paymentDate BETWEEN '2003-01-01' AND '2005-12-31'\n```"}]}, {"id": "train-1551", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which countries do the top 5 highest paying customers in a single payment come from? Indicate their entire address."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.country, T2.addressLine1, T2.addressLine2 FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber ORDER BY T1.amount DESC LIMIT 5\n```"}]}, {"id": "train-1552", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many checks were issued by Euro+ Shopping Channel in the year 2004?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.checkNumber) FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE customerName = 'Euro+ Shopping Channel' AND STRFTIME('%Y', T1.paymentDate) = '2004'\n```"}]}, {"id": "train-1553", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the classic cars, with a product scale of 1:18, which product is the most ordered product by customers?"}, {"from": "gpt", "value": "```sql\nSELECT T1.productName FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode WHERE T1.productScale = '1:18' AND T1.productLine = 'Classic Cars' GROUP BY T1.productName ORDER BY SUM(T2.quantityOrdered) DESC LIMIT 1\n```"}]}, {"id": "train-1554", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT COUNT(customerNumber) FROM customers WHERE creditLimit <= 100000 AND customerNumber IN ( SELECT customerNumber FROM payments WHERE STRFTIME('%Y', paymentDate) = '2004' ) ), T1.customerName FROM customers AS T1 INNER JOIN payments AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.creditLimit <= 100000 AND STRFTIME('%Y', T2.paymentDate) = '2004' GROUP BY T1.customerNumber, T1.customerName ORDER BY SUM(T2.amount) DESC LIMIT 1\n```"}]}, {"id": "train-1555", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of the customers, whose Tokyo-based sales representative reports to the Vice President of Sales whose employee number is 1056, has paid the highest payment? List the customer's name, the contact person and calculate the total amount of that customer's total payments."}, {"from": "gpt", "value": "```sql\nSELECT T2.customerName, T2.contactFirstName, T2.contactLastName, SUM(T3.amount) FROM employees AS T1 INNER JOIN customers AS T2 ON T2.salesRepEmployeeNumber = T1.employeeNumber INNER JOIN payments AS T3 ON T2.customerNumber = T3.customerNumber INNER JOIN offices AS T4 ON T1.officeCode = T4.officeCode WHERE T4.city = 'Tokyo' AND T1.reportsTo = 1056 GROUP BY T2.customerName, T2.contactFirstName, T2.contactLastName ORDER BY amount DESC LIMIT 1\n```"}]}, {"id": "train-1556", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which two products has the highest and lowest expected profits? Determine the total price for each product in terms of the largest quantity that was ordered."}, {"from": "gpt", "value": "```sql\nSELECT T2.productName, SUM(T1.quantityOrdered * T1.priceEach) FROM orderdetails AS T1 INNER JOIN ( SELECT productCode, productName FROM products ORDER BY MSRP - buyPrice DESC LIMIT 1 ) AS T2 ON T1.productCode = T2.productCode UNION SELECT T2.productName, SUM(quantityOrdered * priceEach) FROM orderdetails AS T1 INNER JOIN ( SELECT productCode, productName FROM products ORDER BY MSRP - buyPrice ASC LIMIT 1 ) AS T2 ON T1.productCode = T2.productCode\n```"}]}, {"id": "train-1557", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different orders with a total price greater than 4000 are cancelled?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.orderNumber) FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.quantityOrdered * T1.priceEach > 4000 AND T2.status = 'Cancelled'\n```"}]}, {"id": "train-1558", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many distinct orders were there in 2003 when the quantity ordered was less than 30?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.orderNumber) FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.quantityOrdered < 30 AND STRFTIME('%Y', T2.orderDate) = '2003'\n```"}]}, {"id": "train-1559", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total value of cancelled orders?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.quantityOrdered * T1.priceEach) FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE T2.status = 'Cancelled'\n```"}]}, {"id": "train-1560", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate the total value of Motorcycles orders."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.quantityOrdered * T1.priceEach) FROM orderdetails AS T1 INNER JOIN products AS T2 ON T1.productCode = T2.productCode WHERE T2.productLine = 'Motorcycles'\n```"}]}, {"id": "train-1561", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Planes orders were there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.productCode) FROM orderdetails AS T1 INNER JOIN products AS T2 ON T1.productCode = T2.productCode WHERE T2.productLine = 'Planes'\n```"}]}, {"id": "train-1562", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders which expected profits greater than 100?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.productCode) FROM orderdetails AS T1 INNER JOIN products AS T2 ON T1.productCode = T2.productCode WHERE T2.MSRP - T2.buyPrice > 100\n```"}]}, {"id": "train-1563", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate the average total price of orders from Exoto Designs Vendor in 2005."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.quantityOrdered * T2.priceEach) / COUNT(T3.orderNumber) FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode INNER JOIN orders AS T3 ON T2.orderNumber = T3.orderNumber WHERE T1.productVendor = 'Exoto Designs' AND STRFTIME('%Y', T3.orderDate) = '2005'\n```"}]}, {"id": "train-1564", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales representatives who have office code is 1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(officeCode) FROM employees WHERE jobTitle = 'Sales Rep' AND officeCode = 1\n```"}]}, {"id": "train-1565", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list different customer names with the payment amount of over 50,000."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.customerName FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.amount > 50000\n```"}]}, {"id": "train-1566", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate the total payment amount of customers who come from the USA."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.amount) FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T2.country = 'USA'\n```"}]}, {"id": "train-1567", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the total payments of customers with no credit limit in 2003?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(amount) FROM payments WHERE STRFTIME('%Y', paymentDate) = '2003' AND customerNumber IN ( SELECT customerNumber FROM customers WHERE creditLimit = 0 )\n```"}]}, {"id": "train-1568", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the name and phone number of the customer whose order was cancelled."}, {"from": "gpt", "value": "```sql\nSELECT T2.customerName, T2.phone FROM orders AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.status = 'Cancelled'\n```"}]}, {"id": "train-1569", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many French customers shipped 2 orders which have been cancelled?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.country) FROM orders AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.status = 'Shipped' AND T2.country = 'France' GROUP BY T2.customerNumber HAVING COUNT(T1.status) = 2\n```"}]}, {"id": "train-1570", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate the average total price of shipped orders from German customers."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.quantityOrdered * T3.priceEach) / COUNT(T2.orderNumber) FROM customers AS T1 INNER JOIN orders AS T2 ON T1.customerNumber = T2.customerNumber INNER JOIN orderdetails AS T3 ON T2.orderNumber = T3.orderNumber WHERE T2.status = 'Shipped' AND T1.country = 'Germany'\n```"}]}, {"id": "train-1571", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out full name of employees who are working in Tokyo?"}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.city = 'Tokyo'\n```"}]}, {"id": "train-1572", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Sales Rep who are working in Tokyo? List out email and full name of those employees."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName, T1.email FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.city = 'Tokyo' AND T1.jobTitle = 'Sales Rep'\n```"}]}, {"id": "train-1573", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the email of those who are staff of Murphy Diane whose number is 1002 and living in San Francisco"}, {"from": "gpt", "value": "```sql\nSELECT T1.email FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T1.reportsTo = 1002 AND T2.city = 'San Francisco'\n```"}]}, {"id": "train-1574", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Determine the email and Code of employee who are working at United State, state MA"}, {"from": "gpt", "value": "```sql\nSELECT T1.email, T1.employeeNumber FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.state = 'MA' AND T2.country = 'USA'\n```"}]}, {"id": "train-1575", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Sales Manager who are working in Sydney? List out their email."}, {"from": "gpt", "value": "```sql\nSELECT T1.email FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T1.jobTitle LIKE '%Sales Manager%' AND T2.city = 'Sydney'\n```"}]}, {"id": "train-1576", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees who are living in Australia and have the credit limit under 200000? State their email address and countries where they are working."}, {"from": "gpt", "value": "```sql\nSELECT T2.email, T3.country FROM customers AS T1 INNER JOIN employees AS T2 ON T1.salesRepEmployeeNumber = T2.employeeNumber INNER JOIN offices AS T3 ON T2.officeCode = T3.officeCode WHERE T3.country = 'Australia' AND T1.creditLimit < 200000 AND T2.jobTitle = 'Sales Rep'\n```"}]}, {"id": "train-1577", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State 10 emails of UK Sales Rep who have the lowest credit limit."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.email FROM customers AS T1 INNER JOIN employees AS T2 ON T1.salesRepEmployeeNumber = T2.employeeNumber WHERE T2.jobTitle = 'Sales Rep' AND T1.country = 'UK' ORDER BY T1.creditLimit LIMIT 10\n```"}]}, {"id": "train-1578", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Australian customers who have credit line under 220000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(creditLimit) FROM customers WHERE creditLimit < 220000 AND country = 'Australia'\n```"}]}, {"id": "train-1579", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out 3 customer numbers who have highest amount payment"}, {"from": "gpt", "value": "```sql\nSELECT customerNumber FROM payments ORDER BY amount DESC LIMIT 3\n```"}]}, {"id": "train-1580", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Determine the email and Code of employee who are working at United State, state CA"}, {"from": "gpt", "value": "```sql\nSELECT T1.email, T1.employeeNumber FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.country = 'USA' AND T2.state = 'CA' GROUP BY T1.email, T1.officeCode\n```"}]}, {"id": "train-1581", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out full name of employees who are working in Boston?"}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.city = 'Boston'\n```"}]}, {"id": "train-1582", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State top 3 emails of UK Sales Rep who have the highest credit limit."}, {"from": "gpt", "value": "```sql\nSELECT T2.email FROM customers AS T1 INNER JOIN employees AS T2 ON T1.salesRepEmployeeNumber = T2.employeeNumber WHERE T2.jobTitle = 'Sales Rep' AND T1.country = 'UK' GROUP BY T1.customerName, T2.email ORDER BY SUM(T1.creditLimit) DESC LIMIT 3\n```"}]}, {"id": "train-1583", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers who are in Norway and have credit line under 220000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(creditLimit) FROM customers WHERE creditLimit < 220000 AND country = 'Norway'\n```"}]}, {"id": "train-1584", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out full name and email of employees who are working in Paris?"}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName, T1.email FROM employees AS T1 INNER JOIN offices AS T2 ON T1.officeCode = T2.officeCode WHERE T2.city = 'Paris'\n```"}]}, {"id": "train-1585", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the product code of the top five motorcycles, by descending order, the number of quantity in stock."}, {"from": "gpt", "value": "```sql\nSELECT productCode, quantityInStock FROM products WHERE productLine = 'Motorcycles' ORDER BY quantityInStock DESC LIMIT 5\n```"}]}, {"id": "train-1586", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the German customers, how many of the them has credit limit of zero?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(customerNumber) FROM customers WHERE creditLimit = 0 AND country = 'Germany'\n```"}]}, {"id": "train-1587", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 2003 to 2004, how many customers have paid more than three times?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(customernumber) FROM ( SELECT customernumber FROM payments WHERE STRFTIME('%Y', paymentDate) >= '2003' AND STRFTIME('%Y', paymentDate) <= '2004' GROUP BY customernumber HAVING COUNT(customernumber) > 3 ) T\n```"}]}, {"id": "train-1588", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average actual profit by 1937 Lincoln Berline?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.priceEach - T2.buyPrice) / COUNT(*) FROM orderdetails AS T1 INNER JOIN products AS T2 ON T1.productCode = T2.productCode WHERE T2.productName = '1937 Lincoln Berline'\n```"}]}, {"id": "train-1589", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the motorcycles with product scale of 1:10, which of them is the most ordered by American customers?"}, {"from": "gpt", "value": "```sql\nSELECT T1.productName FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode INNER JOIN orders AS T3 ON T2.orderNumber = T3.orderNumber INNER JOIN customers AS T4 ON T3.customerNumber = T4.customerNumber WHERE T1.productLine = 'Motorcycles' AND T1.productScale = '1:10' AND T4.country = 'USA' GROUP BY T1.productName ORDER BY SUM(T2.quantityOrdered) DESC LIMIT 1\n```"}]}, {"id": "train-1590", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 8/1/2003 and 8/30/2004, how many checks were issued by Mini Gifts Distributors Ltd.? Please list their check numbers."}, {"from": "gpt", "value": "```sql\nSELECT T1.checkNumber FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.paymentDate >= '2003-08-01' AND T1.paymentDate <= '2004-08-30' AND T2.customerName = 'Mini Gifts Distributors Ltd.'\n```"}]}, {"id": "train-1591", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the planes which has the hightest total price, how much it exceeds the average?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(quantityOrdered * priceEach) - AVG(priceEach) FROM orderdetails WHERE productCode IN ( SELECT productCode FROM products WHERE productLine = 'Planes' )\n```"}]}, {"id": "train-1592", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total value of shipped vintage car orders from 2003-2004?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.priceEach * T2.quantityOrdered) FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode INNER JOIN orders AS T3 ON T2.orderNumber = T3.orderNumber WHERE T3.status = 'Shipped' AND T3.orderDate BETWEEN '2003-01-01' AND '2004-12-31'\n```"}]}, {"id": "train-1593", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the sales agent of the customer who has made the highest payment? Include the full names of employee and his/her supervisor."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName, T1.reportsTo FROM employees AS T1 INNER JOIN customers AS T2 ON T1.employeeNumber = T2.salesRepEmployeeNumber INNER JOIN payments AS T3 ON T2.customerNumber = T3.customerNumber ORDER BY T3.amount DESC LIMIT 1\n```"}]}, {"id": "train-1594", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest amount of order made by the sales representative in Boston? Please give the name of the product and amount."}, {"from": "gpt", "value": "```sql\nSELECT T2.productName, T1.quantityOrdered * T1.priceEach FROM orderdetails AS T1 INNER JOIN products AS T2 ON T1.productCode = T2.productCode INNER JOIN orders AS T3 ON T1.orderNumber = T3.orderNumber INNER JOIN customers AS T4 ON T3.customerNumber = T4.customerNumber WHERE T4.city = 'Boston' AND T4.salesRepEmployeeNumber IN ( SELECT employeeNumber FROM employees WHERE jobTitle = 'Sales Rep' ) ORDER BY T1.quantityOrdered DESC LIMIT 1\n```"}]}, {"id": "train-1595", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total actual profit gained from orders made by American customers from 2003-01-06 to 2005-05-09?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.priceEach - T1.buyPrice) FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode INNER JOIN orders AS T3 ON T2.orderNumber = T3.orderNumber INNER JOIN customers AS T4 ON T3.customerNumber = T4.customerNumber WHERE T3.orderDate > '2003-01-05' AND T3.orderDate < '2005-05-10'\n```"}]}, {"id": "train-1596", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From which branch does the sales representative employee who made the most sales in 2005? Please indicates its full address and phone number."}, {"from": "gpt", "value": "```sql\nSELECT T3.addressLine1, T3.addressLine2, T3.phone FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber INNER JOIN customers AS T3 ON T2.customerNumber = T3.customerNumber INNER JOIN employees AS T4 ON T3.salesRepEmployeeNumber = T4.employeeNumber INNER JOIN offices AS T5 ON T4.officeCode = T5.officeCode WHERE STRFTIME('%Y', T2.orderDate) = '2005' AND T4.jobTitle = 'Sales Rep' ORDER BY T1.quantityOrdered DESC LIMIT 1\n```"}]}, {"id": "train-1597", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT phone FROM customers WHERE contactLastName LIKE 'M%' AND country != 'Germany'\n```"}]}, {"id": "train-1598", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average amount of payments made by customers during the first half of 2004."}, {"from": "gpt", "value": "```sql\nSELECT AVG(amount) FROM payments WHERE paymentDate BETWEEN '2004-01-01' AND '2004-06-30'\n```"}]}, {"id": "train-1599", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the orders placed and shipped throughout the year 2005, what percentage of those orders corresponds to customer number 186?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN customerNumber = 186 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(orderNumber) FROM orders WHERE status = 'Shipped' AND shippedDate BETWEEN '2005-01-01' AND '2005-12-31'\n```"}]}, {"id": "train-1600", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers with a canceled shipment have a credit limit greater than 115,000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.customerNumber) FROM customers AS T1 INNER JOIN orders AS T2 ON T1.customerNumber = T2.customerNumber WHERE T2.status = 'Cancelled' AND T1.creditLimit > 115000\n```"}]}, {"id": "train-1601", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On what date did the customer with the lowest credit limit serviced by sales representative Barry Jones make payments for his/her orders?"}, {"from": "gpt", "value": "```sql\nSELECT T3.paymentDate FROM employees AS T1 INNER JOIN customers AS T2 ON T1.employeeNumber = T2.salesRepEmployeeNumber INNER JOIN payments AS T3 ON T2.customerNumber = T3.customerNumber WHERE T1.firstName = 'Barry' AND T1.lastName = 'Jones' AND T1.jobTitle = 'Sales Rep' ORDER BY T2.creditLimit ASC LIMIT 1\n```"}]}, {"id": "train-1602", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To whom does the employee have to inform that is the sales representative of the French customer?"}, {"from": "gpt", "value": "```sql\nSELECT T1.reportsTo FROM employees AS T1 INNER JOIN customers AS T2 ON T1.employeeNumber = T2.salesRepEmployeeNumber WHERE T2.country = 'France'\n```"}]}, {"id": "train-1603", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full address of the customer who commented that DHL be used for the order that was shipped on April 4, 2005?"}, {"from": "gpt", "value": "```sql\nSELECT T1.addressLine1, T1.addressLine2 FROM customers AS T1 INNER JOIN orders AS T2 ON T1.customerNumber = T2.customerNumber WHERE T2.shippedDate = '2005-04-04' AND T2.status = 'Shipped'\n```"}]}, {"id": "train-1604", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full address of the office where the employee who is a sales representative for the customer whose business is located in the city of New York works?"}, {"from": "gpt", "value": "```sql\nSELECT T2.addressLine1, T2.addressLine2 FROM employees AS T1 INNER JOIN customers AS T2 ON T1.employeeNumber = T2.salesRepEmployeeNumber INNER JOIN offices AS T3 ON T1.officeCode = T3.officeCode WHERE T2.city = 'NYC' AND T1.jobTitle = 'Sales Rep'\n```"}]}, {"id": "train-1605", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full address of the office where 4 people work and one of them is Sales Representation?"}, {"from": "gpt", "value": "```sql\nSELECT T1.addressLine1, T1.addressLine2 FROM customers AS T1 INNER JOIN employees AS T2 ON T1.salesRepEmployeeNumber = T2.employeeNumber WHERE T2.jobTitle = 'Sales Rep'\n```"}]}, {"id": "train-1606", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.MSRP - T2.buyPrice) FROM productlines AS T1 INNER JOIN products AS T2 ON T1.productLine = T2.productLine WHERE T2.productVendor = 'Carousel DieCast Legends' AND T1.textDescription LIKE '%perfect holiday or anniversary gift for executives%'\n```"}]}, {"id": "train-1607", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the clients whose businesses are located in the city of Boston, calculate which of them has a higher average amount of payment."}, {"from": "gpt", "value": "```sql\nSELECT T1.customerNumber FROM customers AS T1 INNER JOIN payments AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.city = 'Boston' GROUP BY T1.customerNumber ORDER BY SUM(T2.amount) / COUNT(T2.paymentDate) DESC LIMIT 1\n```"}]}, {"id": "train-1608", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total quantity ordered for 18th Century Vintage Horse Carriage and the average price."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.quantityOrdered) , SUM(T2.quantityOrdered * T2.priceEach) / SUM(T2.quantityOrdered) FROM products AS T1 INNER JOIN orderdetails AS T2 ON T1.productCode = T2.productCode WHERE T1.productName = '18th Century Vintage Horse Carriage'\n```"}]}, {"id": "train-1609", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many kinds of products did order No. 10252 contain?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(t.productCode) FROM orderdetails t WHERE t.orderNumber = '10252'\n```"}]}, {"id": "train-1610", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the sales representative that made the order which was sent to 25 Maiden Lane, Floor No. 4?"}, {"from": "gpt", "value": "```sql\nSELECT T2.firstName, T2.lastName FROM customers AS T1 INNER JOIN employees AS T2 ON T1.salesRepEmployeeNumber = T2.employeeNumber WHERE T1.addressLine1 = '25 Maiden Lane' AND T1.addressLine2 = 'Floor No. 4'\n```"}]}, {"id": "train-1611", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where's Foon Yue Tseng's office located at? Give the detailed address."}, {"from": "gpt", "value": "```sql\nSELECT T1.addressLine1, T1.addressLine2 FROM offices AS T1 INNER JOIN employees AS T2 ON T1.officeCode = T2.officeCode WHERE T2.firstName = 'Foon Yue' AND T2.lastName = 'Tseng'\n```"}]}, {"id": "train-1612", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compared with the orders happened on 2005-04-08 and two days later, which day's order had a higher value?"}, {"from": "gpt", "value": "```sql\nSELECT T2.orderDate FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE STRFTIME('%Y-%m-%d', T2.orderDate) = '2005-04-08' OR STRFTIME('%Y-%m-%d', T2.orderDate) = '2005-04-10' ORDER BY T1.quantityOrdered * T1.priceEach DESC LIMIT 1\n```"}]}, {"id": "train-1613", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products with the highest expected profits were sold in total?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(t2.quantityOrdered) FROM orderdetails AS t2 INNER JOIN ( SELECT t1.productCode FROM products AS t1 ORDER BY t1.MSRP - t1.buyPrice DESC LIMIT 1 ) AS t3 ON t2.productCode = t3.productCode\n```"}]}, {"id": "train-1614", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much did Petit Auto pay on 2004-08-09?"}, {"from": "gpt", "value": "```sql\nSELECT t1.amount FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.customerName = 'Petit Auto' AND t1.paymentDate = '2004-08-09'\n```"}]}, {"id": "train-1615", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the contact name for the check \"NR157385\"?"}, {"from": "gpt", "value": "```sql\nSELECT t2.contactFirstName, t2.contactLastName FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.checkNumber = 'NR157385'\n```"}]}, {"id": "train-1616", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which customer made the order No. 10160? Give the contact name."}, {"from": "gpt", "value": "```sql\nSELECT t2.contactFirstName, t2.contactLastName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.orderNumber = '10160'\n```"}]}, {"id": "train-1617", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where was the order No. 10383 shipped to? Show me the address."}, {"from": "gpt", "value": "```sql\nSELECT t2.addressLine1, t2.addressLine2 FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.orderNumber = '10383'\n```"}]}, {"id": "train-1618", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the productline where the product No.S18_2949 was produced, what's the text description for that product line?"}, {"from": "gpt", "value": "```sql\nSELECT t1.textDescription FROM productlines AS t1 INNER JOIN products AS t2 ON t1.productLine = t2.productLine WHERE t2.productCode = 'S18_2949'\n```"}]}, {"id": "train-1619", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: If Dragon Souveniers, Ltd. aren't satisfied with their order and want to send a complain e-mail, which e-mail address should they send to?"}, {"from": "gpt", "value": "```sql\nSELECT t2.email FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.customerName = 'Dragon Souveniers, Ltd.'\n```"}]}, {"id": "train-1620", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many French customers does Gerard Hernandez take care of?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(t1.customerNumber) FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.country = 'France' AND t2.firstName = 'Gerard' AND t2.lastName = 'Hernandez'\n```"}]}, {"id": "train-1621", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the latest order that customer No.114 made? Give the name of the product."}, {"from": "gpt", "value": "```sql\nSELECT t3.productName FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN products AS t3 ON t1.productCode = t3.productCode WHERE t2.customerNumber = '114' ORDER BY t2.orderDate DESC LIMIT 1\n```"}]}, {"id": "train-1622", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the product No. S18_3482 in the Order No.10108, how much discount did the customer have?"}, {"from": "gpt", "value": "```sql\nSELECT (t1.MSRP - t2.priceEach) / t1.MSRP FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode WHERE t1.productCode = 'S18_3482' AND t2.orderNumber = '10108'\n```"}]}, {"id": "train-1623", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To whom does Steve Patterson report? Please give his or her full name."}, {"from": "gpt", "value": "```sql\nSELECT t2.firstName, t2.lastName FROM employees AS t1 INNER JOIN employees AS t2 ON t2.employeeNumber = t1.reportsTo WHERE t1.firstName = 'Steve' AND t1.lastName = 'Patterson'\n```"}]}, {"id": "train-1624", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How do I contact the President of the company?"}, {"from": "gpt", "value": "```sql\nSELECT t.email FROM employees t WHERE t.jobTitle = 'President'\n```"}]}, {"id": "train-1625", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the sales representitive of Muscle Machine Inc? Please give the employee's full name."}, {"from": "gpt", "value": "```sql\nSELECT t2.firstName, t2.lastName FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.customerName = 'Muscle Machine Inc'\n```"}]}, {"id": "train-1626", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT t2.email FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t1.customerName = 'Muscle Machine Inc'\n```"}]}, {"id": "train-1627", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the customers that have Steve Patterson as their sales representitive."}, {"from": "gpt", "value": "```sql\nSELECT t1.customerName FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'Steve' AND t2.lastName = 'Patterson'\n```"}]}, {"id": "train-1628", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers have an employee who reports to William Patterson as their sales representitive?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(t1.customerNumber) FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'William' AND t2.lastName = 'Patterson'\n```"}]}, {"id": "train-1629", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the phone numbers of the top 3 customers that have the highest credit limit and have Leslie Jennings as their sales representitive."}, {"from": "gpt", "value": "```sql\nSELECT t1.phone FROM customers AS t1 INNER JOIN employees AS t2 ON t1.salesRepEmployeeNumber = t2.employeeNumber WHERE t2.firstName = 'Leslie' AND t2.lastName = 'Jennings' ORDER BY t1.creditLimit DESC LIMIT 3\n```"}]}, {"id": "train-1630", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales representitives are based in the offices in the USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(t1.employeeNumber) FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t2.country = 'USA' AND t1.jobTitle = 'Sales Rep'\n```"}]}, {"id": "train-1631", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where can I find the office of the President of the company?"}, {"from": "gpt", "value": "```sql\nSELECT t2.addressLine1, t2.addressLine2 FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t1.jobTitle = 'President'\n```"}]}, {"id": "train-1632", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the postal code of the office the VP Sales is at?"}, {"from": "gpt", "value": "```sql\nSELECT t2.postalCode FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t1.jobTitle = 'VP Sales'\n```"}]}, {"id": "train-1633", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total price of the order made by Cruz & Sons Co. on 2003/3/3?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(t1.priceEach * t1.quantityOrdered) FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber WHERE t3.customerName = 'Cruz & Sons Co.' AND t2.orderDate = '2003-03-03'\n```"}]}, {"id": "train-1634", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product did Cruz & Sons Co. order on 2003/3/3?"}, {"from": "gpt", "value": "```sql\nSELECT t4.productName FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber INNER JOIN products AS t4 ON t1.productCode = t4.productCode WHERE t3.customerName = 'Cruz & Sons Co.' AND t2.orderDate = '2003-03-03'\n```"}]}, {"id": "train-1635", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product did Cruz & Sons Co. ask for the biggest amount in a single order?"}, {"from": "gpt", "value": "```sql\nSELECT t4.productName FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber INNER JOIN products AS t4 ON t1.productCode = t4.productCode WHERE t3.customerName = 'Cruz & Sons Co.' ORDER BY t1.priceEach * t1.quantityOrdered DESC LIMIT 1\n```"}]}, {"id": "train-1636", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When were the products ordered by Cruz & Sons Co. on 2003-03-03 shipped?"}, {"from": "gpt", "value": "```sql\nSELECT t1.shippedDate FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.customerName = 'Cruz & Sons Co.' AND t1.orderDate = '2003-03-03'\n```"}]}, {"id": "train-1637", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the amount of customers of 1957 Chevy Pickup by customers in a month?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.customerNumber) FROM orderdetails AS T1 INNER JOIN orders AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.productCode IN ( SELECT productCode FROM products WHERE productName = '1957 Chevy Pickup' )\n```"}]}, {"id": "train-1638", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the product from the 'Classic Cars' production line that has the greatest expected profit."}, {"from": "gpt", "value": "```sql\nSELECT t.productName, t.MSRP - t.buyPrice FROM products AS t WHERE t.productLine = 'Classic Cars' ORDER BY t.MSRP - t.buyPrice DESC LIMIT 1\n```"}]}, {"id": "train-1639", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the name of customers who have orders that are still processing."}, {"from": "gpt", "value": "```sql\nSELECT t2.customerName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.status = 'In Process'\n```"}]}, {"id": "train-1640", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all orders shipped, calculate the percentage of orders shipped at least 3 days before the required date."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN JULIANDAY(t1.shippeddate) - JULIANDAY(t1.requireddate) > 3 THEN T1.customerNumber ELSE NULL END) FROM orders AS T1 INNER JOIN orderdetails AS T2 ON T1.orderNumber = T2.orderNumber WHERE T1.status = 'Shipped'\n```"}]}, {"id": "train-1641", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the customer who made the highest payment in 2005."}, {"from": "gpt", "value": "```sql\nSELECT t2.customerName FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE STRFTIME('%Y', t1.paymentDate) = '2005' GROUP BY t2.customerNumber, t2.customerName ORDER BY SUM(t1.amount) DESC LIMIT 1\n```"}]}, {"id": "train-1642", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which is the most ordered quantity product? What is its expected profit margin per piece?"}, {"from": "gpt", "value": "```sql\nSELECT productName, MSRP - buyPrice FROM products WHERE productCode = ( SELECT productCode FROM orderdetails ORDER BY quantityOrdered DESC LIMIT 1 )\n```"}]}, {"id": "train-1643", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the order has the most product ordered, name the customer who placed the order."}, {"from": "gpt", "value": "```sql\nSELECT T2.firstName, T2.lastName FROM offices AS T1 INNER JOIN employees AS T2 ON T1.officeCode = T2.officeCode WHERE T2.employeeNumber = ( SELECT MAX(employeeNumber) FROM employees )\n```"}]}, {"id": "train-1644", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all customer names with orders that are disputed."}, {"from": "gpt", "value": "```sql\nSELECT t3.firstName, t3.lastName FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber INNER JOIN employees AS t3 ON t2.salesRepEmployeeNumber = t3.employeeNumber WHERE t1.status = 'Disputed'\n```"}]}, {"id": "train-1645", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of employees are in Paris office?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN t1.city = 'Paris' THEN t2.employeeNumber ELSE NULL END) AS REAL) * 100 / COUNT(t2.employeeNumber) FROM offices AS t1 INNER JOIN employees AS t2 ON t1.officeCode = t2.officeCode\n```"}]}, {"id": "train-1646", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the Sales Manager of Europe, Middle East, and Africa region. In which office does he/she report to?"}, {"from": "gpt", "value": "```sql\nSELECT t2.firstName, t2.lastName FROM offices AS t1 INNER JOIN employees AS t2 ON t1.officeCode = t2.officeCode WHERE t2.jobTitle = 'Sale Manager (EMEA)'\n```"}]}, {"id": "train-1647", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of employees in Japan office and who are they reporting to."}, {"from": "gpt", "value": "```sql\nSELECT t2.firstName, t2.lastName, t2.reportsTo FROM offices AS t1 INNER JOIN employees AS t2 ON t1.officeCode = t2.officeCode WHERE t1.country = 'Japan'\n```"}]}, {"id": "train-1648", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which customer ordered 1939 'Chevrolet Deluxe Coupe' at the highest price?"}, {"from": "gpt", "value": "```sql\nSELECT t4.customerName FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode INNER JOIN orders AS t3 ON t2.orderNumber = t3.orderNumber INNER JOIN customers AS t4 ON t3.customerNumber = t4.customerNumber WHERE t1.productName = '1939 Chevrolet Deluxe Coupe' ORDER BY t2.priceEach DESC LIMIT 1\n```"}]}, {"id": "train-1649", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the payment amount in 2004 was made by Atelier graphique?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN t1.customerName = 'Atelier graphique' THEN t2.amount ELSE 0 END) * 100 / SUM(t2.amount) FROM customers AS t1 INNER JOIN payments AS t2 ON t1.customerNumber = t2.customerNumber WHERE STRFTIME('%Y', t2.paymentDate) = '2004'\n```"}]}, {"id": "train-1650", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the actual profit for order number 10100."}, {"from": "gpt", "value": "```sql\nSELECT SUM((t1.priceEach - t2.buyPrice) * t1.quantityOrdered) FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode WHERE t1.orderNumber = '10100'\n```"}]}, {"id": "train-1651", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much did customer 103 pay in total?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(t.amount) FROM payments t WHERE t.customerNumber = '103'\n```"}]}, {"id": "train-1652", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total price of the order 10100?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(t.priceEach * t.quantityOrdered) FROM orderdetails t WHERE t.orderNumber = '10100'\n```"}]}, {"id": "train-1653", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top three product names with the highest unit price."}, {"from": "gpt", "value": "```sql\nSELECT t1.productName FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode ORDER BY t2.priceEach DESC LIMIT 3\n```"}]}, {"id": "train-1654", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers of empolyee 1370, who has the highest credit limit?Please list the full name of the contact person."}, {"from": "gpt", "value": "```sql\nSELECT t2.contactFirstName, t2.contactLastName FROM employees AS t1 INNER JOIN customers AS t2 ON t1.employeeNumber = t2.salesRepEmployeeNumber WHERE t1.employeeNumber = '1370' ORDER BY t2.creditLimit DESC LIMIT 1\n```"}]}, {"id": "train-1655", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 2003 Harley-Davidson Eagle Drag Bikes were ordered?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(t2.quantityOrdered) FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode WHERE t1.productName = '2003 Harley-Davidson Eagle Drag Bike'\n```"}]}, {"id": "train-1656", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the product with the highest unit price shipped?"}, {"from": "gpt", "value": "```sql\nSELECT t1.shippedDate FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber ORDER BY t2.priceEach DESC LIMIT 1\n```"}]}, {"id": "train-1657", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many motorcycles have been ordered in 2004?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(t2.quantityOrdered) FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN products AS t3 ON t2.productCode = t3.productCode WHERE t3.productLine = 'motorcycles' AND STRFTIME('%Y', t1.orderDate) = '2004'\n```"}]}, {"id": "train-1658", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the order number of the customer whose credit card has a limit of 45300."}, {"from": "gpt", "value": "```sql\nSELECT t1.orderNumber FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.creditLimit = 45300\n```"}]}, {"id": "train-1659", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For Which order was the most profitable, please list the customer name of the order and the profit of the order."}, {"from": "gpt", "value": "```sql\nSELECT t3.customerName, (t1.priceEach - t4.buyPrice) * t1.quantityOrdered FROM orderdetails AS t1 INNER JOIN orders AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN customers AS t3 ON t2.customerNumber = t3.customerNumber INNER JOIN products AS t4 ON t1.productCode = t4.productCode GROUP BY t3.customerName, t1.priceEach, t4.buyPrice, t1.quantityOrdered ORDER BY (t1.priceEach - t4.buyPrice) * t1.quantityOrdered DESC LIMIT 1\n```"}]}, {"id": "train-1660", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many transactions payment made by customer that is lower than 10000. Group the result by year."}, {"from": "gpt", "value": "```sql\nSELECT STRFTIME('%Y', t1.paymentDate), COUNT(t1.customerNumber) FROM payments AS t1 WHERE t1.amount < 10000 GROUP BY STRFTIME('%Y', t1.paymentDate)\n```"}]}, {"id": "train-1661", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out 3 best seller products during year 2003 with their total quantity sold during 2003."}, {"from": "gpt", "value": "```sql\nSELECT t3.productName, SUM(t2.quantityOrdered) FROM orders AS t1 INNER JOIN orderdetails AS t2 ON t1.orderNumber = t2.orderNumber INNER JOIN products AS t3 ON t2.productCode = t3.productCode WHERE STRFTIME('%Y', t1.orderDate) = '2003' GROUP BY t3.productName ORDER BY SUM(t2.quantityOrdered) DESC LIMIT 3\n```"}]}, {"id": "train-1662", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out sale rep that has sold 1969 Harley Davidson Ultimate Chopper. List out their names and quantity sold throughout the year."}, {"from": "gpt", "value": "```sql\nSELECT t5.firstName, t5.lastName, SUM(t2.quantityOrdered) FROM products AS t1 INNER JOIN orderdetails AS t2 ON t1.productCode = t2.productCode INNER JOIN orders AS t3 ON t2.orderNumber = t3.orderNumber INNER JOIN customers AS t4 ON t3.customerNumber = t4.customerNumber INNER JOIN employees AS t5 ON t4.salesRepEmployeeNumber = t5.employeeNumber WHERE t1.productName = '1969 Harley Davidson Ultimate Chopper' GROUP BY t5.lastName, t5.firstName\n```"}]}, {"id": "train-1663", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the sales representatives in New York City? List their full names."}, {"from": "gpt", "value": "```sql\nSELECT t1.lastName, t1.firstName FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t2.city = 'NYC' AND t1.jobTitle = 'Sales Rep'\n```"}]}, {"id": "train-1664", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the customer and list down the country with the check number GG31455."}, {"from": "gpt", "value": "```sql\nSELECT t2.customerName, t2.country FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t1.checkNumber = 'GG31455'\n```"}]}, {"id": "train-1665", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 2001 Ferrari Enzo were ordered?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(t1.orderNumber) FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode WHERE t2.productName = '2001 Ferrari Enzo'\n```"}]}, {"id": "train-1666", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which 5 products has the lowest amount of orders? List the product names."}, {"from": "gpt", "value": "```sql\nSELECT t2.productName FROM orderdetails AS t1 INNER JOIN products AS t2 ON t1.productCode = t2.productCode GROUP BY t2.productName ORDER BY SUM(t1.quantityOrdered) ASC LIMIT 5\n```"}]}, {"id": "train-1667", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the customer names with a disputed order status."}, {"from": "gpt", "value": "```sql\nSELECT t1.customerName FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.status = 'Disputed'\n```"}]}, {"id": "train-1668", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries from the USA have an In Process order status?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(t2.orderNumber) FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.status = 'On Hold' AND t1.country = 'USA'\n```"}]}, {"id": "train-1669", "db_id": "car_retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total price of shipped orders belonging to Land of Toys Inc. under the classic car line of products."}, {"from": "gpt", "value": "```sql\nSELECT SUM(t3.priceEach * t3.quantityOrdered) FROM customers AS t1 INNER JOIN orders AS t2 ON t1.customerNumber = t2.customerNumber INNER JOIN orderdetails AS t3 ON t2.orderNumber = t3.orderNumber INNER JOIN products AS t4 ON t3.productCode = t4.productCode WHERE t4.productLine = 'Classic Cars' AND t1.customerName = 'Land of Toys Inc.' AND t2.status = 'Shipped'\n```"}]}, {"id": "train-1670", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restaurants have not obtained a minimum of 3 in their reviews?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id_restaurant) FROM generalinfo WHERE review < 3\n```"}]}, {"id": "train-1671", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What types of food are served at the 4 top-reviewed restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT food_type FROM generalinfo WHERE review = ( SELECT MAX(review) FROM generalinfo ) LIMIT 4\n```"}]}, {"id": "train-1672", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restaurants in the city of Richmond serve Mediterranean food?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id_restaurant) FROM generalinfo WHERE food_type = 'mediterranean' AND city = 'richmond'\n```"}]}, {"id": "train-1673", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the cities in Sonoma County."}, {"from": "gpt", "value": "```sql\nSELECT city FROM geographic WHERE county = 'sonoma county'\n```"}]}, {"id": "train-1674", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What counties are not in the Bay Area Region?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT county FROM geographic WHERE region != 'bay area'\n```"}]}, {"id": "train-1675", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all cities in the Northern California Region."}, {"from": "gpt", "value": "```sql\nSELECT city FROM geographic WHERE region = 'northern california'\n```"}]}, {"id": "train-1677", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restaurants can we find at number 871 on its street?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id_restaurant) FROM location WHERE street_num = 871\n```"}]}, {"id": "train-1678", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: At what numbers on 9th Avenue of San Francisco there are restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT id_restaurant FROM location WHERE City = 'san francisco' AND street_name = '9th avenue'\n```"}]}, {"id": "train-1679", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What type of food is there in the restaurants on Adeline Street in Berkeley city?"}, {"from": "gpt", "value": "```sql\nSELECT T1.food_type FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'adeline st' AND T2.city = 'berkeley'\n```"}]}, {"id": "train-1680", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which regions are there no African food restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type != 'african'\n```"}]}, {"id": "train-1681", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which counties are there A&W Root Beer Restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'a & w root beer'\n```"}]}, {"id": "train-1682", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate street and number of the Adelitas Taqueria Restaurants."}, {"from": "gpt", "value": "```sql\nSELECT T1.street_name, T1.street_num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'adelitas taqueria'\n```"}]}, {"id": "train-1683", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What type of food is served at the restaurant located at 3140, Alpine Road at San Mateo County?"}, {"from": "gpt", "value": "```sql\nSELECT T2.food_type FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant INNER JOIN geographic AS T3 ON T2.city = T3.city WHERE T3.County = 'san mateo county' AND T1.street_name = 'alpine rd' AND T1.street_num = 3140\n```"}]}, {"id": "train-1684", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which streets of the city of San Francisco are there restaurants that serve seafood?"}, {"from": "gpt", "value": "```sql\nSELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T2.food_type = 'seafood' AND street_name IS NOT NULL\n```"}]}, {"id": "train-1685", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all counties where there is no Bakers Square Restaurant & Pie Shop."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label != 'bakers square restaurant & pie shop'\n```"}]}, {"id": "train-1686", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In how many counties is there a street called Appian Way?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.county) FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.street_name = 'appian way'\n```"}]}, {"id": "train-1687", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the rating of each restaurant reviews on Atlantic Ave?"}, {"from": "gpt", "value": "```sql\nSELECT T1.review FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'atlantic ave'\n```"}]}, {"id": "train-1688", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify all restaurants in Contra Costa County by id."}, {"from": "gpt", "value": "```sql\nSELECT T1.id_restaurant FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'contra costa county'\n```"}]}, {"id": "train-1689", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify all the restaurants in Yolo County by their label."}, {"from": "gpt", "value": "```sql\nSELECT T1.id_restaurant, T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'yolo county'\n```"}]}, {"id": "train-1690", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What restaurant on Drive Street in San Rafael doesn't serve American food?"}, {"from": "gpt", "value": "```sql\nSELECT T1.label FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'drive' AND T1.food_type != 'american' AND T2.city = 'san rafael'\n```"}]}, {"id": "train-1691", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On which streets in the city of San Francisco are there restaurants with a review of 1.7?"}, {"from": "gpt", "value": "```sql\nSELECT T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.review = 1.7\n```"}]}, {"id": "train-1693", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On what street in Tuolumne County is Good Heavens restaurant located?"}, {"from": "gpt", "value": "```sql\nSELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant INNER JOIN geographic AS T3 ON T2.city = T3.city WHERE T2.label = 'good heavens' AND T3.county = 'tuolumne county'\n```"}]}, {"id": "train-1694", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the street numbers where Aux Delices Vietnamese Restaurant are located."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.street_num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'aux delices vietnamese restaurant'\n```"}]}, {"id": "train-1695", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify all the restaurants in Marin County by their id."}, {"from": "gpt", "value": "```sql\nSELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county'\n```"}]}, {"id": "train-1696", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which regions are there no pizza restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type = 'pizza' AND T2.region != 'unknown'\n```"}]}, {"id": "train-1697", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average rating of reviews for restaurants in Santa Cruz County."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.review) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'santa cruz county'\n```"}]}, {"id": "train-1698", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of restaurants in Monterey County have Mexican food?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.food_type = 'mexican', 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.county = 'monterey county'\n```"}]}, {"id": "train-1699", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of streets named 11th Street are in Alameda County?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.street_name = '11th st', 1, 0)) AS REAL) * 100 / COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.County = 'alameda county'\n```"}]}, {"id": "train-1700", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all of the restaurants that serve European food."}, {"from": "gpt", "value": "```sql\nSELECT label FROM generalinfo WHERE food_type = 'european'\n```"}]}, {"id": "train-1701", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What cities are located in Northern California?"}, {"from": "gpt", "value": "```sql\nSELECT city FROM geographic WHERE region = 'northern california'\n```"}]}, {"id": "train-1702", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What does the one and only 24-hour diner's name?"}, {"from": "gpt", "value": "```sql\nSELECT label FROM generalinfo WHERE food_type = '24 hour diner'\n```"}]}, {"id": "train-1703", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any five cities that have an unidentified county and region."}, {"from": "gpt", "value": "```sql\nSELECT city FROM geographic WHERE county = 'unknown' AND region = 'unknown' LIMIT 5\n```"}]}, {"id": "train-1707", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many American food restaurants are unpopular in Carmel?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id_restaurant) FROM generalinfo WHERE food_type = 'american' AND city = 'carmel' AND review = ( SELECT MIN(review) FROM generalinfo WHERE food_type = 'american' AND city = 'carmel' )\n```"}]}, {"id": "train-1708", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of restaurants that serve American food in Dublin city?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(food_type = 'american food', 1, 0)) AS REAL) * 100 / COUNT(id_restaurant) FROM generalinfo WHERE city = 'dublin'\n```"}]}, {"id": "train-1711", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What kind of restaurants can be found at \"106 E 25th Ave\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.food_type FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_num = 106 AND T2.street_name = 'e 25th ave'\n```"}]}, {"id": "train-1712", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please name any three restaurants that have an unidentified region."}, {"from": "gpt", "value": "```sql\nSELECT T2.label FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant INNER JOIN geographic AS T3 ON T2.city = T3.city WHERE T3.region = 'unknown' LIMIT 3\n```"}]}, {"id": "train-1714", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Thai restaurants can be found in San Pablo Ave, Albany?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id_restaurant) FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.food_type = 'thai' AND T1.city = 'albany' AND T2.street_name = 'san pablo ave'\n```"}]}, {"id": "train-1715", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the county and region of Plearn-Thai Cuisine restaurant?"}, {"from": "gpt", "value": "```sql\nSELECT T1.county, T1.region, T2.label FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.label = 'plearn-thai cuisine'\n```"}]}, {"id": "train-1716", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the restaurant that is located in El Dorado County, Lake Tahoe region?"}, {"from": "gpt", "value": "```sql\nSELECT T2.label FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'lake tahoe' AND T1.county = 'el dorado county'\n```"}]}, {"id": "train-1719", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of restaurants in the Bay Area region that scored over 4 for the review rating?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.review > 4, 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 RIGHT JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'bay area'\n```"}]}, {"id": "train-1720", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List every city in San Mateo County."}, {"from": "gpt", "value": "```sql\nSELECT city FROM geographic WHERE county = 'san mateo county'\n```"}]}, {"id": "train-1721", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restaurants have more than 4 star reviews?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id_restaurant) AS cnt FROM generalinfo WHERE review > 4\n```"}]}, {"id": "train-1722", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which street has the most restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT street_name FROM location GROUP BY street_name ORDER BY COUNT(street_name) DESC LIMIT 1\n```"}]}, {"id": "train-1723", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which chicken restaurant has the highest review?"}, {"from": "gpt", "value": "```sql\nSELECT label FROM generalinfo WHERE food_type = 'chicken' ORDER BY review DESC LIMIT 1\n```"}]}, {"id": "train-1724", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which county is El Cerrito from?"}, {"from": "gpt", "value": "```sql\nSELECT county FROM geographic WHERE city = 'el cerrito'\n```"}]}, {"id": "train-1725", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restaurants are on Irving Street?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id_restaurant) FROM location WHERE street_name = 'irving'\n```"}]}, {"id": "train-1726", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide a list of restaurants from Marin county."}, {"from": "gpt", "value": "```sql\nSELECT T1.label FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'marin county'\n```"}]}, {"id": "train-1727", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the address of the Peking Duck restaurant?"}, {"from": "gpt", "value": "```sql\nSELECT T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.label = 'peking duck restaurant'\n```"}]}, {"id": "train-1728", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the streets with more than 10 restaurants in Alameda county."}, {"from": "gpt", "value": "```sql\nSELECT T2.street_name FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.county = 'alameda county' GROUP BY T2.street_name HAVING COUNT(T2.id_restaurant) > 10\n```"}]}, {"id": "train-1729", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the regions with Greek restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.region FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'greek'\n```"}]}, {"id": "train-1730", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of the restaurant addresses from an unknown region."}, {"from": "gpt", "value": "```sql\nSELECT T2.street_name FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'unknown'\n```"}]}, {"id": "train-1731", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the review of the restaurant at 8440 Murray Ave?"}, {"from": "gpt", "value": "```sql\nSELECT T2.review FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_name = 'murray ave' AND T1.street_num = 8440\n```"}]}, {"id": "train-1733", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which street in San Francisco has the most burger restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.food_type = 'burgers' GROUP BY T2.street_name ORDER BY COUNT(T2.id_restaurant) DESC LIMIT 1\n```"}]}, {"id": "train-1734", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the region of 1149 El Camino Real?"}, {"from": "gpt", "value": "```sql\nSELECT T2.region FROM location AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.street_num = 1149 AND T1.street_name = 'el camino real'\n```"}]}, {"id": "train-1735", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the county of the Sankee restaurant?"}, {"from": "gpt", "value": "```sql\nSELECT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'sankee'\n```"}]}, {"id": "train-1736", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many streets with restaurants are there in the Northern California region?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.city) FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city WHERE T1.region = 'northern california'\n```"}]}, {"id": "train-1737", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of the restaurants on Park St."}, {"from": "gpt", "value": "```sql\nSELECT T2.label FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_name = 'park st'\n```"}]}, {"id": "train-1738", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of restaurants are from the Bay Area?"}, {"from": "gpt", "value": "```sql\nSELECT 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\n```"}]}, {"id": "train-1739", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the average reviews of Chinese restaurants for each county from highest to lowest."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.review) FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type = 'chinese' GROUP BY T1.id_restaurant ORDER BY AVG(T1.review) DESC\n```"}]}, {"id": "train-1742", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities are located in the Bay Area?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(city) FROM geographic WHERE region = 'bay area'\n```"}]}, {"id": "train-1743", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many labels of the restaurant have an unknown country?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.label) FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T2.county = 'unknown'\n```"}]}, {"id": "train-1747", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the address of the restaurant with the most popular reviews."}, {"from": "gpt", "value": "```sql\nSELECT T2.street_num, T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant ORDER BY T1.review DESC LIMIT 1\n```"}]}, {"id": "train-1749", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the percentage of restaurant in Napa Valley."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(region = 'Napa Valley', 1, 0)) AS REAL) * 100 / COUNT(region) FROM geographic\n```"}]}, {"id": "train-1750", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the cities are in a Bay Area?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(city) FROM geographic WHERE region = 'bay area'\n```"}]}, {"id": "train-1751", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the cities with unknown country."}, {"from": "gpt", "value": "```sql\nSELECT city FROM geographic WHERE county = 'unknown'\n```"}]}, {"id": "train-1752", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the city located in Bay Area of Santa Clara?"}, {"from": "gpt", "value": "```sql\nSELECT city FROM geographic WHERE region = 'bay area' AND county = 'santa clara county'\n```"}]}, {"id": "train-1753", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the restaurant ID of restaurants located in Sunnyvale."}, {"from": "gpt", "value": "```sql\nSELECT id_restaurant FROM location WHERE city = 'sunnyvale'\n```"}]}, {"id": "train-1754", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the restaurants on street number below 1000, how many of them are in Railroad St.?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(city) FROM location WHERE street_name = 'railroad' AND street_num < 1000\n```"}]}, {"id": "train-1755", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the 24 hour diner at San Francisco?"}, {"from": "gpt", "value": "```sql\nSELECT label FROM generalinfo WHERE food_type = '24 hour diner' AND city = 'san francisco'\n```"}]}, {"id": "train-1756", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the review of the restaurant located in Ocean St., Santa Cruz."}, {"from": "gpt", "value": "```sql\nSELECT T2.review FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'santa cruz' AND T1.street_name = 'ocean st'\n```"}]}, {"id": "train-1757", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the street number of a bar in Oakland with a 2.7 review."}, {"from": "gpt", "value": "```sql\nSELECT T2.street_num FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.review = 2.7 AND T2.city = 'oakland' AND T1.food_type = 'bar'\n```"}]}, {"id": "train-1758", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the bakeries, what is total number of bakery located at University Avenue, Palo Alto?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.food_type = 'bakery' AND T2.city = 'palo alto' AND T1.street_name = 'university ave.'\n```"}]}, {"id": "train-1760", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the review and label of the restaurants in Mission Blvd., Hayward."}, {"from": "gpt", "value": "```sql\nSELECT T2.review, T2.label FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'hayward' AND T1.street_name = 'mission blvd'\n```"}]}, {"id": "train-1761", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all indian restaurants in Castro St., Mountainview, how many of them is about cookhouse in their label?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_name = 'castro st' AND T1.city = 'mountain view' AND T2.food_type = 'indian' AND T2.label LIKE '%cookhouse%'\n```"}]}, {"id": "train-1762", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In restaurants with a review of 2, how many restaurants have a street number below 500?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.review = 2 AND T1.street_num < 500\n```"}]}, {"id": "train-1763", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all asian restaurants in N. Milpitas Blvd., Milpitas, how many of them have restaurant ID greater than 385?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id_restaurant) AS num FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.city = 'milpitas' AND T2.food_type = 'asian' AND T1.street_name = 'n milpitas blvd' AND T1.id_restaurant > 385\n```"}]}, {"id": "train-1764", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the restaurant's name and ID located at Ocean Avenue, San Francisco?"}, {"from": "gpt", "value": "```sql\nSELECT T2.label, T1.id_restaurant FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.street_name = 'ocean avenue'\n```"}]}, {"id": "train-1765", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full address of the restaurant named \"Sanuki Restaurant\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city, T1.street_num, T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.label = 'sanuki restaurant'\n```"}]}, {"id": "train-1767", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many American restaurants are located in Front, San Francisco?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.food_type = 'american') FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'san francisco' AND T1.street_name = 'front'\n```"}]}, {"id": "train-1768", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the restaurant's ID that has a review greater than the 70% of average review of all American restaurants with street number greater than 2000."}, {"from": "gpt", "value": "```sql\nSELECT T1.id_restaurant FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.food_type = 'american' AND T1.street_num > 2000 GROUP BY T1.id_restaurant ORDER BY AVG(T2.review) * 0.7 DESC\n```"}]}, {"id": "train-1769", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the restaurants located on the street number ranges from 1000 to 2000, what is the percentage of Afghani restaurants are there?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.food_type = 'afghani', 1, 0)) AS REAL) * 100 / COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE 1000 <= T1.street_num <= 2000\n```"}]}, {"id": "train-1770", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the most popular restaurant serving Asian foods in San Francisco?"}, {"from": "gpt", "value": "```sql\nSELECT label FROM generalinfo WHERE food_type = 'asian' AND city = 'san francisco' AND review = ( SELECT MAX(review) FROM generalinfo WHERE food_type = 'asian' AND city = 'san francisco' )\n```"}]}, {"id": "train-1771", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities are there in Monterey?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT city) FROM geographic WHERE region = 'monterey'\n```"}]}, {"id": "train-1772", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many deli in Belmont have a review rating of 2 or more?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id_restaurant) FROM generalinfo WHERE city = 'belmont' AND review > 2 AND food_type = 'deli'\n```"}]}, {"id": "train-1773", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which county in northern California has the highest number of cities?"}, {"from": "gpt", "value": "```sql\nSELECT county FROM geographic WHERE region = 'northern california' GROUP BY county ORDER BY COUNT(city) DESC LIMIT 1\n```"}]}, {"id": "train-1774", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restaurants can you find in Concord?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id_restaurant) FROM location WHERE city = 'concord'\n```"}]}, {"id": "train-1775", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which region can you find the top 4 most popular restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT T2.region FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city ORDER BY T1.review DESC LIMIT 4\n```"}]}, {"id": "train-1776", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Chinese restaurants are there on 1st st, Livermore?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id_restaurant) FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'livermore' AND T1.food_type = 'chinese' AND T2.street_name = '1st st'\n```"}]}, {"id": "train-1777", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Indian restaurants are there in the Los Angeles area?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.city) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'indian' AND T1.region = 'los angeles area'\n```"}]}, {"id": "train-1778", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the Bay Area, what is the most common type of food served by restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT T2.food_type FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'bay area' GROUP BY T2.food_type ORDER BY COUNT(T2.food_type) DESC LIMIT 1\n```"}]}, {"id": "train-1779", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restaurants in Broadway, Oakland received a review of no more than 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.street_name = 'broadway' AND T2.review < 3 AND T1.city = 'oakland'\n```"}]}, {"id": "train-1780", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which region can you find the highest number of Baskin Robbins restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT T2.region AS num FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'baskin robbins' GROUP BY T2.region ORDER BY COUNT(T1.city) DESC LIMIT 1\n```"}]}, {"id": "train-1781", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the streets where pizza-serving restaurants are found in San Jose."}, {"from": "gpt", "value": "```sql\nSELECT T1.street_name FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.food_type = 'pizza' AND T1.city = 'san jose'\n```"}]}, {"id": "train-1782", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many types of restaurants are there in the Yosemite and Mono Lake area?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.food_type) FROM geographic AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'yosemite and mono lake area'\n```"}]}, {"id": "train-1783", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full address of the most popular restaurant among the diners?"}, {"from": "gpt", "value": "```sql\nSELECT T2.street_name, T2.street_num, T2.city FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant ORDER BY T1.review DESC LIMIT 1\n```"}]}, {"id": "train-1784", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which counties can you find the restaurant with the highest number of branches?"}, {"from": "gpt", "value": "```sql\nSELECT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city GROUP BY T2.county ORDER BY COUNT(T1.label) DESC LIMIT 1\n```"}]}, {"id": "train-1785", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region has the highest number of restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT T1.region FROM geographic AS T1 INNER JOIN location AS T2 ON T1.city = T2.city GROUP BY T1.region ORDER BY COUNT(T2.id_restaurant) DESC LIMIT 1\n```"}]}, {"id": "train-1786", "db_id": "restaurant", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full address of all the American restaurants with a review of 4 or more?"}, {"from": "gpt", "value": "```sql\nSELECT T1.street_num, T1.street_name, T1.city FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.review >= 4\n```"}]}, {"id": "train-1787", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players were born after the year 1985?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Player_Id) FROM Player WHERE SUBSTR(DOB, 1, 4) > 1985\n```"}]}, {"id": "train-1788", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches were there in May, 2008?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Match_Id) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2008' AND SUBSTR(Match_Date, 7, 1) = '5'\n```"}]}, {"id": "train-1789", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many times has player no.41 won the \"man of the match\" award?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Match_Id) FROM `Match` WHERE Man_of_the_Match = 41\n```"}]}, {"id": "train-1790", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of all the matches in the year 2008."}, {"from": "gpt", "value": "```sql\nSELECT Match_Id FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2008'\n```"}]}, {"id": "train-1791", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players are from Australia?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T2.Country_Name = 'Australia' THEN T1.Player_Id ELSE NULL END) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id\n```"}]}, {"id": "train-1792", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is the oldest player from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Country_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T2.Country_Name = T1.Country_Id WHERE T2.Country_Name IS NOT NULL ORDER BY T2.DOB LIMIT 1\n```"}]}, {"id": "train-1793", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the bowling skill of SC Ganguly?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Bowling_Skill FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T2.Bowling_skill = T1.Bowling_Id WHERE T2.Player_Name = 'SC Ganguly'\n```"}]}, {"id": "train-1794", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who use the right hand as their batting hand, how many of them were born after 1985?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN SUBSTR(T1.DOB, 1, 4) > 1985 THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T2.Batting_Hand = 'Right-hand bat'\n```"}]}, {"id": "train-1795", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the players who use the right hand as their batting hand and are from Australia."}, {"from": "gpt", "value": "```sql\nSELECT T2.Player_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T2.Country_Name = T1.Country_id INNER JOIN Batting_Style AS T3 ON T2.Batting_hand = T3.Batting_Id WHERE T1.Country_Name = 'Australia' AND T3.Batting_Hand = 'Right-hand bat'\n```"}]}, {"id": "train-1796", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the bowling skills of all the players from Australia."}, {"from": "gpt", "value": "```sql\nSELECT T2.Bowling_Skill FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id INNER JOIN Country AS T3 ON T1.Country_Name = T3.Country_Id WHERE T3.Country_Name = 'Australia' GROUP BY T2.Bowling_Skill\n```"}]}, {"id": "train-1797", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players whose bowling skill is \"Legbreak\", when was the oldest one of them born?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(T1.DOB) FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id WHERE T2.Bowling_Skill = 'Legbreak'\n```"}]}, {"id": "train-1798", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the bowling skill used by most players?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Bowling_Skill FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T2.Bowling_skill = T1.Bowling_Id GROUP BY T1.Bowling_Skill ORDER BY COUNT(T1.Bowling_Skill) DESC LIMIT 1\n```"}]}, {"id": "train-1799", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the player who won the \"man of the match\" award in the match on 2008/4/18?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Player_Name FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match WHERE T1.Match_Date = '2008-04-18'\n```"}]}, {"id": "train-1800", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many times has SC Ganguly played as team captain in a match?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.Role_Desc = 'Captain' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id WHERE T1.Player_Name = 'SC Ganguly'\n```"}]}, {"id": "train-1801", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the role of SC Ganguly in the match on 2008/4/18?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Role_Id FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id INNER JOIN Match AS T4 ON T2.Match_Id = T4.Match_Id WHERE T1.Player_Name = 'SC Ganguly' AND T4.Match_Date = '2008-04-18'\n```"}]}, {"id": "train-1802", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the matches SC Ganguly has played in, what is the highest winning margin?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T3.Win_Margin) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id WHERE T1.Player_Name = 'SC Ganguly'\n```"}]}, {"id": "train-1803", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average winning margin of all the matches SC Ganguly has played in?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T3.Win_Margin) AS REAL) / COUNT(*) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id WHERE T1.Player_Name = 'SC Ganguly'\n```"}]}, {"id": "train-1804", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the players born after the year 1985, what is the percentage of the players who use the right hand as their batting hand?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Batting_Hand = 'Right-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE SUBSTR(T1.DOB, 1, 4) > 1985\n```"}]}, {"id": "train-1805", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the youngest player."}, {"from": "gpt", "value": "```sql\nSELECT Player_Name FROM Player ORDER BY DOB DESC LIMIT 1\n```"}]}, {"id": "train-1806", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times has Sunrisers Hyderabad been the toss winner of a game?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Toss_Winner = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Sunrisers Hyderabad' ) THEN 1 ELSE 0 END) FROM `Match`\n```"}]}, {"id": "train-1807", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the striker in the match no. 419169, over no.3, ball no.2, inning no.2."}, {"from": "gpt", "value": "```sql\nSELECT T2.Player_Name FROM Ball_by_Ball AS T1 INNER JOIN Player AS T2 ON T1.Striker = T2.Player_Id WHERE T1.Match_Id = 419169 AND T1.Over_Id = 3 AND T1.Ball_Id = 2 AND T1.Innings_No = 2\n```"}]}, {"id": "train-1808", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of venue for the game with a win margin of 138 points."}, {"from": "gpt", "value": "```sql\nSELECT T2.Venue_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Win_Margin = 138\n```"}]}, {"id": "train-1809", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the game on 2008/5/12, who was the man of the match?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match WHERE T2.Match_Date = '2008-05-12'\n```"}]}, {"id": "train-1810", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of captain keeper of the match no.419117."}, {"from": "gpt", "value": "```sql\nSELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Rolee AS T2 ON T1.Role_Id = T2.Role_Id INNER JOIN Player AS T3 ON T1.Player_Id = T3.Player_Id WHERE T1.Match_Id = '419117' AND T2.Role_Desc = 'CaptainKeeper'\n```"}]}, {"id": "train-1811", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the man of the series in 2013? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT T2.Player_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Season_Year = 2013\n```"}]}, {"id": "train-1812", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the date of birth of the 2014 Orange Cap winner."}, {"from": "gpt", "value": "```sql\nSELECT T2.DOB FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Season_Year = 2014 AND T1.Orange_Cap IS NOT NULL\n```"}]}, {"id": "train-1813", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the nationality of the 7th season Purple Cap winner?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Country_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Season_Id = 7 AND T1.Purple_Cap IS NOT NULL\n```"}]}, {"id": "train-1814", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country does Ranchi city belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country_Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id WHERE T1.City_Name = 'Ranchi'\n```"}]}, {"id": "train-1815", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Indian cities are there in the database?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id\n```"}]}, {"id": "train-1816", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of the city with the most venues."}, {"from": "gpt", "value": "```sql\nSELECT T1.City_Name FROM City AS T1 INNER JOIN Venue AS T2 ON T1.City_Id = T2.City_Id GROUP BY T1.City_Id ORDER BY COUNT(T2.Venue_Id) DESC LIMIT 1\n```"}]}, {"id": "train-1817", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the batting hand of MK Pandey?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Batting_hand FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T1.Player_Name = 'MK Pandey'\n```"}]}, {"id": "train-1818", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the database, how many times is the number of Indian cities to the South African cities?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id\n```"}]}, {"id": "train-1819", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times does M Chinnaswamy Stadium host games than Maharashtra Cricket Association Stadium?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Venue_Name = 'M Chinnaswamy Stadium' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.Venue_Name = 'Maharashtra Cricket Association Stadium' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id\n```"}]}, {"id": "train-1820", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the oldest player?"}, {"from": "gpt", "value": "```sql\nSELECT Player_Name FROM Player ORDER BY DOB ASC LIMIT 1\n```"}]}, {"id": "train-1821", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches were played on May 2008?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN SUBSTR(Match_Date, 7, 1) = '5' THEN 1 ELSE 0 END) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2008'\n```"}]}, {"id": "train-1822", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players were born in the 90s?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Player_Id) AS cnt FROM Player WHERE DOB BETWEEN '1990-01-01' AND '1999-12-31'\n```"}]}, {"id": "train-1823", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches did Team 10 play in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Team_1 = 10 OR Team_2 = 10 THEN 1 ELSE 0 END) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2012'\n```"}]}, {"id": "train-1824", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the id of the player who won the Orange Cap for 2 consecutive seasons."}, {"from": "gpt", "value": "```sql\nSELECT Orange_Cap FROM Season GROUP BY Orange_Cap HAVING COUNT(Season_Year) > 1\n```"}]}, {"id": "train-1825", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches were played in Season 7?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Match_Id) FROM `Match` WHERE Season_Id = 7\n```"}]}, {"id": "train-1826", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many umpires are from South Africa?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN Umpire AS T2 ON T1.Country_ID = T2.Umpire_Country\n```"}]}, {"id": "train-1827", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the player with the highest number of outstanding player awards in a particular match?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match GROUP BY T2.Man_of_the_Match ORDER BY COUNT(T2.Man_of_the_Match) DESC LIMIT 1\n```"}]}, {"id": "train-1828", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which country do the majority of the players are from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Country_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T1.Country_Id = T2.Country_Name GROUP BY T2.Country_Name ORDER BY COUNT(T2.Country_Name) DESC LIMIT 1\n```"}]}, {"id": "train-1829", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Orange Cap awards were won by CH Gayle?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Player_Name = 'CH Gayle' THEN 1 ELSE 0 END) AS cnt FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = T2.Orange_Cap\n```"}]}, {"id": "train-1830", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which season played the highest number of matches at M Chinnaswamy Stadium?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Season_Id FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T2.Venue_Name = 'M Chinnaswamy Stadium' GROUP BY T1.Season_Id ORDER BY COUNT(T1.Season_Id) DESC LIMIT 1\n```"}]}, {"id": "train-1831", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the team that won the most number of matches in season 1?"}, {"from": "gpt", "value": "```sql\nSELECT Team_Name FROM Team WHERE Team_Id = ( SELECT Match_Winner FROM `Match` WHERE season_Id = 1 GROUP BY Match_Winner ORDER BY COUNT(Match_Winner) DESC LIMIT 1 )\n```"}]}, {"id": "train-1832", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which venue did Kolkata Knight Riders play most of their matches as a Team 1?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Venue_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Team_1 INNER JOIN Venue AS T3 ON T2.Venue_Id = T3.Venue_Id WHERE T1.Team_Name = 'Kolkata Knight Riders' GROUP BY T3.Venue_Id ORDER BY COUNT(T3.Venue_Id) DESC LIMIT 1\n```"}]}, {"id": "train-1833", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team has the highest number of losses of all time?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Team_Name FROM Team AS T1 INNER JOIN ( SELECT COUNT(Team_1) AS a, Team_1 FROM Match WHERE Team_1 <> Match_Winner GROUP BY Team_1 UNION SELECT COUNT(Team_2) AS a, Team_2 FROM Match WHERE Team_2 <> Match_Winner GROUP BY Team_2 ORDER BY a DESC LIMIT 1 ) AS T2 ON T1.Team_Id = T2.Team_1\n```"}]}, {"id": "train-1834", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the player who won the first ever \"man of the match\" award?"}, {"from": "gpt", "value": "```sql\nSELECT Player_Name FROM Player WHERE Player_Id = ( SELECT Man_of_the_Match FROM `Match` ORDER BY match_date ASC LIMIT 1 )\n```"}]}, {"id": "train-1835", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Chennai Super Kings play its first match?"}, {"from": "gpt", "value": "```sql\nSELECT Match_Date FROM `Match` WHERE team_1 = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Chennai Super Kings' ) OR Team_2 = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Chennai Super Kings' ) ORDER BY Match_Date ASC LIMIT 1\n```"}]}, {"id": "train-1836", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players with left-hand batting style are from India?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) AS cnt FROM Batting_Style AS T1 INNER JOIN Player AS T2 ON T1.Batting_Id = T2.Batting_hand INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T3.Country_Name = 'India'\n```"}]}, {"id": "train-1837", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the player that has the highest number of roles as a captain for Deccan Chargers?"}, {"from": "gpt", "value": "```sql\nSELECT T4.Player_Name FROM Team AS T1 INNER JOIN Player_Match AS T2 ON T1.Team_id = T2.Team_id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id INNER JOIN Player AS T4 ON T2.Player_Id = T4.Player_Id WHERE T1.Team_Name = 'Deccan Chargers' AND T1.Team_Id = 8 AND T3.Role_Desc = 'Captain' AND T3.Role_Id = 1 GROUP BY T4.Player_Id ORDER BY COUNT(T3.Role_Id) DESC LIMIT 1\n```"}]}, {"id": "train-1838", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of all right-handed batting players among all the other players?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Batting_hand = 'Right-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Player_Id) FROM Batting_Style AS T1 INNER JOIN Player AS T2 ON T2.Batting_hand = T1.Batting_Id\n```"}]}, {"id": "train-1839", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the player who is born on July 7, 1981."}, {"from": "gpt", "value": "```sql\nSELECT Player_name FROM Player WHERE DOB = '1981-07-07'\n```"}]}, {"id": "train-1840", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches were played by the player with player ID 2?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Player_Id = 2 THEN 1 ELSE 0 END) FROM Player_Match\n```"}]}, {"id": "train-1841", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the first team's name in the match with the highest winning margin."}, {"from": "gpt", "value": "```sql\nSELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 ORDER BY T1.Win_Margin DESC LIMIT 1\n```"}]}, {"id": "train-1842", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the country where St. George's Park is located."}, {"from": "gpt", "value": "```sql\nSELECT T3.Country_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T2.City_Id = T1.City_Id INNER JOIN Country AS T3 ON T3.Country_Id = T2.Country_id WHERE T1.Venue_Name = 'St George''s Park'\n```"}]}, {"id": "train-1843", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the player's name of Mumbai Indians in the match ID 335990."}, {"from": "gpt", "value": "```sql\nSELECT T3.Team_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Team AS T3 ON T3.Team_Id = T2.Team_Id WHERE T2.Match_Id = 335990 AND T3.Team_Name = 'Mumbai Indians' GROUP BY T3.Team_Name\n```"}]}, {"id": "train-1844", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the winning team's name in the match with the point of winning margin of 7 on May 7, 2009."}, {"from": "gpt", "value": "```sql\nSELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T2.Match_Date = '2009-05-07' AND T2.Win_Margin = 7\n```"}]}, {"id": "train-1845", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the matches are Superover?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Outcome_Type = 'Superover' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Outcome AS T2 ON T2.Outcome_Id = T1.Outcome_type\n```"}]}, {"id": "train-1846", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the cities located in U.A.E."}, {"from": "gpt", "value": "```sql\nSELECT T1.City_Name FROM City AS T1 INNER JOIN Country AS T2 ON T2.Country_Id = T1.Country_id WHERE T2.Country_Name = 'U.A.E'\n```"}]}, {"id": "train-1847", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of won matches of the team named \"Pune Warriors\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Team_Name = 'Pune Warriors' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner\n```"}]}, {"id": "train-1849", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the role of K Goel in the match ID 335992?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Role_Desc FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Rolee AS T3 ON T3.Role_Id = T2.Role_Id WHERE T2.Match_Id = 335992 AND T1.Player_Name = 'K Goel'\n```"}]}, {"id": "train-1850", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities are located in South Africa?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T2.Country_Id = T1.Country_id\n```"}]}, {"id": "train-1851", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches were held at the venue named \"Newlands\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Venue_Name = 'Newlands' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Venue AS T2 ON T2.Venue_Id = T1.Venue_Id\n```"}]}, {"id": "train-1852", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the point of the winning margin in a match between Mumbai Indians and Royal Challengers Bangalore on May 28, 2008."}, {"from": "gpt", "value": "```sql\nSELECT T1.Win_Margin FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 INNER JOIN Team AS T3 ON T3.Team_Id = T1.Team_2 WHERE (T2.Team_Name = 'Mumbai Indians' AND T3.Team_Name = 'Royal Challengers Bangalore' AND T1.Match_Date = '2008-05-28') OR (T2.Team_Name = 'Royal Challengers Bangalore' AND T3.Team_Name = 'Mumbai Indians' AND T1.Match_Date = '2008-05-28')\n```"}]}, {"id": "train-1853", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the first andthe second teams that played a match with the point of the winning margin lower than the 30% of the average winning margin of the matches held in 2011."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT CASE WHEN T1.Win_Margin < ( SELECT AVG(Win_Margin) * 0.3 FROM Match WHERE Match_Date LIKE '2011%' ) THEN T2.Team_Name END, CASE WHEN T1.Win_Margin < ( SELECT AVG(Win_Margin) * 0.3 FROM Match WHERE Match_Date LIKE '2011%' ) THEN T3.Team_Name END FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 INNER JOIN Team AS T3 ON T3.Team_Id = T1.Team_2 WHERE T1.Match_Date LIKE '2011%'\n```"}]}, {"id": "train-1854", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players born in 1977, what is the percentage of the players with a role as a captain?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Role_Desc = 'Captain' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Role_Id) FROM Rolee AS T1 INNER JOIN Player_Match AS T2 ON T2.Role_Id = T1.Role_Id INNER JOIN Player AS T3 ON T3.Player_Id = T2.Player_Id WHERE T3.DOB LIKE '1977%'\n```"}]}, {"id": "train-1855", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many overs were there in the first innings of match ID \"335996\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Over_Id) FROM Ball_by_Ball WHERE Match_Id = 335996 AND Innings_No = 1\n```"}]}, {"id": "train-1856", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the over IDs, ball IDs, and innings numbers of the match ID \"336004\" while the batsman got the maximum scores."}, {"from": "gpt", "value": "```sql\nSELECT Over_Id, Ball_Id, Innings_No FROM Batsman_Scored WHERE Match_Id = 336004 ORDER BY Runs_Scored DESC LIMIT 1\n```"}]}, {"id": "train-1857", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe any five matches IDs that reached over ID 20."}, {"from": "gpt", "value": "```sql\nSELECT Match_Id FROM Ball_by_Ball WHERE Over_Id = 20 GROUP BY Match_Id LIMIT 5\n```"}]}, {"id": "train-1858", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players got out in the first inning of match ID \"548335\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Match_Id = 548335 THEN 1 ELSE 0 END) FROM Wicket_Taken WHERE Innings_No = 1\n```"}]}, {"id": "train-1859", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the players' names who were born in 1971."}, {"from": "gpt", "value": "```sql\nSELECT Player_name FROM Player WHERE DOB LIKE '1971%'\n```"}]}, {"id": "train-1860", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the match IDs which were held on 18th April 2015."}, {"from": "gpt", "value": "```sql\nSELECT Match_Id FROM Match WHERE Match_Date LIKE '%2015-04-18%'\n```"}]}, {"id": "train-1861", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the match IDs which had players out by hit wickets."}, {"from": "gpt", "value": "```sql\nSELECT T1.Match_Id FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T2.Out_Name = 'hit wicket'\n```"}]}, {"id": "train-1862", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players got out by being stumped in the second innings of all matches?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Innings_No = 2 THEN 1 ELSE 0 END) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T2.Out_Name = 'stumped'\n```"}]}, {"id": "train-1863", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did Yuvraj Singh receive the Man of the Match award?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Player_Name = 'Yuvraj Singh' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match\n```"}]}, {"id": "train-1864", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who were born in 1977, provide names and birthdates of the players from England."}, {"from": "gpt", "value": "```sql\nSELECT T2.Player_Name, T2.DOB FROM Country AS T1 INNER JOIN Player AS T2 ON T2.Country_Name = T1.Country_Id WHERE T2.DOB LIKE '1977%' AND T1.Country_Name = 'England'\n```"}]}, {"id": "train-1865", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who got the Man of the Series Award in 2010?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T2.Man_of_the_Match = T1.Player_Id INNER JOIN Season AS T3 ON T3.Season_Id = T2.Season_Id WHERE T3.Season_Year = 2010 GROUP BY T1.Player_Name\n```"}]}, {"id": "train-1866", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the win rate of the team \"Chennai Super Kings\"."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Match_Winner = 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Match_Id) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 INNER JOIN Team AS T3 ON T3.Team_Id = T1.Team_2 WHERE T2.Team_Name = 'Chennai Super Kings' OR T3.Team_Name = 'Chennai Super Kings'\n```"}]}, {"id": "train-1867", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names and countries of the players from Gujarat Lions who played in the match held on 11th April 2016."}, {"from": "gpt", "value": "```sql\nSELECT T4.Player_Name, T5.Country_Name FROM Player_Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_Id INNER JOIN Match AS T3 ON T3.Match_Id = T1.Match_Id INNER JOIN Player AS T4 ON T4.Player_Id = T1.Player_Id INNER JOIN Country AS T5 ON T5.Country_Id = T4.Country_Name WHERE T2.Team_Name = 'Gujarat Lions' AND T3.Match_Date = '2016-04-11'\n```"}]}, {"id": "train-1868", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names and birthdates of players who have left-arm fast skills."}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name, T1.DOB FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T2.Bowling_Id = T1.Bowling_skill WHERE T2.Bowling_skill = 'Left-arm fast'\n```"}]}, {"id": "train-1869", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where did BR Doctrove come from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Country_Name FROM Country AS T1 INNER JOIN Umpire AS T2 ON T2.Umpire_Country = T1.Country_Id WHERE T2.Umpire_Name = 'BR Doctrove'\n```"}]}, {"id": "train-1870", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the captain of the winning team in the match held on 1st June 2008?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Match AS T2 ON T2.Match_Id = T1.Match_Id INNER JOIN Player AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Rolee AS T4 ON T4.Role_Id = T1.Role_Id WHERE T2.Match_Date = '2008-06-01' AND T4.Role_Desc = 'Captain' AND T2.Match_Winner = T1.Team_Id\n```"}]}, {"id": "train-1871", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team did CK Kapugedera belong to? How many matches did he play?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Team_Name, COUNT(T2.Match_Id) FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Team AS T3 ON T3.Team_Id = T2.Team_Id WHERE T1.Player_Name = 'CK Kapugedera'\n```"}]}, {"id": "train-1872", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the matches held in Mumbai, how many percent of them were held in Wankhede Stadium?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Venue_Name = 'Wankhede Stadium' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Match_Id) FROM City AS T1 INNER JOIN Venue AS T2 ON T2.City_Id = T1.City_Id INNER JOIN Match AS T3 ON T3.Venue_Id = T2.Venue_Id WHERE T1.City_Name = 'Mumbai'\n```"}]}, {"id": "train-1873", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players out in match ID 392187, calculate the percentage of players out by bowl."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Out_Name = 'bowled' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Player_Out) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T2.Out_Id = T1.Kind_Out WHERE T1.Match_Id = 392187\n```"}]}, {"id": "train-1874", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of the toss-winners decided to bowl first on the pitch from 2010 to 2016?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Toss_Name = 'field' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Toss_Id) FROM Match AS T1 INNER JOIN Toss_Decision AS T2 ON T2.Toss_Id = T1.Toss_Decide WHERE T1.Match_Date BETWEEN '2010-01-01' AND '2016-12-31'\n```"}]}, {"id": "train-1875", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the ID of toss winners who decided to bat after winning the \"toss of the coin\"."}, {"from": "gpt", "value": "```sql\nSELECT Toss_Winner FROM Match WHERE Toss_Decide = 2\n```"}]}, {"id": "train-1876", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the match ID of matches that the \"man of the match\" award was given to BB McCullum."}, {"from": "gpt", "value": "```sql\nSELECT T1.Match_Id FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match WHERE T2.Player_Name = 'BB McCullum'\n```"}]}, {"id": "train-1877", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the DOB of players who received the \"man of the match\" award."}, {"from": "gpt", "value": "```sql\nSELECT T2.DOB FROM Match AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match\n```"}]}, {"id": "train-1878", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the name of teams that won the toss of the coin from matches with ID from 336010 to 336020."}, {"from": "gpt", "value": "```sql\nSELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Toss_Winner WHERE T1.Match_Id BETWEEN 336010 AND 336020\n```"}]}, {"id": "train-1879", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches have Mumbai Indians won?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Team_Name = 'Mumbai Indians' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner\n```"}]}, {"id": "train-1880", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down names of teams that have played as second team against Pune Warriors."}, {"from": "gpt", "value": "```sql\nSELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_2 WHERE T1.Team_1 = ( SELECT Team_Id FROM Team WHERE Team_Name = 'Pune Warriors' ) GROUP BY T2.Team_Name\n```"}]}, {"id": "train-1881", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the team that won match ID 336000?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Team_Name FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner WHERE T1.Match_Id = 336000\n```"}]}, {"id": "train-1882", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the match IDs that were played at Brabourne Stadium?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Match_Id FROM Match AS T1 INNER JOIN Venue AS T2 ON T2.Venue_Id = T1.Venue_Id WHERE T2.Venue_Name = 'Brabourne Stadium'\n```"}]}, {"id": "train-1883", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the name of venues in season 2."}, {"from": "gpt", "value": "```sql\nSELECT T2.Venue_Name FROM Match AS T1 INNER JOIN Venue AS T2 ON T2.Venue_Id = T1.Venue_Id WHERE T1.Season_Id = 2 GROUP BY T2.Venue_Name\n```"}]}, {"id": "train-1884", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the city of M Chinnaswamy Stadium?"}, {"from": "gpt", "value": "```sql\nSELECT T1.City_Name FROM City AS T1 INNER JOIN Venue AS T2 ON T2.City_Id = T1.City_Id WHERE T2.Venue_Name = 'M Chinnaswamy Stadium'\n```"}]}, {"id": "train-1885", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all of the venues in Mumbai."}, {"from": "gpt", "value": "```sql\nSELECT T2.Venue_Name FROM City AS T1 INNER JOIN Venue AS T2 ON T2.City_Id = T1.City_Id WHERE T1.City_Name = 'Mumbai'\n```"}]}, {"id": "train-1886", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all of the winning teams' IDs that played in St George's Park."}, {"from": "gpt", "value": "```sql\nSELECT T2.Match_Winner FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Venue_Name LIKE 'St George%'\n```"}]}, {"id": "train-1887", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is SuperSport Park located at Centurion?"}, {"from": "gpt", "value": "```sql\nSELECT T2.City_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id WHERE T1.Venue_Name LIKE 'St George%'\n```"}]}, {"id": "train-1888", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total winning match for Deccan Chargers."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Match_Winner) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T1.Team_Name = 'Deccan Chargers'\n```"}]}, {"id": "train-1889", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the total venues located in Pune City."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Venue_Name) FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id WHERE T2.City_Name = 'Pune'\n```"}]}, {"id": "train-1890", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the player id of the player who was at the non-striker end for the most number of balls in the match 501219."}, {"from": "gpt", "value": "```sql\nSELECT Ball_Id FROM Ball_by_Ball WHERE Non_Striker = Ball_Id ORDER BY Ball_Id DESC LIMIT 1\n```"}]}, {"id": "train-1891", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average runs scored during the first half of all first innings."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN 1 < Over_Id AND Over_Id < 25 THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(Runs_Scored) FROM Batsman_Scored WHERE Innings_No = 1\n```"}]}, {"id": "train-1892", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the average extra runs given in the second innings of every match?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(Innings_No) FROM Extra_Runs WHERE Innings_No = 2\n```"}]}, {"id": "train-1893", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the matches, what percentage have a winning margin above 100?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN Win_Margin > 100 THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(Match_Id) FROM `Match`\n```"}]}, {"id": "train-1894", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of the players born between 1970 and 1990 in descending order of age."}, {"from": "gpt", "value": "```sql\nSELECT Player_Name FROM Player WHERE DOB BETWEEN '1970-01-01' AND '1990-12-31' ORDER BY DOB DESC\n```"}]}, {"id": "train-1895", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the wickets taken in the third overs, how many are without the involvement of fielders?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Fielders = '' THEN 1 ELSE 0 END) FROM Wicket_Taken WHERE Over_Id = 3\n```"}]}, {"id": "train-1896", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From which country does the most umpires are from? How many of them are from the mentioned country?\n"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country_Id, COUNT(T1.Umpire_Id) FROM Umpire AS T1 INNER JOIN Country AS T2 ON T2.Country_Id = T1.Umpire_Country GROUP BY T2.Country_Id ORDER BY COUNT(T1.Umpire_Id) DESC LIMIT 1\n```"}]}, {"id": "train-1897", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players, what percentage are both captain and keeper?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Role_Desc = 'CaptainKeeper' THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Player_Id) FROM Player_Match AS T1 INNER JOIN Rolee AS T2 ON T1.Role_Id = T2.Role_Id\n```"}]}, {"id": "train-1898", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the players, how many were out by hit wicket?"}, {"from": "gpt", "value": "```sql\nSELECT Player_Out FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T1.Kind_Out = T2.Out_Id WHERE Out_Name = 'hit wicket'\n```"}]}, {"id": "train-1899", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On average, how many players from each country bat with their right hand?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Batting_hand = 'Right-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Country_Name) FROM Batting_Style AS T1 INNER JOIN Player AS T2 ON T1.Batting_id = T2.Batting_hand\n```"}]}, {"id": "train-1900", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of players have Legbreak skill?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Bowling_skill = ' Legbreak' THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Player_Id) FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id\n```"}]}, {"id": "train-1901", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the matches where the winning margin is less than fifty, how many teams won by wicket?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Win_Id) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T2.Win_Type = 'wickets' AND T1.Win_Margin < 50\n```"}]}, {"id": "train-1902", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In how many venues did team 2 win the toss and lose the match?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Team_2 = T1.Match_Winner THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Team_1 = T1.Toss_Winner\n```"}]}, {"id": "train-1903", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which player became the man of the series in the year 2012? Give the name and country of this player."}, {"from": "gpt", "value": "```sql\nSELECT T2.Player_Name, T3.Country_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Season_Year = 2012\n```"}]}, {"id": "train-1904", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the venue where the most number of matches are held."}, {"from": "gpt", "value": "```sql\nSELECT T2.Venue_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id GROUP BY T2.Venue_Name ORDER BY COUNT(T2.Venue_Id) DESC LIMIT 1\n```"}]}, {"id": "train-1905", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city hosted the least number of no-result matches?"}, {"from": "gpt", "value": "```sql\nSELECT T4.City_Name FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id INNER JOIN Venue AS T3 ON T1.Venue_Id = T3.Venue_Id INNER JOIN City AS T4 ON T3.City_Id = T4.City_Id WHERE T2.Win_Type = 'NO Result' GROUP BY T4.City_Id ORDER BY COUNT(T2.Win_Type) ASC LIMIT 1\n```"}]}, {"id": "train-1906", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the name of the player who was the man of the series more than one time."}, {"from": "gpt", "value": "```sql\nSELECT T2.Player_Name FROM Season AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Series = T2.Player_Id WHERE T1.Man_of_the_Series > 1\n```"}]}, {"id": "train-1907", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name and country of the players who got more than average catches in ascending order of the number of catches."}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name, T4.Country_Name FROM Player AS T1 INNER JOIN Wicket_Taken AS T2 ON T1.Player_Id = T2.Fielders INNER JOIN Out_Type AS T3 ON T2.Kind_Out = T3.Out_Id INNER JOIN Country AS T4 ON T1.Country_Name = T4.Country_Id GROUP BY T1.Player_Name ORDER BY COUNT(T3.Out_Name) ASC\n```"}]}, {"id": "train-1908", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the matches that were won by runs by team 1, what percentage have team 1 won the toss and decided to field?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.Team_1 = T1.Match_Winner = T1.Toss_Winner THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Team_1) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id INNER JOIN Toss_Decision AS T3 ON T1.Toss_Decide = T3.Toss_Id WHERE T3.Toss_Name = 'field' AND T2.Win_Type = 'runs'\n```"}]}, {"id": "train-1909", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in the average number of players out by lbw and runout in the matches?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.Player_Out) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T1.Kind_Out = T2.Out_Id WHERE T2.Out_Name = 'lbw'\n```"}]}, {"id": "train-1910", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify by their ID all the overs in which the player with ID 7 was on strike."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT Over_Id FROM Ball_by_Ball WHERE Striker = 7\n```"}]}, {"id": "train-1911", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many first teams chose to bat after winning the toss?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Team_1) FROM `Match` WHERE Team_1 = Toss_Winner AND Toss_Decide = 2\n```"}]}, {"id": "train-1912", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games were played in March 2010?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Match_Date LIKE '2010-03%' THEN 1 ELSE 0 END) FROM `Match`\n```"}]}, {"id": "train-1913", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players are older than Gurkeerat Singh player?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN DOB < '1990-06-29' THEN 1 ELSE 0 END) FROM Player WHERE Player_Name != 'Gurkeerat Singh'\n```"}]}, {"id": "train-1914", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times has SR Watson been named 'Man of the Match'?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Player_Name = 'SR Watson' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Match = T2.Player_Id\n```"}]}, {"id": "train-1915", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the name of the most versatile players of the Delhi Daredevils."}, {"from": "gpt", "value": "```sql\nSELECT T3.Player_Name FROM Player_Match AS T1 INNER JOIN Team AS T2 ON T1.Team_Id = T2.Team_Id INNER JOIN Player AS T3 ON T1.Player_Id = T3.Player_Id WHERE T2.Team_Name = 'Delhi Daredevils' GROUP BY T3.Player_Name ORDER BY COUNT(T1.Role_Id) DESC LIMIT 1\n```"}]}, {"id": "train-1916", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the player who has been chosen the most times for 'Man of the Series'?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Player_Name FROM Season AS T1 INNER JOIN Match AS T2 ON T1.Man_of_the_Series = T2.Man_of_the_Match INNER JOIN Player AS T3 ON T2.Man_of_the_Match = T3.Player_Id GROUP BY T3.Player_Name ORDER BY COUNT(T1.Man_of_the_Series) DESC LIMIT 1\n```"}]}, {"id": "train-1917", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In what year did SP Narine win the Orange Cap?"}, {"from": "gpt", "value": "```sql\nSELECT T4.Season_Year, T4.Orange_Cap FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Season AS T4 ON T3.Season_Id = T4.Season_Id WHERE T1.Player_Name = 'SP Narine' GROUP BY T4.Season_Year, T4.Orange_Cap\n```"}]}, {"id": "train-1918", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which teams have had a player awarded the Purple Cap and another with the Orange Cap in the same season?"}, {"from": "gpt", "value": "```sql\nSELECT T5.Team_Name, T1.Orange_Cap, T1.Purple_Cap FROM Season AS T1 INNER JOIN Match AS T2 ON T1.Season_Id = T2.Season_Id INNER JOIN Player_Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Player AS T4 ON T3.Player_Id = T4.Player_Id INNER JOIN Team AS T5 ON T3.Team_Id = T5.Team_Id GROUP BY T5.Team_Name, T1.Orange_Cap, T1.Purple_Cap\n```"}]}, {"id": "train-1919", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all Zimbabwean players."}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id WHERE T2.Country_Name = 'Zimbabwea'\n```"}]}, {"id": "train-1920", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players bat with their left hands?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id\n```"}]}, {"id": "train-1921", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games were not won by runs?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Win_Type != 'runs' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id\n```"}]}, {"id": "train-1922", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of all New Zealand umpires."}, {"from": "gpt", "value": "```sql\nSELECT T1.Umpire_Name FROM Umpire AS T1 INNER JOIN Country AS T2 ON T1.Umpire_Country = T2.Country_Id WHERE T2.Country_Name = 'New Zealand'\n```"}]}, {"id": "train-1923", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which country do most players have the 'slow left-arm chinaman' bowling style?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Country_Name FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T1.Bowling_skill = 'Slow left-arm chinaman'\n```"}]}, {"id": "train-1924", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which venue did Kochi Tuskers Kerala play most of their matches?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.Venue_Id = T2.Venue_Id INNER JOIN Team AS T3 ON T2.Team_1 = T3.Team_Id WHERE T3.Team_Name = 'Kochi Tuskers Kerala' GROUP BY T1.Venue_Name\n```"}]}, {"id": "train-1925", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In how many games in which the batting team was the Delhi Daredevils were no runs scored?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Runs_Scored) FROM Batsman_Scored AS T1 INNER JOIN Ball_by_Ball AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id INNER JOIN Team AS T4 ON T3.Team_1 = T4.Team_Id WHERE T2.Team_Batting = 1 OR T2.Team_Batting = 2 AND T4.Team_Name = 'Delhi Daredevils'\n```"}]}, {"id": "train-1926", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In what percentage of games played at the Dr DY Patil Sports Academy venue did the winning team win by a margin of less than 10?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.Win_Margin < 10 THEN 1 ELSE 0 END) AS REAL) * 100 / TOTAL(T1.Venue_Id) FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Venue_Name = 'Dr DY Patil Sports Academy'\n```"}]}, {"id": "train-1927", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of extra runs made as noballs?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.Extra_Runs) FROM Extra_Runs AS T1 INNER JOIN Extra_Type AS T2 ON T1.Extra_Type_Id = T2.Extra_Id WHERE T2.Extra_Name = 'noballs'\n```"}]}, {"id": "train-1928", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the player's ID of the top five players, by descending order, in terms of bowling skill."}, {"from": "gpt", "value": "```sql\nSELECT Player_Id FROM Player ORDER BY Bowling_skill DESC LIMIT 5\n```"}]}, {"id": "train-1929", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players were born before 10/16/1975, and have a bowling skill of less than 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Player WHERE DOB < '1975-10-16' AND Bowling_skill < 3\n```"}]}, {"id": "train-1930", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the youngest player?"}, {"from": "gpt", "value": "```sql\nSELECT Player_Name FROM Player ORDER BY DOB DESC LIMIT 1\n```"}]}, {"id": "train-1931", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tally the player IDs of \"Man of the Series\" awardees for the seasons from 2011 to 2015."}, {"from": "gpt", "value": "```sql\nSELECT Man_of_the_Series FROM Season WHERE 2011 < Season_Year < 2015\n```"}]}, {"id": "train-1932", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of runs scored by the batsmen during the 2nd inning of the match ID 335988?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(Runs_Scored) FROM Batsman_Scored WHERE Match_Id = 335988 AND Innings_No = 2\n```"}]}, {"id": "train-1933", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between match nos. 335989 and 337000, how many times did a batsman score more than 3 runs during over no. 1, ball no. 1, and inning no. 1 of the matches?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Runs_Scored > 3 THEN 1 ELSE 0 END) FROM Batsman_Scored WHERE 335989 < Match_Id < 337000 AND Innings_No = 1 AND Over_Id = 1 AND Ball_Id = 1\n```"}]}, {"id": "train-1934", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give me the match ID and date of the matches that were held in Kingsmead for three consecutive days."}, {"from": "gpt", "value": "```sql\nSELECT T1.Match_Id, T1.Match_Date FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T2.Venue_Name = 'Kingsmead'\n```"}]}, {"id": "train-1935", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did the matches were held in MA Chidambaram Stadium from 5/9/2009 to 8/8/2011?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Venue_Name = 'MA Chidambaram Stadium' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE Match_Date BETWEEN '2009-05-09' AND '2011-08-08'\n```"}]}, {"id": "train-1936", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where was the ID 336005 match held? Please give me the venue and the city."}, {"from": "gpt", "value": "```sql\nSELECT T2.Venue_Name, T3.City_Name FROM `Match` AS T1 INNER JOIN Venue AS T2 ON T1.Venue_Id = T2.Venue_Id INNER JOIN City AS T3 ON T2.City_Id = T3.City_Id WHERE T1.Match_Id = '336005'\n```"}]}, {"id": "train-1937", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team wins the toss during the match ID 336011, and can you tell me whether they decided to bat or field?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Toss_Name, T1.Toss_Decide, T1.Toss_Winner FROM `Match` AS T1 INNER JOIN Toss_Decision AS T2 ON T1.Toss_Decide = T2.Toss_Id WHERE T1.Match_Id = '336011'\n```"}]}, {"id": "train-1938", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the South African players, how many were born before 4/11/1980?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.DOB < '1980-4-11' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id WHERE T2.Country_Name = 'South Africa'\n```"}]}, {"id": "train-1939", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the name of players whose bowling skill is Legbreak."}, {"from": "gpt", "value": "```sql\nSELECT T2.Player_Name FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill WHERE T1.Bowling_skill = 'Legbreak'\n```"}]}, {"id": "train-1940", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When and for what role did the youngest player appear in his first match?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Match_Date, T4.Role_Desc FROM `Match` AS T1 INNER JOIN Player_Match AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id INNER JOIN Rolee AS T4 ON T2.Role_Id = T4.Role_Id ORDER BY T3.DOB DESC LIMIT 1\n```"}]}, {"id": "train-1941", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tally the match IDs in which V Kohli is the \"Man of the Match\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.Match_Id FROM `Match` AS T1 INNER JOIN Player AS T2 ON T1.Man_of_the_Match = T2.Player_Id WHERE T2.Player_Name = 'V Kohli'\n```"}]}, {"id": "train-1942", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 2011 to 2012, how many Australian players became the \"Man of the Match\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Match_Date BETWEEN '2011%' AND '2012%' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Player AS T2 ON T2.Player_Id = T1.Man_of_the_Match INNER JOIN Country AS T3 ON T3.Country_Id = T2.Country_Name WHERE T3.Country_Name = 'Australia'\n```"}]}, {"id": "train-1944", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did the Sunrisers Hyderabad win their first match?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Match_Date FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Match_Winner = T2.Team_Id WHERE T2.Team_Name = 'Sunrisers Hyderabad'\n```"}]}, {"id": "train-1945", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the player names and IDs of the English umpires."}, {"from": "gpt", "value": "```sql\nSELECT T1.Umpire_Name, T1.Umpire_Id FROM Umpire AS T1 INNER JOIN Country AS T2 ON T1.Umpire_Country = T2.Country_Id WHERE T2.Country_Name = 'England'\n```"}]}, {"id": "train-1948", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the id of the team with the highest number of matches won?"}, {"from": "gpt", "value": "```sql\nSELECT Match_Id FROM `Match` ORDER BY Match_Winner DESC LIMIT 1\n```"}]}, {"id": "train-1949", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year do the majority of the players were born?"}, {"from": "gpt", "value": "```sql\nSELECT DOB FROM Player GROUP BY DOB ORDER BY COUNT(DOB) DESC LIMIT 1\n```"}]}, {"id": "train-1950", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the date of the match that has the highest wager on the final result of a game?"}, {"from": "gpt", "value": "```sql\nSELECT Match_Date FROM `Match` ORDER BY Win_Margin DESC LIMIT 1\n```"}]}, {"id": "train-1951", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which season has the fewest number of matches?"}, {"from": "gpt", "value": "```sql\nSELECT Season_Id FROM `Match` GROUP BY Season_Id ORDER BY COUNT(Match_Id) LIMIT 1\n```"}]}, {"id": "train-1952", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players have won at least 5 man of the match awards?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Match_Id) FROM `Match` GROUP BY Man_of_the_Match HAVING COUNT(Match_Id) >= 5\n```"}]}, {"id": "train-1953", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the player who received the man of the match award during the last match of Season 9?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match WHERE T2.Season_Id = 9 ORDER BY T2.Match_Date DESC LIMIT 1\n```"}]}, {"id": "train-1954", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the team that won the first ever match?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Team_Name FROM team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T2.Season_Id = 1 ORDER BY T2.Match_Date LIMIT 1\n```"}]}, {"id": "train-1955", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities are in U.A.E?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Country_Name = 'U.A.E' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN country AS T2 ON T1.Country_id = T2.Country_id\n```"}]}, {"id": "train-1956", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of all the umpires from England."}, {"from": "gpt", "value": "```sql\nSELECT T1.Umpire_Name FROM Umpire AS T1 INNER JOIN country AS T2 ON T2.Country_Id = T1.Umpire_Country WHERE T2.Country_Name = 'England'\n```"}]}, {"id": "train-1957", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players bowl in the legbreak style?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id WHERE T2.Bowling_skill = 'Legbreak'\n```"}]}, {"id": "train-1958", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches did Rajasthan Royals play in Season 8?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Season_Id = 8 THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Team_1 = T2.Team_Id OR T1.Team_2 = T2.Team_Id WHERE T2.Team_Name = 'Rajasthan Royals'\n```"}]}, {"id": "train-1959", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is umpire TH Wijewardene from?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country_Name FROM Umpire AS T1 INNER JOIN country AS T2 ON T2.Country_Id = T1.Umpire_Country WHERE T1.Umpire_Name = 'TH Wijewardene'\n```"}]}, {"id": "train-1960", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the venues in Abu Dhabi?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id WHERE T2.City_Name = 'Abu Dhabi'\n```"}]}, {"id": "train-1961", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is the youngest player from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Country_Name FROM Country AS T1 INNER JOIN Player AS T2 ON T1.Country_Id = T2.Country_Name ORDER BY T2.DOB DESC LIMIT 1\n```"}]}, {"id": "train-1962", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the names of the winning team's players in the first match of season 1."}, {"from": "gpt", "value": "```sql\nSELECT T3.Player_Name FROM `Match` AS T1 INNER JOIN Player_Match AS T2 ON T1.Match_Winner = T2.Team_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id WHERE T1.Season_Id = 1 ORDER BY T1.Match_Date LIMIT 1\n```"}]}, {"id": "train-1963", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the youngest player to have won the Purple Cap?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Season AS T2 ON T1.Player_Id = T2.Purple_Cap ORDER BY T2.Season_Year - SUBSTR(T1.DOB, 1, 4) LIMIT 1\n```"}]}, {"id": "train-1964", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the complete name of the venue, city and country where the last match was held."}, {"from": "gpt", "value": "```sql\nSELECT T1.Venue_Name, T2.City_Name, T3.Country_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id INNER JOIN Country AS T3 ON T2.Country_Id = T3.Country_Id INNER JOIN Match AS T4 ON T1.Venue_Id = T4.Venue_Id ORDER BY T4.Match_Date DESC LIMIT 1\n```"}]}, {"id": "train-1965", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many overs were there in each innings of match ID \"336011\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Innings_No = 1 THEN 1 ELSE 0 END) AS IN1 , SUM(CASE WHEN Innings_No = 2 THEN 1 ELSE 0 END) AS IN2 FROM Ball_by_Ball WHERE Match_Id = 336011\n```"}]}, {"id": "train-1966", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ball IDs, scores, and innings numbers in the over ID 20 of match ID \"335988\"."}, {"from": "gpt", "value": "```sql\nSELECT Ball_Id, Runs_Scored, Innings_No FROM Batsman_Scored WHERE Match_Id = 335988 AND Over_Id = 20\n```"}]}, {"id": "train-1967", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches were held in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2011%'\n```"}]}, {"id": "train-1968", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How old is Ishan Kishan in 2022?"}, {"from": "gpt", "value": "```sql\nSELECT 2022 - SUBSTR(DOB, 1, 4) FROM Player WHERE Player_Name = 'Ishan Kishan'\n```"}]}, {"id": "train-1969", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the win rate of the toss-winners in 2012."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN Toss_Winner = Match_Winner THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN Match_Date LIKE '2012%' THEN 1 ELSE 0 END) FROM `Match`\n```"}]}, {"id": "train-1970", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches in 2009 had win margins of less than 10?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2009%' AND Win_Margin < 10\n```"}]}, {"id": "train-1971", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the players' names in both teams of the match that was held in June 2014."}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Match AS T3 ON T2.Match_Id = T3.Match_Id WHERE SUBSTR(T3.Match_Date, 1, 4) = '2014' AND SUBSTR(T3.Match_Date, 7, 1) = '6' LIMIT 2\n```"}]}, {"id": "train-1972", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches did Mohammad Hafeez play?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Player_Name = 'Mohammad Hafeez' THEN 1 ELSE 0 END) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id\n```"}]}, {"id": "train-1973", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players from South Africa, provide the players' names who were born in 1984."}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id WHERE T2.Country_Name = 'South Africa' AND T1.DOB LIKE '1984%'\n```"}]}, {"id": "train-1974", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the\" Mumbai Indians\" team that played in 2009, how many percent of the matches did they win?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Match_Winner = T2.Team_Id THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Match_Id) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Team_1 = T2.Team_Id OR T1.Team_2 = T2.Team_Id WHERE T2.Team_Name = 'Mumbai Indians' AND T1.Match_Date LIKE '2009%'\n```"}]}, {"id": "train-1975", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of players with batting hands of left and right?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Batting_hand = 'Right-hand bat' THEN 1 ELSE 0 END) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id\n```"}]}, {"id": "train-1976", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the eldest player and where did he/she come from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name, T2.Country_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id ORDER BY T1.DOB LIMIT 1\n```"}]}, {"id": "train-1977", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which bowling skills did the players from Zimbabwea have?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Bowling_skill FROM Bowling_Style AS T1 INNER JOIN Player AS T2 ON T1.Bowling_Id = T2.Bowling_skill INNER JOIN Country AS T3 ON T2.Country_Name = T3.Country_Id WHERE T3.Country_Name = 'Zimbabwea'\n```"}]}, {"id": "train-1978", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the IDs and names of the umpires from New Zealand."}, {"from": "gpt", "value": "```sql\nSELECT T1.Umpire_Id, T1.Umpire_Name FROM Umpire AS T1 INNER JOIN Country AS T2 ON T1.Umpire_Country = T2.Country_Id WHERE T2.Country_Name = 'New Zealand'\n```"}]}, {"id": "train-1979", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the captain-keeper of Rising Pune Supergiants?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Team AS T3 ON T2.Team_Id = T3.Team_Id INNER JOIN Rolee AS T4 ON T2.Role_Id = T4.Role_Id WHERE T3.Team_Name = 'Rising Pune Supergiants' AND T4.Role_Desc = 'CaptainKeeper' GROUP BY T1.Player_Name\n```"}]}, {"id": "train-1980", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches did the Sunrisers Hyderabad team win in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Match_Date LIKE '2013%' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T1.Match_Winner = T2.Team_Id WHERE T2.Team_Name = 'Sunrisers Hyderabad'\n```"}]}, {"id": "train-1981", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide match ID which had the extra type of penalty."}, {"from": "gpt", "value": "```sql\nSELECT T1.Match_Id FROM Extra_Runs AS T1 INNER JOIN Extra_Type AS T2 ON T1.Extra_Type_Id = T2.Extra_Id WHERE T2.Extra_Name = 'penalty'\n```"}]}, {"id": "train-1982", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the teams played in a match which resulted in a tie in 2015."}, {"from": "gpt", "value": "```sql\nSELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Team_1 OR T1.Team_Id = T2.Team_2 INNER JOIN Win_By AS T3 ON T2.Win_Type = T3.Win_Id WHERE SUBSTR(T2.Match_Date, 1, 4) = '2015' AND T3.Win_Type = 'Tie' LIMIT 1\n```"}]}, {"id": "train-1983", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average players out in the first innings per match. How many of them were out by the leg before wicket?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.Player_Out) AS REAL) / COUNT(T1.Match_Id), SUM(CASE WHEN T2.Out_Name = 'lbw' THEN 1 ELSE 0 END) FROM Wicket_Taken AS T1 INNER JOIN Out_Type AS T2 ON T1.Kind_Out = T2.Out_Id WHERE T1.Innings_No = 2\n```"}]}, {"id": "train-1984", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches are there in 2008?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Match_Id) FROM `Match` WHERE Match_Date LIKE '2008%'\n```"}]}, {"id": "train-1985", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the matches with a total of two innings."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Match_Id) FROM Wicket_Taken WHERE innings_no = 2\n```"}]}, {"id": "train-1986", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which is the country of the city named \"Rajkot\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Country_Name FROM Country AS T1 INNER JOIN city AS T2 ON T1.Country_Id = T2.Country_Id WHERE city_name = 'Rajkot'\n```"}]}, {"id": "train-1987", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the matches are Superover?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.win_type = 'wickets' THEN 1 ELSE 0 END) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id\n```"}]}, {"id": "train-1988", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the teams that played in a match with the point of winning margin of 38 on April 30, 2009?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Team_1 WHERE T2.win_margin = 38 AND match_date = '2009-04-30'\n```"}]}, {"id": "train-1989", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the team of T Kohli in the match ID 335989."}, {"from": "gpt", "value": "```sql\nSELECT T1.Team_Name FROM Team AS T1 INNER JOIN Player_Match AS T2 ON T1.Team_Id = T2.Team_Id INNER JOIN Player AS T3 ON T2.Player_Id = T3.Player_Id WHERE T2.match_id = 335989 AND T3.player_name = 'T Kohli'\n```"}]}, {"id": "train-1990", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many venues are located at Centurion, South Africa?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Venue_name) FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_Id = T2.City_Id INNER JOIN Country AS T3 ON T2.Country_Id = T3.Country_Id WHERE T3.country_name = 'South Africa' AND T2.city_name = 'Centurion'\n```"}]}, {"id": "train-1991", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the matches of Delhi Daredevils in 2014, how many won matches are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Match_Winner) FROM `Match` AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Team_1 OR T2.Team_Id = T1.Team_2 WHERE T2.team_name = 'Delhi Daredevils' AND T1.Match_Date LIKE '2014%'\n```"}]}, {"id": "train-1992", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the matches played by Royal Challengers Bangalore, what is the match ID of the match with the highest winning margin?"}, {"from": "gpt", "value": "```sql\nSELECT T2.match_id FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner WHERE T1.team_name = 'Royal Challengers Bangalore' AND T2.match_date LIKE '2012%' ORDER BY T2.win_margin DESC LIMIT 1\n```"}]}, {"id": "train-1993", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did K Goel played as a player only?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Match_Id) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T2.Player_Name = 'K Goel' AND T3.Role_Id = 3\n```"}]}, {"id": "train-1994", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average winning margin of the matches held in Newlands?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.win_margin) FROM Match AS T1 INNER JOIN Venue AS T2 ON T1.venue_id = T2.venue_id WHERE T2.venue_name = 'Newlands'\n```"}]}, {"id": "train-1995", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the losing team's name in the match ID 336039."}, {"from": "gpt", "value": "```sql\nSELECT Team_Name FROM Team WHERE Team_Id = ( SELECT CASE WHEN Team_1 = Match_Winner THEN Team_2 ELSE Team_1 END FROM Match WHERE match_id = 336039 )\n```"}]}, {"id": "train-1996", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the venue for the match ID 829768?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id WHERE T2.match_id = 829768\n```"}]}, {"id": "train-1997", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the second team's name in the match with the lowest winning margin?"}, {"from": "gpt", "value": "```sql\nSELECT T1.team_name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.team_2 ORDER BY T2.win_margin LIMIT 1\n```"}]}, {"id": "train-1998", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the matches in 2013, what is the percentage of winning of the team \"Mumbai Indians\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Match_Winner = 7 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.Match_Winner) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner WHERE T2.Match_Date LIKE '2013%'\n```"}]}, {"id": "train-1999", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference between the number of matches where SC Ganguly played as a Captain and those matches where he played other roles?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.Role_Id = 1 THEN 1 ELSE 0 END) - SUM(CASE WHEN T3.Role_Id > 1 THEN 1 ELSE 0 END) FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T2.Player_Name = 'SC Ganguly'\n```"}]}, {"id": "train-2000", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players have the bowling skill greater than 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Player_Name) FROM Player WHERE Bowling_skill > 2\n```"}]}, {"id": "train-2001", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players were born in 1970?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Player_Name) FROM Player WHERE DOB LIKE '1970%'\n```"}]}, {"id": "train-2002", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players were born in the 80s and have bowling skill of 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Player_Name) FROM Player WHERE DOB LIKE '198%' AND Bowling_skill = 2\n```"}]}, {"id": "train-2003", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches are there in April, 2008?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Match_Id) FROM Match WHERE Match_date LIKE '2008-04%'\n```"}]}, {"id": "train-2004", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the city name of country ID 3?"}, {"from": "gpt", "value": "```sql\nSELECT City_Name FROM City WHERE Country_ID = 3\n```"}]}, {"id": "train-2005", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many victory matches were there in 2008?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Match_Id) FROM Match WHERE Match_Date LIKE '2008%' AND Match_Winner IS NOT NULL\n```"}]}, {"id": "train-2006", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the country ID of East London."}, {"from": "gpt", "value": "```sql\nSELECT Country_id FROM City WHERE City_Name = 'East London'\n```"}]}, {"id": "train-2007", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How old is SC Ganguly in 2008?"}, {"from": "gpt", "value": "```sql\nSELECT 2008 - strftime('%Y', DOB) FROM Player WHERE Player_Name = 'SC Ganguly'\n```"}]}, {"id": "train-2008", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of players who play by the left hand."}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T2.Batting_hand = 'Left-hand bat'\n```"}]}, {"id": "train-2009", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players are Indians?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE T2.Country_Name = 'India'\n```"}]}, {"id": "train-2010", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of England players."}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE T2.Country_Name = 'England'\n```"}]}, {"id": "train-2011", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the venue name of Bandladore?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Venue_Name FROM Venue AS T1 INNER JOIN City AS T2 ON T1.City_ID = T2.City_ID WHERE T2.City_Name = 'Bangalore'\n```"}]}, {"id": "train-2012", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of players who participated in season year 2008?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T4.Season_Year = 2008 GROUP BY T1.Player_Name\n```"}]}, {"id": "train-2013", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of players that have run scored less than 3?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Batsman_Scored AS T3 ON T2.Match_ID = T3.Match_ID WHERE T3.Runs_Scored < 3 GROUP BY T1.Player_Name\n```"}]}, {"id": "train-2014", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the role of SC Ganguly?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Role_Desc FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id WHERE T1.Player_Name = 'SC Ganguly' GROUP BY T3.Role_Desc\n```"}]}, {"id": "train-2015", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of players who played as a keeper."}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id WHERE T3.Role_Desc = 'Keeper' GROUP BY T1.Player_Name\n```"}]}, {"id": "train-2016", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of players in team 1?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Player_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Team AS T3 ON T2.Team_Id = T3.Team_Id WHERE T3.Team_Id = 1 GROUP BY T1.Player_Name\n```"}]}, {"id": "train-2017", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players played as a captain in season year 2008?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Player_Id) FROM Player_Match AS T1 INNER JOIN Match AS T2 ON T1.Match_Id = T2.Match_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T3.Role_Desc = 'Captain' AND T2.Match_Date LIKE '2008%'\n```"}]}, {"id": "train-2018", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which teams did SC Ganguly join in season year 2008?"}, {"from": "gpt", "value": "```sql\nSELECT T5.Team_Name FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id INNER JOIN Team AS T5 ON T3.Team_Id = T5.Team_Id WHERE T4.Season_Year = 2008 AND T1.Player_Name = 'SC Ganguly' GROUP BY T5.Team_Name\n```"}]}, {"id": "train-2019", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What type did match ID 336000 win?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Win_Type FROM Match AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T1.Match_Id = 336000\n```"}]}, {"id": "train-2020", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where did SB Joshi come from?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE T1.Player_Name = 'SB Joshi'\n```"}]}, {"id": "train-2021", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players have left arm fast in bowling skill?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Bowling_Style AS T2 ON T1.Bowling_skill = T2.Bowling_Id WHERE T2.Bowling_skill = 'Left-arm fast'\n```"}]}, {"id": "train-2022", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the outcome type of match ID 392195?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Outcome_Type FROM Match AS T1 INNER JOIN Outcome AS T2 ON T1.Outcome_type = T2.Outcome_Id WHERE T1.Match_Id = '392195'\n```"}]}, {"id": "train-2023", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the youngest player and which city did he/she come from?"}, {"from": "gpt", "value": "```sql\nSELECT T3.City_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id INNER JOIN City AS T3 ON T2.Country_Id = T3.Country_Id ORDER BY T1.DOB LIMIT 1\n```"}]}, {"id": "train-2024", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches did team Kings XI Punjab win in season year 2008?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.Match_Id) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T1.Team_Name = 'Kings XI Punjab' AND T4.Season_Year = 2008\n```"}]}, {"id": "train-2025", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many seasons did Pune Warriors participate in?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.Season_Year) FROM ( SELECT T4.Season_Year FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T1.Team_Name = 'Pune Warriors' GROUP BY T4.Season_Year ) T\n```"}]}, {"id": "train-2026", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What year was R Dravid born and the role he played?"}, {"from": "gpt", "value": "```sql\nSELECT T1.DOB, T3.Role_Desc FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T2.Role_Id = T3.Role_Id WHERE T1.Player_Name = 'R Dravid' GROUP BY T1.DOB, T3.Role_Desc\n```"}]}, {"id": "train-2027", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did SC Ganguly be the man of the match?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Man_of_the_Match) FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id WHERE T1.Player_Name = 'SC Ganguly'\n```"}]}, {"id": "train-2028", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches did team Mumbai Indians win in 2008?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.Match_Id) FROM ( SELECT T2.Match_Id FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id WHERE T1.Team_Name = 'Mumbai Indians' AND T2.Match_Date LIKE '2008%' GROUP BY T2.Match_Id ) T\n```"}]}, {"id": "train-2029", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team won by wickets in match ID 335993?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Player_Match AS T3 ON T1.Team_Id = T3.Team_Id INNER JOIN Win_By AS T4 ON T2.Win_Type = T4.Win_Id WHERE T2.Match_Id = '335993' GROUP BY T1.Team_Name\n```"}]}, {"id": "train-2030", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the matches that were won by wickets in all season."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Match_Id) FROM Match AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T2.Win_type = 'wickets'\n```"}]}, {"id": "train-2032", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of players who had been man of the match more than 5 times in season year 2008?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN COUNT(T2.Man_of_the_Match) > 5 THEN T1.Player_Name ELSE 0 END FROM Player AS T1 INNER JOIN Match AS T2 ON T1.Player_Id = T2.Man_of_the_Match INNER JOIN Player_Match AS T3 ON T3.Player_Id = T1.Player_Id INNER JOIN Season AS T4 ON T2.Season_Id = T4.Season_Id WHERE T4.Season_Year = 2008\n```"}]}, {"id": "train-2033", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average of Indian players that were born between 1975 and 1985 among all players?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE strftime('%Y', T1.DOB) BETWEEN '1975' AND '1985'\n```"}]}, {"id": "train-2034", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of left hand batting style players among all players."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Batting_hand = 'Left-hand bat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Player_Id) FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id\n```"}]}, {"id": "train-2035", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of matches that are won by runs?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.win_type = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Win_Type) FROM Match AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id\n```"}]}, {"id": "train-2036", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches have 7 points of winning margin?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Match_Id) FROM Match WHERE win_margin = 7\n```"}]}, {"id": "train-2037", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of players born between 1970 to 1975?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Player_Id) FROM Player WHERE strftime('%Y', DOB) BETWEEN '1970' AND '1975'\n```"}]}, {"id": "train-2038", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the winning team in a match held on April 26, 2009 with a winning margin of 6 points?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner WHERE T2.Win_Margin = 6 AND T2.Match_Date = '2009-04-26'\n```"}]}, {"id": "train-2039", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the match ID 419135, who won by runs?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Team_Name FROM Team AS T1 INNER JOIN Match AS T2 ON T1.team_id = T2.match_winner INNER JOIN Win_By AS T3 ON T2.win_type = T3.win_id WHERE T2.Match_Id = 419135\n```"}]}, {"id": "train-2040", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the matches held in St. George's Park, give the match ID of the match with the highest winning margin points."}, {"from": "gpt", "value": "```sql\nSELECT T2.Match_Id FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id WHERE T1.Venue_Name = 'St George''s Park' ORDER BY T2.Win_Margin DESC LIMIT 1\n```"}]}, {"id": "train-2041", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the players are from Sri Lanka?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_ID WHERE T2.Country_Name = 'Sri Lanka'\n```"}]}, {"id": "train-2042", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the player's name who played as a captain."}, {"from": "gpt", "value": "```sql\nSELECT T2.Player_Name FROM Player_Match AS T1 INNER JOIN Player AS T2 ON T1.Player_Id = T2.Player_Id INNER JOIN Rolee AS T3 ON T1.Role_Id = T3.Role_Id WHERE T3.Role_Desc = 'Captain' GROUP BY T2.Player_Name\n```"}]}, {"id": "train-2043", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the match's venue and winning team for the match ID 392194."}, {"from": "gpt", "value": "```sql\nSELECT T1.Venue_Name, T3.Team_Name FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.venue_id = T2.venue_id INNER JOIN Team AS T3 ON T2.match_winner = T3.Team_Id WHERE T2.Match_Id = 392194\n```"}]}, {"id": "train-2044", "db_id": "soccer_2016", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the matches of Delhi Daredevils in 2009, what is the percentage of their matches won by wickets?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.Win_Type = 'wickets' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Win_Type) FROM Team AS T1 INNER JOIN Match AS T2 ON T1.Team_Id = T2.Match_Winner INNER JOIN Win_By AS T3 ON T2.Win_Type = T3.Win_Id WHERE T1.Team_Name = 'Delhi Daredevils'\n```"}]}, {"id": "train-2046", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times was the album released by blowfly in 1980 downloaded?"}, {"from": "gpt", "value": "```sql\nSELECT totalSnatched FROM torrents WHERE artist LIKE 'blowfly' AND groupYear = 1980\n```"}]}, {"id": "train-2047", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the tag of the album with the highest amount of downloads?"}, {"from": "gpt", "value": "```sql\nSELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched DESC LIMIT 1\n```"}]}, {"id": "train-2048", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 5 tags with the highest amount of downloads?"}, {"from": "gpt", "value": "```sql\nSELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched DESC LIMIT 5\n```"}]}, {"id": "train-2049", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the release title of the single under the \"funk\" tag that was released the oldest?"}, {"from": "gpt", "value": "```sql\nSELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag LIKE 'funk' AND T1.releaseType = 'single' ORDER BY T1.groupYear LIMIT 1\n```"}]}, {"id": "train-2050", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all the release titles of the \"ep's\" under the alternative tag."}, {"from": "gpt", "value": "```sql\nSELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag LIKE 'alternative' AND T1.releaseType = 'ep'\n```"}]}, {"id": "train-2051", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the tags of the top 5 least downloaded live albums?"}, {"from": "gpt", "value": "```sql\nSELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'album' ORDER BY T1.totalSnatched LIMIT 5\n```"}]}, {"id": "train-2052", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the tag and the artist of the most downloaded single?"}, {"from": "gpt", "value": "```sql\nSELECT T2.tag, T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'single' ORDER BY T1.totalSnatched DESC LIMIT 1\n```"}]}, {"id": "train-2053", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many releases are tagged \"1980s\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM tags WHERE tag LIKE '1980s'\n```"}]}, {"id": "train-2054", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times has the release \"city funk\" been downloaded?"}, {"from": "gpt", "value": "```sql\nSELECT totalSnatched FROM torrents WHERE groupName LIKE 'city funk'\n```"}]}, {"id": "train-2055", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the releases that have been downloaded for more than 20000 times."}, {"from": "gpt", "value": "```sql\nSELECT groupName FROM torrents WHERE totalSnatched > 20000\n```"}]}, {"id": "train-2056", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the tags of the release \"sugarhill gang\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupName = 'sugarhill gang'\n```"}]}, {"id": "train-2057", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many tags does the release \"city funk\" have\uff1f"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.tag) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupName = 'city funk'\n```"}]}, {"id": "train-2058", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the releases with the tag \"1980s\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s'\n```"}]}, {"id": "train-2059", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the releases with the tag \"1980s\", which one of them is the most downloaded? Please give its title."}, {"from": "gpt", "value": "```sql\nSELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s' ORDER BY T1.totalSnatched DESC LIMIT 1\n```"}]}, {"id": "train-2060", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many releases by the artist michael jackson are tagged \"pop\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.groupName) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'pop' AND T1.artist = 'michael jackson'\n```"}]}, {"id": "train-2061", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the releases that were released in 2000, how many of them were released as an album and tagged \"pop\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.groupName) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'pop' AND T1.releaseType = 'album' AND T1.groupYear = 2000\n```"}]}, {"id": "train-2062", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the average download times for the a release tagged \"1980s\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.totalSnatched) AS REAL) / COUNT(T2.tag) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = '1980s'\n```"}]}, {"id": "train-2063", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the title of the top three releases with the highest number of downloads."}, {"from": "gpt", "value": "```sql\nSELECT groupName FROM torrents ORDER BY totalSnatched DESC LIMIT 3\n```"}]}, {"id": "train-2064", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of the artist who released his or her Single-Table in 2012 with the highest number of downloads. Name the Single-Table title as well."}, {"from": "gpt", "value": "```sql\nSELECT artist, groupName FROM torrents WHERE groupYear = 2012 AND releaseType LIKE 'Single' ORDER BY totalSnatched DESC LIMIT 1\n```"}]}, {"id": "train-2065", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many albums and Single-Tables were released by the artist named '50 cent' between 2010 and 2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id), ( SELECT COUNT(id) FROM torrents WHERE groupYear BETWEEN 2010 AND 2015 AND artist LIKE '50 cent' AND releaseType LIKE 'album' ) FROM torrents WHERE groupYear BETWEEN 2010 AND 2015 AND artist LIKE '50 cent' AND releaseType LIKE 'Single'\n```"}]}, {"id": "train-2066", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: An American rapper '2Pac' released his first solo album in 1991, how many years have passed until his next album was released?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT groupYear FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'album' ORDER BY groupYear LIMIT 1, 1 ) - groupYear FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'album' AND groupYear = 1991\n```"}]}, {"id": "train-2067", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the average number of downloads for Single-Tables released by '2Pac' between 2001 and 2013."}, {"from": "gpt", "value": "```sql\nSELECT AVG(totalSnatched) FROM torrents WHERE artist LIKE '2Pac' AND releaseType LIKE 'Single' AND groupYear BETWEEN 2001 AND 2013\n```"}]}, {"id": "train-2068", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the title, release year and the tag associated with the live album that has the highest number of downloads?"}, {"from": "gpt", "value": "```sql\nSELECT T1.groupName, T1.groupYear, T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'live album' ORDER BY T1.totalSnatched DESC LIMIT 1\n```"}]}, {"id": "train-2069", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of artists who released at least two bootlegs in 2016."}, {"from": "gpt", "value": "```sql\nSELECT artist FROM torrents WHERE groupYear = 2016 AND releaseType LIKE 'bootleg' GROUP BY artist HAVING COUNT(releaseType) > 2\n```"}]}, {"id": "train-2070", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which artist released singles between 1980 to 1982?"}, {"from": "gpt", "value": "```sql\nSELECT artist FROM torrents WHERE groupYear BETWEEN 1980 AND 1982 AND releaseType LIKE 'single'\n```"}]}, {"id": "train-2071", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicates groups with id from 10 to 20 with singles downloaded at least 20."}, {"from": "gpt", "value": "```sql\nSELECT groupName FROM torrents WHERE totalSnatched >= 20 AND releaseType LIKE 'single' AND id BETWEEN 10 AND 20\n```"}]}, {"id": "train-2072", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the artists from 1980 to 1982. Which artist was tagged as \"disco\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'disco' AND T1.groupYear BETWEEN 1980 AND 1982\n```"}]}, {"id": "train-2073", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of artists who had no more than 100 downloads and are tagged \"funk\" in 1980."}, {"from": "gpt", "value": "```sql\nSELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'funk' AND T1.groupYear = 1980 AND T1.totalSnatched <= 100\n```"}]}, {"id": "train-2074", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which artist has released the most singles with the tag \"soul\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'soul' AND T1.releaseType = 'single' GROUP BY T1.artist ORDER BY COUNT(T1.releaseType) DESC LIMIT 1\n```"}]}, {"id": "train-2075", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the artists with the id from 10 to 30. Which artist released the product with the tag \"funk\" in 1980?"}, {"from": "gpt", "value": "```sql\nSELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'funk' AND T1.groupYear = 1980 AND T1.id BETWEEN 10 AND 30\n```"}]}, {"id": "train-2076", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the group name has the most downloaded that have released jazz genres from 1982 or later."}, {"from": "gpt", "value": "```sql\nSELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'jazz' AND T1.groupYear >= 1982 ORDER BY T1.totalSnatched DESC LIMIT 1\n```"}]}, {"id": "train-2077", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which artist has id \"16\"? Provide her or his tag genre."}, {"from": "gpt", "value": "```sql\nSELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.id = 16\n```"}]}, {"id": "train-2078", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among id from 10 to 50. Which artist tagged as \"new.york\" has the most downloads?"}, {"from": "gpt", "value": "```sql\nSELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.id BETWEEN 10 AND 50 AND T2.tag LIKE 'new.york' ORDER BY T1.totalSnatched DESC LIMIT 1\n```"}]}, {"id": "train-2079", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of artists who have released albums and mixtape from 1980 to 1985 in \"dance\" genre."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.artist) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'dance' AND T1.groupYear BETWEEN 1980 AND 1985 AND T1.releaseType LIKE 'album' OR T1.releaseType LIKE 'mixtape'\n```"}]}, {"id": "train-2080", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many singles were released between 1979 and 1981 labeled as \"soul\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.tag) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'soul' AND T1.groupYear BETWEEN 1979 AND 1981 AND T1.releaseType LIKE 'single'\n```"}]}, {"id": "train-2081", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many singles were released in 1979?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(releaseType) FROM torrents WHERE releaseType LIKE 'single' AND groupYear = 1979\n```"}]}, {"id": "train-2082", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1980, how many singles were released by sugar daddy?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(releaseType) FROM torrents WHERE artist LIKE 'sugar daddy' AND releaseType LIKE 'Single' AND groupYear = 1980\n```"}]}, {"id": "train-2083", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many christmas albums were released in 2004?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T2.tag = 'christmas' AND T1.groupYear = 2004 AND T1.releaseType LIKE 'album'\n```"}]}, {"id": "train-2084", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all tags of kurtis blow from 2000 to 2010."}, {"from": "gpt", "value": "```sql\nSELECT T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear BETWEEN 2000 AND 2010 AND T1.artist LIKE 'kurtis blow'\n```"}]}, {"id": "train-2085", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which album title and tag that millie jackson released in 1980?"}, {"from": "gpt", "value": "```sql\nSELECT T1.groupName, T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear = 1980 AND T1.artist LIKE 'millie jackson' AND T1.releaseType LIKE 'album'\n```"}]}, {"id": "train-2086", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all release titles whose tag is jazz in 2005."}, {"from": "gpt", "value": "```sql\nSELECT T1.groupName FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear = 2005 AND T2.tag LIKE 'jazz'\n```"}]}, {"id": "train-2087", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1980 to 2000, which artist had the most disco releases?"}, {"from": "gpt", "value": "```sql\nSELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear BETWEEN 1980 AND 2000 AND T2.tag LIKE 'disco' GROUP BY T1.artist ORDER BY COUNT(T2.tag) DESC LIMIT 1\n```"}]}, {"id": "train-2088", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which artists have released singles with the tag 1970s?"}, {"from": "gpt", "value": "```sql\nSELECT T1.artist FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'single' AND T2.tag LIKE '1970s'\n```"}]}, {"id": "train-2089", "db_id": "music_tracker", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1979 to 1982, what was the percentage of united.states albums out of total albums were released?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.tag LIKE 'united.states' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.releaseType) FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.groupYear BETWEEN 1979 AND 1982 AND T1.releaseType LIKE 'album'\n```"}]}, {"id": "train-2090", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries in the group of Heavily Indebted Poor Countries, how many of them are under the lending category of the International Development Associations?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CountryCode) FROM Country WHERE LendingCategory = 'IDA' AND OtherGroups = 'HIPC'\n```"}]}, {"id": "train-2091", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the countries under the lending category of the International Development Associations and have a external debt reporting finished by estimation."}, {"from": "gpt", "value": "```sql\nSELECT ShortName, ExternalDebtReportingStatus FROM Country WHERE LendingCategory = 'IDA'\n```"}]}, {"id": "train-2092", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the description of the series code SM.POP.TOTL for Aruba?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.ShortName = 'Aruba' AND T2.Seriescode = 'SM.POP.TOTL'\n```"}]}, {"id": "train-2093", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the countries in Latin America & Caribbean with a note on the series code SM.POP.TOTL."}, {"from": "gpt", "value": "```sql\nSELECT T1.SHORTNAME, T2.Description FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.Region = 'Latin America & Caribbean' AND T2.Seriescode = 'SM.POP.TOTL'\n```"}]}, {"id": "train-2094", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries with note on the series code SM.POP.TOTL, how many of them are in the low-income group?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Countrycode) FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Seriescode = 'SM.POP.TOTL' AND T1.IncomeGroup = 'Low income'\n```"}]}, {"id": "train-2095", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the descriptions of the series code SM.POP.TOTL for all the countries that are under the lending category of the International Development Associations."}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.LendingCategory = 'IDA' AND T2.Seriescode = 'SM.POP.TOTL'\n```"}]}, {"id": "train-2096", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many low-income countries under the lending category of the International Development Associations have a note on the series code SM.POP.TOTL?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Countrycode) FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.LendingCategory = 'IDA' AND T2.Seriescode = 'SM.POP.TOTL' AND IncomeGroup = 'Low income'\n```"}]}, {"id": "train-2097", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries in the High income: OECD group whose currency unit is Euro, how many of them have a note on the series code SP.DYN.AMRT.FE?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Countrycode) FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.IncomeGroup = 'High income: OECD' AND T1.CurrencyUnit = 'Euro' AND T2.Seriescode = 'SP.DYN.AMRT.FE'\n```"}]}, {"id": "train-2099", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description of the footnote on the series code AG.LND.FRST.K2 in 1990 for Aruba?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.ShortName = 'Aruba' AND T2.Seriescode = 'AG.LND.FRST.K2' AND T2.Year = 'YR1990'\n```"}]}, {"id": "train-2100", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On which years did Aruba got a footnote on the series code AG.LND.FRST.K2?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Year FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.ShortName = 'Aruba' AND T2.Seriescode = 'AG.LND.FRST.K2'\n```"}]}, {"id": "train-2101", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the countries that got the footnote \"Data are classified as official aid.\" on the series code DC.DAC.AUSL.CD in 2002."}, {"from": "gpt", "value": "```sql\nSELECT T1.SHORTNAME FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Data are classified as official aid.' AND T2.Seriescode = 'DC.DAC.AUSL.CD' AND T2.Year LIKE '%2002%'\n```"}]}, {"id": "train-2102", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many footnotes did Aruba got on different series code in the year 2002?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.SeriesCode) FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.ShortName = 'Aruba' AND T2.Year = 'YR2002'\n```"}]}, {"id": "train-2103", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many consecutive years did Aruba get a footnote on the series code BX.KLT.DINV.CD.WD?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Year) FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.ShortName = 'Aruba' AND T2.Seriescode = 'BX.KLT.DINV.CD.WD'\n```"}]}, {"id": "train-2104", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average adolescent fertility rate of the country whose Alpha2Code is 1A over the years this indicator was calculated."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName LIKE 'adolescent fertility rate%'\n```"}]}, {"id": "train-2105", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the special notes for the country whose average adolescent fertility rate is the highest?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.SpecialNotes FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Value = ( SELECT Value FROM Indicators WHERE IndicatorName LIKE 'Adolescent fertility rate%' ORDER BY Value DESC LIMIT 1 )\n```"}]}, {"id": "train-2106", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the East Asia & Pacific countries which are under the High income: nonOECD group. Please include their alpha code."}, {"from": "gpt", "value": "```sql\nSELECT CountryCode, Alpha2Code FROM Country WHERE Region = 'East Asia & Pacific' AND IncomeGroup = 'High income: nonOECD'\n```"}]}, {"id": "train-2107", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which country's latest trade data and latest water withdrawal data were both updated in the year 2013? Give its long name and Alpha 2 code."}, {"from": "gpt", "value": "```sql\nSELECT LongName, Alpha2Code FROM Country WHERE LatestTradeData = 2013 AND LatestWaterWithdrawalData = 2013\n```"}]}, {"id": "train-2108", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average value of Adjusted net enrolment rate, primary, both sexes (%) indicator in Algeria from 1975 to 1980?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(Value) AS REAL) / COUNT(CountryCode) FROM Indicators WHERE CountryName = 'Algeria' AND Year > 1974 AND Year < 1981 AND IndicatorName = 'Adjusted net enrolment rate, primary, both sexes (%)'\n```"}]}, {"id": "train-2109", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the Indicator names and aggregation methods when the topic is Economic Policy & Debt: Balance of payments: Capital & financial account?"}, {"from": "gpt", "value": "```sql\nSELECT IndicatorName, AggregationMethod FROM Series WHERE Topic = 'Economic Policy & Debt: Balance of payments: Capital & financial account'\n```"}]}, {"id": "train-2110", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the series codes in which the topic is about Environment: Emissions and the license type is restricted. Please include their alpha code."}, {"from": "gpt", "value": "```sql\nSELECT SeriesCode FROM Series WHERE Topic = 'Environment: Emissions' AND LicenseType = 'Restricted'\n```"}]}, {"id": "train-2111", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1970, how many Middle Eastern & North African countries whose value for CO2 emissions from gaseous fuel consumption (kt) indicator is more than 600?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.CountryCode) FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Middle East & North Africa' AND T1.IndicatorName = 'CO2 emissions FROM gaseous fuel consumption (kt)' AND T1.Year = 1970 AND T1.Value > 600\n```"}]}, {"id": "train-2112", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the top 3 Latin American & Caribbean countries with the highest average value in \"CO2 emissions (kt)\" indicator since 1965. Give their highest value and in what year."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CountryCode, T1.Year, T1.Value FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Latin America & Caribbean' AND T1.IndicatorName = 'CO2 emissions (kt)' AND T1.Year > 1965 AND T1.Year < 1980 ORDER BY T1.Value DESC LIMIT 3\n```"}]}, {"id": "train-2113", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the series note description of the series \"SP.DYN.TO65.MA.ZS\" which covers the topic \"Health: Mortality\" in 1967?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Series AS T1 INNER JOIN SeriesNotes AS T2 ON T1.SeriesCode = T2.Seriescode WHERE T1.SeriesCode = 'SP.DYN.TO65.MA.ZS' AND T1.Topic = 'Health: Mortality' AND T2.Year = 'YR1967'\n```"}]}, {"id": "train-2114", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please write down the footnote descriptions of Albania in 1981."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Description FROM FootNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode WHERE T1.Year = 'YR1981' AND T2.ShortName = 'Albania'\n```"}]}, {"id": "train-2115", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Enumerate the footnote narratives of The Bahamas under the series code SH.DTH.IMRT in the year 1984."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Description FROM FootNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode WHERE T1.Year = 'YR1984' AND T2.ShortName = 'The Bahamas' AND T1.Seriescode = 'SH.DTH.IMRT'\n```"}]}, {"id": "train-2117", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the World Bank code of the countries whose country note has described \"Data source : Human Mortality Database by University of California, Berkeley, and Max Planck Institute for Demographic Research.\"? Please include their lending category."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Wb2code, T1.LendingCategory FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Data source : Human Mortality Database by University of California, Berkeley, and Max Planck Institute for Demographic Research.' AND T1.LendingCategory != ''\n```"}]}, {"id": "train-2118", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the topic of the series when the Total reserves minus gold (current US$) indicator of Haiti hit the value of 3,000,000 in 1961? Please include its series code and license type."}, {"from": "gpt", "value": "```sql\nSELECT T2.Topic, T2.Seriescode, T2.LicenseType FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.Year = 1961 AND T1.CountryName = 'Haiti' AND T1.IndicatorName = 'Total reserves minus gold (current US$)' AND T1.Value = 3000000\n```"}]}, {"id": "train-2119", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries have reached their Adjusted net national income per capita (constant 2005 US$) indicator value to more than 1,000 but have not finished their external debt reporting?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CountryCode) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Adjusted net national income per capita (constant 2005 US$)' AND T1.ExternalDebtReportingStatus = 'Preliminary' AND T2.Value > 1000\n```"}]}, {"id": "train-2120", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which countries have a fertility rate between 4 and 5 in 1979? List their names."}, {"from": "gpt", "value": "```sql\nSELECT CountryName FROM Indicators WHERE Year = 1979 AND IndicatorName = 'Fertility rate, total (births per woman)' AND value >= 4 AND Value <= 5\n```"}]}, {"id": "train-2121", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the countries in south Asia which are in the low-income group. What is the source of their recent income and expenditure data? List it alongside the table name of the countries."}, {"from": "gpt", "value": "```sql\nSELECT TableName, SourceOfMostRecentIncomeAndExpenditureData FROM Country WHERE Region = 'South Asia' AND IncomeGroup = 'Low income'\n```"}]}, {"id": "train-2122", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the sources for the data of children who finished primary school education in Latin America & Caribbean countries?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Source FROM Footnotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode INNER JOIN Country AS T3 ON T1.Countrycode = T3.CountryCode WHERE T3.Region = 'Latin America & Caribbean' AND T2.IndicatorName = 'Children out of school, primary'\n```"}]}, {"id": "train-2123", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the sources for the Net Migration in South American countries in 2002."}, {"from": "gpt", "value": "```sql\nSELECT T2.Source FROM CountryNotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode INNER JOIN Country AS T3 ON T1.Countrycode = T3.CountryCode INNER JOIN SeriesNotes AS T4 ON T2.SeriesCode = T4.Seriescode WHERE T4.Year LIKE '%2002%' AND T2.IndicatorName = 'Net migration'\n```"}]}, {"id": "train-2124", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the sources for the data of children who finished primary school education in North American countries?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.Description FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T2.CountryCode = T3.Countrycode WHERE T1.Region = 'North America' AND T2.IndicatorName = 'Out-of-school children of primary school age, both sexes (number)'\n```"}]}, {"id": "train-2125", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the countries for which the latest trade data are from 2013, what was the GDP growth in 2014? List them in the ascending order of GDP."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CountryCode, T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.LatestTradeData = 2013 AND T2.IndicatorName LIKE 'GDP growth (annual %)' AND T2.year = 2014 AND T2.Value > 0 ORDER BY T2.Value ASC\n```"}]}, {"id": "train-2126", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which European countries had the highest private expenditure on health in 2005? List the top ten countries in descending order and find the source of the data."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CountryCode, T3.Description FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T1.CountryCode = T3.Countrycode WHERE T2.IndicatorName = 'Out-of-pocket health expenditure (% of private expenditure on health)' AND T2.Value > 0 AND T2.year = 2005 ORDER BY T2.Value DESC LIMIT 10\n```"}]}, {"id": "train-2127", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many low income countries are there in South Asia?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CountryCode) FROM Country WHERE Region = 'South Asia' AND IncomeGroup = 'Low income'\n```"}]}, {"id": "train-2128", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the short name of countries which have the latest trade data after 2010."}, {"from": "gpt", "value": "```sql\nSELECT ShortName FROM Country WHERE LatestTradeData > 2010\n```"}]}, {"id": "train-2129", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate the percentage of Sub-Saharan African countries which are in the Special trade system."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN Region = 'Sub-Saharan Africa' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(CountryCode) FROM Country WHERE SystemOfTrade = 'Special trade system'\n```"}]}, {"id": "train-2130", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate the average of Arms imports (SIPRI trend indicator values) of the European & Central Asian countries."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.Value) AS REAL) / COUNT(T1.CountryCode) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Region = 'Europe & Central Asia' AND T2.IndicatorName = 'Arms imports (SIPRI trend indicator values)'\n```"}]}, {"id": "train-2131", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which upper middle income country has the lowest value of CO2 emissions (kt)?"}, {"from": "gpt", "value": "```sql\nSELECT T1.CountryCode FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'Upper middle income' AND T2.IndicatorName = 'CO2 emissions (kt)' ORDER BY T2.Value ASC LIMIT 1\n```"}]}, {"id": "train-2132", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the minimum of International migrant stock, total of heavily indebted poor countries?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.OtherGroups = 'HIPC' AND T2.IndicatorName = 'International migrant stock, total'\n```"}]}, {"id": "train-2133", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the indicator names belonging to Education: Inputs topic in 2000."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.IndicatorName FROM Footnotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode WHERE T1.Year = 'YR2000' AND T2.Topic = 'Education: Inputs'\n```"}]}, {"id": "train-2134", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many annual indicators use the Sum aggregation method from 2001 to 2003?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.SeriesCode) FROM Footnotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode WHERE T1.Year IN ('YR2001', 'YR2002', 'YR2003') AND T2.Periodicity = 'Annual' AND T2.AggregationMethod = 'Sum'\n```"}]}, {"id": "train-2135", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2005, which series codes use the International Monetary Fund, Balance of Payments Statistics Yearbook and data files source?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Seriescode, T2.Source FROM Footnotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode WHERE T1.Year LIKE '%2005%' AND T2.Source LIKE 'International Monetary Fund%'\n```"}]}, {"id": "train-2136", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of countries in South Asia have the Life expectancy at birth, female (years) greater than 50?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.value > 50 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.CountryCode) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Region = 'South Asia' AND T2.IndicatorName = 'Life expectancy at birth, female (years)'\n```"}]}, {"id": "train-2137", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1960 to 1965, which country had the highest Death rate, crude (per 1,000 people)?"}, {"from": "gpt", "value": "```sql\nSELECT CountryName FROM Indicators WHERE Year BETWEEN 1960 AND 1965 AND IndicatorName = 'Death rate, crude (per 1,000 people)' ORDER BY Value DESC LIMIT 1\n```"}]}, {"id": "train-2138", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the indicator names of Arab World whose values are higher than 50 in 1960."}, {"from": "gpt", "value": "```sql\nSELECT IndicatorName FROM Indicators WHERE CountryName = 'Arab World' AND Year = 1960 AND Value > 50\n```"}]}, {"id": "train-2139", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the highest value of Merchandise imports by the reporting economy (current US$)?"}, {"from": "gpt", "value": "```sql\nSELECT CountryName FROM Indicators WHERE IndicatorName = 'Merchandise imports by the reporting economy (current US$)' ORDER BY Value DESC LIMIT 1\n```"}]}, {"id": "train-2140", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list annual indicator names which have values of more than 100 in 1965."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.IndicatorName FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.Year = 1965 AND T1.Value > 100 AND T2.Periodicity = 'Annual'\n```"}]}, {"id": "train-2141", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1968 to 1970, what are indicator names whose license type is open and values are less than 100?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.IndicatorName FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.Year >= 1968 AND T1.Year < 1971 AND T2.LicenseType = 'Open' AND T1.Value < 100\n```"}]}, {"id": "train-2142", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country had the highest value of indicator belongs to Private Sector & Trade: Exports topic? Please list the country name and indicator name."}, {"from": "gpt", "value": "```sql\nSELECT T1.CountryName, T1.IndicatorName FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T2.Topic = 'Private Sector & Trade: Exports' ORDER BY T1.Value DESC LIMIT 1\n```"}]}, {"id": "train-2143", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which indicator name uses the Weighted average method and has the lowest value?"}, {"from": "gpt", "value": "```sql\nSELECT T1.IndicatorName, MIN(T1.Value) FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T2.AggregationMethod = 'Weighted average'\n```"}]}, {"id": "train-2144", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list out all annual indicator names of Sudan in 1961?"}, {"from": "gpt", "value": "```sql\nSELECT T1.IndicatorName FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.CountryName = 'Sudan' AND T1.Year = 1961 AND T2.Periodicity = 'Annual'\n```"}]}, {"id": "train-2145", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1960 to 1965, which country has the lowest value of indicator belongs to Health: Population: Structure?"}, {"from": "gpt", "value": "```sql\nSELECT CountryName FROM Indicators WHERE Value = ( SELECT MIN(T1.Value) FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.Year >= 1960 AND T1.Year < 1966 AND T2.Topic = 'Health: Population: Structure' )\n```"}]}, {"id": "train-2146", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of upper middle income countries which have the CO2 emissions from liquid fuel consumption (% of total)\n\nless than 80%?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.IndicatorName = 'CO2 emissions FROM liquid fuel consumption (% of total)' AND t2.Value < 80 THEN 1 ELSE 0 END) * 1.0 / COUNT(T1.CountryCode) persent FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'Upper middle income'\n```"}]}, {"id": "train-2147", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is indicator code of Rural population?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT IndicatorCode FROM Indicators WHERE IndicatorName = 'Rural population'\n```"}]}, {"id": "train-2148", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many country uses the 2008 System of National Accounts methodology? List our their table name."}, {"from": "gpt", "value": "```sql\nSELECT TableName FROM Country WHERE SystemOfNationalAccounts = 'Country uses the 2008 System of National Accounts methodology.'\n```"}]}, {"id": "train-2149", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the series code of countries using Euro as their currency unit."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.SeriesCode FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.CurrencyUnit = 'Euro'\n```"}]}, {"id": "train-2150", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the long name of countries using series code as DT.DOD.DSTC.CD"}, {"from": "gpt", "value": "```sql\nSELECT T1.LongName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.SeriesCode = 'DT.DOD.DSTC.CD'\n```"}]}, {"id": "train-2151", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the series code of countries using Hong Kong dollar as their currency unit."}, {"from": "gpt", "value": "```sql\nSELECT T2.SeriesCode FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.CurrencyUnit = 'Hong Kong dollar'\n```"}]}, {"id": "train-2152", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the table name of countries using series code as SP.DYN.TO65.MA.ZS"}, {"from": "gpt", "value": "```sql\nSELECT T1.TableName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Seriescode = 'SP.DYN.TO65.MA.ZS'\n```"}]}, {"id": "train-2153", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the country name of lower earning countries"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.CountryName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'Low income'\n```"}]}, {"id": "train-2154", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the series code and country code of the poor countries that located in Latin American & Carribbean."}, {"from": "gpt", "value": "```sql\nSELECT T2.SeriesCode, T2.CountryCode FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.Region = 'Latin America & Caribbean' AND t1.incomegroup = 'Low income'\n```"}]}, {"id": "train-2155", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the series code of countries using Australian dollar as their currency unit. Which country belongs to middle income group among them."}, {"from": "gpt", "value": "```sql\nSELECT T1.CountryCode, T2.SeriesCode FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.CurrencyUnit = 'Australian dollar' AND T1.IncomeGroup = 'Lower middle income'\n```"}]}, {"id": "train-2156", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the country name of upper middle income group. Which country has the earliest national account base year? List out the region where this country locates."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CountryName FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IncomeGroup = 'Upper middle income' UNION SELECT longname FROM ( SELECT longname FROM country WHERE NationalAccountsBaseYear <> '' ORDER BY NationalAccountsBaseYear ASC LIMIT 1 )\n```"}]}, {"id": "train-2157", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the country code and country name of the rich countries using Euro as their currency unit"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CountryCode, T2.CountryName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.CurrencyUnit = 'Euro' AND (T1.IncomeGroup = 'High income: OECD' OR T1.IncomeGroup = 'High income: nonOECD')\n```"}]}, {"id": "train-2158", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the table name and currency unit of countries using series code as FP.CPI.TOTL"}, {"from": "gpt", "value": "```sql\nSELECT T1.TableName, T1.CurrencyUnit FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.SeriesCode = 'FP.CPI.TOTL'\n```"}]}, {"id": "train-2159", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the name and indicator code of high income: nonOECD countries"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CountryCode, T2.CountryName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'High income: nonOECD'\n```"}]}, {"id": "train-2160", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the series code of countries using pound sterling as their currency unit. Which country belongs to high income group among them."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CountryCode, T1.CurrencyUnit, T1.IncomeGroup FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.CurrencyUnit = 'Pound sterling' AND T1.IncomeGroup LIKE '%high income%'\n```"}]}, {"id": "train-2161", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down 10 country codes and it's short names."}, {"from": "gpt", "value": "```sql\nSELECT CountryCode, ShortName FROM Country LIMIT 10\n```"}]}, {"id": "train-2162", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the countries name start with alphabet A? List down the Alpha2Code of them."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ShortName) FROM Country WHERE ShortName LIKE 'A%' UNION SELECT alpha2code FROM country WHERE shortname LIKE 'A%'\n```"}]}, {"id": "train-2163", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which countries use Euro as their currency? List down the table name."}, {"from": "gpt", "value": "```sql\nSELECT TableName FROM Country WHERE CurrencyUnit = 'Euro'\n```"}]}, {"id": "train-2164", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the countries do not have special notes? List the long name."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(LongName) FROM Country WHERE SpecialNotes = '' UNION SELECT longname FROM country WHERE specialnotes = ''\n```"}]}, {"id": "train-2165", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which high income group countries are from Asia?"}, {"from": "gpt", "value": "```sql\nSELECT CountryCode, Region FROM Country WHERE (IncomeGroup = 'High income: OECD' OR IncomeGroup = 'High income: nonOECD') AND Region LIKE '%Asia%'\n```"}]}, {"id": "train-2166", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the countries' long name with national accounts base year prior to 1980."}, {"from": "gpt", "value": "```sql\nSELECT LongName FROM Country WHERE NationalAccountsBaseYear < '1980' AND NationalAccountsBaseYear != ''\n```"}]}, {"id": "train-2167", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which low income country has a series code of DT.DOD.DECT.CD? Name the country code of it."}, {"from": "gpt", "value": "```sql\nSELECT T1.CountryCode FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.IncomeGroup = 'Low income' AND T2.Seriescode = 'DT.DOD.DECT.CD'\n```"}]}, {"id": "train-2168", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the table name of country with description of \"Covers mainland Tanzania only\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.TableName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Covers mainland Tanzania only.'\n```"}]}, {"id": "train-2169", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the description and series code of Benin in year 2005."}, {"from": "gpt", "value": "```sql\nSELECT T2.Description, T2.Seriescode FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.TableName = 'Benin' AND T2.Year = 'YR2005'\n```"}]}, {"id": "train-2170", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the footnote description of Finland in year 2000?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Description FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.TableName = 'Finland' AND T2.Year = 'YR2000'\n```"}]}, {"id": "train-2171", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the years when countries have indicator name of \"Air transport, passengers carried\"? List the table name of these countries."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Year, T1.TableName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Air transport, passengers carried'\n```"}]}, {"id": "train-2172", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the long name of countries with indicator name in 1980."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.LongName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Year = 1980 AND T2.IndicatorName IS NOT NULL\n```"}]}, {"id": "train-2173", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the currency of Malaysia and what are the indicator code used by this country in 1970?"}, {"from": "gpt", "value": "```sql\nSELECT T1.currencyunit, T2.IndicatorCode FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.TableName = 'Malaysia' AND T2.Year = 1970\n```"}]}, {"id": "train-2174", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name 5 country codes of country with highest value and state the region of these countries."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CountryCode, T1.Region FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode ORDER BY T2.Value DESC LIMIT 5\n```"}]}, {"id": "train-2175", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries have country note description as \"Sources: UN Energy Statistics (2014)\"? List the currency of these countries."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.Countrycode) FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Sources: UN Energy Statistics (2014)' UNION SELECT DISTINCT t1.CurrencyUnit FROM country AS t1 INNER JOIN countrynotes AS t2 ON t1.CountryCode = t2.Countrycode WHERE t2.Description = 'Sources: UN Energy Statistics (2014)'\n```"}]}, {"id": "train-2176", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many footnotes have been made in year 1980 and what are the table names of these countries that made the footnotes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Description) FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Year = 'YR1980' UNION ALL SELECT DISTINCT T1.TableName FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Year = 'YR1980'\n```"}]}, {"id": "train-2177", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the series code of country with country notes description as \"Data sources : Eurostat\" and state the Wb2Code of these countries."}, {"from": "gpt", "value": "```sql\nSELECT T2.seriescode, T1.Wb2Code FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Data sources : Eurostat'\n```"}]}, {"id": "train-2178", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the low income countries, which country has the lowest fertility rate?"}, {"from": "gpt", "value": "```sql\nSELECT T2.CountryName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'Low income' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' ORDER BY T2.Value LIMIT 1\n```"}]}, {"id": "train-2179", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the total urban population of middle income countries in 1960?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup LIKE '%middle income' AND T2.Year = 1960 AND T2.IndicatorName = 'Urban population'\n```"}]}, {"id": "train-2180", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the country with fastest growth in adjusted net national income in 1980 and state the currency used by this country."}, {"from": "gpt", "value": "```sql\nSELECT T2.countryname, T1.CurrencyUnit FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Adjusted net national income (annual % growth)' AND T2.Year = 1980 AND T1.CurrencyUnit != '' ORDER BY T2.Value DESC LIMIT 1\n```"}]}, {"id": "train-2181", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries using the 1993 System of National Accounts methodology?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CountryCode) FROM Country WHERE SystemOfNationalAccounts = 'Country uses the 1993 System of National Accounts methodology.'\n```"}]}, {"id": "train-2182", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country have completed vital registration? List all the countries."}, {"from": "gpt", "value": "```sql\nSELECT ShortName FROM Country WHERE VitalRegistrationComplete = 'Yes'\n```"}]}, {"id": "train-2183", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country have conducted population census from 2010 until 2012 and have completed vital registration?"}, {"from": "gpt", "value": "```sql\nSELECT ShortName, LongName FROM Country WHERE LatestPopulationCensus >= 2010 AND LatestPopulationCensus < 2013 AND VitalRegistrationComplete = 'Yes'\n```"}]}, {"id": "train-2184", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country have the highest CO2 emissions in 1960?"}, {"from": "gpt", "value": "```sql\nSELECT CountryName FROM Indicators WHERE Year = 1960 AND IndicatorName = 'CO2 emissions (metric tons per capita)' ORDER BY Value DESC LIMIT 1\n```"}]}, {"id": "train-2185", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio between country with the highest number of infant deaths in 1971 and the lowest number of infant deaths in 1971? List the country with the highest number of infant deaths in 1971 and the lowest number of infant deaths in 1971."}, {"from": "gpt", "value": "```sql\nSELECT CAST(MAX(value) AS REAL) / MIN(value) FROM indicators WHERE indicatorname = 'Number of infant deaths' AND year = '1971' UNION ALL SELECT countryname FROM ( SELECT countryname, MAX(value) FROM indicators WHERE indicatorname = 'Number of infant deaths' AND year = '1971' ) UNION SELECT countryname FROM ( SELECT countryname, MIN(value) FROM indicators WHERE indicatorname = 'Number of infant deaths' AND year = '1971' )\n```"}]}, {"id": "train-2186", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What country have the series code of SP.DYN.CBRT.IN?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ShortName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.SeriesCode = 'SP.DYN.CBRT.IN'\n```"}]}, {"id": "train-2187", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country have data classified as official aid?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CountryCode FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Data are classified as official aid.'\n```"}]}, {"id": "train-2188", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What country have its data estimated based on regression?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.ShortName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Estimates are based on regression.'\n```"}]}, {"id": "train-2189", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the country in East Asia & Pacific region that have more than 2000000 urban population in 1970."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CountryCode FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Year = 1970 AND T1.Region = 'East Asia & Pacific' AND T2.Value > 2000000 AND t2.indicatorname = 'Urban population'\n```"}]}, {"id": "train-2190", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1960, what is largest population for country with upper middle income?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'Upper middle income' AND T2.Year = 1960 AND T2.IndicatorName = 'Population, total'\n```"}]}, {"id": "train-2191", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries uses the 1968 System of National Accounts methodology?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CountryCode) FROM Country WHERE SystemOfNationalAccounts = 'Country uses the 1968 System of National Accounts methodology.'\n```"}]}, {"id": "train-2192", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What upper middle income country under East Asia & Pacific region which covers the topic about Social Protection & Labor: Migration\n? Indicate the short name of the said country."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.ShortName FROM Country AS T1 INNER JOIN footnotes AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T1.IncomeGroup = 'Upper middle income' AND T1.Region = 'East Asia & Pacific' AND T3.Topic = 'Social Protection & Labor: Migration'\n```"}]}, {"id": "train-2193", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the country in which the topic is about Poverty: Shared Prosperity. Indicate the long name of the country."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.LongName FROM Country AS T1 INNER JOIN footnotes AS T2 ON T1.CountryCode = T2.Countrycode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T3.Topic = 'Poverty: Shared prosperity'\n```"}]}, {"id": "train-2194", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What country has the latest trade data with a series code of \"SP.DYN.CDRT.IN\n\"? List the table name of the country."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.TableName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.LatestTradeData = 2013 AND T2.IndicatorCode = 'SP.DYN.CDRT.IN'\n```"}]}, {"id": "train-2195", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What country in the region of Sub-Saharan Africa has a series code of \"SP.DYN.AMRT.FE\"? Indicate the long name of the country"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.LongName FROM SeriesNotes AS T1 INNER JOIN CountryNotes AS T2 ON T1.SeriesCode = T2.Seriescode INNER JOIN Country AS T3 ON T2.Countrycode = T3.CountryCode WHERE T3.Region = 'Sub-Saharan Africa' AND T1.SeriesCode = 'SP.DYN.AMRT.FE'\n```"}]}, {"id": "train-2196", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries are using the same type of currency? Please list the short names of any 3 countries."}, {"from": "gpt", "value": "```sql\nSELECT ShortName FROM country WHERE currencyunit = 'U.S. dollar' LIMIT 3\n```"}]}, {"id": "train-2197", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What South Asian nations have low incomes? Please include the entire names of the nations in your answer."}, {"from": "gpt", "value": "```sql\nSELECT LongName FROM Country WHERE IncomeGroup = 'Low income' AND Region = 'South Asia'\n```"}]}, {"id": "train-2198", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide full name of any two countries using special trade system."}, {"from": "gpt", "value": "```sql\nSELECT LongName FROM Country WHERE SystemOfTrade = 'Special trade system' LIMIT 2\n```"}]}, {"id": "train-2199", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has had the highest proportion of CO2 emissions from transport?"}, {"from": "gpt", "value": "```sql\nSELECT CountryName FROM Indicators WHERE IndicatorName LIKE 'CO2 emissions FROM transport%' ORDER BY Value DESC LIMIT 1\n```"}]}, {"id": "train-2200", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the lowest percentage of arable land?"}, {"from": "gpt", "value": "```sql\nSELECT CountryName FROM Indicators WHERE IndicatorName LIKE 'Arable land (% of land area)' ORDER BY Value DESC LIMIT 1\n```"}]}, {"id": "train-2201", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the subjects of series that have a restricted type of license?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT Topic FROM Series WHERE LicenseType = 'Restricted'\n```"}]}, {"id": "train-2202", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which countries in the upper middle income category still have unfinished external debt reporting? Please provide the country codes in your answer."}, {"from": "gpt", "value": "```sql\nSELECT CountryCode FROM Country WHERE IncomeGroup = 'Upper middle income' AND ExternalDebtReportingStatus = 'Preliminary'\n```"}]}, {"id": "train-2203", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of countries in the Middle East and North Africa that have finished reporting on their real external debt?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN ExternalDebtReportingStatus = 'Actual' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(CountryCode) FROM Country WHERE region = 'Middle East & North Africa'\n```"}]}, {"id": "train-2204", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which form of government has more countries that have completed the actual external debt reporting between the two types of government accounting concepts, budgetary central government vs. consolidated central government?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN GovernmentAccountingConcept = 'Budgetary central government' THEN 1 ELSE 0 END), SUM(CASE WHEN GovernmentAccountingConcept = 'Consolidated central government' THEN 1 ELSE 0 END) central_nums FROM country WHERE ExternalDebtReportingStatus = 'Actual'\n```"}]}, {"id": "train-2205", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many nations in East Asia and the Pacific have completed their external debt reporting on time?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CountryCode) FROM Country WHERE Region = 'East Asia & Pacific' AND ExternalDebtReportingStatus = 'Estimate'\n```"}]}, {"id": "train-2206", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What proportion of Sub-Saharan Africa's countries have lower middle incomes?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN IncomeGroup = 'Lower middle income' THEN 1 ELSE 0 END) * 100.0 / COUNT(CountryCode) persentage FROM Country WHERE Region = 'Sub-Saharan Africa'\n```"}]}, {"id": "train-2207", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1961 to 1980, what was the highest percentage of land used for agriculture in the Republic of Benin?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.Value) FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Year >= 1961 AND T1.Year < 1981 AND T1.IndicatorName LIKE 'Agricultural land (% of land area)' AND T2.LongName = 'Republic of Benin'\n```"}]}, {"id": "train-2208", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of any three countries that have their series code with a description of UN Energy Statistics (2014)."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.LongName FROM CountryNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode WHERE T1.Description = 'Sources: UN Energy Statistics (2014)' LIMIT 3\n```"}]}, {"id": "train-2209", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the deposit interest rate in the Commonwealth of Australia in 1979 in percentage?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Value FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.LongName = 'Commonwealth of Australia' AND T1.IndicatorName = 'Deposit interest rate (%)' AND T1.Year = 1979\n```"}]}, {"id": "train-2210", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the series code for Germany and what is its description?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Seriescode, T1.Description FROM CountryNotes AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.ShortName = 'Germany'\n```"}]}, {"id": "train-2211", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the subject of series of Austria."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.Topic FROM CountryNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode INNER JOIN Series AS T3 ON T1.Seriescode = T3.SeriesCode WHERE T2.ShortName = 'Austria'\n```"}]}, {"id": "train-2212", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the subject of the series SP.DYN.AMRT.MA and what does it pertain to?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Topic, T2.Description FROM Series AS T1 INNER JOIN SeriesNotes AS T2 ON T1.SeriesCode = T2.Seriescode WHERE T1.SeriesCode = 'SP.DYN.AMRT.MA'\n```"}]}, {"id": "train-2213", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries are having their country's footnotes described as \"unspecified\"? Please provide the full names of any three of those countries."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.CountryCode) FROM Country AS T1 INNER JOIN Footnotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Unspecified' OR T2.Description = 'Not specified' UNION SELECT T1.LongName FROM Country AS T1 INNER JOIN Footnotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Unspecified' OR T2.Description = 'Not specified' LIMIT 4\n```"}]}, {"id": "train-2214", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which nation completed its external debt reporting in 1980 and had a Land under cereal production value of 3018500?"}, {"from": "gpt", "value": "```sql\nSELECT T2.CountryCode FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName LIKE 'Land under cereal production%' AND T1.Value = 3018500 AND T1.Year = 1980 AND T2.ExternalDebtReportingStatus = 'Actual'\n```"}]}, {"id": "train-2215", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What portion of the nations in Latin America and the Caribbean had more than 50% of their land used for agriculture in 1961?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Value > 50 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.CountryCode) FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Year = 1961 AND T2.Region = 'Latin America & Caribbean' AND indicatorname = 'Agricultural land (% of land area)'\n```"}]}, {"id": "train-2216", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the full names of the countries in South Asia that belongs to the low income group?"}, {"from": "gpt", "value": "```sql\nSELECT LongName FROM Country WHERE IncomeGroup = 'Low income' AND Region = 'South Asia'\n```"}]}, {"id": "train-2217", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the indicator code for Mobile Cellular Subscriptions of Brazil?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT IndicatorCode FROM Indicators WHERE CountryName = 'Brazil' AND IndicatorName = 'Mobile cellular subscriptions'\n```"}]}, {"id": "train-2218", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries in Europe & Central Asia uses Danish krone as its currency? List the full names of those coutnries."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(longname) FROM country WHERE region = 'Europe & Central Asia' AND currencyunit = 'Danish krone' UNION SELECT longname FROM country WHERE currencyunit = 'Danish krone' AND region = 'Europe & Central Asia'\n```"}]}, {"id": "train-2219", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the country with the highest percentage of rural population in the overall total population? Indicate the rural population percentage of total population."}, {"from": "gpt", "value": "```sql\nSELECT countryname, MAX(value) FROM indicators WHERE indicatorname = 'Rural population (% of total population)'\n```"}]}, {"id": "train-2220", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries have a latest population census in 2011? Indicate their full names."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(LongName) FROM country WHERE LatestPopulationCensus = '2011' UNION ALL SELECT LongName FROM country WHERE LatestPopulationCensus = '2011'\n```"}]}, {"id": "train-2221", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the agricultural land area in sq. km of Italy in 1968?"}, {"from": "gpt", "value": "```sql\nSELECT Value FROM Indicators WHERE IndicatorName = 'Agricultural land (sq. km)' AND Year = 1968 AND CountryName = 'Italy'\n```"}]}, {"id": "train-2222", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Sub-Saharan Africa, how many female out-of-school children of primary school age are there in the country with the higest number of female out-of-school children of primary school age? Indicate the year of when it was recorded."}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.value), T1.year FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Sub-Saharan Africa' AND T1.IndicatorName = 'Out-of-school children of primary school age, female (number)'\n```"}]}, {"id": "train-2223", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the series code for number of infant deaths in year 1965 for the country whose full name is Islamic State of Afghanistan?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.Seriescode FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T2.CountryCode = T3.Countrycode WHERE T2.IndicatorName = 'Number of infant deaths' AND T1.LongName = 'Islamic State of Afghanistan' AND T2.Year = 1965\n```"}]}, {"id": "train-2224", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries who uses the 1968 System of National Accounts methodology, how many are in the Middle East & North Africa? Name the country with the highest CO2 emissions from solid fuel consumption in kiloton."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.CountryCode) FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Middle East & North Africa' AND T2.SystemOfNationalAccounts = 'Country uses the 1968 System of National Accounts methodology.' AND T1.IndicatorName = 'CO2 emissions FROM solid fuel consumption (kt)' UNION SELECT * FROM ( SELECT T1.CountryName FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Middle East & North Africa' AND T2.SystemOfNationalAccounts = 'Country uses the 1968 System of National Accounts methodology.' AND T1.IndicatorName = 'CO2 emissions FROM solid fuel consumption (kt)' GROUP BY T1.CountryName ORDER BY SUM(T1.value) DESC LIMIT 1 )\n```"}]}, {"id": "train-2225", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the indicator codes for the Republic of Albania in the year 1960?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.IndicatorCode FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Year = 1960 AND T2.LongName = 'Republic of Albania'\n```"}]}, {"id": "train-2226", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the lending category of the country with a cereal production of 6140000 metric tons for the year 1966?"}, {"from": "gpt", "value": "```sql\nSELECT T1.LendingCategory FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Cereal production (metric tons)' AND T2.Value = 6140000 AND T2.Year = 1966\n```"}]}, {"id": "train-2227", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the highest population in largest city for 19 consecutive years starting from 1960? Indicate the region to which the country is located."}, {"from": "gpt", "value": "```sql\nSELECT T2.CountryCode, T2.Region FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Population in largest city' AND T1.Year >= 1960 AND T1.Year < 1980 ORDER BY T2.Region DESC LIMIT 1\n```"}]}, {"id": "train-2228", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1975 to 1980, how much is the total amount CO2 emmission in kiloton of the the world? Indicate which year the world recorded its highest CO2 emmissions."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Value), T1.Year FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'CO2 emissions (kt)' AND T1.Year >= 1975 AND T1.Year < 1981 AND T1.CountryCode = 'WLD' AND T2.SpecialNotes = 'World aggregate.'\n```"}]}, {"id": "train-2229", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the smallest land area in square kilometers for 19 consecutive years starting from year 1961? Indicate how much is its land area in square kilometers in those years and the income group of the country."}, {"from": "gpt", "value": "```sql\nSELECT T1.CountryName, SUM(T1.Value) area, T2.IncomeGroup FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Land area (sq. km)' AND T1.Year >= 1961 AND T1.Year < 1980 GROUP BY T1.CountryCode ORDER BY SUM(T1.Value) ASC LIMIT 1\n```"}]}, {"id": "train-2230", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.Value), T2.SystemOfTrade FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Air transport, passengers carried' AND T1.Year >= 1970 AND T1.Year < 1981 AND T1.CountryName = 'Bulgaria'\n```"}]}, {"id": "train-2231", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the lastest household survey in Angola and when did it take place?"}, {"from": "gpt", "value": "```sql\nSELECT LatestHouseholdSurvey, PppSurveyYear FROM Country WHERE ShortName = 'Angola'\n```"}]}, {"id": "train-2232", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries in the North America Region has completed the vital registration?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CountryCode) FROM Country WHERE VitalRegistrationComplete = 'Yes' AND Region = 'North America'\n```"}]}, {"id": "train-2233", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which years does the country whose Alpha2Code is 1A have a result of the indicator Adolescent fertility rate?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Year FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'\n```"}]}, {"id": "train-2234", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the long name of the country that got 3000000 on the indicator Arms exports in 1960?"}, {"from": "gpt", "value": "```sql\nSELECT T1.LongName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Arms exports (SIPRI trend indicator values)' AND T2.Year = 1960 AND T2.Value = 3000000\n```"}]}, {"id": "train-2235", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the Alpha2Codes of all the countries that have an indicator on Rural population in 1960."}, {"from": "gpt", "value": "```sql\nSELECT T1.Alpha2Code FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Rural population' AND T2.Year = 1960\n```"}]}, {"id": "train-2236", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country's indicator for Adolescent fertility rate is the highest in 1960, please give its special notes."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CountryCode, T1.SpecialNotes FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Value = ( SELECT Value FROM Indicators WHERE IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND Year = 1960 ORDER BY Value DESC LIMIT 1 )\n```"}]}, {"id": "train-2237", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: By how much did the indicator on Adolescent fertility rate increase from 1960 to 1961 in the country whose Alpha2Code is 1A?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1961 ) - ( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1960 ) DIFF\n```"}]}, {"id": "train-2238", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the note for Australia on the indicator SP.ADO.TFRT?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Seriescode = 'SP.ADO.TFRT' AND T1.ShortName = 'Australia'\n```"}]}, {"id": "train-2239", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the notes for Aruba on the indicators under the topic of Environment: Energy production & use."}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T1.ShortName = 'Aruba' AND T3.Topic = 'Environment: Energy production & use'\n```"}]}, {"id": "train-2240", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which countries have notes on the indicator BX.KLT.DINV.CD.WD?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ShortName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T3.Seriescode = 'BX.KLT.DINV.CD.WD'\n```"}]}, {"id": "train-2241", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the country that has notes on the indicator Inflation, consumer prices, in which region is it in?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Region FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T3.IndicatorName = 'Inflation, consumer prices (annual %)'\n```"}]}, {"id": "train-2242", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries have notes on the indicator Stocks traded, turnover ratio of domestic shares?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Countrycode) FROM CountryNotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode WHERE T2.IndicatorName = 'Stocks traded, turnover ratio of domestic shares (%)'\n```"}]}, {"id": "train-2243", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the agregation method for the indicator whose value is 133 in 1960 for the Arab World?"}, {"from": "gpt", "value": "```sql\nSELECT T2.AggregationMethod FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName INNER JOIN Country AS T3 ON T1.CountryCode = T3.CountryCode WHERE T3.ShortName = 'Arab World' AND T1.Value = 133 AND T1.Year = 1960\n```"}]}, {"id": "train-2244", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the value of the indicator whose long definition is \"Adolescent fertility rate is the number of births per 1,000 women ages 15-19.\" for the Arab World in 1960?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Value FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName INNER JOIN Country AS T3 ON T1.CountryCode = T3.CountryCode WHERE T2.LongDefinition = 'Adolescent fertility rate is the number of births per 1,000 women ages 15-19.' AND T3.ShortName = 'Arab World' AND T1.Year = 1960\n```"}]}, {"id": "train-2245", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of increase of the indicator on Adolescent fertility rate from 1960 to 1961 in the country whose Alpha2Code is 1A?"}, {"from": "gpt", "value": "```sql\nSELECT (( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1961 ) - ( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1960 )) * 1.0 / ( SELECT SUM(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1960 )\n```"}]}, {"id": "train-2246", "db_id": "world_development_indicators", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average value of Adolescent fertility rate in the country whose Alpha2Code is 1A?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.Value) AS REAL) * 100 / COUNT(T2.Year) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'\n```"}]}, {"id": "train-2247", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the different director IDs of the movies whose user rating is more than 4."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.directorid FROM u2base AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.rating > 4\n```"}]}, {"id": "train-2248", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users who gave a rating of 5, how many of them are male?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.userid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 5 AND T2.u_gender = 'M'\n```"}]}, {"id": "train-2249", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the genres of the movies which actor id 851 is the star."}, {"from": "gpt", "value": "```sql\nSELECT T2.genre FROM movies2actors AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T1.actorid = T3.actorid WHERE T3.actorid = 851\n```"}]}, {"id": "train-2250", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies from the USA which user rating is less than 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' AND T1.rating < 3\n```"}]}, {"id": "train-2251", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the movies from France, how many of them are drama?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movieid) FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'France' AND T1.genre = 'drama'\n```"}]}, {"id": "train-2252", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average occupation of users whose ratings are not more than 2 ?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.occupation) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating < 2\n```"}]}, {"id": "train-2253", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the top 10 USA movies, by descending order, from the highest to the lowest, the user rating."}, {"from": "gpt", "value": "```sql\nSELECT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' GROUP BY T1.movieid ORDER BY AVG(T1.rating) DESC LIMIT 10\n```"}]}, {"id": "train-2254", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of casts of movies that are from the USA?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.cast_num) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'USA'\n```"}]}, {"id": "train-2255", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the top 5 movies from other countries which to language is not in English."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'other' AND T2.isEnglish = 'F' LIMIT 5\n```"}]}, {"id": "train-2256", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the best actors, how many of them got a rating of 5 to the movies they starred?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.actorid) FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid INNER JOIN u2base AS T3 ON T2.movieid = T3.movieid WHERE T1.a_quality = 5 AND T3.rating = 5\n```"}]}, {"id": "train-2257", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating of the newest movies from France?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.rating) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'france' AND T2.year = 4\n```"}]}, {"id": "train-2258", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the most rated UK movies, how many of them has running time of less than 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'UK' AND T2.runningtime < 2 AND T1.rating = 5\n```"}]}, {"id": "train-2259", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the id of male users who gave ratings of less than 3 to French movies with running time of 2."}, {"from": "gpt", "value": "```sql\nSELECT T1.userid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T1.userid = T3.userid WHERE T2.country = 'France' AND T2.runningtime = 2 AND T1.rating < 3 AND T3.u_gender = 'M'\n```"}]}, {"id": "train-2260", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the worst actresses, how many of them got a rating of more than 3 to the movies they starred?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.userid) FROM u2base AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid INNER JOIN users AS T4 ON T1.userid = T4.userid WHERE T3.a_quality = 0 AND T1.rating > 3 AND T4.u_gender = 'F'\n```"}]}, {"id": "train-2261", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of audiences that gave the most rating of 5?"}, {"from": "gpt", "value": "```sql\nSELECT userid FROM u2base WHERE rating = 5 GROUP BY userid ORDER BY COUNT(movieid) DESC LIMIT 1\n```"}]}, {"id": "train-2262", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the ID of actors that had worked together with director 22397? What was the genre of that movie?"}, {"from": "gpt", "value": "```sql\nSELECT T2.actorid, T4.genre FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid INNER JOIN movies2directors AS T4 ON T1.movieid = T4.movieid WHERE T4.directorid = 22397\n```"}]}, {"id": "train-2263", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list down the ID of actors and directors in action movies."}, {"from": "gpt", "value": "```sql\nSELECT T2.actorid, T1.directorid FROM movies2directors AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.genre = 'Action'\n```"}]}, {"id": "train-2264", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female actors acted in the movies of year 4?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.actorid) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid WHERE T3.a_gender = 'F' AND T1.year = 4\n```"}]}, {"id": "train-2265", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the ID of actors with quality rating of 3 acted in English USA movies?"}, {"from": "gpt", "value": "```sql\nSELECT T2.actorid FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid WHERE T3.a_quality = 3 AND T1.country = 'USA' AND T1.isEnglish = 'T'\n```"}]}, {"id": "train-2266", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the ID of movies with running time of 3 and average revenue of 1?"}, {"from": "gpt", "value": "```sql\nSELECT T1.movieid FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid INNER JOIN directors AS T3 ON T2.directorid = T3.directorid WHERE T1.runningtime = 3 AND T3.avg_revenue = 1\n```"}]}, {"id": "train-2267", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: UK produced what genre of movies?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'UK'\n```"}]}, {"id": "train-2268", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the favourite movie genre for audiences of age 18?"}, {"from": "gpt", "value": "```sql\nSELECT T1.genre FROM movies2directors AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T2.userid = T3.userid WHERE T3.age = 18 GROUP BY T1.genre ORDER BY COUNT(T1.movieid) DESC LIMIT 1\n```"}]}, {"id": "train-2269", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of actors that acted in the movies most viewed by audience with occupation 5?"}, {"from": "gpt", "value": "```sql\nSELECT T3.actorid FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid INNER JOIN movies2actors AS T3 ON T2.movieid = T3.movieid WHERE T1.occupation = 5 GROUP BY T2.movieid ORDER BY COUNT(T1.userid) DESC LIMIT 1\n```"}]}, {"id": "train-2270", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Movies with rating 3 are viewed by audiences in which distinct age group?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.age FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 3\n```"}]}, {"id": "train-2271", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Action movies are mostly directed by directors of which country?"}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM movies2directors AS T1 INNER JOIN directors AS T2 ON T1.directorid = T2.directorid INNER JOIN movies AS T3 ON T1.movieid = T3.movieid WHERE T1.genre = 'Action' GROUP BY T3.country ORDER BY COUNT(T3.country) DESC LIMIT 1\n```"}]}, {"id": "train-2272", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list down ID of movies acted by top 5 actors based on actor rating."}, {"from": "gpt", "value": "```sql\nSELECT T2.movieid FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid GROUP BY T2.actorid ORDER BY AVG(T1.a_quality) DESC LIMIT 5\n```"}]}, {"id": "train-2273", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down 5 non English adventure movies from UK?"}, {"from": "gpt", "value": "```sql\nSELECT T1.movieid FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'UK' AND T1.genre = 'Adventure' AND T2.isEnglish = 'F' LIMIT 5\n```"}]}, {"id": "train-2274", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of female audiences who viewed movies with rating 2?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.u_gender = 'F', 1, 0)) AS REAL) * 100 / COUNT(T2.userid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 2\n```"}]}, {"id": "train-2275", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference of female and male audiences in number who viewed horror movies?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T2.u_gender = 'F', 1, 0)) - SUM(IIF(T2.u_gender = 'M', 1, 0)) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid INNER JOIN movies2directors AS T3 ON T3.movieid = T1.movieid WHERE T3.genre = 'horror'\n```"}]}, {"id": "train-2276", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the genre of the movies that are the newest and is in English."}, {"from": "gpt", "value": "```sql\nSELECT T2.genre FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.year = 4 AND T1.isEnglish = 'T'\n```"}]}, {"id": "train-2277", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the action movies from the USA, how many of them are not in English?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movieid) FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'USA' AND T1.isEnglish = 'F' AND T2.genre = 'Action'\n```"}]}, {"id": "train-2278", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the male users no older than 18, how many times have they given the highest rating?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 5 AND T2.age < 18 AND T2.u_gender = 'M'\n```"}]}, {"id": "train-2279", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the ID of the movie that has been mostly rated by female users."}, {"from": "gpt", "value": "```sql\nSELECT T1.movieid FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T2.u_gender = 'F' GROUP BY T1.movieid ORDER BY COUNT(T2.userid) DESC LIMIT 1\n```"}]}, {"id": "train-2280", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among divergent movies that got the highest rating, how many of them are from the UK?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.movieid) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'UK' AND T1.rating = 5\n```"}]}, {"id": "train-2281", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list different IDs of movies that are the newest and have gotten the lowest rating."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.year = 4 AND T1.rating = 1\n```"}]}, {"id": "train-2282", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the movies in English that are the oldest, how many of them have the lowest rating?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.movieid) FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.year = 1 AND T2.rating = 1 AND T1.isEnglish = 'T'\n```"}]}, {"id": "train-2283", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different female users have rated movies from France?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.userid) FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid INNER JOIN movies AS T3 ON T2.movieid = T3.movieid WHERE T1.u_gender = 'F' AND T3.country = 'France'\n```"}]}, {"id": "train-2284", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For different directors who direct well, how many of them have directed an action film?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.directorid) FROM movies2directors AS T2 INNER JOIN directors AS T3 ON T2.directorid = T3.directorid WHERE T2.genre = 'Action' AND T3.d_quality = 4\n```"}]}, {"id": "train-2285", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the genre of the movies that are directed by the directors with the highest level of average revenue."}, {"from": "gpt", "value": "```sql\nSELECT T2.genre FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.avg_revenue = 4\n```"}]}, {"id": "train-2286", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many distinct movies in English stars a male actor who acts the best?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.actorid) FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid INNER JOIN movies AS T3 ON T2.movieid = T3.movieid WHERE T3.isEnglish = 'T' AND T1.a_gender = 'M' AND T1.a_quality = 5\n```"}]}, {"id": "train-2287", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the country of the movie that stars an actress who acts the worse."}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid INNER JOIN movies AS T3 ON T2.movieid = T3.movieid WHERE T1.a_gender = 'F' AND T1.a_quality = 0\n```"}]}, {"id": "train-2288", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest average rating for action movies made in the USA?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.rating) FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid INNER JOIN movies2directors AS T3 ON T1.movieid = T3.movieid WHERE T1.country = 'USA' AND T3.genre = 'Action' GROUP BY T1.movieid ORDER BY AVG(T2.rating) DESC LIMIT 1\n```"}]}, {"id": "train-2289", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the films directed by directors who direct the best, how many of them have an average rating of over 3.5?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT DISTINCT T2.movieid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid INNER JOIN u2base AS T3 ON T2.movieid = T3.movieid WHERE T1.d_quality = 5 GROUP BY T2.movieid HAVING AVG(T3.rating) > 3.5 ) AS T1\n```"}]}, {"id": "train-2290", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which adventure movie has the highest average rating?"}, {"from": "gpt", "value": "```sql\nSELECT T1.movieid FROM movies2directors AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.genre = 'Adventure' GROUP BY T1.movieid ORDER BY AVG(T2.rating) DESC LIMIT 1\n```"}]}, {"id": "train-2291", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the users who rate the movie with the id '2462959' are female?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.userid) FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid WHERE T2.userid = 2462959 AND T1.u_gender = 'F'\n```"}]}, {"id": "train-2292", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most distinct rated movie with a running time of 0?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.movieid FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.runningtime = 0 AND T2.rating = ( SELECT MAX(rating) FROM u2base )\n```"}]}, {"id": "train-2293", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ids and ratings of each actors played in the movie with the id 1722327?"}, {"from": "gpt", "value": "```sql\nSELECT T1.actorid, T1.a_quality FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid WHERE T2.movieid = 1722327\n```"}]}, {"id": "train-2294", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which directors with the best quality directed the most films?"}, {"from": "gpt", "value": "```sql\nSELECT T1.directorid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 5 GROUP BY T1.directorid ORDER BY COUNT(T2.movieid) DESC LIMIT 1\n```"}]}, {"id": "train-2295", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many drama movie with the rating of 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.movieid) FROM u2base AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T2.genre = 'drama' AND T1.rating = 3\n```"}]}, {"id": "train-2296", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the movies rated 5 are rated by a user between the ages of 25 and 35?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 5 AND T2.age BETWEEN 25 AND 35\n```"}]}, {"id": "train-2297", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all horror films that have a rating of 1."}, {"from": "gpt", "value": "```sql\nSELECT T1.movieid FROM u2base AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.rating = 1 AND T2.genre = 'Horror'\n```"}]}, {"id": "train-2298", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the IDs of all the directors who worked on French films."}, {"from": "gpt", "value": "```sql\nSELECT T2.directorid FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'France'\n```"}]}, {"id": "train-2299", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of the user ids and ages who rated movies with the id 1695219?"}, {"from": "gpt", "value": "```sql\nSELECT T2.userid, T2.age FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.movieid = 1695219\n```"}]}, {"id": "train-2300", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which genre contains the greatest number of non-English films?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.isEnglish = 'F' GROUP BY T2.genre ORDER BY COUNT(T1.movieid) DESC LIMIT 1\n```"}]}, {"id": "train-2301", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the cast and the director of the movie with the id 1949144."}, {"from": "gpt", "value": "```sql\nSELECT T1.actorid, T2.directorid FROM movies2actors AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.movieid = 1949144\n```"}]}, {"id": "train-2302", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the actors who acted in UK movies, what percentage of actors received a rating of at least 3?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T3.a_quality >= 3, 1, 0)) AS REAL) * 100 / COUNT(T1.movieid) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid WHERE T1.country = 'UK'\n```"}]}, {"id": "train-2303", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the proportion of action movies directors who are called 'box office success paradox'?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.avg_revenue > T2.d_quality, 1, 0)) AS REAL) * 100 / COUNT(T1.movieid) FROM movies2directors AS T1 INNER JOIN directors AS T2 ON T1.directorid = T2.directorid WHERE T1.genre = 'Action'\n```"}]}, {"id": "train-2304", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the actor IDs whose movies have the newest published date."}, {"from": "gpt", "value": "```sql\nSELECT T1.actorid FROM movies2actors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.year = 4\n```"}]}, {"id": "train-2305", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are cast members in an English movie which has a running time equal to 2? Please list their IDs."}, {"from": "gpt", "value": "```sql\nSELECT T2.actorid FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.runningtime = 2 AND T1.isEnglish = 'T'\n```"}]}, {"id": "train-2306", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which actor has acted in at least 2 French films? Please list their IDs."}, {"from": "gpt", "value": "```sql\nSELECT T2.actorid FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'France' GROUP BY T2.actorid HAVING COUNT(T1.movieid) > 2\n```"}]}, {"id": "train-2307", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many American movies have cast number more than 1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.actorid) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'USA' AND T2.cast_num > 1\n```"}]}, {"id": "train-2308", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list movie IDs which has the oldest publication date and the cast numbers are zero."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.movieid FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.year = 1 AND T2.cast_num = 0\n```"}]}, {"id": "train-2309", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many actors have acted in both US or UK films?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.actorid) FROM movies2actors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA' OR T2.country = 'UK'\n```"}]}, {"id": "train-2310", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many directors with average revenue of 4 have made either action or adventure films?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.directorid) FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.avg_revenue = 4 AND (T2.genre = 'Adventure' OR T2.genre = 'Action')\n```"}]}, {"id": "train-2311", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list director IDs who have the quality of at least 3 and have made at least 2 different genres of movies."}, {"from": "gpt", "value": "```sql\nSELECT T1.directorid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality >= 3 GROUP BY T1.directorid HAVING COUNT(T2.movieid) >= 2\n```"}]}, {"id": "train-2312", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many American comedies are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movieid) FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'USA' AND T2.genre = 'comedy'\n```"}]}, {"id": "train-2313", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many latest released dramas and action movies?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movieid) FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.year = 4 AND T1.genre IN ('Action', 'drama')\n```"}]}, {"id": "train-2314", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What horror movies have a running time of at least 2? Please list movie IDs."}, {"from": "gpt", "value": "```sql\nSELECT T1.movieid FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.runningtime >= 2 AND T1.genre = 'Horror'\n```"}]}, {"id": "train-2315", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate negative critical reception of American movies"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.rating = 1, 1, 0)) AS REAL) * 100 / COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'USA'\n```"}]}, {"id": "train-2316", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the disparate number of the comedy films that got the 1 rating?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.movieid) FROM movies2directors AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T2.rating = 1 AND T1.genre = 'comedy'\n```"}]}, {"id": "train-2317", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's different average revenue status for director who directed the movie that got the most 1 ratings?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.avg_revenue FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 5\n```"}]}, {"id": "train-2318", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many French movies got the highest ranking?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movieid) FROM movies WHERE country = 'France' AND movieid IN ( SELECT movieid FROM u2base WHERE rating = ( SELECT MAX(rating) FROM u2base ) )\n```"}]}, {"id": "train-2319", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the movie that has been rated most by 25 years old users."}, {"from": "gpt", "value": "```sql\nSELECT T2.movieid FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid WHERE T1.age = 25 GROUP BY T2.movieid ORDER BY COUNT(T1.userid) DESC LIMIT 1\n```"}]}, {"id": "train-2320", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many separate 35 year-old uesers have rated the movie from UK?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.userid) FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T2.userid = T3.userid WHERE T1.country = 'UK' AND T3.age = 35\n```"}]}, {"id": "train-2321", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the user ids and ages who gave the rate 2 to the movie No. 2409051."}, {"from": "gpt", "value": "```sql\nSELECT T1.userid, T1.age FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid WHERE T2.movieid = '2409051' AND T2.rating = 2\n```"}]}, {"id": "train-2322", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the ids of the oldest films that got the most ratings."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T1.rating = 5 AND T2.year = 1\n```"}]}, {"id": "train-2323", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which different movies from France got the least ratings?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.movieid FROM u2base AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid WHERE T2.country = 'France' AND T1.rating = 1\n```"}]}, {"id": "train-2324", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female actors have been played a role in any of French or USA movies?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.actorid) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.country IN ('France', 'USA')\n```"}]}, {"id": "train-2325", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different actors have played a role in the highest rating movie?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.actorid) FROM u2base AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid WHERE T1.rating = 5\n```"}]}, {"id": "train-2326", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Crime film got the lowest average rating?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movieid FROM u2base AS T2 INNER JOIN movies2directors AS T3 ON T2.movieid = T3.movieid WHERE T3.genre = 'Crime' GROUP BY T2.movieid ORDER BY AVG(T2.rating) LIMIT 1\n```"}]}, {"id": "train-2327", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the ratio of gender in actors to actress in all the UK movies?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T3.a_gender = 'M', 1, 0)) AS REAL) / SUM(IIF(T3.a_gender = 'F', 1, 0)) FROM movies AS T1 INNER JOIN movies2actors AS T2 ON T1.movieid = T2.movieid INNER JOIN actors AS T3 ON T2.actorid = T3.actorid WHERE T1.country = 'UK'\n```"}]}, {"id": "train-2328", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 35-year-old female users gave the movie 1711133 a rating of 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.userid) FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid WHERE T2.rating = 3 AND T2.movieid = '1711133' AND T1.age = 35 AND T1.u_gender = 'F'\n```"}]}, {"id": "train-2329", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users have rated 1 each for the UK's second newest movies with a running time of 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.userid) FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'UK' AND T1.runningtime = 2 AND T2.rating = 1 AND T1.year = 2\n```"}]}, {"id": "train-2330", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unique directors with an average earnings of 2 and a quality of 3 have not made comedy films? List them."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.directorid FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 3 AND T1.avg_revenue = 2 AND T2.genre != 'Comedy'\n```"}]}, {"id": "train-2331", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of female actors and quality 2 who have appeared twice at the casting of the film 1672580."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.cast_num = 2 AND T1.a_quality = 2, 1, 0)) AS REAL) * 100 / COUNT(T1.actorid) FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid WHERE T2.movieid = 1672580 AND T1.a_gender = 'F'\n```"}]}, {"id": "train-2332", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the worst actors are men and how many of the worst actors are women? Indicate your answer in ratio form."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(a_gender = 'M', 1, 0)) AS REAL) / SUM(IIF(a_gender = 'F', 1, 0)) FROM actors WHERE a_quality = 0\n```"}]}, {"id": "train-2333", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which actor has appeared in the most films?"}, {"from": "gpt", "value": "```sql\nSELECT actorid FROM movies2actors GROUP BY actorid ORDER BY COUNT(movieid) DESC LIMIT 1\n```"}]}, {"id": "train-2334", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most popular genre of film directed by directors?"}, {"from": "gpt", "value": "```sql\nSELECT genre FROM movies2directors GROUP BY genre ORDER BY COUNT(movieid) DESC LIMIT 1\n```"}]}, {"id": "train-2335", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the most common film genres made by the worst directors?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid WHERE T1.d_quality = 0 GROUP BY T2.genre ORDER BY COUNT(T2.movieid) DESC LIMIT 1\n```"}]}, {"id": "train-2336", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What non-English American film/s has received the lowest user ratings? Mention the movie's I.D."}, {"from": "gpt", "value": "```sql\nSELECT T2.movieid FROM movies AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid WHERE T1.isEnglish = 'F' AND T1.country = 'USA' ORDER BY T2.rating LIMIT 1\n```"}]}, {"id": "train-2337", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total average movie directed by the directors who's quality and revenue is 4?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.d_quality = 4 AND T1.avg_revenue = 4 THEN 1 ELSE 0 END) AS REAL) / COUNT(T2.movieid) FROM directors AS T1 INNER JOIN movies2directors AS T2 ON T1.directorid = T2.directorid\n```"}]}, {"id": "train-2338", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movies have received the greatest ratings from female users whose occupations fall within the category of 3?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movieid FROM users AS T1 INNER JOIN u2base AS T2 ON T1.userid = T2.userid INNER JOIN movies AS T3 ON T2.movieid = T3.movieid WHERE T1.u_gender = 'F' AND T1.occupation = 3 AND T2.rating = 5\n```"}]}, {"id": "train-2339", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female actresses appeared in the movie 2312852, what country was it in, and what was it's running time?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.a_gender = 'F', 1, 0)) , T3.country, T3.runningtime FROM actors AS T1 INNER JOIN movies2actors AS T2 ON T1.actorid = T2.actorid INNER JOIN movies AS T3 ON T2.movieid = T3.movieid WHERE T2.movieid = 2312852 GROUP BY T3.country, T3.runningtime\n```"}]}, {"id": "train-2340", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many horror movies were made by the worst directors?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.movieid) FROM movies2directors AS T1 INNER JOIN movies AS T2 ON T1.movieid = T2.movieid INNER JOIN directors AS T3 ON T1.directorid = T3.directorid WHERE T1.genre = 'horror' AND T3.d_quality = 0\n```"}]}, {"id": "train-2341", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the genres of all the English-language foreign films having a runtime of two hours or less? List each one."}, {"from": "gpt", "value": "```sql\nSELECT T2.genre FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.runningtime <= 2 AND T1.isEnglish = 'T' AND T1.country = 'other'\n```"}]}, {"id": "train-2342", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the English comedy movies produced in the UK, how many movies with a running time of 3 was rated the highest by users between the age 45-50? Indicate the movie names."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.movieid FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid INNER JOIN u2base AS T3 ON T1.movieid = T3.movieid INNER JOIN users AS T4 ON T3.userid = T4.userid WHERE T1.country = 'UK' AND T2.genre = 'Comedy' AND T1.runningtime = 3 AND T3.rating = 5 AND T4.age BETWEEN 45 AND 50 AND T1.isEnglish = 'T'\n```"}]}, {"id": "train-2343", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage difference of English and non-English-language crime movies in other countries in year 3?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.isEnglish = 'T', 1, 0)) - SUM(IIF(T1.isEnglish = 'F', 1, 0)) AS REAL) * 100 / COUNT(T1.movieid) FROM movies AS T1 INNER JOIN movies2directors AS T2 ON T1.movieid = T2.movieid WHERE T1.country = 'other' AND T1.year = 3\n```"}]}, {"id": "train-2344", "db_id": "movielens", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total amount male and female actors who were casted in movie ID 1684910 and what is the proportion between the highest quality actors against the worst quality of actors? Indicate your answer in percentage. List the the director as well as the genre."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(a_gender = 'M', 1, 0)) , SUM(IIF(a_gender = 'F', 1, 0)) , CAST(SUM(IIF(a_quality = 5, 1, 0)) AS REAL) * 100 / COUNT(*) , CAST(SUM(IIF(a_quality = 0, 1, 0)) AS REAL) * 100 / COUNT(*), ( SELECT directorid FROM movies2directors WHERE movieid = 1684910 ) , ( SELECT genre FROM movies2directors WHERE movieid = 1684910 ) FROM actors WHERE actorid IN ( SELECT actorid FROM movies2actors WHERE movieid = 1684910 )\n```"}]}, {"id": "train-2345", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the products ordered in order CA-2011-112326 in superstores in the center."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'CA-2011-112326'\n```"}]}, {"id": "train-2346", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the orders made by Aimee Bixby, what was the longest shipment time?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(strftime('%J', `Ship Date`) - strftime('%J', `Order Date`)) AS longestTimeDays FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby'\n```"}]}, {"id": "train-2347", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the orders made by Aimee Bixby, how many of them chose the slowest delivery speed?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T2.`Ship Mode` = 'Standard Class'\n```"}]}, {"id": "train-2348", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders has Aimee Bixby made?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby'\n```"}]}, {"id": "train-2349", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the orders made by Aimee Bixby with more than 3 kinds of products ordered."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Order ID` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby' GROUP BY T2.`Product ID` HAVING COUNT(T2.`Product ID`) > 3\n```"}]}, {"id": "train-2350", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the orders made by Aimee Bixby, how many of them included at least one kind of product under the category \"Furniture\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T3.Category = 'Furniture' AND T1.`Customer Name` = 'Aimee Bixby'\n```"}]}, {"id": "train-2351", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the products ordered by Aimee Bixby in 2016."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND STRFTIME('%Y', T2.`Ship Date`) = '2016'\n```"}]}, {"id": "train-2352", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total quantity of \"Telescoping Adjustable Floor Lamp\" ordered from central superstores?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Quantity) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Telescoping Adjustable Floor Lamp'\n```"}]}, {"id": "train-2353", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the customers who had ordered the product \"Telescoping Adjustable Floor Lamp\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.`Customer Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T3.`Product Name` = 'Telescoping Adjustable Floor Lamp'\n```"}]}, {"id": "train-2354", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers who have ordered the product \"Telescoping Adjustable Floor Lamp\", how many of them are consumers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.`Customer Name`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T3.`Product Name` = 'Telescoping Adjustable Floor Lamp' AND T1.Segment = 'Consumer'\n```"}]}, {"id": "train-2355", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the quantity of Xerox 1952 ordered by Aimee Bixby on 2014/9/10?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Quantity) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T3.`Product Name` = 'Xerox 1952' AND T2.`Order Date` = '2014-09-10'\n```"}]}, {"id": "train-2356", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many times has Aimee Bixby ordered the product Xerox 1952?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T3.`Product Name` = 'Xerox 1952'\n```"}]}, {"id": "train-2357", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the original price of Xerox 1952 ordered by Aimee Bixby on 2014/9/10?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Sales / (1 - T2.Discount) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T3.`Product Name` = 'Xerox 1952' AND T2.`Order Date` = '2014-09-10'\n```"}]}, {"id": "train-2358", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the total cost of Xerox 1952 ordered by Aimee Bixby on 2014/9/10?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT (T2.Sales / (1 - T2.discount)) * T2.Quantity - Profit FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Aimee Bixby' AND T3.`Product Name` = 'Xerox 1952' AND T2.`Order Date` = '2014-09-10'\n```"}]}, {"id": "train-2359", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many art products were ordered in 2013 in the east superstore?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.`Product ID`) FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Sub-Category` = 'Art' AND T1.Region = 'East' AND STRFTIME('%Y', T1.`Order Date`) = '2013'\n```"}]}, {"id": "train-2360", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the customer who purchased the largest total cost of products in a single order?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` GROUP BY T1.`Order ID`, T2.`Customer Name` ORDER BY SUM((T1.Sales / (1 - T1.Discount)) * T1.Quantity - T1.Profit) DESC LIMIT 1\n```"}]}, {"id": "train-2361", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the product that has the highest original price?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` ORDER BY (T1.Sales / (1 - T1.Discount)) DESC LIMIT 1\n```"}]}, {"id": "train-2362", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the product that was ordered recently by Darren Powers?"}, {"from": "gpt", "value": "```sql\nSELECT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Darren Powers' ORDER BY T2.`Order Date` DESC LIMIT 1\n```"}]}, {"id": "train-2363", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many quantities of Advantus plastic paper clips were ordered overall?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Quantity) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Advantus Plastic Paper Clips'\n```"}]}, {"id": "train-2364", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which order of Logitech G600 MMO Gaming Mouse has the highest total cost?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`Order ID` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Logitech G600 MMO Gaming Mouse' GROUP BY T1.`Order ID` ORDER BY SUM((T1.Sales / (1 - T1.Discount)) * T1.Quantity - T1.Profit) DESC LIMIT 1\n```"}]}, {"id": "train-2365", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the products that were ordered by Alejandro Grove?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Alejandro Grove'\n```"}]}, {"id": "train-2366", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers in Chicago ordered at least 10 Cardinal EasyOpen D-Ring Binders in a single order?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.`Customer ID`) FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Cardinal EasyOpen D-Ring Binders' AND T2.City = 'Chicago' AND T1.Quantity > 10\n```"}]}, {"id": "train-2367", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the products with a profit of no less than 1,000 in one single order?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Product Name` FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.Profit > 1000\n```"}]}, {"id": "train-2368", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name 10 products that were shipped first class from the East region."}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'First Class' AND T2.Region = 'East' LIMIT 10\n```"}]}, {"id": "train-2369", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the products ordered by Becky Martin around the Central region."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Becky Martin' AND T3.Region = 'Central'\n```"}]}, {"id": "train-2370", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List 5 customers in the West region who had their item shipped 'Second Class.'"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'West' AND T1.`Ship Mode` = 'Second Class' LIMIT 5\n```"}]}, {"id": "train-2371", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Add the total profit of Patrick Gardner in the Central region."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Profit) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Patrick Gardner' AND T1.Region = 'Central'\n```"}]}, {"id": "train-2372", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which item was shipped on 3/4/2013 and scheduled for same day delivery in the South region?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Date` = '2013-03-04' AND T2.Region = 'South' AND T1.`Order Date` = '2013-03-04'\n```"}]}, {"id": "train-2373", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total sales of 'Avery Hi-Liter EverBold Pen Style Fluorescent Highlighters, 4/Pack' in the Central region?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Sales) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Avery Hi-Liter EverBold Pen Style Fluorescent Highlighters, 4/Pack' AND T2.Region = 'Central'\n```"}]}, {"id": "train-2374", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the item ordered by Jonathan Doherty with the highest quantity in the East region."}, {"from": "gpt", "value": "```sql\nSELECT T3.`Product Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Jonathan Doherty' AND T2.Region = 'East' ORDER BY T1.Quantity DESC LIMIT 1\n```"}]}, {"id": "train-2375", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the total quantity of items from the East region shipped on 3/25/2015? Name the products."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Quantity), T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Date` = '2015-03-25' AND T2.Region = 'East'\n```"}]}, {"id": "train-2376", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which customer ordered 'Global High-Back Leather Tilter, Burgundy' on 10/13/2013 in the East region?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Global High-Back Leather Tilter, Burgundy' AND T1.`Order Date` = '2013-10-13' AND T1.Region = 'East'\n```"}]}, {"id": "train-2377", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What category does the item ordered by Katherine Murray on 11/4/2018 in the South region belong to?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.Category FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Katherine Murray' AND T1.`Order Date` = '2018-11-04' AND T2.Region = 'South'\n```"}]}, {"id": "train-2378", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage do items under the category of 'Furniture' make up the total number of items ordered that are shipped as standard in the West region?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Category = 'Furniture' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(T1.Quantity) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'West' AND T1.`Ship Mode` = 'Standard Class'\n```"}]}, {"id": "train-2379", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ship date of the order by the customer named Ann Chong in the central region?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Ship Date` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Ann Chong' AND T1.Region = 'Central'\n```"}]}, {"id": "train-2380", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the customer segment from the West region that orders the order ID CA-2011-108189."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Segment FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'West' AND T1.`Order ID` = 'CA-2011-108189'\n```"}]}, {"id": "train-2381", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the total sales of the accumulated orders of Hon Valutask Swivel Chairs in the West region?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Sales) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Hon Valutask Swivel Chairs' AND T1.Region = 'West'\n```"}]}, {"id": "train-2382", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the order ID of Frank Olsen of the South region."}, {"from": "gpt", "value": "```sql\nSELECT T1.`Order ID` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Region = 'South' AND T2.`Customer Name` = 'Frank Olsen'\n```"}]}, {"id": "train-2383", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What product was ordered in the Central region on April 26, 2018, and shipped by April 27, 2018?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order Date` = '2018-04-26' AND T1.`Ship Date` = '2018-04-27' AND T2.Region = 'Central'\n```"}]}, {"id": "train-2384", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From which city and state does the customer that bought the product with the highest sales?"}, {"from": "gpt", "value": "```sql\nSELECT T5.City, T5.State FROM west_superstore AS T1 INNER JOIN east_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN central_superstore AS T3 ON T3.`Customer ID` = T2.`Customer ID` INNER JOIN south_superstore AS T4 ON T4.`Customer ID` = T3.`Customer ID` INNER JOIN people AS T5 ON T5.`Customer ID` = T4.`Customer ID` ORDER BY T2.Sales DESC LIMIT 1\n```"}]}, {"id": "train-2385", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the customer from the East region that purchased the order with the highest profit?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'East' ORDER BY T1.Profit DESC LIMIT 1\n```"}]}, {"id": "train-2386", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers from Chicago, Illinois, what is the highest quantity of products bought in a single order?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Quantity FROM west_superstore AS T1 INNER JOIN east_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN central_superstore AS T3 ON T3.`Customer ID` = T2.`Customer ID` INNER JOIN south_superstore AS T4 ON T4.`Customer ID` = T3.`Customer ID` INNER JOIN people AS T5 ON T5.`Customer ID` = T4.`Customer ID` WHERE T5.City = 'Chicago' AND T5.State = 'Illinois' ORDER BY T1.Quantity DESC LIMIT 1\n```"}]}, {"id": "train-2387", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the order date and product name of the order ID CA-2011-137274 from the Central region?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`Order Date`, T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'CA-2011-137274' AND T2.Region = 'Central'\n```"}]}, {"id": "train-2388", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the customers that purchased the product named Xerox 23 in the South region."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T1.Region = 'South' AND T3.`Product Name` = 'Xerox 23'\n```"}]}, {"id": "train-2389", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products under the office supplies category, what is the product that made the highest sales in the Central region?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Office Supplies' AND T2.Region = 'Central' ORDER BY T1.Sales DESC LIMIT 1\n```"}]}, {"id": "train-2390", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the customer from the West region that received the highest discount?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'West' ORDER BY T1.Discount DESC LIMIT 1\n```"}]}, {"id": "train-2391", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names of the products with a profit greater than 98% of the average profit of all products in the East region."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'East' AND T1.Profit > ( SELECT AVG(Profit) * 0.98 FROM east_superstore )\n```"}]}, {"id": "train-2392", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the customers from the Eastern region whose orders cost above 80000."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'East' AND T1.Sales / (1 - T1.Discount) * T1.Quantity - T1.Profit > 80000\n```"}]}, {"id": "train-2393", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were made by Maxwell Schwartz in 2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.`Order ID`) FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.`Customer Name` = 'Maxwell Schwartz' AND STRFTIME('%Y', T1.`Order Date`) = '2015'\n```"}]}, {"id": "train-2394", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who ordered the Bush Mission Pointe Library in the Central Region?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name` FROM central_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Bush Mission Pointe Library' AND T3.Region = 'Central'\n```"}]}, {"id": "train-2395", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total profit by Cisco SPA301 for all regions."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Profit) + SUM(T2.Profit) + SUM(T3.Profit) + SUM(T4.Profit) AS totalProfit FROM west_superstore AS T1 INNER JOIN east_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN central_superstore AS T3 ON T3.`Customer ID` = T2.`Customer ID` INNER JOIN south_superstore AS T4 ON T4.`Customer ID` = T3.`Customer ID` INNER JOIN product AS T5 ON T5.`Product ID` = T4.`Product ID` WHERE T5.`Product Name` = 'Cisco SPA301'\n```"}]}, {"id": "train-2396", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the products that were ordered by Anne McFarland from the Western store."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Anne McFarland'\n```"}]}, {"id": "train-2397", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the products ordered by customers in Coachella."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.City = 'Coachella'\n```"}]}, {"id": "train-2398", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compare the numbers of orders between the Eastern and Western stores in 2015."}, {"from": "gpt", "value": "```sql\nSELECT east, west FROM ( SELECT COUNT(`Order ID`) AS east , ( SELECT COUNT(`Order ID`) FROM west_superstore WHERE `Order Date` LIKE '2015%' ) AS west FROM east_superstore WHERE `Order Date` LIKE '2015%' )\n```"}]}, {"id": "train-2399", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the products ordered by Matt Abelman from the Western store in 2013."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Matt Abelman' AND STRFTIME('%Y', T1.`Order Date`) = '2013'\n```"}]}, {"id": "train-2400", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total cost of the orders by Brad Thomas in 2016."}, {"from": "gpt", "value": "```sql\nSELECT SUM((T1.Sales / (1 - T1.Discount)) * T1.Quantity - T1.Profit) AS cost FROM east_superstore 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' AND strftime('%Y', T1.`Order Date`) = '2016'\n```"}]}, {"id": "train-2401", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names, cities, and countries of the customers who ordered the Plantronics single ear headset."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name`, T2.City, T2.Country FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Plantronics Single Ear Headset'\n```"}]}, {"id": "train-2402", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the shipping dates and products of the orders by Gene Hale."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Ship Date`, T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Gene Hale'\n```"}]}, {"id": "train-2403", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders in the south superstore with the fastest delivery are items of furniture?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.`Order ID`) FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'First Class' AND T2.Category = 'Furniture'\n```"}]}, {"id": "train-2404", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many office supply orders were made by Cindy Stewart in the south superstore?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.Category = 'Office Supplies' AND T2.`Customer Name` = 'Cindy Stewart'\n```"}]}, {"id": "train-2405", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What product category got the highest profit in the south superstore?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Category FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` ORDER BY T1.Profit DESC LIMIT 1\n```"}]}, {"id": "train-2406", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of all products that Cindy Stewart ordered in the east superstore."}, {"from": "gpt", "value": "```sql\nSELECT T3.`Product Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Cindy Stewart'\n```"}]}, {"id": "train-2407", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of all products in the west superstore that customers chose for same-day shipment in the year 2013."}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'Same Day' AND T1.`Ship Date` LIKE '2013%'\n```"}]}, {"id": "train-2408", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What product category that Sam Craven ordered from the central and east superstore?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.Category FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` LEFT JOIN central_superstore AS T4 ON T3.`Product ID` = T4.`Product ID` WHERE T2.`Customer Name` = 'Sam Craven'\n```"}]}, {"id": "train-2409", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total quantity that Cindy Stewart order \"Lexmark X 9575 Professional All-in-One Color Printer\" in the south superstore?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Quantity) FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Cindy Stewart' AND T3.`Product Name` = 'Lexmark X 9575 Professional All-in-One Color Printer'\n```"}]}, {"id": "train-2410", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of all the products with order quantities greater than or equal to 10 in the central superstore that has been shipped by the slowest delivery method."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'Standard Class' AND T1.Quantity >= 10\n```"}]}, {"id": "train-2411", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What product category got the least sales in the west superstore?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Category FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` ORDER BY T1.Sales LIMIT 1\n```"}]}, {"id": "train-2412", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total profit of \"Memorex Froggy Flash Drive 8 GB in south superstore?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Profit) FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` GROUP BY T2.`Product Name` = 'Memorix Froggy Flash Drive 8 GB'\n```"}]}, {"id": "train-2413", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total sales of furniture products in the east superstore in the year 2016.\n"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Sales) FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE STRFTIME('%Y', T1.`Order Date`) = '2016' AND T2.Category = 'Furniture'\n```"}]}, {"id": "train-2414", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average sales of \"\"Sharp AL-1530CS Digital Copier in the east and the west superstore."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.Sales) FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Sharp AL-1530CS Digital Copier'\n```"}]}, {"id": "train-2415", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of ordered office supplies products in the central and the south superstore."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.Category = 'Office Supplies' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Category) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID`\n```"}]}, {"id": "train-2416", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio between customers who live in Texas and customers who live in Indiana?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN State = 'Texas' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN State = 'Indiana' THEN 1 ELSE 0 END) FROM people\n```"}]}, {"id": "train-2417", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the orders in Central superstore, which art product were ordered the most?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Sub-Category` = 'Art' GROUP BY T2.`Product Name` ORDER BY COUNT(T2.`Product ID`) DESC LIMIT 1\n```"}]}, {"id": "train-2418", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers in South superstore, which customers ordered more than 3 times in 2015? State the name of the customers."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE STRFTIME('%Y', T1.`Order Date`) = '2015' GROUP BY T2.`Customer Name` HAVING COUNT(T2.`Customer Name`) > 3\n```"}]}, {"id": "train-2419", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the highest profit made by Anna Chung's orders in the Central Superstore."}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.Profit) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Anna Chung'\n```"}]}, {"id": "train-2420", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were made by Corey Roper in 2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.`Customer ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Corey Roper' AND STRFTIME('%Y', T2.`Ship Date`) = '2015'\n```"}]}, {"id": "train-2421", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference between the total sales in the East superstore and the total sales in the West superstore."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Sales) - SUM(T2.Sales) AS difference FROM east_superstore AS T1 INNER JOIN west_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID`\n```"}]}, {"id": "train-2422", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the ordered products that have profit deficiency in central superstore?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'Central' AND T1.Profit < 0\n```"}]}, {"id": "train-2423", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In west superstore, what is the name and the shipping mode of the product that was ordered with the shortest shipment time?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Product Name`, T1.`Ship Mode` FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'West' ORDER BY T1.`Ship Date` - T1.`Order Date` LIMIT 1\n```"}]}, {"id": "train-2424", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders of O'Sullivan Plantations 2-Door Library in Landvery Oak in central superstore were shipped through the shipping mode with the fastest delivery speed?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.`Order ID`) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'O''Sullivan Plantations 2-Door Library in Landvery Oak' AND T2.Region = 'Central' AND T1.`Ship Mode` = 'First Class'\n```"}]}, {"id": "train-2425", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the corporate customer from Rhode Island who had the highest number of orders in 2016 from the east superstore?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Segment = 'Corporate' AND T2.State = 'Rhode Island' AND T2.Region = 'East' AND STRFTIME('%Y', T1.`Order Date`) = '2016' GROUP BY T2.`Customer Name` ORDER BY COUNT(T2.`Customer Name`) DESC LIMIT 1\n```"}]}, {"id": "train-2426", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the orders with sales value of no less than 5,000 in west superstore, how many were bought by the customers in California?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.`Order ID`) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` INNER JOIN people AS T3 ON T3.`Customer ID` = T1.`Customer ID` WHERE T1.Sales > 5000 AND T3.State = 'California' AND T2.Region = 'West'\n```"}]}, {"id": "train-2427", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which segment does the customer who purchased the product from the east superstore with the highest original price belong?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Segment FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T1.Region = 'East' ORDER BY (T1.Sales / (1 - T1.Discount)) DESC LIMIT 1\n```"}]}, {"id": "train-2428", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the shipment duration for order number CA-2011-134103?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT strftime('%J', `Ship Date`) - strftime('%J', `Order Date`) AS duration FROM central_superstore WHERE `Order ID` = 'CA-2011-134103'\n```"}]}, {"id": "train-2429", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders with a quantity greater than 5 have been shipped by the fastest delivery method?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT `Order ID`) FROM central_superstore WHERE Quantity > 5 AND `Ship Mode` = 'First Class'\n```"}]}, {"id": "train-2430", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three orders that caused a loss to the company."}, {"from": "gpt", "value": "```sql\nSELECT `Order ID` FROM central_superstore WHERE Profit < 0 LIMIT 3\n```"}]}, {"id": "train-2431", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product did Phillina Ober buy?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Phillina Ober'\n```"}]}, {"id": "train-2432", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the customer in the South Region superstore who bought the most \u201cHon Multipurpose Stacking Arm Chairs\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T3.`Product Name` = 'Hon Multipurpose Stacking Arm Chairs' GROUP BY T2.`Customer Name` ORDER BY COUNT(T2.`Customer Name`) DESC LIMIT 1\n```"}]}, {"id": "train-2433", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the profit from selling the \"O'Sullivan Living Dimensions 2-Shelf Bookcases\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Profit FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'O''Sullivan Living Dimensions 2-Shelf Bookcases'\n```"}]}, {"id": "train-2434", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the \"Hon Pagoda Stacking Chairs\" have been sold in total in the west superstore?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Quantity) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Hon Pagoda Stacking Chairs'\n```"}]}, {"id": "train-2435", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders purchased by Aaron Bergman have been delivered with the slowest shipping speed?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aaron Bergman' AND T2.`Ship Mode` = 'Standard Class'\n```"}]}, {"id": "train-2436", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the original price of the \"Black Avery Flip-Chart Easel Binder\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Sales / (1 - T1.Discount) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Blackstonian Pencils'\n```"}]}, {"id": "train-2437", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the product that Aimee Bixby bought?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.`Product Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Aimee Bixby'\n```"}]}, {"id": "train-2438", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the profit of product Sauder Camden County Barrister Bookcase, Planked Cherry Finish."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Profit FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Sauder Camden County Barrister Bookcase, Planked Cherry Finish'\n```"}]}, {"id": "train-2439", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many furniture products had been shipped by standard class in the East superstore?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Category) FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Ship Mode` = 'Standard Class'\n```"}]}, {"id": "train-2440", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest profit order in the East superstore of customers from Houston, Texas?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`Order ID` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.City = 'Houston' AND T2.State = 'Texas' ORDER BY T1.Profit DESC LIMIT 1\n```"}]}, {"id": "train-2441", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many furniture products were ordered at central superstore?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Furniture'\n```"}]}, {"id": "train-2442", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the products that had been shipped in March 2013 at central superstore?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE strftime('%Y-%m', T1.`Ship Date`) = '2013-03'\n```"}]}, {"id": "train-2443", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were made by customers who live in Texas at the Central superstore?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.State = 'Texas'\n```"}]}, {"id": "train-2444", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were made by Alan Barnes in 2015 at the Central superstore?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.`Order ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Alan Barnes' AND STRFTIME('%Y', T2.`Order Date`) = '2015'\n```"}]}, {"id": "train-2445", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the product name of order CA-2011-115791 in the East superstore?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'CA-2011-141817'\n```"}]}, {"id": "train-2446", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of orders with 0.2 discount in the Central superstore were purchased by customers who live in Texas?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Discount = 0.2 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.State = 'Texas'\n```"}]}, {"id": "train-2447", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of furniture orders that were shipped through first class in 2013 at the Central superstore?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.`Ship Mode` = 'First Class' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Furniture' AND STRFTIME('%Y', T1.`Ship Date`) = '2013'\n```"}]}, {"id": "train-2448", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who order from the west region on August 12, 2013, and received a discount of 0.2?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Order Date` = '2013-08-12' AND T1.Discount = 0.2 AND T1.Region = 'West'\n```"}]}, {"id": "train-2449", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the order ID of the security-Tint Envelopes product ordered on June 3, 2013, in the Central region?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.`Order ID` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'Security-Tint Envelopes' AND T1.`Order Date` = '2013-06-03'\n```"}]}, {"id": "train-2450", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the product's name bought by the customer named Bill Shonely from the Central region."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Bill Shonely' AND T2.Region = 'Central'\n```"}]}, {"id": "train-2451", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the name of customers from the West region that bought exactly 8 items in their purchase."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Quantity = 8 AND T1.Region = 'West'\n```"}]}, {"id": "train-2452", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers from Houston, Texas, what is the total profit of their orders in the Central region?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Profit) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.City = 'Houston' AND T1.State = 'Texas' AND T2.Region = 'Central'\n```"}]}, {"id": "train-2453", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the customer with an order shipped on March 5, 2013, in the eastern region?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Ship Date` = '2013-03-05'\n```"}]}, {"id": "train-2454", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the orders from 2016 in the Central region, what is the product with the lowest profit?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'Central' AND STRFTIME('%Y', T1.`Order Date`) = '2016' ORDER BY T1.Profit ASC LIMIT 1\n```"}]}, {"id": "train-2455", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who ordered the order ID CA-2011-118976 from the East region?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Order ID` = 'CA-2011-118976' AND T2.Region = 'East'\n```"}]}, {"id": "train-2456", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the product's name of the product with the highest sales in the South region."}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM south_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'South' ORDER BY T1.Sales DESC LIMIT 1\n```"}]}, {"id": "train-2457", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the sales, profit, and subcategories of the product ordered in the order ID US-2011-126571 in the East region."}, {"from": "gpt", "value": "```sql\nSELECT T1.Sales, T1.Profit, T2.`Sub-Category` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T1.`Order ID` = 'US-2011-126571' AND T2.Region = 'East'\n```"}]}, {"id": "train-2458", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the product's name in the highest quantity in a single purchase?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM east_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'East' ORDER BY T1.Quantity DESC LIMIT 1\n```"}]}, {"id": "train-2459", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the customer's name from the South region with a standard class ship mode and sales greater than the 88% of the average sales of all orders."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Customer Name` FROM south_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Region = 'South' AND T1.`Ship Mode` = 'Standard Class' AND 100 * T1.Sales / ( SELECT AVG(Sales) FROM south_superstore ) > 88\n```"}]}, {"id": "train-2460", "db_id": "superstore", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers from Indiana, what is the percentage of their purchased orders in the Central region with no discount?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Discount = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Region = 'Central' AND T1.State = 'Indiana'\n```"}]}, {"id": "train-2461", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the male officers, what is the percentage of them are White?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(race = 'W', 1, 0)) AS REAL) * 100 / COUNT(case_number) FROM officers WHERE gender = 'M'\n```"}]}, {"id": "train-2463", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year has the greatest number of cases where Handgun was used as weapon?"}, {"from": "gpt", "value": "```sql\nSELECT STRFTIME('%Y', date) FROM incidents WHERE subject_weapon = 'Handgun' GROUP BY STRFTIME('%Y', date) ORDER BY COUNT(case_number) DESC LIMIT 1\n```"}]}, {"id": "train-2465", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Did the number of cases with Vehicle as subject weapon increase or decrease from year 2007 to 2008. State the difference."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(STRFTIME('%Y', date) = '2007', 1, 0)) - SUM(IIF(STRFTIME('%Y', date) = '2008', 1, 0)) FROM incidents WHERE subject_weapon = 'Vehicle'\n```"}]}, {"id": "train-2466", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the 'Handgun' weapon used by subject, how many percent were 'Shoot and Miss'?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(subject_statuses = 'Shoot and Miss') AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE subject_weapon = 'Handgun'\n```"}]}, {"id": "train-2468", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which are the cases where the subject are female. List the case number, subject status and weapon."}, {"from": "gpt", "value": "```sql\nSELECT T1.case_number, T1.subject_statuses, T1.subject_weapon FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'F'\n```"}]}, {"id": "train-2469", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From the cases where the subject are male, list the case number and the location and subject status."}, {"from": "gpt", "value": "```sql\nSELECT T1.case_number, T1.location, T1.subject_statuses FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'M'\n```"}]}, {"id": "train-2471", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For case number '134472-2015', list the last name of the officers involved and state the subject statuses."}, {"from": "gpt", "value": "```sql\nSELECT T2.last_name, T1.subject_statuses FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T1.case_number = '134472-2015'\n```"}]}, {"id": "train-2472", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From the cases where the subject were deceased, list the subject's last name, gender, race and case number."}, {"from": "gpt", "value": "```sql\nSELECT T2.last_name, T2.gender, T2.race, T2.case_number FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T1.subject_statuses = 'Deceased'\n```"}]}, {"id": "train-2473", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of subject who are female used the Vehicle as weapon?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.subject_weapon = 'Vehicle') AS REAL) * 100 / COUNT(T1.case_number) FROM incidents T1 INNER JOIN subjects T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'F'\n```"}]}, {"id": "train-2474", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From the 'Injured' statuses of the subject, what is the ratio of weapons used are knife against handgun?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.subject_weapon = 'Knife') AS REAL) * 100 / SUM(T1.subject_weapon = 'Handgun') FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T1.subject_statuses = 'Injured'\n```"}]}, {"id": "train-2476", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all male officers, what percentage are black officers?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(race = 'B') AS REAL) * 100 / COUNT(case_number) FROM officers WHERE gender = 'M'\n```"}]}, {"id": "train-2477", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many incidents in which the subject's weapon was a vehicle were investigated by a female officer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.case_number) FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T1.subject_weapon = 'Vehicle' AND T2.gender = 'F'\n```"}]}, {"id": "train-2478", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In how many cases where the subject was a female was the subject's status listed as Deceased?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.case_number) FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T2.gender = 'F' AND T1.subject_statuses = 'Deceased'\n```"}]}, {"id": "train-2479", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the black officers, how many of them investigated cases between the years 2010 and 2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.case_number) FROM officers AS T1 INNER JOIN incidents AS T2 ON T2.case_number = T1.case_number WHERE T1.race = 'B' AND T2.date BETWEEN '2010-01-01' AND '2015-12-31'\n```"}]}, {"id": "train-2480", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many instances were found in June 2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(case_number) FROM incidents WHERE date BETWEEN '2015-06-01' AND '2015-06-30'\n```"}]}, {"id": "train-2481", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people were injured between 2006 and 2014 as a result of a handgun?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(location) FROM incidents WHERE subject_weapon = 'Handgun' AND subject_statuses = 'Injured' AND date BETWEEN '2006-01-01' AND '2013-12-31'\n```"}]}, {"id": "train-2482", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common type of weapon that causes death?"}, {"from": "gpt", "value": "```sql\nSELECT subject_weapon FROM incidents WHERE subject_statuses = 'Deceased' GROUP BY subject_weapon ORDER BY COUNT(case_number) DESC LIMIT 1\n```"}]}, {"id": "train-2483", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the proportion of white males and females in the police force?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(gender = 'M') AS REAL) / SUM(gender = 'F') FROM officers WHERE race = 'W'\n```"}]}, {"id": "train-2484", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more black female victims than white female victims were discovered?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(race = 'B') - SUM(race = 'W') FROM subjects WHERE gender = 'F'\n```"}]}, {"id": "train-2485", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of deaths were caused by rifles?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(subject_statuses = 'Deceased') AS REAL) * 100 / COUNT(case_number) FROM incidents WHERE subject_weapon = 'Rifle'\n```"}]}, {"id": "train-2486", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which type of weapon was used to attack the victim in the record number 031347-2015? What is the victim's race and gender?"}, {"from": "gpt", "value": "```sql\nSELECT T1.subject_weapon, T2.race, T2.gender FROM incidents AS T1 INNER JOIN subjects AS T2 ON T1.case_number = T2.case_number WHERE T1.case_number = '031347-2015'\n```"}]}, {"id": "train-2487", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which near-death incident did a policeman by the name of Ruben Fredirick look into? What is the victim in this incident's race and gender?"}, {"from": "gpt", "value": "```sql\nSELECT T1.case_number, T3.race, T3.gender FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number INNER JOIN subjects AS T3 ON T1.case_number = T3.case_number WHERE T2.first_name = 'Fredirick' AND T2.last_name = 'Ruben'\n```"}]}, {"id": "train-2488", "db_id": "shooting", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What proportion of male police officers looked into events where people were injured?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.gender = 'M') AS REAL) * 100 / COUNT(T1.case_number) FROM incidents T1 INNER JOIN officers T2 ON T1.case_number = T2.case_number WHERE T1.subject_statuses = 'Injured'\n```"}]}, {"id": "train-2489", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the genes that are located in the plasma membrane, please list their number of chromosomes."}, {"from": "gpt", "value": "```sql\nSELECT T1.Chromosome FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID WHERE T2.Localization = 'plasma membrane'\n```"}]}, {"id": "train-2490", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many non-essential genes are located in the nucleus?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID WHERE T2.Localization = 'nucleus' AND T1.Essential = 'Non-Essential'\n```"}]}, {"id": "train-2491", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the genes with nucleic acid metabolism defects, how many of them can be found in the vacuole?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID WHERE T2.Localization = 'vacuole' AND T1.Phenotype = 'Nucleic acid metabolism defects'\n```"}]}, {"id": "train-2492", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the location of the genes that have the most chromosomes."}, {"from": "gpt", "value": "```sql\nSELECT T2.Localization FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID ORDER BY T1.Chromosome DESC LIMIT 1\n```"}]}, {"id": "train-2493", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the pairs of genes that are both located in the nucleus, what is the highest expression correlation score?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Expression_Corr FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 INNER JOIN Genes AS T3 ON T3.GeneID = T2.GeneID2 WHERE T1.Localization = 'nucleus' AND T3.Localization = 'nucleus' ORDER BY T2.Expression_Corr DESC LIMIT 1\n```"}]}, {"id": "train-2494", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the functions of the pair of genes that have the lowest expression correlation score?a"}, {"from": "gpt", "value": "```sql\nSELECT T1.Function FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 ORDER BY T2.Expression_Corr ASC LIMIT 1\n```"}]}, {"id": "train-2495", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the pairs of genes that are not from the class of motorproteins, how many of them are negatively correlated?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T2.Expression_Corr < 0 AND T1.Class = 'Motorproteins'\n```"}]}, {"id": "train-2496", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the pairs of genes with one having 8 chromosomes and the other having 6 chromosomes, what is the highest expression correlation score?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Expression_Corr FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T1.Chromosome = 6 OR T1.Chromosome = 8 ORDER BY T2.Expression_Corr DESC LIMIT 1\n```"}]}, {"id": "train-2497", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the motif of the genes that are located in the cytoplasm and have 7 chromosomes."}, {"from": "gpt", "value": "```sql\nSELECT T2.GeneID1, T2.GeneID2 FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T1.Localization = 'cytoplasm' AND T1.Chromosome = 7\n```"}]}, {"id": "train-2498", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the non-essential genes whose functions are transcription, how many of them are not located in the cytoplasm?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T1.Localization != 'cytoplasm' AND T1.Function = 'TRANSCRIPTION' AND T1.Essential = 'NON-Essential'\n```"}]}, {"id": "train-2499", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many pairs of positively correlated genes are both non-essential?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.GeneID2) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T2.Expression_Corr > 0 AND T1.Essential = 'Non-Essential'\n```"}]}, {"id": "train-2500", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: If a pair of genes is positively correlated, what is the possibility of it being composed of two genes both with over 10 chromosomes?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.Chromosome > 10 AND T3.Chromosome > 10, 1, 0)) AS REAL) * 100 / COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 INNER JOIN Genes AS T3 ON T3.GeneID = T2.GeneID2 WHERE T2.Expression_Corr > 0\n```"}]}, {"id": "train-2501", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the pairs of genes both from the class ATPases, what is the average expression correlation score?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.Expression_Corr) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T1.Class = 'ATPases'\n```"}]}, {"id": "train-2502", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Lists all genes by identifier number located in the cytoplasm and whose function is metabolism."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT GeneID FROM Genes WHERE Localization = 'cytoplasm' AND Function = 'METABOLISM'\n```"}]}, {"id": "train-2503", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different genes do we have if we add those located in the plasma and in the nucleus?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(GeneID) FROM Classification WHERE Localization IN ('plasma', 'nucleus')\n```"}]}, {"id": "train-2504", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What kind of expression correlation occurs in physical type interacting gene pairs and what percentage of these are negatively correlated?"}, {"from": "gpt", "value": "```sql\nSELECT Expression_Corr FROM Interactions WHERE Type = 'Physical' UNION ALL SELECT CAST(SUM(Expression_Corr < 0) AS REAL) * 100 / COUNT(*) FROM Interactions WHERE Type = 'Physical'\n```"}]}, {"id": "train-2505", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of genes located in the cytoskeleton are of unknown class? And of these, how many are not conditional phenotypes?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(Localization = 'cytoskeleton' AND Phenotype = 'Conditional phenotypes') , CAST(SUM(Localization = 'cytoskeleton') AS REAL) * 100 / COUNT(GeneID) FROM Genes;\n```"}]}, {"id": "train-2506", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What type of interactions occurs in genes whose function is cellular transport and transport medicine and are classified as non-essential?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Type FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T1.Function = 'TRANSCRIPTION' AND T1.Essential = 'Non-Essential'\n```"}]}, {"id": "train-2507", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all genes whose interaction is with genes located in the nucleus in which it is positively correlated."}, {"from": "gpt", "value": "```sql\nSELECT T1.GeneID FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T2.Expression_Corr > 0 AND T1.Localization = 'nucleus'\n```"}]}, {"id": "train-2508", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Taking all the essential genes of the transcription factors class located in the nucleus as a reference, how many of them carry out a genetic-type interaction with another gene? List them."}, {"from": "gpt", "value": "```sql\nSELECT T2.GeneID1 FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T1.Localization = 'nucleus' AND T1.Class = 'Transcription factors' AND T1.Essential = 'Essential' AND T2.Expression_Corr != 0\n```"}]}, {"id": "train-2509", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the nonessential genes that are not of the motorprotein class and whose phenotype is cell cycle defects, how many do not have a physical type of interaction?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T2.Type != 'Physical' AND T1.Phenotype = 'Cell cycle defects' AND T1.Class != 'Motorproteins' AND T1.Essential = 'Non-Essential'\n```"}]}, {"id": "train-2510", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the genes whose phenotype and motif are nucleic acid metabolism defects, PS00107, what percentage perform positive interaction with another gene?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.Expression_Corr > 0, 1, 0)) AS REAL) * 100 / COUNT(T2.GeneID1) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T1.Phenotype = 'Nucleic acid metabolism defects' AND T1.Motif = 'PS00107'\n```"}]}, {"id": "train-2511", "db_id": "genes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which negatively correlated, genetically interacting genes are non-essential? What percentage do they represent with respect to those that are essential?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.GeneID) AS REAL) * 100 / ( SELECT COUNT(T1.GeneID) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T2.Expression_Corr < 0 ) FROM Genes AS T1 INNER JOIN Interactions AS T2 ON T1.GeneID = T2.GeneID1 WHERE T2.Expression_Corr < 0 AND T1.Essential = 'Non-Essential'\n```"}]}, {"id": "train-2514", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users holds neutral attitude towards the HTC Weather app? Indicate the app's rating on the Google Play Store."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Rating), T1.Rating FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'HTC Weather' AND T2.Sentiment = 'Neutral'\n```"}]}, {"id": "train-2515", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name and category of the app with the highest amount of -1 sentiment polarity score?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.App, T1.Category FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Sentiment_Polarity = '-1.0'\n```"}]}, {"id": "train-2516", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average sentiment polarity score of the Cooking Fever app? Indicate the age group that the app is targeted at."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.Sentiment_Polarity), T1.\"Content Rating\" FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Cooking Fever'\n```"}]}, {"id": "train-2517", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the lowest sentiment polarity score of the Basketball Stars app for people who dislikes the app pretty much and how many downloads does it have?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(T2.Sentiment_Polarity), T1.Installs FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Basketball Stars'\n```"}]}, {"id": "train-2519", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many apps have rating of 5?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(App) FROM playstore WHERE Rating = 5\n```"}]}, {"id": "train-2520", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 5 installed free apps?"}, {"from": "gpt", "value": "```sql\nSELECT App FROM playstore WHERE Price = 0 ORDER BY CAST(REPLACE(REPLACE(Installs, ',', ''), '+', '') AS INTEGER) DESC LIMIT 5\n```"}]}, {"id": "train-2521", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the top 10 most reviewed apps."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT App FROM playstore ORDER BY Reviews DESC LIMIT 10\n```"}]}, {"id": "train-2522", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the users hold neutral attitude on \"10 Best Foods for You\" app and what category is this app?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.App), T1.Category FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = '10 Best Foods for You' AND T2.Sentiment = 'Neutral'\n```"}]}, {"id": "train-2523", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the apps that users pretty like this app and how many installs amount of these apps?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.App, T1.Installs FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Sentiment_Polarity > 0\n```"}]}, {"id": "train-2524", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List apps whose rating is 3.9 and state the translated review of each app."}, {"from": "gpt", "value": "```sql\nSELECT T1.App, T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Rating = 3.9\n```"}]}, {"id": "train-2526", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which apps have multiple genres and what is the total sentiment subjectivity of these apps?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Sentiment_Subjectivity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Genres > 1\n```"}]}, {"id": "train-2527", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which apps have not been updated since year 2015 and what kind of sentiment users hold on it?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT App, Sentiment FROM user_reviews WHERE App IN ( SELECT App FROM playstore WHERE CAST(SUBSTR('Last Updated', -4, 4) AS INTEGER) < 2015 )\n```"}]}, {"id": "train-2528", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total installs of apps with content rating of adults only 18+ and what are the translated reviews of it?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Installs), T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.\"Content Rating\" = 'Adults only 18+'\n```"}]}, {"id": "train-2529", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of the app is the best selling app and what is the sentiments polarity of it?"}, {"from": "gpt", "value": "```sql\nSELECT T1.App, T2.Sentiment_Polarity FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App ORDER BY T1.Price * CAST(REPLACE(REPLACE(Installs, ',', ''), '+', '') AS INTEGER) DESC LIMIT 1\n```"}]}, {"id": "train-2530", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating of comic category apps? How many users hold positive attitude towards this app?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.Rating) , COUNT(CASE WHEN T2.Sentiment = 'Positive' THEN 1 ELSE NULL END) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Category = 'COMICS'\n```"}]}, {"id": "train-2531", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the rating for \"Draw A Stickman\"?"}, {"from": "gpt", "value": "```sql\nSELECT Rating FROM playstore WHERE APP = 'Draw A Stickman'\n```"}]}, {"id": "train-2532", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the reviews for the app \"Brit + Co\" have a comment?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(App) FROM user_reviews WHERE App = 'Brit + Co' AND Translated_Review IS NOT NULL\n```"}]}, {"id": "train-2533", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the top 5 shopping apps with the most reviews."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT App FROM playstore WHERE Genres = 'Shopping' GROUP BY App ORDER BY COUNT(App) DESC LIMIT 5\n```"}]}, {"id": "train-2534", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many neutral reviews does the app \"Dino War: Rise of Beasts\" have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(App) FROM user_reviews WHERE App = 'Dino War: Rise of Beasts' AND Sentiment = 'Neutral'\n```"}]}, {"id": "train-2535", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the apps with only 5,000+ installs?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT App FROM playstore WHERE Installs = '5,000+'\n```"}]}, {"id": "train-2536", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the negative comments on the \"Dog Run - Pet Dog Simulator\" app."}, {"from": "gpt", "value": "```sql\nSELECT Translated_Review FROM user_reviews WHERE App = 'Dog Run - Pet Dog Simulator' AND Sentiment = 'Negative'\n```"}]}, {"id": "train-2537", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which free app has the most Negative comments?"}, {"from": "gpt", "value": "```sql\nSELECT T1.App FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Type = 'Free' AND T2.Sentiment = 'Negative' GROUP BY T1.App ORDER BY COUNT(T2.Sentiment) DESC LIMIT 1\n```"}]}, {"id": "train-2538", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many negative comments are there in all the apps with 100,000,000+ installs?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Sentiment) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Installs = '100,000,000+' AND T2.Sentiment = 'Negative'\n```"}]}, {"id": "train-2539", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the content ratings for the apps that have \"gr8\" in their comments?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.`Content Rating` FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Translated_Review LIKE '%gr8%'\n```"}]}, {"id": "train-2540", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total Sentiment polarity score of the most expensive app?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Price = ( SELECT MAX(Price) FROM playstore )\n```"}]}, {"id": "train-2541", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the rating for \"Garden Coloring Book\"? List all of its reviews."}, {"from": "gpt", "value": "```sql\nSELECT T1.Rating, T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Garden Coloring Book'\n```"}]}, {"id": "train-2542", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Photography app has the highest total Sentiment subjectivity score?"}, {"from": "gpt", "value": "```sql\nSELECT T1.App FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Genres = 'Photography' GROUP BY T1.App ORDER BY SUM(T2.Sentiment_Subjectivity) DESC LIMIT 1\n```"}]}, {"id": "train-2543", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the comments on the lowest rated Mature 17+ app."}, {"from": "gpt", "value": "```sql\nSELECT T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.\"Content Rating\" = 'Mature 17+' ORDER BY T1.Rating LIMIT 1\n```"}]}, {"id": "train-2544", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of installments of the app with the highest total Sentiment polarity score?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Installs FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App GROUP BY T1.App ORDER BY SUM(T2.Sentiment_Polarity) DESC LIMIT 1\n```"}]}, {"id": "train-2545", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of neutral comments from all the weather apps?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Sentiment) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Genres = 'Weather' AND T2.Sentiment = 'Neutral'\n```"}]}, {"id": "train-2546", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which 1,000,000,000+ intalls apps has the most no comment reviews?"}, {"from": "gpt", "value": "```sql\nSELECT T1.App FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Installs = '1,000,000+' AND T2.Translated_Review = 'nan' GROUP BY T1.App ORDER BY COUNT(T2.Translated_Review) DESC LIMIT 1\n```"}]}, {"id": "train-2547", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the rating and the total Sentiment subjectivity score of \"Onefootball - Soccer Scores\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Rating, SUM(T2.Sentiment_Subjectivity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Onefootball - Soccer Scores'\n```"}]}, {"id": "train-2548", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of no comment reviews are from \"Teen\" content rating apps?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.`Content Rating` = 'Teen' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.App) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Translated_Review = 'nan'\n```"}]}, {"id": "train-2549", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which apps have 5 rating? List out then application name."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT App FROM playstore WHERE Rating = 5\n```"}]}, {"id": "train-2550", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which apps have been reviewed more than 75 000 000 times and the content is suitable for teenagers?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT App FROM playstore WHERE Reviews > 75000000 AND `Content Rating` = 'Teen'\n```"}]}, {"id": "train-2551", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out genre that have downloads more than 1000000000."}, {"from": "gpt", "value": "```sql\nSELECT Genres FROM playstore WHERE Installs = '1,000,000,000+' GROUP BY Genres\n```"}]}, {"id": "train-2552", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average price for a dating application?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(Price) FROM playstore WHERE Genres = 'Dating'\n```"}]}, {"id": "train-2553", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average download for entertainment apps with size no more than 1.0 M?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(CAST(REPLACE(REPLACE(Installs, ',', ''), '+', '') AS INTEGER)) FROM playstore WHERE Category = 'ENTERTAINMENT' AND Size < '1.0M'\n```"}]}, {"id": "train-2554", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average review number for application with 5 rating?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(Reviews) FROM playstore WHERE Rating = 5\n```"}]}, {"id": "train-2555", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the top 3 genre for application with a sentiment review greater than 0.5."}, {"from": "gpt", "value": "```sql\nSELECT Genres FROM playstore WHERE App IN ( SELECT App FROM user_reviews WHERE Sentiment = 'Positive' AND Sentiment_Polarity > 0.5 ORDER BY Sentiment_Polarity DESC LIMIT 3 )\n```"}]}, {"id": "train-2556", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of application with 4.7 rating having more positives sentiment than negative sentiment?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN ( SELECT COUNT(CASE WHEN Sentiment = 'Positive' THEN 1 ELSE NULL END) - COUNT(CASE WHEN Sentiment = 'Negative' THEN 1 ELSE NULL END) FROM user_reviews GROUP BY App ) > 0 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.Sentiment) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Rating = 4.7\n```"}]}, {"id": "train-2557", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down app that does not have negative sentiment and give their average rating?"}, {"from": "gpt", "value": "```sql\nSELECT T1.App, AVG(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Sentiment != 'Negative' GROUP BY T1.App\n```"}]}, {"id": "train-2559", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage for free application with a rating 4.5 and above have not been updated since 2018?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN SUBSTR('Last Updated', -4) > '2018' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(App) PER FROM playstore WHERE Type = 'Free' AND Rating >= 4.5\n```"}]}, {"id": "train-2560", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What genre does Honkai Impact 3rd belong to?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT Genres FROM playstore WHERE App = 'Honkai Impact 3rd'\n```"}]}, {"id": "train-2561", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the rating for the App Learn C++."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT Rating FROM playstore WHERE App = 'Learn C++'\n```"}]}, {"id": "train-2562", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average price of games belonging in the arcade genre which has a content rating of Everyone 10+?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(Price) FROM playstore WHERE 'Content Rating' = 'Everyone 10+' AND Genres = 'Arcade'\n```"}]}, {"id": "train-2563", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the size of Browser 4G and how many users have a pretty positive favorability on it?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Size, COUNT(T1.App) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Browser 4G' AND T2.Sentiment_Polarity >= 0.5\n```"}]}, {"id": "train-2564", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the Apps with a sentiment objectivity of 0.3 and include their number of installs."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.App, T1.Installs FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Sentiment_Polarity = 0.3\n```"}]}, {"id": "train-2565", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.Sentiment_Polarity), T1.Rating FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Golf GPS Rangefinder: Golf Pad'\n```"}]}, {"id": "train-2566", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the top 5 lowest rated puzzle games and count the number of negative sentiments the games received."}, {"from": "gpt", "value": "```sql\nSELECT T1.App, COUNT(T1.App) COUNTNUMBER FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T2.Sentiment = 'Negative' GROUP BY T1.App ORDER BY T1.Rating LIMIT 5\n```"}]}, {"id": "train-2568", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the number of installs and include the percentage of positive sentiments of FREEDOME VPN Unlimited anonymous Wifi Security."}, {"from": "gpt", "value": "```sql\nSELECT T1.Installs , CAST(SUM(CASE WHEN T2.Sentiment = 'Positive' THEN 1 ELSE 0 END) * 100 / SUM(CASE WHEN T2.Sentiment IS NOT NULL THEN 1.0 ELSE 0 END) AS REAL) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'FREEDOME VPN Unlimited anonymous Wifi Security'\n```"}]}, {"id": "train-2569", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the Honkai Impact 3rd App, what is the highest sentiment polarity score and what genre does it belong to?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.Sentiment_Polarity), T1.Genres FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Honkai Impact 3rd' AND T2.Sentiment_Polarity > 0.5 GROUP BY T1.Genres\n```"}]}, {"id": "train-2570", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the rating of Dragon Ball Legends and how many users dislike this App?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Rating, COUNT(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.App = 'Dragon Ball Legends' AND CAST(Sentiment_Polarity AS INTEGER) < -0.5\n```"}]}, {"id": "train-2571", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which education App has the worst rating and state the translated review if available."}, {"from": "gpt", "value": "```sql\nSELECT T1.App, T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Category = 'EDUCATION' GROUP BY T1.App, T2.Translated_Review ORDER BY T1.Rating ASC LIMIT 1\n```"}]}, {"id": "train-2572", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all free sports Apps and their translated review."}, {"from": "gpt", "value": "```sql\nSELECT T1.App, T2.Translated_Review FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Type = 'Free' AND T1.Category = 'SPORTS'\n```"}]}, {"id": "train-2573", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the role playing game genre, how many are targeted to teens and what is their average sentiment polarity score?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.App), AVG(T2.Sentiment_Polarity) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.\"Content Rating\" = 'Teen' AND T1.Genres = 'Role Playing'\n```"}]}, {"id": "train-2574", "db_id": "app_store", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating of Apps falling under the racing genre and what is the percentage ratio of positive sentiment reviews?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.Rating), CAST(COUNT(CASE WHEN T2.Sentiment = 'Positive' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.Sentiment) FROM playstore AS T1 INNER JOIN user_reviews AS T2 ON T1.App = T2.App WHERE T1.Genres = 'Racing'\n```"}]}, {"id": "train-2575", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region has the most number of sales team?"}, {"from": "gpt", "value": "```sql\nSELECT Region FROM `Sales Team` GROUP BY Region ORDER BY COUNT(DISTINCT `Sales Team`) DESC LIMIT 1\n```"}]}, {"id": "train-2576", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the customers with name containing the word 'Group'."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT IIF(`Customer Names` LIKE '%Group%', `Customer Names`, NULL) AS T FROM Customers ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2577", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average median income for all City type of stores?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(`Median Income`) FROM `Store Locations` WHERE Type = 'City'\n```"}]}, {"id": "train-2578", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the sales team and the region of order number 'SO - 000137'."}, {"from": "gpt", "value": "```sql\nSELECT T2.`Sales Team`, T2.Region FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.OrderNumber = 'SO - 000137'\n```"}]}, {"id": "train-2579", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the order numbers along with its product name for each order under the sales team of 'Douglas Tucker'."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.ProductID, T1.`Product Name` FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID WHERE T3.`Sales Team` = 'Douglas Tucker'\n```"}]}, {"id": "train-2580", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among orders in 2020, name the customers who had the greatest discount applied for 'Cocktail Glasses'"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.`Customer Names` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN Products AS T3 ON T3.ProductID = T2._ProductID WHERE T3.`Product Name` = 'Cocktail Glasses' AND SUBSTR(T2.OrderDate, -2) = '20' AND T2.`Discount Applied` = ( SELECT T2.`Discount Applied` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN Products AS T3 ON T3.ProductID = T2._ProductID WHERE T3.`Product Name` = 'Cocktail Glasses' AND T2.OrderDate LIKE '%/%/20' ORDER BY T2.`Discount Applied` DESC LIMIT 1 )\n```"}]}, {"id": "train-2581", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the order numbers for In-Store sales and find the city where the store is located."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.OrderNumber, T2.`City Name` FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.`Sales Channel` = 'In-Store'\n```"}]}, {"id": "train-2582", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the most expensive ordered? Who, when was it ordered?"}, {"from": "gpt", "value": "```sql\nSELECT T2.OrderNumber, T1.`Customer Names`, T2.OrderDate FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN Products AS T3 ON T3.ProductID = T2._ProductID ORDER BY T2.`Unit Cost` DESC LIMIT 1\n```"}]}, {"id": "train-2583", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the numbers ordered by 'Rochester Ltd' in 2018."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T FROM ( SELECT CASE WHEN T1.OrderDate LIKE '%/%/18' AND T2.`Customer Names` = 'Rochester Ltd' THEN T1.OrderNumber ELSE NULL END AS T FROM `Sales Orders` T1 INNER JOIN Customers T2 ON T2.CustomerID = T1._CustomerID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2584", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide all the orders from WARE-NMK1003. Name the product and sales team for each of these order."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.`Product Name`, T3.`Sales Team` FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID WHERE T2.WarehouseCode = 'WARE-NMK1003'\n```"}]}, {"id": "train-2585", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of all customers who had made orders online."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT CASE WHEN T2.`Sales Channel` = 'Online' THEN T1.`Customer Names` ELSE NULL END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2586", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average net profit for bakeware product."}, {"from": "gpt", "value": "```sql\nSELECT AVG(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T2.`Product Name` = 'Bakeware'\n```"}]}, {"id": "train-2587", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the sales team name who had orders with the greatest net profit in 2020."}, {"from": "gpt", "value": "```sql\nSELECT T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.OrderDate LIKE '%/%/20' GROUP BY T2.`Sales Team` ORDER BY SUM(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) DESC LIMIT 1\n```"}]}, {"id": "train-2588", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Sate the order number and calculate the net profit for each order under Joshua Bennett."}, {"from": "gpt", "value": "```sql\nSELECT T1.OrderNumber , REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.`Sales Team` = 'Joshua Bennett'\n```"}]}, {"id": "train-2589", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the sales order shipped in July 2018, calculate the percentage of orders for home fragrances."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.`Product Name` = 'Home Fragrances' THEN 1 ELSE 0 END) * 100 / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.ShipDate LIKE '7/%/18'\n```"}]}, {"id": "train-2590", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the customer IDs and names that start with alphabet \"W\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT CustomerID, `Customer Names` FROM Customers WHERE `Customer Names` LIKE 'W%' ORDER BY `Customer Names` DESC\n```"}]}, {"id": "train-2591", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the product IDs and names that include the word \"Outdoor\"."}, {"from": "gpt", "value": "```sql\nSELECT ProductID, T FROM ( SELECT ProductID , CASE WHEN `Product Name` LIKE '%Outdoor%' THEN `Product Name` ELSE NULL END AS T FROM Products ) WHERE T IS NOT NULL ORDER BY T DESC\n```"}]}, {"id": "train-2592", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the sales with 40% discount via in-store channel, how many products were shipped from warehouse code of WARE-NMK1003?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T) FROM ( SELECT CASE WHEN `Sales Channel` = 'In-Store' AND WarehouseCode = 'WARE-NMK1003' AND `Discount Applied` = '0.4' THEN OrderNumber ELSE NULL END AS T FROM `Sales Orders` ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2593", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the most populated city and median income of the store in Florida state."}, {"from": "gpt", "value": "```sql\nSELECT `City Name`, `Median Income` FROM `Store Locations` WHERE State = 'Florida' ORDER BY Population DESC LIMIT 1\n```"}]}, {"id": "train-2594", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the ID, city and region of the stores which are in Allen country."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.StoreID, T2.`City Name`, T1.Region FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode WHERE T2.County = 'Allen County'\n```"}]}, {"id": "train-2595", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ID, city, state and region for the store type which is fewer between borough and CDP."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.StoreID, T2.`City Name`, T1.State, T2.Type FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode WHERE T2.Type = 'Borough' OR T2.Type = 'CDP'\n```"}]}, {"id": "train-2596", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the region and name of the sale team ID of 18 and compare their orders between in-store and online."}, {"from": "gpt", "value": "```sql\nSELECT T2.Region, T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.SalesTeamID = 18 AND T1.`Sales Channel` = 'In-Store' OR T1.`Sales Channel` = 'Online'\n```"}]}, {"id": "train-2597", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of order via in-store channel of customer \"Medline\"."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.`Sales Channel` = 'In-Store' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1._CustomerID) FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T2.`Customer Names` = 'Medline '\n```"}]}, {"id": "train-2598", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the customer names and lasting delivery periods for the product of \"Bedroom Furniture\" by wholesale channel in 2019."}, {"from": "gpt", "value": "```sql\nSELECT T1.`Customer Names`, T2.DeliveryDate FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN Products AS T3 ON T3.ProductID = T2._ProductID WHERE T2.`Sales Channel` = 'Wholesale' AND T3.`Product Name` = 'Bedroom Furniture' AND T2.OrderDate LIKE '%/%/19'\n```"}]}, {"id": "train-2599", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the customer names and product names which had over 3800 USD in net profit."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT `Customer Names`, `Product Name` FROM ( SELECT T1.`Customer Names`, T3.`Product Name` , REPLACE(T2.`Unit Price`, ',', '') - REPLACE(T2.`Unit Cost`, ',', '') AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID INNER JOIN Products T3 ON T3.ProductID = T2._ProductID ) WHERE T > 3800\n```"}]}, {"id": "train-2600", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the store located cities with regions in no water area of California state."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`City Name` FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode WHERE T2.State = 'California' AND T2.`Water Area` = '0'\n```"}]}, {"id": "train-2601", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the order percentage by \"Carlos Miller\" sales team."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.`Sales Team` = 'Carlos Miller' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID\n```"}]}, {"id": "train-2602", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compare the number of orders between \"Platters\" and \"Serveware\" products."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.`Product Name` = 'Platters' THEN 1 ELSE 0 END) AS num1 , SUM(CASE WHEN T2.`Product Name` = 'Serveware' THEN 1 ELSE 0 END) AS num2 FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID\n```"}]}, {"id": "train-2603", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total net profit of the store located in highest median income city."}, {"from": "gpt", "value": "```sql\nSELECT SUM(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID ORDER BY T2.`Median Income` DESC LIMIT 1\n```"}]}, {"id": "train-2604", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the sales team in South region, write down the numbers of orders made by the sales team ID of one digit."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.Region = 'South' AND T2.SalesTeamID BETWEEN 1 AND 9 GROUP BY T2.SalesTeamID HAVING COUNT(T1.OrderNumber)\n```"}]}, {"id": "train-2605", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders have order date in 5/31/2018?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(OrderDate = '5/31/18', 1, 0)) FROM `Sales Orders`\n```"}]}, {"id": "train-2606", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the name of orders which have delivery date of 6/13/2018."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T FROM ( SELECT IIF(DeliveryDate = '6/13/18', OrderNumber, NULL) AS T FROM `Sales Orders` ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2607", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders placed were with more than 5 product quantities?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(`Order Quantity` > 5, 1, 0)) FROM `Sales Orders`\n```"}]}, {"id": "train-2608", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the full name of state code \"GA\"."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT IIF(StateCode = 'GA', State, NULL) AS T FROM Regions ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2609", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many states located in the Midwest region?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T) FROM ( SELECT CASE WHEN Region = 'Midwest' THEN StateCode ELSE NULL END AS T FROM Regions ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2610", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the product name of order which has unit cost of 781.22."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT IIF(T1.`Unit Cost` = 781.22, T2.`Product Name`, NULL) AS T FROM `Sales Orders` T1 INNER JOIN Products T2 ON T2.ProductID = T1._ProductID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2611", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the delivery date of cookware."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT IIF(T2.`Product Name` = 'Cookware', T1.DeliveryDate, NULL) AS T FROM `Sales Orders` T1 INNER JOIN Products T2 ON T2.ProductID = T1._ProductID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2612", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many furniture cushions orders which have date of order in 2018?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.OrderDate LIKE '%/%/18' AND T2.`Product Name` = 'Furniture Cushions' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID\n```"}]}, {"id": "train-2613", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the name of products which have been applied 10% discount."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT IIF(T1.`Discount Applied` = 0.1, T2.`Product Name`, NULL) AS T FROM `Sales Orders` T1 INNER JOIN Products T2 ON T2.ProductID = T1._ProductID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2614", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average net profit of phones which have sales channel of distributor."}, {"from": "gpt", "value": "```sql\nSELECT SUM(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T2.`Product Name` = 'Phones' AND T1.`Sales Channel` = 'Distributor'\n```"}]}, {"id": "train-2615", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average net profit of bar tools which has ordered quantity exceed 5."}, {"from": "gpt", "value": "```sql\nSELECT SUM(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T2.`Product Name` = 'Bar Tools' AND T1.`Order Quantity` > 5\n```"}]}, {"id": "train-2616", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the city name of states located in South region."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T1.Region = 'South' THEN T2.`City Name` END AS T FROM Regions T1 INNER JOIN `Store Locations` T2 ON T2.StateCode = T1.StateCode ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2617", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the region of stores which have type of \"Town\" in the list?"}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T2.Type = 'Town' THEN T1.Region END AS T FROM Regions T1 INNER JOIN `Store Locations` T2 ON T2.StateCode = T1.StateCode ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2618", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders that Medsep Group had made?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.`Customer Names` = 'Medsep Group' THEN 1 ELSE 0 END) FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID\n```"}]}, {"id": "train-2619", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the discount levels applied for all orders from Ole Group."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T1.`Customer Names` = 'Ole Group' THEN T2.`Discount Applied` END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2620", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the customer name of orders which has shipped date in 7/8/2018."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T2.ShipDate = '7/8/18' THEN T1.`Customer Names` END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2621", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the orders placed by Ei, how many orders have quantity greater than 4?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.`Order Quantity` > 4 AND T2.`Customer Names` = 'Ei ' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID\n```"}]}, {"id": "train-2622", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the orders placed by Pacific Ltd, how many orders have been applied 5% discount ?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.`Discount Applied` = 0.05 AND T2.`Customer Names` = 'Pacific Ltd' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID\n```"}]}, {"id": "train-2623", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the customer names of orders which have unit cost greater than 4000USD?"}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T2.`Unit Cost` > 4000 THEN T1.`Customer Names` END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2624", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the id and detailed position of all stores in Birmingham city."}, {"from": "gpt", "value": "```sql\nSELECT StoreID, Latitude, Longitude FROM `Store Locations` WHERE `City Name` = 'Birmingham'\n```"}]}, {"id": "train-2625", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city has the largest population?"}, {"from": "gpt", "value": "```sql\nSELECT `City Name` FROM `Store Locations` ORDER BY Population DESC LIMIT 1\n```"}]}, {"id": "train-2626", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many CDP stores are there in California?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN State = 'California' AND Type = 'CDP' THEN 1 ELSE 0 END) FROM `Store Locations`\n```"}]}, {"id": "train-2627", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the order number and product name of the order which has the lowest unit price."}, {"from": "gpt", "value": "```sql\nSELECT T1.OrderNumber, T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE REPLACE(T1.`Unit Price`, ',', '') = ( SELECT REPLACE(T1.`Unit Price`, ',', '') FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID ORDER BY REPLACE(T1.`Unit Price`, ',', '') LIMIT 1 )\n```"}]}, {"id": "train-2628", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product has the highest net profit in 2019?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.OrderDate LIKE '%/%/19' ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 1\n```"}]}, {"id": "train-2629", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average unit price of a Cookware product?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(REPLACE(T1.`Unit Price`, ',', '')) FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T2.`Product Name` = 'Cookware'\n```"}]}, {"id": "train-2630", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all sale team names which had orders on 5/31/2018."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T1.OrderDate = '5/31/18' THEN T2.`Sales Team` ELSE NULL END AS T FROM `Sales Orders` T1 INNER JOIN `Sales Team` T2 ON T2.SalesTeamID = T1._SalesTeamID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2631", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which sales team name has the least orders in 2019?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.OrderDate LIKE '%/%/19' GROUP BY T2.`Sales Team` ORDER BY COUNT(T1.OrderNumber) ASC LIMIT 1\n```"}]}, {"id": "train-2632", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 2018 to 2020, which year did the George Lewis group have the highest number of orders?"}, {"from": "gpt", "value": "```sql\nSELECT SUBSTR(T1.OrderDate, -2, 2) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.`Sales Team` = 'George Lewis' GROUP BY SUBSTR(T1.OrderDate, -2, 2) ORDER BY COUNT(T1.OrderNumber) DESC LIMIT 1\n```"}]}, {"id": "train-2633", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of total orders from stores in Orange County in 2018?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.County = 'Orange County' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.OrderDate LIKE '%/%/18'\n```"}]}, {"id": "train-2634", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which order number has the highest unit price?"}, {"from": "gpt", "value": "```sql\nSELECT OrderNumber FROM `Sales Orders` WHERE REPLACE(`Unit Price`, ',', '') = ( SELECT REPLACE(`Unit Price`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Price`, ',', '') DESC LIMIT 1 )\n```"}]}, {"id": "train-2635", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which sales team id has the highest number of orders in 2018?"}, {"from": "gpt", "value": "```sql\nSELECT _SalesTeamID FROM `Sales Orders` WHERE OrderDate LIKE '%/%/18' GROUP BY _SalesTeamID ORDER BY COUNT(_SalesTeamID) DESC LIMIT 1\n```"}]}, {"id": "train-2636", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the unit cost of order SO - 000103?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T FROM ( SELECT IIF(OrderNumber = 'SO - 000103', `Unit Cost`, NULL) AS T FROM `Sales Orders` ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2637", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2020, what were the total orders of all stores in Maricopa County?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.County = 'Maricopa County' AND OrderDate LIKE '%/%/20' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID\n```"}]}, {"id": "train-2638", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the detailed position of the store which has order SO - 000115?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Latitude, T2.Longitude FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.OrderNumber = 'SO - 000115'\n```"}]}, {"id": "train-2639", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate the total number of orders by each city in 2019."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.OrderDate LIKE '%/%/19' GROUP BY T2.`City Name` HAVING COUNT(T1.OrderNumber)\n```"}]}, {"id": "train-2640", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of customers who have total orders of over 3 in 2018."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT IIF(COUNT(T2.CustomerID) > 3, T2.`Customer Names`, NULL) FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T1.OrderDate LIKE '%/%/18' GROUP BY T1._CustomerID HAVING COUNT(T2.CustomerID)\n```"}]}, {"id": "train-2641", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What were the total orders of Medsep Group from 2018 to 2020?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN SUBSTR(T1.OrderDate, -2) IN ('18', '19', '20') AND T2.`Customer Names` = 'Medsep Group' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID\n```"}]}, {"id": "train-2642", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the customer names whose order quantity was more than 5 on 6/1/2018."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN SUM(T1.`Order Quantity`) > 5 THEN T2.`Customer Names` END AS T FROM `Sales Orders` T1 INNER JOIN Customers T2 ON T2.CustomerID = T1._CustomerID WHERE T1.OrderDate = '6/1/18' GROUP BY T1._CustomerID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2643", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of total orders of Stephen Payne that had a net profit of over 1000?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') > 1000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.`Sales Team` = 'Stephen Payne'\n```"}]}, {"id": "train-2644", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales team were from Northeast?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Region = 'Northeast' THEN 1 ELSE 0 END) FROM `Sales Team`\n```"}]}, {"id": "train-2645", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of all city in Maricopa County along with its latitude and longitude."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT `City Name`, Latitude, Longitude FROM `Store Locations` WHERE County = 'Maricopa County'\n```"}]}, {"id": "train-2646", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which order have the highest unit cost?"}, {"from": "gpt", "value": "```sql\nSELECT OrderNumber FROM `Sales Orders` WHERE REPLACE(`Unit Cost`, ',', '') = ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Cost`, ',', '') DESC LIMIT 1 )\n```"}]}, {"id": "train-2647", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the name of products with the ID of 30 to 40."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT CASE WHEN ProductID BETWEEN 30 AND 40 THEN `Product Name` ELSE NULL END AS T FROM Products ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2648", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate ratio between the highest unit cost and the lowest unit cost?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` WHERE REPLACE(`Unit Cost`, ',', '') = ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Cost`, ',', '') DESC LIMIT 1 ) ORDER BY REPLACE(`Unit Cost`, ',', '') DESC LIMIT 1 ) / ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` WHERE REPLACE(`Unit Cost`, ',', '') = ( SELECT REPLACE(`Unit Cost`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Cost`, ',', '') ASC LIMIT 1 ) ORDER BY REPLACE(`Unit Cost`, ',', '') ASC LIMIT 1 )\n```"}]}, {"id": "train-2649", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product was ordered the most in 2018?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.OrderDate LIKE '%/%/18' GROUP BY T1._ProductID ORDER BY COUNT(T1._ProductID) DESC LIMIT 1\n```"}]}, {"id": "train-2650", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products sold by Adam Hernandez?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.`Sales Team` = 'Adam Hernandez' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID\n```"}]}, {"id": "train-2651", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all orders where its products were shipped from Daly City."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T2.`City Name` = 'Daly City' THEN T1.OrderNumber END AS T FROM `Sales Orders` T1 INNER JOIN `Store Locations` T2 ON T2.StoreID = T1._StoreID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2652", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders made by Rochester Ltd?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.`Customer Names` = 'Rochester Ltd' THEN 1 ELSE 0 END) FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID\n```"}]}, {"id": "train-2653", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the order number where Qualitest ordered the highest product quantity."}, {"from": "gpt", "value": "```sql\nSELECT T1.OrderNumber FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T2.`Customer Names` = 'Qualitest ' ORDER BY T1.`Order Quantity` DESC LIMIT 1\n```"}]}, {"id": "train-2654", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the order for all in-store sales along with the products sold."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.OrderNumber, T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.`Sales Channel` = 'In-Store'\n```"}]}, {"id": "train-2655", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many online sales were made in May 2018 where products were shipped from Norman?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.OrderDate LIKE '5/%/18' AND T1.`Sales Channel` = 'Online' AND T2.`City Name` = 'Norman' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID\n```"}]}, {"id": "train-2656", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products sold in Maricopa County, which was the least sold?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`Product Name` FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID WHERE T3.County = 'Maricopa County' ORDER BY T2.`Order Quantity` ASC LIMIT 1\n```"}]}, {"id": "train-2657", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State all the order numbers for sales team of Samuel Fowler."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T2.`Sales Team` = 'Samuel Fowler' THEN T1.OrderNumber ELSE NULL END AS T FROM `Sales Orders` T1 INNER JOIN `Sales Team` T2 ON T2.SalesTeamID = T1._SalesTeamID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2658", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the number of baseball ordered in December 2017."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.OrderNumber) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID WHERE T1.`Product Name` = 'Baseball' AND T2.OrderDate LIKE '12/%/18'\n```"}]}, {"id": "train-2659", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the average number of ornaments sold each month in 2018."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.`Order Quantity`) AS REAL) / 12 FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID WHERE T1.`Product Name` = 'Ornaments' AND T2.OrderDate LIKE '%/%/18'\n```"}]}, {"id": "train-2660", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the percentage of products that were shipped from Burbank in 2018?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.`City Name` = 'Burbank' THEN T2.`Order Quantity` ELSE 0 END) AS REAL) * 100 / SUM(T2.`Order Quantity`) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID WHERE T2.OrderDate LIKE '%/%/18'\n```"}]}, {"id": "train-2661", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in order number from \"WARE-MKL1006\" and \"WARE-NBV1002\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(WarehouseCode = 'WARE-MKL1006', 1, 0)) - SUM(IIF(WarehouseCode = 'WARE-NBV1002', 1, 0)) AS difference FROM `Sales Orders`\n```"}]}, {"id": "train-2662", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the product names delivered in 2021 for the customer \"Sundial\"."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T2.DeliveryDate LIKE '%/%/21' AND T1.`Customer Names` = 'Sundial ' THEN T3.`Product Name` END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID INNER JOIN Products T3 ON T3.ProductID = T2._ProductID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2663", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the store IDs and region of the state \"Michigan\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.StoreID, T1.Region FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode WHERE T2.State = 'Michigan'\n```"}]}, {"id": "train-2664", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compare the total number of orders between customer \"Apollo Ltd\" and \"Pacific Ltd\"."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.`Customer Names` = 'Apollo Ltd' THEN 1 ELSE 0 END), SUM(CASE WHEN T2.`Customer Names` = 'Pacific Ltd' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID\n```"}]}, {"id": "train-2665", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the store ID with more orders between \"Aurora\" and \"Babylon\" city."}, {"from": "gpt", "value": "```sql\nSELECT T2.StoreID FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T2.`City Name` = 'Aurora (Township)' OR T2.`City Name` = 'Babylon (Town)' GROUP BY T2.StoreID ORDER BY COUNT(T1.OrderNumber) DESC LIMIT 1\n```"}]}, {"id": "train-2666", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the customer names and product names of the order made by \"Anthony Torres\" via distributor channel."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.`Customer Names`, T4.`Product Name` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID INNER JOIN Products AS T4 ON T4.ProductID = T2._ProductID WHERE T3.`Sales Team` = 'Anthony Torres' AND T2.`Sales Channel` = 'Distributor'\n```"}]}, {"id": "train-2667", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the customer names and IDs which ordered total net profit of above 5000 USD through online channel."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT `Customer Names`, CustomerID FROM ( SELECT T2.`Customer Names`, T2.CustomerID , SUM(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) AS T FROM `Sales Orders` T1 INNER JOIN Customers T2 ON T2.CustomerID = T1._CustomerID WHERE T1.`Sales Channel` = 'Online' GROUP BY T2.CustomerID ) WHERE T > 5000\n```"}]}, {"id": "train-2668", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the net profit of the floral products which were delivered in 2021."}, {"from": "gpt", "value": "```sql\nSELECT SUM(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.DeliveryDate LIKE '%/%/21' AND T2.`Product Name` = 'Floral'\n```"}]}, {"id": "train-2669", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the number of orders made from the store in city with population of 3000000 to 4000000."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T2.Population BETWEEN 3000000 AND 4000000\n```"}]}, {"id": "train-2670", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the products via wholesale channel of the store under Pacific/Honolulu time zone."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T3.`Time Zone` = 'Pacific/Honolulu' AND T2.`Sales Channel` = 'Wholesale' THEN T1.`Product Name` ELSE NULL END AS T FROM Products T1 INNER JOIN `Sales Orders` T2 ON T2._ProductID = T1.ProductID INNER JOIN `Store Locations` T3 ON T3.StoreID = T2._StoreID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2671", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the order numbers and product names which were ordered on 6th June, 2018."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT OrderNumber, `Product Name` FROM ( SELECT IIF(T2.OrderDate = '6/6/18', T2.OrderNumber, NULL) AS \"OrderNumber\" , IIF(T2.OrderDate = '6/6/18', T1.`Product Name`, NULL) AS \"Product Name\" FROM Products T1 INNER JOIN `Sales Orders` T2 ON T2._ProductID = T1.ProductID ) WHERE OrderNumber IS NOT NULL AND `Product Name` IS NOT NULL\n```"}]}, {"id": "train-2672", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the average yearly order by customer Weimei Corp for 2018, 2019 and 2020."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.OrderNumber) / 3 FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE (T1.OrderDate LIKE '%/%/18' AND T2.`Customer Names` = 'Weimei Corp') OR (T1.OrderDate LIKE '%/%/19' AND T2.`Customer Names` = 'Weimei Corp') OR (T1.OrderDate LIKE '%/%/20' AND T2.`Customer Names` = 'Weimei Corp')\n```"}]}, {"id": "train-2673", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average monthly order and percentage of warehouse \"WARE-NMK1003\" in 2019. Among them, mention number of orders for floor lamps."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.WarehouseCode = 'WARE-NMK1003' THEN 1 ELSE 0 END) AS REAL) / 12 , CAST(SUM(CASE WHEN T2.WarehouseCode = 'WARE-NMK1003' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.OrderNumber), COUNT(CASE WHEN T1.`Product Name` = 'Floor Lamps' AND T2.WarehouseCode = 'WARE-NMK1003' THEN T2.`Order Quantity` ELSE NULL END) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID WHERE T2.OrderDate LIKE '%/%/19'\n```"}]}, {"id": "train-2674", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the procured dates for the customer whose ID is 11."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T FROM ( SELECT IIF(_CustomerID = 11, ProcuredDate, NULL) AS T FROM `Sales Orders` ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2675", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders through distributor were for the minimum quantity?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN `Order Quantity` = 1 AND `Sales Channel` = 'Distributor' THEN 1 ELSE 0 END) FROM `Sales Orders`\n```"}]}, {"id": "train-2676", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List by ID all sales teams that have sold products at a 10% discount in store."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T FROM ( SELECT CASE WHEN `Discount Applied` = '0.1' AND `Sales Channel` = 'In-Store' THEN _SalesTeamID ELSE NULL END AS T FROM `Sales Orders` ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2677", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Borough-type stores located in the city of Brooklyn have a population of less than 3 million?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Population < 3000000 AND Type = 'Borough' AND `City Name` = 'Brooklyn' THEN 1 ELSE 0 END) FROM `Store Locations`\n```"}]}, {"id": "train-2678", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many states are in the Midwest region?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T) FROM ( SELECT CASE WHEN Region = 'Midwest' THEN State ELSE NULL END AS T FROM Regions ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2679", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 10 products with the highest net profit?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID GROUP BY T1._ProductID ORDER BY SUM(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) DESC LIMIT 10\n```"}]}, {"id": "train-2681", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the sales teams that have served to customer Apotheca, Ltd?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.`Sales Team` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID WHERE T1.`Customer Names` = 'Apotheca, Ltd'\n```"}]}, {"id": "train-2682", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which regions are the stores that have shipped products through the WARE-UHY1004 warehouse?"}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T3.WarehouseCode = 'WARE-UHY1004' THEN T1.Region END AS T FROM Regions T1 INNER JOIN `Store Locations` T2 ON T2.StateCode = T1.StateCode INNER JOIN `Sales Orders` T3 ON T3._StoreID = T2.StoreID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2683", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the cities where Shawn Torres sells Audio products."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T4.`Product Name` = 'Audio' AND T3.`Sales Team` = 'Shawn Torres' THEN T1.`City Name` ELSE NULL END AS T FROM `Store Locations` T1 INNER JOIN `Sales Orders` T2 ON T2._StoreID = T1.StoreID INNER JOIN `Sales Team` T3 ON T3.SalesTeamID = T2._SalesTeamID INNER JOIN Products T4 ON T4.ProductID = T2._ProductID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2685", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stores procured products on October 27, 2018, in the city of Oregon?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.ProcuredDate = '10/27/18' AND T2.`City Name` = 'Orlando' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID\n```"}]}, {"id": "train-2686", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What sales channels are used the most in the 3 places with the highest median income?"}, {"from": "gpt", "value": "```sql\nSELECT `Sales Channel` FROM ( SELECT T1.`Sales Channel` FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID ORDER BY T2.`Median Income` DESC LIMIT 3 ) GROUP BY `Sales Channel` ORDER BY COUNT(`Sales Channel`) DESC LIMIT 1\n```"}]}, {"id": "train-2687", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the 5 sales teams that have made sales with the highest net profits."}, {"from": "gpt", "value": "```sql\nSELECT T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 5\n```"}]}, {"id": "train-2688", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest discount applied by the store located in a city of the state of Colorado whose land area is 111039036."}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.`Discount Applied`) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T2.State = 'Colorado' AND T2.`Land Area` = 111039036\n```"}]}, {"id": "train-2689", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different time zones are there in the Northeast region?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.`Time Zone`) FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode WHERE T1.Region = 'Northeast'\n```"}]}, {"id": "train-2690", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What type of store is most popular in the South?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT CASE WHEN MAX(T2.Population) THEN T2.Type END FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode\n```"}]}, {"id": "train-2691", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which region does the sales team that has used the WARE-MKL1006 warehouse the most times for its shipments belong?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Region FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.WarehouseCode = 'WARE-MKL1006' GROUP BY T2.Region ORDER BY COUNT(T1.OrderNumber) DESC LIMIT 1\n```"}]}, {"id": "train-2692", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city is the store with the highest sales order unit price located?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`City Name` FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE REPLACE(T1.`Unit Price`, ',', '') = ( SELECT REPLACE(T1.`Unit Price`, ',', '') FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID ORDER BY REPLACE(T1.`Unit Price`, ',', '') DESC LIMIT 1 ) ORDER BY REPLACE(T1.`Unit Price`, ',', '') DESC LIMIT 1\n```"}]}, {"id": "train-2693", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many online purchases did Ole Group make in May 2019?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.`Sales Channel` = 'Online' AND T2.`Customer Names` = 'Ole Group' AND T1.OrderDate LIKE '5/%/19' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID\n```"}]}, {"id": "train-2694", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stores with less need for products, and purchased through a distributor, are located in Washtenaw County?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.`Order Quantity` = 1 AND T1.`Sales Channel` = 'Distributor' AND T2.County = 'Washtenaw County' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID\n```"}]}, {"id": "train-2695", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the least purchased product by stores in the city of Santa Clarita?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`Product Name` FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID WHERE T3.`City Name` = 'Santa Clarita' GROUP BY T1.`Product Name` ORDER BY COUNT(T1.`Product Name`) ASC LIMIT 1\n```"}]}, {"id": "train-2696", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: At what Latitude and Longitude is the store that has used the WARE-PUJ1005 warehouse the fewest times?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Latitude, T2.Longitude FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.WarehouseCode = 'WARE-PUJ1005' GROUP BY T2.StoreID ORDER BY COUNT(T1.WarehouseCode) ASC LIMIT 1\n```"}]}, {"id": "train-2697", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of sell orders on 04/04/2020 were for the state of New York?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.State = 'New York' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.OrderDate = '4/4/20'\n```"}]}, {"id": "train-2698", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average land area of \u200b\u200bthe cities in which stores that purchased products for a unit price of 998.30 are located?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.`Land Area`) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T1.`Unit Price` = '998.30'\n```"}]}, {"id": "train-2699", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average household income in cities in the state of New Hampshire where there are stores of the type city?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.`Household Income`) FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode WHERE T2.State = 'New Hampshire' AND T2.Type = 'City'\n```"}]}, {"id": "train-2700", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales teams are there in the Midwest?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Region = 'Midwest' THEN 1 ELSE 0 END) FROM `Sales Team`\n```"}]}, {"id": "train-2701", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate order numbers with an order date after 1/1/2018."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T FROM ( SELECT CASE WHEN OrderDate > '1/1/18' THEN OrderNumber ELSE NULL END AS T FROM `Sales Orders` ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2702", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales channels does the sales team have in the Midwest?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.`Sales Channel`) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.Region = 'Midwest'\n```"}]}, {"id": "train-2703", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which sales team has the other with the highest unit price?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE REPLACE(T1.`Unit Price`, ',', '') = ( SELECT REPLACE(T1.`Unit Price`, ',', '') FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID ORDER BY REPLACE(T1.`Unit Price`, ',', '') DESC LIMIT 1 ) ORDER BY REPLACE(T1.`Unit Price`, ',', '') DESC LIMIT 1\n```"}]}, {"id": "train-2704", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which regions have online sales channels that have the most discounts?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Region FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.`Sales Channel` = 'Online' ORDER BY T1.`Discount Applied` DESC LIMIT 1\n```"}]}, {"id": "train-2705", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Apollo Ltd customer's order number has the most expensive unit price, indicating the order date?"}, {"from": "gpt", "value": "```sql\nSELECT T1.OrderNumber, T1.OrderDate FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T2.`Customer Names` = 'Apollo Ltd' ORDER BY T1.`Unit Price` DESC LIMIT 1\n```"}]}, {"id": "train-2706", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide order number, warehouse code of customers Elorac, Corp."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.OrderNumber, T1.WarehouseCode FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T2.`Customer Names` = 'Elorac, Corp'\n```"}]}, {"id": "train-2707", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name of customers who have ordered Cocktail Glasses by online sales channel."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T3.`Product Name` = 'Cocktail Glasses' AND T2.`Sales Channel` = 'Online' THEN T1.`Customer Names` END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID INNER JOIN Products T3 ON T3.ProductID = T2._ProductID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2708", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which store in Arizona has the most net profit?"}, {"from": "gpt", "value": "```sql\nSELECT T2.StoreID FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T2.State = 'Arizona' ORDER BY T1.`Unit Price` - T1.`Unit Cost` DESC LIMIT 1\n```"}]}, {"id": "train-2709", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much more is the Florida store's computer product unit price than the Texas store?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.State = 'Florida' THEN T2.`Unit Price` ELSE 0 END) - SUM(CASE WHEN T3.State = 'Texas' THEN T2.`Unit Price` ELSE 0 END) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID WHERE T1.`Product Name` = 'Computers'\n```"}]}, {"id": "train-2710", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among sales teams in Midwest region, which sales team has an order quantity greater than 5?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.Region = 'Midwest' AND T1.`Order Quantity` > 5\n```"}]}, {"id": "train-2711", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate store id in the state of California that have been applied 20% discount in store."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T2.State = 'California' AND T1.`Sales Channel` = 'In-Store' AND T1.`Discount Applied` = 0.2 THEN T2.StoreID END AS T FROM `Sales Orders` T1 INNER JOIN `Store Locations` T2 ON T2.StoreID = T1._StoreID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2712", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of the customer with the most number of order quantity from 2018 to 2020."}, {"from": "gpt", "value": "```sql\nSELECT T1.`Customer Names` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID WHERE T2.OrderDate LIKE '%/%/18' OR T2.OrderDate LIKE '%/%/19' OR T2.OrderDate LIKE '%/%/20' ORDER BY T2.`Order Quantity` DESC LIMIT 1\n```"}]}, {"id": "train-2713", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate total order quantity of product Candles and calculate the percentage of such product among all the orders."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.`Product Name` = 'Candles' THEN T2.`Order Quantity` ELSE 0 END), CAST(SUM(CASE WHEN T1.`Product Name` = 'Candles' THEN T2.`Order Quantity` ELSE 0 END) AS REAL) * 100 / SUM(T2.`Order Quantity`) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID\n```"}]}, {"id": "train-2714", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region is Joshua Bennet located in?"}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN `Sales Team` = 'Joshua Bennett' THEN Region ELSE NULL END AS T FROM `Sales Team` ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2715", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the store id of the store located in the most populous county?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN MAX(Population) THEN StoreID END FROM `Store Locations`\n```"}]}, {"id": "train-2716", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales teams are there in the Midwest?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Region = 'Midwest' THEN 1 ELSE 0 END) FROM `Sales Team`\n```"}]}, {"id": "train-2717", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the type of store located in the city with the highest amount of water area?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN MAX(`Water Area`) THEN Type END FROM `Store Locations`\n```"}]}, {"id": "train-2718", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many online orders were shipped during the month of June 2018?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(ShipDate LIKE '6/%/18' AND `Sales Channel` = 'Online', 1, 0)) FROM `Sales Orders`\n```"}]}, {"id": "train-2719", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the discount applied to the order with the highest unit price?"}, {"from": "gpt", "value": "```sql\nSELECT `Discount Applied` FROM `Sales Orders` WHERE REPLACE(`Unit Price`, ',', '') = ( SELECT REPLACE(`Unit Price`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Price`, ',', '') DESC LIMIT 1 ) ORDER BY REPLACE(`Unit Price`, ',', '') DESC LIMIT 1\n```"}]}, {"id": "train-2720", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the product with the highest net profit?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 1\n```"}]}, {"id": "train-2721", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the Northeast region, what is the average household income for each city located in the state with the highest number of stores?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.`Household Income`) FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode WHERE T1.Region = 'Northeast' GROUP BY T2.State ORDER BY COUNT(T2.StoreID) DESC LIMIT 1\n```"}]}, {"id": "train-2722", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which region can you find the stores located in the state whose median income is no more than 30,000?"}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T2.`Median Income` < 30000 THEN T1.Region END AS T FROM Regions T1 INNER JOIN `Store Locations` T2 ON T2.StateCode = T1.StateCode ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2723", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the West, how many stores are there in the city whose land area is below 20,000,000?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Region = 'West' AND T2.`Land Area` < 20000000 THEN 1 ELSE 0 END) FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode\n```"}]}, {"id": "train-2724", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the customer who purchased the product with the highest net profiit?"}, {"from": "gpt", "value": "```sql\nSELECT `Customer Names` FROM ( SELECT T1.`Customer Names`, T2.`Unit Price` - T2.`Unit Cost` AS \"net profit\" FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) ORDER BY `net profit` DESC LIMIT 1\n```"}]}, {"id": "train-2725", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2019, how many orders were shipped by the sales team with the highest number of orders in the said year? Provide the name of the sales team."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.OrderNumber), T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.OrderDate LIKE '%/%/19' AND T1.ShipDate LIKE '%/%/19' GROUP BY T2.`Sales Team` ORDER BY COUNT(T1.OrderNumber) DESC LIMIT 1\n```"}]}, {"id": "train-2726", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products with an order quantity of no less than 5 that was shipped in the month of May 2019, what is the name of the product with the lowest net profit?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.`Order Quantity` > 5 AND ShipDate LIKE '5/%/19' ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') ASC LIMIT 1\n```"}]}, {"id": "train-2727", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the detailed coordinates of the store where the product with the 4th highest profit were purchased from?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Latitude, T2.Longitude FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 3, 1\n```"}]}, {"id": "train-2728", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were shipped by the sales team with the highest amount of shipped orders in 2020? Give the name of the said sales team."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.OrderNumber), T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.ShipDate LIKE '%/%/20' GROUP BY T2.`Sales Team` ORDER BY COUNT(T1.OrderNumber) DESC LIMIT 1\n```"}]}, {"id": "train-2729", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 2018 to 2020, what is the average amount of shipped orders per year under Carl Nguyen?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.OrderNumber) AS REAL) / 3 FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE (T2.`Sales Team` = 'Carl Nguyen' AND ShipDate LIKE '%/%/18') OR (T2.`Sales Team` = 'Carl Nguyen' AND ShipDate LIKE '%/%/19') OR (T2.`Sales Team` = 'Carl Nguyen' AND ShipDate LIKE '%/%/20')\n```"}]}, {"id": "train-2730", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the amount of discount applied to the product with the highest net profit and what is the name of the said product?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`Unit Price` * T1.`Discount Applied`, T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 1\n```"}]}, {"id": "train-2731", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the top 3 customers who paid the highest amount of price per order after discount?"}, {"from": "gpt", "value": "```sql\nSELECT `Customer Names` FROM ( SELECT T1.`Customer Names` , REPLACE(T2.`Unit Price`, ',', '') * T2.`Order Quantity` - REPLACE(T2.`Unit Price`, ',', '') * T2.`Discount Applied` AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) ORDER BY T DESC LIMIT 3\n```"}]}, {"id": "train-2732", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which sales channel was most preferred in commercializing products in January 2020 based on the number of orders placed?"}, {"from": "gpt", "value": "```sql\nSELECT `Sales Channel` FROM `Sales Orders` WHERE OrderDate LIKE '1/%/20' GROUP BY `Sales Channel` ORDER BY COUNT(`Sales Channel`) DESC LIMIT 1\n```"}]}, {"id": "train-2733", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the product that was registered in the sales order 'SO - 0005951'."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T2.OrderNumber = 'SO - 0005951' THEN T1.`Product Name` ELSE NULL END AS T FROM Products T1 INNER JOIN `Sales Orders` T2 ON T2._ProductID = T1.ProductID ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-2734", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the store location and sales team who processed the sales order 'SO - 0001004'."}, {"from": "gpt", "value": "```sql\nSELECT T3.`Sales Team`, T1.`City Name` FROM `Store Locations` AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._StoreID = T1.StoreID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID WHERE T2.OrderNumber = 'SO - 0001004'\n```"}]}, {"id": "train-2735", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the top customer of the store located in Gilbert, Arizona based on net profit associated with the customer relationship in 2019."}, {"from": "gpt", "value": "```sql\nSELECT T1.`Customer Names` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID WHERE T3.`City Name` = 'Gilbert' AND T2.ProcuredDate LIKE '%/%/19' ORDER BY REPLACE(T2.`Unit Price`, ',', '') - REPLACE(T2.`Unit Cost`, ',', '') DESC LIMIT 1\n```"}]}, {"id": "train-2736", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales orders were processed by the store located in Chandler in 2020?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.`City Name` = 'Chandler' AND T1.OrderDate LIKE '%/%/20' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID\n```"}]}, {"id": "train-2737", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average household income of Glendale?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(`Household Income`) FROM `Store Locations` WHERE `City Name` = 'Glendale'\n```"}]}, {"id": "train-2738", "db_id": "regional_sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the best discount applied to sales orders in 2020?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(`Discount Applied`) FROM `Sales Orders` WHERE OrderDate LIKE '%/%/20'\n```"}]}, {"id": "train-2739", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most consecutive games tied by Ebbsfleet as an away team in the 2008 season?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM matchs WHERE season = 2008 AND AwayTeam = 'Ebbsfleet' AND FTR = 'D'\n```"}]}, {"id": "train-2740", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the divisions in the world, what percentage of them belong to England?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN country = 'England' THEN division ELSE NULL END) AS REAL) * 100 / COUNT(division) FROM divisions\n```"}]}, {"id": "train-2741", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of games won, games lost and games drawn does Cittadella have as a home team in total?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) / COUNT(HomeTeam) AS REAL) * 100, CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam), CAST(COUNT(CASE WHEN FTR = 'D' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam) FROM matchs WHERE HomeTeam = 'Cittadella'\n```"}]}, {"id": "train-2742", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the teams that played as a team away against Caen in the 2010 season, which one has the highest winning percentage?"}, {"from": "gpt", "value": "```sql\nSELECT AwayTeam FROM matchs WHERE HomeTeam = 'Caen' AND season = 2010 AND FTR = 'A' GROUP BY AwayTeam ORDER BY COUNT(AwayTeam) DESC LIMIT 1\n```"}]}, {"id": "train-2743", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of matches played on 2005/07/30 belong to the F1 division?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN Div = 'F1' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Div) FROM matchs WHERE Date = '2005-07-30' \n```"}]}, {"id": "train-2744", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of all tied games did the Sassuolo team play in?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN HomeTeam = 'Sassuolo' OR AwayTeam = 'Sassuolo' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(FTR) FROM matchs WHERE FTR = 'D'\n```"}]}, {"id": "train-2745", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage whereby the away team scored 2 goals during the 2017 seasons?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN FTAG = 2 THEN 1 ELSE 0 END) / COUNT(FTAG) AS REAL) * 100 FROM matchs WHERE season = 2017\n```"}]}, {"id": "train-2746", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of all the teams that played in the EFL League One division?"}, {"from": "gpt", "value": "```sql\nSELECT T1.HomeTeam,T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.name = 'EFL League One' and T1.Div = 'E2' \n```"}]}, {"id": "train-2747", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teams playing in divisions in Greece have ever scored 4 or more goals?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT CASE WHEN T1.FTHG >= 4 THEN HomeTeam ELSE NULL end) + COUNT(DISTINCT CASE WHEN T1.FTAG >= 4 THEN AwayTeam ELSE NULL end) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece' \n```"}]}, {"id": "train-2748", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches played in the 2019 season of Scottish Championship league were ended with an equal result of 2-2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T2.name = 'Scottish Championship' AND T1.FTAG = 2 AND T1.FTHG = 2\n```"}]}, {"id": "train-2749", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which 2 Scottish teams scored 10 goals playing as a local team and in which seasons?"}, {"from": "gpt", "value": "```sql\nSELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Scotland' AND T1.FTHG = 10\n```"}]}, {"id": "train-2750", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From the Spanish LaLiga division in the 2017 season, which team won the most times as a local team and by what percentage?"}, {"from": "gpt", "value": "```sql\nSELECT T1.HomeTeam HWHT , CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga' AND T2.country = 'Spain' AND T1.season = 2017\n```"}]}, {"id": "train-2751", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teams that played in the 2012 season belong to any of the English divisions and what percentage play in each of the divisions?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT COUNT(T1.Div) AS total FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 ) AS num , CASE WHEN 1 THEN T.result END AS percentage FROM ( SELECT 100.0 * COUNT(T1.Div) / ( SELECT COUNT(T1.Div) FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 ) AS result FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 GROUP BY T2.division ) AS T\n```"}]}, {"id": "train-2752", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest final-time score across all divisions in the 2021 season? Which team was the team that made up that score?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT MAX(MAX(FTAG), MAX(FTHG)) FROM matchs WHERE season = 2021 ) AS T1, AwayTeam FROM matchs WHERE season = 2021 AND FTHG = T1 OR FTAG = T1\n```"}]}, {"id": "train-2753", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the home team in division P1 with the highest final time goal in all seasons?"}, {"from": "gpt", "value": "```sql\nSELECT HomeTeam FROM matchs WHERE Div = 'P1' AND season = 2021 ORDER BY FTHG DESC LIMIT 1\n```"}]}, {"id": "train-2754", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the difference in home team and away team win percentages across all divisions in 2010?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) - CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) DIFFERENCE FROM matchs WHERE season = 2010\n```"}]}, {"id": "train-2755", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which division had the most draft matches in the 2008 season?"}, {"from": "gpt", "value": "```sql\nSELECT Div FROM matchs WHERE season = 2008 AND FTR = 'D' GROUP BY Div ORDER BY COUNT(FTR) DESC LIMIT 1\n```"}]}, {"id": "train-2756", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team won the match in the EC division on January 20, 2008 at home?"}, {"from": "gpt", "value": "```sql\nSELECT HomeTeam FROM matchs WHERE Div = 'EC' AND Date = '2008-01-20' AND FTR = 'H'\n```"}]}, {"id": "train-2757", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the division in which Club Brugge and Genk competed on September 13, 2009?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2009-09-13' and T1.HomeTeam = 'Club Brugge' AND T1.AwayTeam = 'Genk'\n```"}]}, {"id": "train-2758", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches were played in the Scottish Premiership division from 2006 to 2008?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish Premiership' AND (T1.season BETWEEN 2006 AND 2008)\n```"}]}, {"id": "train-2759", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which division was the match between Hibernian, the away team, and Hearts, the home team, played? To which country does this division belong?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.division,T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.HomeTeam = 'Hearts' AND T1.AwayTeam = 'Hibernian'\n```"}]}, {"id": "train-2760", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which away team in the division of Bundesliga has the highest final time goals?"}, {"from": "gpt", "value": "```sql\nSELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.name = 'Bundesliga' ORDER BY T1.FTAG DESC LIMIT 1\n```"}]}, {"id": "train-2761", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the names of any three away teams that competed in the Italian divisions."}, {"from": "gpt", "value": "```sql\nSELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.country = 'Italy' LIMIT 3\n```"}]}, {"id": "train-2762", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the division that has had the lowest number of draft matches in the 2019 season?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T1.FTR = 'D' GROUP BY T2.division ORDER BY COUNT(FTR) LIMIT 1\n```"}]}, {"id": "train-2763", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did Valencia's home team win in the LaLiga division?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga' AND T1.HomeTeam = 'Valencia' AND T1.FTR = 'H'\n```"}]}, {"id": "train-2764", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In how many matches in the Seria A division did both teams have equal goals?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Seria A' AND T1.FTR = 'D'\n```"}]}, {"id": "train-2765", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many football divisions does England have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(division) FROM divisions WHERE country = 'England'\n```"}]}, {"id": "train-2766", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the name of the football division in the Netherlands?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM divisions WHERE country = 'Netherlands'\n```"}]}, {"id": "train-2767", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the winner of the game happened on 2009/10/10, between \"East Fife\" and \"Dumbarton\"?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN FTR = 'H' THEN 'East Fife' ELSE 'Dumbarton' END WINNER FROM matchs WHERE Date = '2009-10-10' AND HomeTeam = 'East Fife' AND AwayTeam = 'Dumbarton'\n```"}]}, {"id": "train-2768", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the final score for the game Bursaspor vs Denizlispor on 2009/4/26?"}, {"from": "gpt", "value": "```sql\nSELECT FTHG, FTAG FROM matchs WHERE Date = '2009-04-26' AND HomeTeam = 'Bursaspor' AND AwayTeam = 'Denizlispor'\n```"}]}, {"id": "train-2769", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did the first match that score more than 10 goals happen?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(Date) FROM matchs WHERE FTHG + FTAG > 10\n```"}]}, {"id": "train-2770", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the Ligue 2 game that made the most goals, who is the winner of that game?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam ELSE T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Ligue 2' ORDER BY T1.FTAG + T1.FTHG DESC LIMIT 1\n```"}]}, {"id": "train-2771", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Away Victories happened on 2016/3/27 in the LaLiga 2 division?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga 2' AND T1.Date = '2016-03-27' AND T1.FTR = 'A'\n```"}]}, {"id": "train-2772", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many draw games happened on 2018/8/7 for National League?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'National League' AND T1.Date = '2018-08-07' AND T1.FTR = 'D'\n```"}]}, {"id": "train-2773", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country had the game that Away team made the most goals?"}, {"from": "gpt", "value": "```sql\nSELECT T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division GROUP BY T2.country ORDER BY SUM(T1.FTAG) DESC LIMIT 1\n```"}]}, {"id": "train-2774", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For a game had a score of 1-8 in the year of 2011, what division was that game in? Give the full name of the division."}, {"from": "gpt", "value": "```sql\nSELECT T2.division, T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2011 AND T1.FTHG = 1 AND T1.FTAG = 8\n```"}]}, {"id": "train-2775", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which division had the most games with more than 5 total field goals on 2020/2/22? Give the full name of the division?"}, {"from": "gpt", "value": "```sql\nSELECT T2.division, T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-02-22' AND T1.FTAG + T1.FTHG > 5 ORDER BY T1.FTAG + T1.FTHG DESC LIMIT 1\n```"}]}, {"id": "train-2776", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name of the divison that had the most 0-0 games."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTAG = 0 AND T1.FTHG = 0 GROUP BY T2.division ORDER BY COUNT(T1.FTAG) DESC LIMIT 1\n```"}]}, {"id": "train-2777", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Scottish League One games took place on the day that \"Pro Vercelli\" and \"Pescara\"had a 5-2 game?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Date) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish League One' AND T1.Date = ( SELECT Date FROM matchs WHERE FTHG = 5 AND FTAG = 2 AND HomeTeam = 'Pro Vercelli' AND AwayTeam = 'Pescara' )\n```"}]}, {"id": "train-2778", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the number of games that ended up with 5-0 in Greece."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece' AND T1.FTHG = 5 AND T1.FTAG = 0\n```"}]}, {"id": "train-2779", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country did Bradford Team belongs to?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.HomeTeam = 'Bradford' OR T1.AwayTeam = 'Bradford'\n```"}]}, {"id": "train-2780", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Eredivisie teams have played in 2008?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Eredivisie' AND T1.season = 2008\n```"}]}, {"id": "train-2781", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the home win ratio of the Bundesliga division in 2021?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T2.name = 'Bundesliga'\n```"}]}, {"id": "train-2782", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the games ended up with 1-1, what percentage of them are from Liga NOS division?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.name = 'Liga NOS' THEN T1.Div ELSE NULL END) AS REAL) * 100 / COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTHG = 1 AND FTAG = 1\n```"}]}, {"id": "train-2783", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches were held during the 2021 season's Premier League?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T2.name = 'Premier League'\n```"}]}, {"id": "train-2784", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team was the home team in the match of the Bundesliga division on 2020/10/2?"}, {"from": "gpt", "value": "```sql\nSELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga'\n```"}]}, {"id": "train-2785", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team won the match of the Bundesliga division on 2020/10/2?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam WHEN T1.FTR = 'A' THEN T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga'\n```"}]}, {"id": "train-2786", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team has the most victories as the home team in matches of the Bundesliga division?"}, {"from": "gpt", "value": "```sql\nSELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'H' GROUP BY T1.HomeTeam ORDER BY COUNT(T1.FTR) DESC LIMIT 1\n```"}]}, {"id": "train-2787", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did the team Werder Bremen win as the away team in matches of the Bundesliga division?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.AwayTeam = 'Werder Bremen' AND T1.FTR = 'A'\n```"}]}, {"id": "train-2788", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many matches of the Bundesliga division ended with an away victory in the 2021 season?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'A' AND T1.season = 2021\n```"}]}, {"id": "train-2789", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the matches in all seasons of the Bundesliga division, how many of them ended with a tie?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'D'\n```"}]}, {"id": "train-2790", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many home victories does the Bundesliga division have in more or less than the Premier League division in the 2021 season?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T2.name = 'Bundesliga' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T2.name = 'Premier League' THEN 1 ELSE NULL END) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H'\n```"}]}, {"id": "train-2791", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the home teams in the matches of the Bundesliga division that ended with a home victory in the 2021 season."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H' AND T2.name = 'Bundesliga'\n```"}]}, {"id": "train-2792", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team had more home victories in the 2021 season's matches of the Bundesliga division, Augsburg or Mainz?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN COUNT(CASE WHEN T1.HomeTeam = 'Augsburg' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T1.HomeTeam = ' Mainz' THEN 1 ELSE NULL END) > 0 THEN 'Augsburg' ELSE 'Mainz' END FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H'\n```"}]}, {"id": "train-2793", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team had the most final-time home-team goals in the 2021 season's matches of the Bundesliga division?"}, {"from": "gpt", "value": "```sql\nSELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.season = 2021 ORDER BY T1.FTHG DESC LIMIT 1\n```"}]}, {"id": "train-2794", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many final-time home-team goals were there in total in all the matches of the Bundesliga division in the 2021 season?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.FTHG) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.season = 2021\n```"}]}, {"id": "train-2795", "db_id": "european_football_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the winning rate of Club Brugge in the 2021 Premier League?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) + COUNT(CASE WHEN T1.FTR = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(t1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.AwayTeam = 'Club Brugge' OR T1.HomeTeam = 'Club Brugge'\n```"}]}, {"id": "train-2796", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the winning game from the team, what is the percentage of the winning was home game."}, {"from": "gpt", "value": "```sql\nSELECT CAST(homeWon AS REAL) * 100 / won FROM teams\n```"}]}, {"id": "train-2797", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team(s) has greater than 75% lost among all the games played."}, {"from": "gpt", "value": "```sql\nSELECT name FROM teams WHERE CAST(lost AS REAL) * 100 / games > 75\n```"}]}, {"id": "train-2798", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the team name and the total wins of the team in year 2005 which has greater winning from the previous year."}, {"from": "gpt", "value": "```sql\nSELECT T1.name, T1.won FROM teams AS T1 INNER JOIN ( SELECT * FROM teams WHERE year = 2004 ) AS T2 on T1.tmID = T2.tmID WHERE T1.year = 2005 and T1.won > T2.won\n```"}]}, {"id": "train-2799", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For team who has more home won than home lost more than 80%, list the team name and the offense points."}, {"from": "gpt", "value": "```sql\nSELECT name, o_pts FROM teams WHERE CAST((homeWon - homeLost) AS REAL) * 100 / games > 80\n```"}]}, {"id": "train-2800", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the teams who had post season (playoff) were ranked number 1?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN rank = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(name) FROM teams\n```"}]}, {"id": "train-2801", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the coach for 'BOS' team in year 1950. List the coach ID together with the number of game won and lost."}, {"from": "gpt", "value": "```sql\nSELECT coachID, won, lost FROM coaches WHERE year = 1950 AND tmID = 'BOS'\n```"}]}, {"id": "train-2802", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the longest serving coach from year 1970 to 1980. List the coach ID and the team(s) he served."}, {"from": "gpt", "value": "```sql\nSELECT coachID, tmID FROM coaches WHERE year BETWEEN 1970 AND 1980 ORDER BY stint DESC LIMIT 1\n```"}]}, {"id": "train-2803", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In year 2000, who are the coaches with more than 50 games won. List the coachID, team name and number of game won at home game."}, {"from": "gpt", "value": "```sql\nSELECT T1.coachID, T2.name, T2.won FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 2000 AND T2.won > 50\n```"}]}, {"id": "train-2804", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the coaches with more game lost than won from year 2000-2010. List the coach ID, team name and year."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.coachID, T2.tmID, T1.year FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year BETWEEN 2000 AND 2010 AND T2.lost > T2.won\n```"}]}, {"id": "train-2805", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which are the teams coached by 'adelmri01' from year 1990-1995. List the team name, year and offense point."}, {"from": "gpt", "value": "```sql\nSELECT T2.name, T1.year, T2.o_pts FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year BETWEEN 1990 AND 1995 AND T1.coachID = 'adelmri01'\n```"}]}, {"id": "train-2806", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team(s) had 90% games won. List the coach ID for the team and year played."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.name, T1.year, T1.coachID FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID WHERE CAST(T2.won AS REAL) * 100 / T2.games > 90\n```"}]}, {"id": "train-2807", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of player who won \"All-Defensive First Team\" from 1980 - 2000 is from 'NY'."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T1.birthState = 'NY' AND T2.award = 'All-Defensive First Team' AND T2.year BETWEEN 1980 AND 2000\n```"}]}, {"id": "train-2808", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What division did the team coached by the winner of the 1977 NBA Coach of the Year award play in in 1976?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.divID FROM awards_coaches AS T1 INNER JOIN coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN teams AS T3 ON T2.tmID = T3.tmID WHERE T1.year = 1977 AND T1.award = 'NBA Coach of the Year' AND T3.year = 1976\n```"}]}, {"id": "train-2809", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which coach of the Chicago Bulls during the year 1981 won the NBA Coach of the Year award in the 1970s?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.coachID FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN teams AS T3 ON T3.tmID = T1.tmID WHERE T2.award = 'NBA Coach of the Year' AND T2.year BETWEEN 1970 AND 1979 AND T1.year = 1981 AND T3.name = 'Chicago Bulls'\n```"}]}, {"id": "train-2810", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the nickname of the NBA player whose team competed in the Western Conference in the season 2006 and who had a total of two blocks?"}, {"from": "gpt", "value": "```sql\nSELECT T2.nameNick FROM player_allstar AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.blocks = 2 AND T1.conference = 'West' AND T1.season_id = 2006\n```"}]}, {"id": "train-2811", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In what year did the only team to beat the Houston in the final round of postseason series games earn its lowest ranking?"}, {"from": "gpt", "value": "```sql\nSELECT T2.year FROM series_post AS T1 INNER JOIN teams AS T2 ON T1.tmIDWinner = T2.tmID WHERE T1.round = 'DSF' AND T1.tmIDLoser = 'HSM' ORDER BY T2.rank ASC LIMIT 1\n```"}]}, {"id": "train-2812", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the birth date of the player with the most assists during the 1985 All-Star season?"}, {"from": "gpt", "value": "```sql\nSELECT T1.birthDate FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1985 ORDER BY T2.assists DESC LIMIT 1\n```"}]}, {"id": "train-2813", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which player, born in Winter Haven, played 12 minutes per season during the 1980s in the All-Stars?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCity = 'Winter Haven' AND T2.season_id BETWEEN 1980 AND 1989 AND T2.minutes = 12\n```"}]}, {"id": "train-2814", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the All-star players who played in the Eastern Conference for no more than 5 minutes, how many went to Illinois College?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.conference = 'East' AND T2.minutes <= 5 AND T1.college = 'Illinois'\n```"}]}, {"id": "train-2815", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between the years 1990 and 2007, of the total rebounds achieved by each player, how many managed to exceed 75% of defensive rebounds?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT playerID) FROM player_allstar WHERE CAST(d_rebounds AS REAL) * 100 / rebounds > 75 AND season_id BETWEEN 1990 AND 2007\n```"}]}, {"id": "train-2816", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: in which year costela01 obtained the best balance of games won as a coach?"}, {"from": "gpt", "value": "```sql\nSELECT year FROM coaches WHERE coachID = 'costela01' ORDER BY CAST(won AS REAL) / (won + lost) DESC LIMIT 1\n```"}]}, {"id": "train-2817", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many total minutes has the Brooklyn-born player, known by the name of Superman, played during all of his NBA All-Star seasons?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.minutes) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCity = 'Brooklyn' AND T1.nameNick LIKE '%Superman%'\n```"}]}, {"id": "train-2818", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the teams coached by the winner of the 1994 NBA Coach of the Year award, which team has lost the most times playing at home?"}, {"from": "gpt", "value": "```sql\nSELECT T3.tmID FROM awards_coaches AS T1 INNER JOIN coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN teams AS T3 ON T3.tmID = T2.tmID WHERE T1.year = 1994 AND T1.award = 'NBA Coach of the Year' GROUP BY T3.tmID ORDER BY SUM(T3.homeLost) DESC LIMIT 1\n```"}]}, {"id": "train-2819", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which winning team in the final round of the postseason series games against the LAL won more than 60 games in the NBA league during the year 1996?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.tmID FROM series_post AS T1 INNER JOIN teams AS T2 ON T1.tmIDWinner = T2.tmID WHERE T2.won > 60 AND T1.year = 1996 AND T1.round = 'CSF' AND T1.tmIDLoser = 'LAL'\n```"}]}, {"id": "train-2820", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which league did the player who weighs 40% less than the heaviest player and whose height is 80 inches play?"}, {"from": "gpt", "value": "```sql\nSELECT T2.lgID FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID GROUP BY T2.lgID, T1.weight HAVING T1.weight = MAX(T1.weight) - MAX(T1.weight) * 0.4\n```"}]}, {"id": "train-2821", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the name of the coach who has served more than 2 NBA teams."}, {"from": "gpt", "value": "```sql\nSELECT coachID FROM coaches GROUP BY coachID HAVING COUNT(DISTINCT tmID) > 2\n```"}]}, {"id": "train-2822", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the coach during whose period of coaching, a team has the most numbers of games won in the post-season games?"}, {"from": "gpt", "value": "```sql\nSELECT coachID FROM coaches ORDER BY post_wins DESC LIMIT 1\n```"}]}, {"id": "train-2823", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches who have served more than 2 NBA teams, during which coach's period of coaching, a team has the least numbers of games lost in the post-season games?"}, {"from": "gpt", "value": "```sql\nSELECT coachID FROM coaches WHERE lgID = 'NBA' AND post_wins != 0 AND post_losses != 0 AND coachID IN ( SELECT coachID FROM coaches WHERE lgID = 'NBA' GROUP BY coachID HAVING COUNT(tmID) > 2 ) ORDER BY post_losses ASC LIMIT 1\n```"}]}, {"id": "train-2824", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players from the ABA league, how many of them have the center position?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.lgID = 'ABA' AND (T1.pos = 'C' OR T1.pos = 'F-C')\n```"}]}, {"id": "train-2825", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the first name of the players from the NBA league with the forward position."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.firstName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE (T1.pos = 'F' OR T1.pos = 'F-C') AND T2.lgID = 'NBA'\n```"}]}, {"id": "train-2826", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who went to high school in Chicago, how many of them belongs to the west conference?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.hsCity = 'Chicago' AND T2.conference = 'West'\n```"}]}, {"id": "train-2827", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the players who belongs to the east conference, please list the name of the college they went to."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.college FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.conference = 'East'\n```"}]}, {"id": "train-2828", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players from the NBL league, how many of them were born in Spencer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCity = 'Spencer' AND T2.lgID = 'NBL'\n```"}]}, {"id": "train-2829", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the birth date of the player who has won the most MVPs."}, {"from": "gpt", "value": "```sql\nSELECT T1.birthDate FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Most Valuable Player' GROUP BY T1.playerID, T1.birthDate ORDER BY COUNT(award) DESC LIMIT 1\n```"}]}, {"id": "train-2830", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players born in Whitestone, how many of them have won the MVP?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Most Valuable Player' AND T1.birthCity = 'Houston'\n```"}]}, {"id": "train-2831", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who have won the award of Rookie of the year, what is the height of the tallest player?"}, {"from": "gpt", "value": "```sql\nSELECT T1.height FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Rookie of the Year' ORDER BY T1.height DESC LIMIT 1\n```"}]}, {"id": "train-2832", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average weight of the players who have won the award of Rookie of the year?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.weight) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Rookie of the Year'\n```"}]}, {"id": "train-2833", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players that went to high school in New York and have won the MVP, what is their average height?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.height) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Most Valuable Player' AND T1.birthCity = 'New York'\n```"}]}, {"id": "train-2834", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top ten teams with the highest scores in 2000."}, {"from": "gpt", "value": "```sql\nSELECT tmID FROM players_teams WHERE year = 2000 GROUP BY tmID ORDER BY SUM(PostPoints) DESC LIMIT 10\n```"}]}, {"id": "train-2835", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which teams have winning rate less than 50%?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM teams WHERE CAST(won AS REAL) * 100 / (won + lost) < 50\n```"}]}, {"id": "train-2836", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the coaches for team with winning rate of 80% and above?"}, {"from": "gpt", "value": "```sql\nSELECT coachID FROM coaches GROUP BY tmID, coachID, won, lost HAVING CAST(won AS REAL) * 100 / (won + lost) > 80\n```"}]}, {"id": "train-2837", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which coach has serviced in NBA for more than 10 years."}, {"from": "gpt", "value": "```sql\nSELECT coachID FROM coaches WHERE lgID = 'NBA' GROUP BY coachID HAVING MAX(year) - MIN(year) > 10\n```"}]}, {"id": "train-2838", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teams have played more than 3800 points and have player with \"Most Valuable Player\" award?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T4.name) FROM ( SELECT T1.name, SUM(T2.points) FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN awards_players AS T3 ON T2.playerID = T3.playerID WHERE T3.award = 'Most Valuable Player' GROUP BY T1.name HAVING SUM(T2.points) >= 3800 ) AS T4\n```"}]}, {"id": "train-2839", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which player from \"AFS\" team has the tallest height?"}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'AFS' ORDER BY T1.height DESC LIMIT 1\n```"}]}, {"id": "train-2840", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list down the last name of players from \"BLB\" team."}, {"from": "gpt", "value": "```sql\nSELECT T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'BLB'\n```"}]}, {"id": "train-2841", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1962 to 1975, how many coaches received the award?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT coachID) FROM awards_coaches WHERE year BETWEEN 1962 AND 1975\n```"}]}, {"id": "train-2842", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the coach IDs who received the award twice from 1970 to 1990."}, {"from": "gpt", "value": "```sql\nSELECT coachID FROM awards_coaches WHERE year BETWEEN 1970 AND 1990 GROUP BY coachID, award HAVING COUNT(award) = 2\n```"}]}, {"id": "train-2843", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1962 to 2011, how many coaches received both NBA and ABA awards?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT coachID) FROM awards_coaches WHERE year BETWEEN 1962 AND 2011 AND award = 'ABA Coach of the Year' AND coachID IN ( SELECT coachID FROM awards_coaches WHERE year BETWEEN 1962 AND 2011 AND award = 'NBA Coach of the Year' )\n```"}]}, {"id": "train-2844", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1975, what was the average point of all-star players coming from the USA?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.points) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1975\n```"}]}, {"id": "train-2845", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the last names and first names of all-star players who are higher than 75 inch."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.lastName, T1.firstName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.height > 75\n```"}]}, {"id": "train-2846", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the minimum weight of all-star players coming from UCLA college?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(T1.weight) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.college = 'UCLA'\n```"}]}, {"id": "train-2847", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the maximum weight of USA all-star players?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.weight) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCountry = 'USA'\n```"}]}, {"id": "train-2848", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1960 to 1970, what is the total point of all-star players who are still alive?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.points) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id BETWEEN 1960 AND 1970 AND T1.deathDate = '0000-00-00'\n```"}]}, {"id": "train-2849", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among players who were born after 1950, who had offence rebounds rates more than 30%? Please list their last names and first names."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.lastName, T1.firstName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.birthDate > 1950 AND CAST(T2.o_rebounds AS REAL) * 100 / T2.rebounds > 30\n```"}]}, {"id": "train-2850", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players received Rookie of the Year award from 1969 to 2010?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(playerID) FROM awards_players WHERE year BETWEEN 1969 AND 2010 AND award = 'Rookie of the Year'\n```"}]}, {"id": "train-2851", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the team names which have at least 3 all-star players."}, {"from": "gpt", "value": "```sql\nSELECT T1.tmID FROM players_teams AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID GROUP BY T1.tmID HAVING COUNT(DISTINCT T1.playerID) >= 3\n```"}]}, {"id": "train-2852", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1950 to 1970, what is the maximum point of players whose teams were ranked 1?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.points) FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year BETWEEN 1950 AND 1970 AND T1.rank = 1\n```"}]}, {"id": "train-2853", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the last names and first names of all-star players whose team were ranked 1 for consecutive 3 years from 1937 to 1940."}, {"from": "gpt", "value": "```sql\nSELECT T5.lastName, T5.firstName FROM players_teams AS T4 INNER JOIN players AS T5 ON T4.playerID = T5.playerID WHERE T4.year BETWEEN 1937 AND 1940 AND T4.tmID IN ( SELECT DISTINCT T1.tmID FROM teams AS T1 INNER JOIN teams AS T2 INNER JOIN teams AS T3 ON T1.tmID = T2.tmID AND T2.tmID = T3.tmID AND T3.year - T2.year = 1 AND T2.year - T1.year = 1 WHERE T1.rank = 1 AND T1.year BETWEEN 1937 AND 1940 )\n```"}]}, {"id": "train-2854", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the teams that were ranked 3 from 1937 to 1940, what is the team name whose players had the highest point?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.name FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.rank = 3 AND T1.year BETWEEN 1937 AND 1940 ORDER BY T2.points DESC LIMIT 1\n```"}]}, {"id": "train-2855", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1937, how many teams whose players got at least 500 points?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT T2.name, SUM(T1.points) FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 1937 GROUP BY T2.name HAVING SUM(points) >= 500 ) AS T3\n```"}]}, {"id": "train-2856", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1990, how many players whose teams had the winning rate of more than 75%?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE CAST(T2.won AS REAL) * 100 / CAST(T2.games AS REAL) > 75 AND T1.year = 1990\n```"}]}, {"id": "train-2857", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top three shortest black players."}, {"from": "gpt", "value": "```sql\nSELECT firstName, lastName FROM players WHERE race = 'B' AND height > 0 ORDER BY height ASC LIMIT 3\n```"}]}, {"id": "train-2858", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players with the first name Joe were drafted in 1970?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT playerID) FROM draft WHERE firstName = 'Joe' AND draftYear = 1970\n```"}]}, {"id": "train-2859", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many field goals did George Mikan make overall between 1951 and 1953?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(fg_made) FROM player_allstar WHERE first_name = 'George' AND last_name = 'Mikan' AND season_id BETWEEN 1951 AND 1953\n```"}]}, {"id": "train-2860", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the basketball players' BMI ranges?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(CAST(weight AS REAL) / (height * height)) , MAX(CAST(weight AS REAL) / (height * height)) FROM players\n```"}]}, {"id": "train-2861", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the team with the highest home lost rate?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM teams ORDER BY CAST(homeWon AS REAL) / (homeWon + homeLost) DESC LIMIT 1\n```"}]}, {"id": "train-2862", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How old was Alexis Ajinca when he was first drafted?"}, {"from": "gpt", "value": "```sql\nSELECT draftYear - strftime('%Y', birthDate) FROM draft AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.firstName = 'Alexis' AND T1.lastName = 'Ajinca' AND draftRound = 1\n```"}]}, {"id": "train-2863", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the tallest player in Denver Nuggets since 1980?"}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID INNER JOIN teams AS T3 ON T3.tmID = T2.tmID WHERE T3.name = 'Denver Nuggets' AND T2.year > 1980 ORDER BY T1.height DESC LIMIT 1\n```"}]}, {"id": "train-2864", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who have passed away, who had the most award?"}, {"from": "gpt", "value": "```sql\nSELECT T1.playerID FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE deathDate IS NOT NULL GROUP BY T1.playerID ORDER BY COUNT(award) DESC LIMIT 1\n```"}]}, {"id": "train-2865", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the team that has the most players from UCLA?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID INNER JOIN teams AS T3 ON T3.tmID = T2.tmID WHERE T1.college = 'UCLA' GROUP BY T3.name ORDER BY COUNT(DISTINCT T1.playerID) DESC LIMIT 1\n```"}]}, {"id": "train-2866", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average BMI of an All-star player?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(CAST(T1.weight AS REAL) / (T1.height * T1.height)) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID\n```"}]}, {"id": "train-2867", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the team with the fastest growth in winning rate in the 'ABA' league from 1972 to 1973?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM teams AS T1 INNER JOIN ( SELECT * FROM teams WHERE lgID = 'ABA' AND year = 1972 ) AS T2 ON T1.tmID = T2.tmID WHERE T1.lgID = 'ABA' AND T1.year = 1973 ORDER BY (CAST(T1.won AS REAL) / (T1.won + T1.lost) - (CAST(T2.won AS REAL) / (T2.won + T2.lost))) DESC LIMIT 1\n```"}]}, {"id": "train-2868", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the first names of the players with the most personal fouls in the 'NBL' league."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.lgID = 'NBL' GROUP BY T1.playerID, T1.firstName ORDER BY COUNT(PF) DESC LIMIT 1\n```"}]}, {"id": "train-2869", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average height of an East conference All-star player?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(DISTINCT height) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE conference = 'East'\n```"}]}, {"id": "train-2870", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches who won the 'ABA Coach of the Year' award, which is the coach with the highest number of won games?"}, {"from": "gpt", "value": "```sql\nSELECT T1.coachID FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.award = 'ABA Coach of the Year' GROUP BY T1.coachID, T1.won ORDER BY T1.won DESC LIMIT 1\n```"}]}, {"id": "train-2871", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the team that the 'NBA Coach of the Year' 1992 winner coached?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM teams AS T1 INNER JOIN coaches AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN awards_coaches AS T3 ON T2.coachID = T3.coachID AND T2.year = T3.year WHERE T3.year = 1992 AND award = 'NBA Coach of the Year'\n```"}]}, {"id": "train-2872", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the first and last name of the player with the highest field goal made rate in 1973?"}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE year = 1973 ORDER BY CAST(T2.fgMade AS REAL) / T2.fgAttempted DESC LIMIT 1\n```"}]}, {"id": "train-2873", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the team that selected Mike Lynn?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM teams AS T1 INNER JOIN draft AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.draftYear WHERE T2.firstName = 'Mike' AND T2.lastName = 'Lynn'\n```"}]}, {"id": "train-2874", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the Most improved Players awarded from 1985-1990, how many player whose country is USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.playerID) FROM awards_players AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.award = 'Most Improved Player' AND T2.birthCountry = 'USA' AND T1.year BETWEEN 1985 AND 1990\n```"}]}, {"id": "train-2875", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list out the first name and last name of player who attended California college and have been selected as all stars?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.firstName, T1.lastName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.college = 'California'\n```"}]}, {"id": "train-2876", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1950 to 1970, how many coaches who received more than 1 award?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(coachID) FROM awards_coaches WHERE year BETWEEN 1950 AND 1970 GROUP BY coachID HAVING COUNT(coachID) > 1\n```"}]}, {"id": "train-2877", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players received Most Valuable Player award from 1969 to 1975?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT playerID) FROM awards_players WHERE year BETWEEN 1969 AND 1975 AND award = 'Most Valuable Player'\n```"}]}, {"id": "train-2878", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the team names which have at least 5 players were born in the same state."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT name FROM teams WHERE tmID IN ( SELECT tmID FROM players_teams AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T2.birthState IS NOT NULL GROUP BY T1.tmID, T2.birthState HAVING COUNT(*) > 5 )\n```"}]}, {"id": "train-2879", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teams in the NBA which has at least 3 all-star players?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT tmID FROM players_teams AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.lgID = 'NBA' GROUP BY T1.tmID HAVING COUNT(DISTINCT T1.playerID) > 3 ) AS T3\n```"}]}, {"id": "train-2880", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which state has the most players selected as all stars?"}, {"from": "gpt", "value": "```sql\nSELECT T1.birthState FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID GROUP BY T1.birthState ORDER BY COUNT(DISTINCT T1.playerID) DESC LIMIT 1\n```"}]}, {"id": "train-2881", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players whose teams were ranked 6 in 1937?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID INNER JOIN teams AS T3 ON T3.tmID = T2.tmID WHERE T3.year = 1937 AND T3.rank = 6\n```"}]}, {"id": "train-2882", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1950, how many players whose teams have the losing rate less than 20%?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID INNER JOIN teams AS T3 ON T3.tmID = T2.tmID WHERE CAST(T3.lost AS REAL) * 100 / (T3.lost + T3.won) < 20\n```"}]}, {"id": "train-2883", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name of players who are born outside USA."}, {"from": "gpt", "value": "```sql\nSELECT firstName, middleName, lastName FROM players WHERE birthCountry != 'USA'\n```"}]}, {"id": "train-2884", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out all the coach ID who have served more than 2 different teams."}, {"from": "gpt", "value": "```sql\nSELECT coachID FROM coaches GROUP BY coachID HAVING COUNT(DISTINCT tmID) > 2\n```"}]}, {"id": "train-2885", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which coach has the most 'won' than 'lost' in year '1988'?"}, {"from": "gpt", "value": "```sql\nSELECT coachID FROM coaches WHERE year = 1988 ORDER BY won - lost DESC LIMIT 1\n```"}]}, {"id": "train-2886", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the team in which the coach won the title 'NBA Coach of the Year' in 2010."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.tmID FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 2010 AND T2.award = 'NBA Coach of the Year'\n```"}]}, {"id": "train-2887", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the first name, last name, height and weight of the players who has all free throw attempted successfully made."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.firstName, T1.lastName, T1.height, T1.weight FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.ft_attempted > 0 AND ft_attempted = ft_made\n```"}]}, {"id": "train-2888", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the first name, last name and team name of players who are drafted from 'Seattle' between year 1965 to 1970."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.firstName, T1.lastName, T3.name FROM players AS T1 INNER JOIN draft AS T2 ON T1.playerID = T2.playerID INNER JOIN teams AS T3 ON T2.tmID = T3.tmID WHERE T2.draftFrom = 'Seattle' AND T2.draftYear BETWEEN 1965 AND 1970\n```"}]}, {"id": "train-2889", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name and age of the player when he won the \"Finals MVP\" in 2003."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.middleName, T1.lastName , 2003 - strftime('%Y', T1.birthDate) FROM awards_players AS T2 JOIN players AS T1 ON T2.playerID = T1.playerID WHERE T2.award = 'Finals MVP' AND T2.year = 2003\n```"}]}, {"id": "train-2890", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the champion (team name) and year from year 1950 to 1960."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.name, T2.year FROM teams AS T1 JOIN series_post AS T2 ON T1.tmID = T2.tmIDWinner WHERE T2.round = 'F' AND T2.year BETWEEN 1950 AND 1960\n```"}]}, {"id": "train-2891", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the teams along with the coaches that went to 'Quarter Final' round in 1946."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.coachID, T3.name FROM coaches AS T1 JOIN series_post AS T2 ON T1.tmID = T2.tmIDWinner JOIN teams AS T3 ON T3.tmID = T1.tmID WHERE T2.round = 'QF' AND T2.year = 1946\n```"}]}, {"id": "train-2892", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out all the players fullname who won the championship in 1970."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.firstName, T3.middleName, T3.lastName FROM series_post AS T1 INNER JOIN players_teams AS T2 ON T1.tmIDWinner = T2.tmID INNER JOIN players AS T3 ON T3.playerID = T2.playerID WHERE T1.year = 1970 AND T1.round = 'F'\n```"}]}, {"id": "train-2893", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From which college was the player who won the most award in 1970."}, {"from": "gpt", "value": "```sql\nSELECT college FROM players WHERE playerID = ( SELECT playerID FROM awards_players WHERE year = 1970 GROUP BY playerID ORDER BY COUNT(award) DESC LIMIT 1 )\n```"}]}, {"id": "train-2894", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the youngest player who ever won \"Rookie of the Year\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Rookie of the Year' ORDER BY T1.birthDate DESC LIMIT 1\n```"}]}, {"id": "train-2895", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name of players who are drafted from round 1 in 1973 but not born in USA."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN draft AS T2 ON T1.playerID = T2.playerID WHERE T2.draftRound = 1 AND T1.birthCountry != 'USA' AND T2.draftYear = 1973\n```"}]}, {"id": "train-2896", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of offense rebounds from the total rebounds of the players in year 2000."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.o_rebounds) AS REAL) * 100 / SUM(T2.rebounds) FROM players_teams AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2000\n```"}]}, {"id": "train-2897", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the year, team and coach that with winning rate of above 75%."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.year, T2.name, T1.coachID FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID WHERE CAST(T1.won AS REAL) / CAST((T1.won + T1.lost) AS REAL) > 0.75\n```"}]}, {"id": "train-2898", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the coatches of the Oklahoma City Thunder"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT coachID FROM coaches AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID WHERE name = 'Oklahoma City Thunder'\n```"}]}, {"id": "train-2899", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players, in games played in 1990, achieved 50% or less of oRebounds than dRebounds."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(playerID) FROM players_teams WHERE CAST(oRebounds AS REAL) * 100 / dRebounds <= 50 AND year = 1990\n```"}]}, {"id": "train-2900", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players did not get more than 10 steals between the years 2000 and 2005?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT playerID) FROM player_allstar WHERE season_id BETWEEN 2000 AND 2005 AND steals <= 10\n```"}]}, {"id": "train-2901", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which player selected by Portland in 2nd draftRound won Rookie of the Year in 1971?"}, {"from": "gpt", "value": "```sql\nSELECT T1.playerID FROM draft AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'Rookie of the Year' AND T1.draftYear = 1971 AND T1.draftRound = 2\n```"}]}, {"id": "train-2902", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many All Star players who played in the 1973 season were black?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1973 AND T1.race = 'B'\n```"}]}, {"id": "train-2903", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which winning team in the 1947 playoff quarterfinals managed to score 3,513 defensive points that same year?"}, {"from": "gpt", "value": "```sql\nSELECT T2.tmID FROM series_post AS T1 INNER JOIN teams AS T2 ON T1.tmIDWinner = T2.tmID WHERE T1.year = 1947 AND T1.round = 'QF' AND T2.d_pts = 3513\n```"}]}, {"id": "train-2904", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Percentage of games lost out of total games played by the Houston Mavericks"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(lost) AS REAL) * 100 / SUM(games) FROM teams WHERE name = 'Houston Mavericks'\n```"}]}, {"id": "train-2905", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the players who received the \"Most Valuable Player\" award in the NBA league after the year of 1990, along with their IDs."}, {"from": "gpt", "value": "```sql\nSELECT playerID FROM awards_players WHERE year > 1990 AND award = 'Most Valuable Player' AND lgID = 'NBA'\n```"}]}, {"id": "train-2906", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times between 1975 and 1980 did the player abdulka01 play for LAL?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.year) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'LAL' AND T2.year BETWEEN 1975 AND 1980 AND T1.playerID = 'abdulka01'\n```"}]}, {"id": "train-2907", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of coaches in 1969 who were awarded \"NBA Coach of the Year\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN award = 'NBA Coach of the Year' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM awards_coaches WHERE year = 1969\n```"}]}, {"id": "train-2908", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What were the difference of the CHS team's winning rate between 1946 and 1947 in the post-season series games? Please provide your answer in percentages."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN year = 1947 AND tmIDWinner = 'CHS' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN year = 1947 THEN 1 ELSE 0 END) - CAST(SUM(CASE WHEN year = 1946 AND tmIDWinner = 'CHS' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN year = 1946 THEN 1 ELSE 0 END) FROM series_post\n```"}]}, {"id": "train-2909", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many awards were given out in 2010 to players who attended high school in Chicago?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.award) FROM awards_players AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2010 AND T2.hsCity = 'Chicago'\n```"}]}, {"id": "train-2910", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of players who attended Auburn University and won an \"All-Defensive Second Team\" award?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.award = 'All-Defensive Second Team' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T1.college = 'Auburn'\n```"}]}, {"id": "train-2911", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top five players with the most steals in the year 1997. Please give their full name."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T2.season_id = 1997 ORDER BY T2.steals DESC LIMIT 5\n```"}]}, {"id": "train-2912", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the university that was drafted from the player who won the NBA Finals MVP in 1990?"}, {"from": "gpt", "value": "```sql\nSELECT T1.college FROM players AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1990 AND T2.award = 'Finals MVP'\n```"}]}, {"id": "train-2913", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the NBA All-star players in 1996 season , which have more than 70% free throw rate? Please give their player id."}, {"from": "gpt", "value": "```sql\nSELECT playerID FROM player_allstar WHERE season_id = 1996 AND CAST(ft_made AS REAL) * 100 / ft_attempted > 70\n```"}]}, {"id": "train-2914", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1980 to 1983, how many of the NBA All-Star players have more than 60% three point rate?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.playerID FROM player_allstar AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.year BETWEEN 1980 AND 1983 AND T1.three_made / T1.three_attempted > 0.6\n```"}]}, {"id": "train-2915", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the NBA winning coaches, which are from STL team? Please list their coach id."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.coachID FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID WHERE T1.tmID = 'STL' AND T1.lgID = 'NBA'\n```"}]}, {"id": "train-2916", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times have coaches who were from CHI been awarded as NBA Coach of the Year?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.coachID) FROM coaches AS T1 INNER JOIN awards_coaches AS T2 ON T1.coachID = T2.coachID WHERE T1.tmID = 'CHI' AND T2.award = 'NBA Coach of the Year'\n```"}]}, {"id": "train-2917", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the players drafted in NBA between 1990 and 2000, who has the most points in all-star? List the player's first name and last name."}, {"from": "gpt", "value": "```sql\nSELECT T3.firstname, T3.lastname FROM player_allstar AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID INNER JOIN draft AS T3 ON T1.playerID = T3.playerID WHERE T2.year BETWEEN 1990 AND 2000 ORDER BY T1.points DESC LIMIT 1\n```"}]}, {"id": "train-2918", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which player from Wake Forest college did the most offensive rebounds than defensive rebounds in the all-star? Please mention the full name of the player including the middle name if have any."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.college = 'Wake Forest' AND T2.o_rebounds > T2.d_rebounds\n```"}]}, {"id": "train-2919", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the full name of the player born in Atlanta and have the highest number of blocks. Also, in which team did this player perform the most number of blocks?"}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName, T2.tmID FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCity = 'Atlanta' ORDER BY T2.blocks DESC LIMIT 1\n```"}]}, {"id": "train-2920", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of teams ranked first five or more times and lost a league two or more times between 1980 and 2000?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM teams AS T1 INNER JOIN series_post AS T2 ON T1.tmID = T2.tmIDLoser AND T1.year = T2.year WHERE T1.rank < 5 AND T2.lgIDLoser > 2 AND T2.year BETWEEN 1980 AND 2000\n```"}]}, {"id": "train-2921", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Player from which team has the highest point per minute in NBA from 1991 to 2000?"}, {"from": "gpt", "value": "```sql\nSELECT tmID FROM players_teams WHERE year BETWEEN 1991 AND 2000 ORDER BY CAST(points AS REAL) / minutes DESC LIMIT 1\n```"}]}, {"id": "train-2922", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.lgID = 'ABA', 1970 - strftime('%Y', T3.birthDate), 0)) AS REAL) / COUNT(IIF(T2.lgID = 'ABA', 1, 0)) - CAST(SUM(IIF(T2.lgID = 'NBA', 1970 - strftime('%Y', T3.birthDate), 0)) AS REAL) / COUNT(IIF(T2.lgID = 'NBA', 1, 0)) FROM draft AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID INNER JOIN players AS T3 ON T2.playerID = T3.playerID WHERE T1.draftYear BETWEEN 1970 AND 1970\n```"}]}, {"id": "train-2923", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which player had the most game presentatons in 2011 NBA season."}, {"from": "gpt", "value": "```sql\nSELECT playerID FROM players_teams WHERE year = 2011 ORDER BY GP DESC LIMIT 1\n```"}]}, {"id": "train-2924", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many first round draft player in 1996 NBA draft became an All-Star?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.playerID) FROM draft AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.draftYear = 1996 AND T1.draftRound = 1\n```"}]}, {"id": "train-2925", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team did the MVP of 1997 NBA season play in?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.tmID FROM players_teams AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID INNER JOIN teams AS T3 ON T1.tmID = T3.tmID AND T1.year = T3.year WHERE T2.year = 1997 AND T2.award = 'Finals MVP' LIMIT 1\n```"}]}, {"id": "train-2926", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games did team of the scoring champion win in 2001 NBA season?"}, {"from": "gpt", "value": "```sql\nSELECT T2.W FROM teams AS T1 INNER JOIN series_post AS T2 ON T1.tmID = T2.tmIDLoser AND T1.year = T2.year WHERE T2.year = 2001 ORDER BY T1.o_fgm DESC LIMIT 1\n```"}]}, {"id": "train-2927", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many turnovers per game did the assist champion had in the 2003 NBA season?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.turnovers) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 2003 GROUP BY T1.playerID, T2.assists ORDER BY T2.assists DESC LIMIT 1\n```"}]}, {"id": "train-2928", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of NBA titles that Ray Allen has won throughout his NBA career?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.playerID) FROM player_allstar AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE first_name = 'Ray' AND last_name = 'Allen'\n```"}]}, {"id": "train-2929", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much did the win rate increase for the team after getting the No.1 NBA draft pick in the 2003 season than previous season?"}, {"from": "gpt", "value": "```sql\nSELECT (CAST(SUM(CASE WHEN T1.year = 2004 THEN T1.won ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.year = 2004 THEN T1.won + T1.lost ELSE 0 END)) - (CAST(SUM(CASE WHEN T1.year = 2003 THEN T1.won ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.year = 2003 THEN T1.won + T1.lost ELSE 0 END)) FROM teams AS T1 INNER JOIN draft AS T2 ON T1.tmID = T2.tmID WHERE T2.draftRound = 1 AND T2.draftYear = 2003\n```"}]}, {"id": "train-2930", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches who won the 'NBA coach of the year' award from 1971 - 1975, how many of them were in 'POR' team?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM awards_coaches AS T1 INNER JOIN teams AS T2 ON T1.year = T2.year WHERE T1.year BETWEEN 1971 AND 1975 AND T1.award = 'NBA Coach of the Year' AND T2.tmID = 'POR'\n```"}]}, {"id": "train-2931", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of points were scored by NBA players who belonged to 'LAL' team and had performed steals movement."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.steals IS NOT NULL AND T1.tmID = 'LAL', 1, 0)) AS REAL) * 100 / COUNT(T1.tmID) FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year\n```"}]}, {"id": "train-2932", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the name of the player in 1996 who had the most steals that didn't play in the playoffs?"}, {"from": "gpt", "value": "```sql\nSELECT T1.playerID FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1996 AND T2.PostGP = 0 ORDER BY T2.steals DESC LIMIT 1\n```"}]}, {"id": "train-2933", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the player id of the man who had the most turnovers whose team missed the playoffs in year 1988."}, {"from": "gpt", "value": "```sql\nSELECT T2.playerID FROM players_teams AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.PostGP = 0 AND T1.year = 1988 ORDER BY T1.turnovers DESC LIMIT 1\n```"}]}, {"id": "train-2934", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which NBA team that didn't play in playoffs had the most winning rate in the 2000 NBA regular season?"}, {"from": "gpt", "value": "```sql\nSELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.PostGP = 0 AND T1.year = 2000 ORDER BY CAST(T2.won AS REAL) / (T2.won + T2.lost) DESC LIMIT 1\n```"}]}, {"id": "train-2935", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which non-playoffs team had the most points in the regular season in the year 1998?"}, {"from": "gpt", "value": "```sql\nSELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 1998 AND T1.PostGP = 0 ORDER BY T1.points DESC LIMIT 1\n```"}]}, {"id": "train-2936", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the full name of the team that won the most games in 2001 but didn't make the playoffs?"}, {"from": "gpt", "value": "```sql\nSELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.PostGP = 0 ORDER BY T2.won DESC LIMIT 1\n```"}]}, {"id": "train-2937", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team that didn't play in playoffs had the most total rebounds in the year 1997?"}, {"from": "gpt", "value": "```sql\nSELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.PostGP = 0 AND T1.year = 1997 ORDER BY T1.rebounds DESC LIMIT 1\n```"}]}, {"id": "train-2938", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the player who was drafted in the 1st round, 6th position in 1976, which team did he play in that year?"}, {"from": "gpt", "value": "```sql\nSELECT T2.tmID FROM draft AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.draftYear = T2.year WHERE T1.draftRound = 1 AND T1.draftSelection = 6 AND T1.draftYear = 1976\n```"}]}, {"id": "train-2939", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the year 1998, how many home wins did the team which had the 1st round, 12th pick have that year?"}, {"from": "gpt", "value": "```sql\nSELECT T2.homeWon FROM draft AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.draftYear = T2.year WHERE T1.draftRound = 1 AND T1.draftSelection = 12 AND T1.draftYear = 1998\n```"}]}, {"id": "train-2940", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the player who had the most rebounds throughout his allstar appearances, what was his weight and height?"}, {"from": "gpt", "value": "```sql\nSELECT T1.weight, T1.height FROM players AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID ORDER BY T2.rebounds DESC LIMIT 1\n```"}]}, {"id": "train-2941", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where was the high school of the player who had the most rebounds in the NBA allstar history?"}, {"from": "gpt", "value": "```sql\nSELECT T2.highSchool FROM player_allstar AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID ORDER BY T1.rebounds DESC LIMIT 1\n```"}]}, {"id": "train-2942", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the year 1997 allstar game, which teams did the players had the most rebounds play in? List their team ids."}, {"from": "gpt", "value": "```sql\nSELECT T2.tmID FROM players_teams AS T1 INNER JOIN teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN player_allstar AS T3 ON T3.playerID = T1.playerID WHERE T3.season_id = 1997 ORDER BY T1.rebounds DESC LIMIT 1\n```"}]}, {"id": "train-2943", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the latest passing player who could play all the positions in the court, how many points did he have in his career?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.points) FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T1.pos = 'C-F-G' GROUP BY T2.playerID, T2.year ORDER BY T2.year DESC LIMIT 1\n```"}]}, {"id": "train-2944", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team did the youngest player who could be in F-G position play in the NBA?"}, {"from": "gpt", "value": "```sql\nSELECT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN players AS T3 ON T2.playerID = T3.playerID WHERE T3.pos = 'F-G' AND T2.lgID = 'NBA' ORDER BY T3.birthDate DESC LIMIT 1\n```"}]}, {"id": "train-2945", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the players who played the most PBLA games, who was graduated from Central Missouri State college?"}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.lgID = 'PBLA' AND T2.GP = 10 AND T1.college = 'Central Missouri State' GROUP BY T1.firstName, T1.middleName, T1.lastName ORDER BY COUNT(T2.id) DESC LIMIT 1\n```"}]}, {"id": "train-2946", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2000, which team did the player who played the least minutes without missing a single game play in? Give the full name of the team."}, {"from": "gpt", "value": "```sql\nSELECT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.GP = 82 AND T2.year = 2000 GROUP BY T1.tmID ORDER BY SUM(T2.PostMinutes) ASC LIMIT 1\n```"}]}, {"id": "train-2947", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the full attendence players in 1995, which player had most turnovers? Give the full name of the player."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.middleName, T1.lastName FROM players AS T1 INNER JOIN players_teams AS T2 ON T1.playerID = T2.playerID WHERE T2.GP = 82 AND T2.year = 1995 ORDER BY T2.turnovers DESC LIMIT 1\n```"}]}, {"id": "train-2948", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the player in 2011 who started every game he played, which team had the player who had the most steals?"}, {"from": "gpt", "value": "```sql\nSELECT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 2011 AND T2.GP = T2.GS GROUP BY T1.tmID, T2.steals ORDER BY T2.steals DESC LIMIT 1\n```"}]}, {"id": "train-2949", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team had the most same starting players througout the season? Give the full name of the team."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.GP = T2.GS\n```"}]}, {"id": "train-2950", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the 2001 rebounds leader in the league, when was his birthday?"}, {"from": "gpt", "value": "```sql\nSELECT birthDate FROM players WHERE playerID = ( SELECT playerID FROM players_teams WHERE year = 2001 GROUP BY playerID ORDER BY SUM(rebounds + dRebounds) DESC LIMIT 1 )\n```"}]}, {"id": "train-2951", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team did the all league rebound champion play in 1997? Give the full name of the team."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.year = 1997 GROUP BY T1.name ORDER BY SUM(rebounds + dRebounds) DESC LIMIT 1\n```"}]}, {"id": "train-2952", "db_id": "professional_basketball", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team had more than one player who grabbed more than 600 rebounds in 2011? Give the full name of the team."}, {"from": "gpt", "value": "```sql\nSELECT T1.tmID FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 2011 AND T2.rebounds > 600\n```"}]}, {"id": "train-2953", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of Shakespeare's works were finished before the year 1602?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM works WHERE Date < 1602\n```"}]}, {"id": "train-2954", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many scenes are there in Act 1 in Twelfth Night?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 1 AND T1.Title = 'Twelfth Night'\n```"}]}, {"id": "train-2955", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description of Act 1, Scene 2 in Twelfth Night?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Twelfth Night' AND T2.Act = 1 AND T2.Scene = 2\n```"}]}, {"id": "train-2956", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more scenes are there in Act 1 than in Act 5 in Twelfth Night?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T2.Act = 1, 1, 0)) - SUM(IIF(T2.Act = 5, 1, 0)) AS more FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Twelfth Night'\n```"}]}, {"id": "train-2957", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which work is the character Lord Abergavenny from? Please give its short or abbreviated title."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T4.CharName = 'Lord Abergavenny'\n```"}]}, {"id": "train-2958", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the character names of all the characters from the work Twelfth Night."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.CharName FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Twelfth Night'\n```"}]}, {"id": "train-2959", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many paragraphs are there in Act 1, Scene 1 in Twelfth Night?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.ParagraphNum) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T2.Act = 1 AND T2.Scene = 1 AND T1.Title = 'Twelfth Night'\n```"}]}, {"id": "train-2960", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the paragraphs in Act 1, Scene 1 in Twelfth Night."}, {"from": "gpt", "value": "```sql\nSELECT T3.PlainText FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T2.Act = 1 AND T2.Scene = 1 AND T1.Title = 'Twelfth Night'\n```"}]}, {"id": "train-2961", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many paragraphs contain the character Lord Abergavenny?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.ParagraphNum) FROM paragraphs AS T1 INNER JOIN characters AS T2 ON T1.character_id = T2.id WHERE T2.CharName = 'Lord Abergavenny'\n```"}]}, {"id": "train-2962", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the paragraphs in which the character \"son to Tamora\" appears."}, {"from": "gpt", "value": "```sql\nSELECT T1.id FROM paragraphs AS T1 INNER JOIN characters AS T2 ON T1.character_id = T2.id WHERE T2.Description = 'son to Tamora'\n```"}]}, {"id": "train-2963", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many times has the scene \"OLIVIA\u2019S house.\" appeared in Twelfth Night?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Description = 'OLIVIA\u2019S house.' AND T1.Title = 'Twelfth Night'\n```"}]}, {"id": "train-2964", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many characters are there in Twelfth Night?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T4.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Twelfth Night'\n```"}]}, {"id": "train-2965", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the title of the work of Shakespeare that has the most characters."}, {"from": "gpt", "value": "```sql\nSELECT T.Title FROM ( SELECT T1.Title, COUNT(T3.character_id) AS num FROM works T1 INNER JOIN chapters T2 ON T1.id = T2.work_id INNER JOIN paragraphs T3 ON T2.id = T3.chapter_id INNER JOIN characters T4 ON T3.character_id = T4.id GROUP BY T3.character_id, T1.Title ) T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-2966", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of characters in all the works of Shakespeare?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(DISTINCT T4.id) / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id\n```"}]}, {"id": "train-2967", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many scenes are there on average in one act in Twelfth Night?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Scene) / COUNT(T2.Act) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Twelfth Night'\n```"}]}, {"id": "train-2968", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many comedies did Shakespeare create?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM works WHERE GenreType = 'Comedy'\n```"}]}, {"id": "train-2969", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Shakespeare write the first poem?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(Date) FROM works WHERE GenreType = 'Poem'\n```"}]}, {"id": "train-2970", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the abbreviation name for the character \"Earl of Westmoreland\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT Abbrev FROM characters WHERE CharName = 'Earl of Westmoreland'\n```"}]}, {"id": "train-2971", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which chapter has the most paragraphs? Give the description of the chapter."}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id ORDER BY T2.ParagraphNum DESC LIMIT 1\n```"}]}, {"id": "train-2973", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many characters are there in Titus Andronicus?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.character_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T1.Title = 'Titus Andronicus'\n```"}]}, {"id": "train-2975", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description for the character mentioned in paragraph No.640171?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.id = '640171'\n```"}]}, {"id": "train-2976", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the title of the work that contains the character \"Shylock\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T4.CharName = 'Shylock'\n```"}]}, {"id": "train-2977", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many scenes are there in King John?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Scene) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'King John'\n```"}]}, {"id": "train-2978", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many chapters does the character Demetrius show in the story?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.chapter_id) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Demetrius'\n```"}]}, {"id": "train-2980", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the description for the Act No.2, Scene No.2 of Midsummer Night's Dream."}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = '2' AND T2.Scene = '2' AND T1.Title = 'Midsummer Night''s Dream'\n```"}]}, {"id": "train-2981", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Shakespeare tragedy has the most scenes? Give the long title."}, {"from": "gpt", "value": "```sql\nSELECT T.LongTitle FROM ( SELECT T1.LongTitle, COUNT(T2.Scene) AS num FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.GenreType = 'Tragedy' GROUP BY T1.LongTitle, T2.Scene ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-2982", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many paragraphs are there in the scene whose description is \"A Sea-port in Cyprus. An open place near the quay.\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.ParagraphNum) FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id WHERE T1.Description = 'A Sea-port in Cyprus. An open place near the quay.'\n```"}]}, {"id": "train-2983", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of all scenes are tragic scenes in Shakespeare's work in 1594?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.GenreType = 'Tragedy', 1, 0)) AS REAL) * 100 / COUNT(T1.Scene) FROM chapters AS T1 INNER JOIN works AS T2 ON T1.work_id = T2.id WHERE T2.Date = '1594'\n```"}]}, {"id": "train-2984", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Gives the average number of chapters in Shakespeare's 1599 work."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.id) AS REAL) / COUNT(DISTINCT T2.id) FROM chapters AS T1 INNER JOIN works AS T2 ON T1.work_id = T2.id WHERE T2.Date = '1599'\n```"}]}, {"id": "train-2985", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"servant to Timon\" characters are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM characters WHERE Description = 'servant to Timon'\n```"}]}, {"id": "train-2986", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the first ever work of William Shakespeare?"}, {"from": "gpt", "value": "```sql\nSELECT Title FROM works WHERE Date = ( SELECT MIN(Date) FROM works )\n```"}]}, {"id": "train-2987", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many poems did Shakespeare write?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM works WHERE GenreType = 'Poem'\n```"}]}, {"id": "train-2988", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many scenes are there in work id 7, act 1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM chapters WHERE work_id = 7 AND Act = 1\n```"}]}, {"id": "train-2989", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the year 1500s, how many tragedies did Shakespeare write?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM works WHERE GenreType = 'Tragedy' AND Date BETWEEN 1500 AND 1599\n```"}]}, {"id": "train-2990", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the daughter of Capulet?"}, {"from": "gpt", "value": "```sql\nSELECT CharName FROM characters WHERE Description = 'Daughter to Capulet'\n```"}]}, {"id": "train-2991", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many paragraphs are there in \"Ay, surely, mere the truth: I know his lady.\"?"}, {"from": "gpt", "value": "```sql\nSELECT ParagraphNum FROM paragraphs WHERE PlainText = 'Ay, surely, mere the truth: I know his lady.'\n```"}]}, {"id": "train-2992", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the long title of the work with the highest number of scenes in act 1?"}, {"from": "gpt", "value": "```sql\nSELECT T2.LongTitle FROM chapters AS T1 INNER JOIN works AS T2 ON T1.work_id = T2.id WHERE T1.Act = 1 ORDER BY T1.Scene DESC LIMIT 1\n```"}]}, {"id": "train-2993", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description of the chapter with the longest number of paragraphs?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id ORDER BY T1.ParagraphNum DESC LIMIT 1\n```"}]}, {"id": "train-2994", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In \"Twelfth Night, Or What You Will\", what is the description of the chapter in 2nd scene, Act 2?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.LongTitle = 'Twelfth Night, Or What You Will' AND T2.Scene = 2 AND T2.Act = 2\n```"}]}, {"id": "train-2995", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the descriptions of the short chapters?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Description FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id WHERE T1.ParagraphNum < 150\n```"}]}, {"id": "train-2996", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of Shakespeare's work has chapter description of \"A field near Windsor\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Title FROM chapters AS T1 INNER JOIN works AS T2 ON T1.work_id = T2.id WHERE T1.Description = 'A field near Windsor.'\n```"}]}, {"id": "train-2997", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many paragraphs are there in the chapter with the highest amount of scenes in act 1?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ParagraphNum FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id WHERE T2.Act = 1 ORDER BY T2.Scene DESC LIMIT 1\n```"}]}, {"id": "train-2998", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Other than \"stage directions\", what is the name of the character that appeared 5 times in \"the sea-coast\"?"}, {"from": "gpt", "value": "```sql\nSELECT T.CharName FROM ( SELECT T3.CharName, COUNT(T3.id) AS num FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id INNER JOIN characters AS T3 ON T1.character_id = T3.id WHERE T2.Description = 'The sea-coast.' AND T3.CharName != '(stage directions)' AND T1.chapter_id = 18709 GROUP BY T3.id, T3.CharName ) AS T WHERE T.num = 5\n```"}]}, {"id": "train-2999", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the chapters in \"As You Like It\", how many chapters have a paragraph number of no more than 50?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.chapter_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T1.Title = 'As You Like It' AND T3.ParagraphNum < 50\n```"}]}, {"id": "train-3000", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In \"Florence. Without the walls. A tucket afar off\", what is the id of the character that was mentioned in \"His name, I pray you.\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.character_id FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id WHERE T1.PlainText = 'His name, I pray you.' AND T2.Description = 'Florence. Without the walls. A tucket afar off.'\n```"}]}, {"id": "train-3001", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many characters are there in Hamlet?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.character_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T1.Title = 'Hamlet'\n```"}]}, {"id": "train-3002", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many scenes are there in the 5th act of \"History of Henry VIII\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Scene) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 5 AND T1.LongTitle = 'History of Henry VIII'\n```"}]}, {"id": "train-3003", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the history works written by Shakespeare, how many works whose 1st acts have no more than 2 scenes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.work_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 1 AND T2.Scene < 2 AND T1.GenreType = 'History'\n```"}]}, {"id": "train-3004", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many acts are there in Sonnets?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(DISTINCT T2.Act) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Sonnets'\n```"}]}, {"id": "train-3005", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description of the chapter where the character whose abrreviated name is 1Play appeared first?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM paragraphs AS T1 INNER JOIN chapters AS T2 ON T1.chapter_id = T2.id INNER JOIN characters AS T3 ON T1.character_id = T3.id WHERE T3.Abbrev = '1Play' ORDER BY T1.chapter_id LIMIT 1\n```"}]}, {"id": "train-3006", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the titles and genres of the one-act works of Shakespeare?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Title, T1.GenreType FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Act = 1\n```"}]}, {"id": "train-3007", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many paragraphs are there in the longest chapter where Sir Richard Ratcliff appeared?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.ParagraphNum) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Sir Richard Ratcliff'\n```"}]}, {"id": "train-3009", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Shakespeare create his work that has 154 scenes?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Date, T1.id FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Scene = 154\n```"}]}, {"id": "train-3010", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On average, how many scenes are there in each of the comedy works written by Shakespeare?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.Scene) AS REAL) / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.GenreType = 'Comedy'\n```"}]}, {"id": "train-3011", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between Rome and Juliet, which character was mentioned the most in the The Tragedy of Romeo and Juliet? Calculate for Romeo and Juliet's individual amount of appearance in percentage against the overall number of characters that appeared in the said work."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T4.CharName = 'Romeo', 1, 0)), SUM(IIF(T4.CharName = 'Juliet', 1, 0)), CAST(SUM(IIF(T4.CharName = 'Romeo', 1, 0)) + SUM(IIF(T4.CharName = 'Juliet', 1, 0)) AS REAL) * 100 / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id\n```"}]}, {"id": "train-3012", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the paragraph number with plain text \"This is Illyria, lady\"?"}, {"from": "gpt", "value": "```sql\nSELECT ParagraphNum FROM paragraphs WHERE PlainText = 'This is Illyria, lady.'\n```"}]}, {"id": "train-3013", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many number of paragraphs are there in chapter ID 18881?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ParagraphNum) FROM paragraphs WHERE chapter_id = 18881\n```"}]}, {"id": "train-3014", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down any 5 titles in the history genre."}, {"from": "gpt", "value": "```sql\nSELECT Title FROM works WHERE GenreType = 'History' LIMIT 5\n```"}]}, {"id": "train-3015", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many scenes are there in Act 5 of work ID 9?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Scene) FROM chapters WHERE work_id = 9 AND Act = 5\n```"}]}, {"id": "train-3016", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the character names and descriptions of chapter ID 18710."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CharName, T1.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.Chapter_id = 18710\n```"}]}, {"id": "train-3017", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many chapters are there in \"Midsummer Night's Dream\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Midsummer Night''s Dream'\n```"}]}, {"id": "train-3018", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many paragraphs are there in Act 5 Scene 1 of \"Comedy of Errors\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id WHERE T2.Act = 5 AND T2.Scene = 1 AND T1.Title = 'Comedy of Errors'\n```"}]}, {"id": "train-3019", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the character names and descriptions of characters in \"Venus and Adonis\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.CharName, T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Venus and Adonis'\n```"}]}, {"id": "train-3020", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title which has character named \"Froth\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T4.CharName = 'Froth'\n```"}]}, {"id": "train-3021", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many chapters include the character name \"First Witch\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.chapter_id) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'First Witch'\n```"}]}, {"id": "train-3022", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the scenes and descriptions in Act 1 of \" Pericles, Prince of Tyre\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.Scene, T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.LongTitle = 'Pericles, Prince of Tyre' AND T2.Act = 1\n```"}]}, {"id": "train-3023", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the full title which had the character named Servant to Montague."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.LongTitle FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T4.Description = 'Servant to Montague'\n```"}]}, {"id": "train-3024", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the scene number, act, and title of work which had the description of \"The house of ANTIPHOLUS of Ephesus\" in chapter."}, {"from": "gpt", "value": "```sql\nSELECT T2.Act, T2.Scene, T1.Title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Description = 'The house of ANTIPHOLUS of Ephesus.'\n```"}]}, {"id": "train-3025", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the character name, paragraph number, and plain text of \"cousin to the king\" description."}, {"from": "gpt", "value": "```sql\nSELECT T1.CharName, T2.ParagraphNum, T2.PlainText FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.Description = 'cousin to the king'\n```"}]}, {"id": "train-3026", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate average scene per act in Antony and Cleopatra."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.Scene) AS REAL) / COUNT(T2.act) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Antony and Cleopatra'\n```"}]}, {"id": "train-3027", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of paragraphs in all chapters of \"All's Well That Ends Well\"."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.Title = 'All''s Well That Ends Well', 1, 0)) AS REAL) * 100 / COUNT(T3.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id\n```"}]}, {"id": "train-3028", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"all\" character names have the \"all\" abbreviation?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM characters WHERE Abbrev = 'All'\n```"}]}, {"id": "train-3030", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1593 onwards, what is the difference between the number of comedy works and history works?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(GenreType = 'Comedy', 1, 0)) - SUM(IIF(GenreType = 'History', 1, 0)) FROM works WHERE Date > 1593\n```"}]}, {"id": "train-3031", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please name the latest historical work."}, {"from": "gpt", "value": "```sql\nSELECT LongTitle FROM works WHERE GenreType = 'History' ORDER BY Date DESC LIMIT 1\n```"}]}, {"id": "train-3032", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the work numbers that are related to King Henry?"}, {"from": "gpt", "value": "```sql\nSELECT id FROM works WHERE Title LIKE '%Henry%'\n```"}]}, {"id": "train-3034", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the character that can be found in paragraph 8 of chapter 18820?"}, {"from": "gpt", "value": "```sql\nSELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.ParagraphNum = 8 AND T2.chapter_id = 18820\n```"}]}, {"id": "train-3035", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description of chapter 18704, where there is a character called Orsino?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id INNER JOIN chapters AS T3 ON T2.chapter_id = T3.id WHERE T1.CharName = 'Orsino' AND T3.ID = 18704\n```"}]}, {"id": "train-3036", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many scenes can be found in \"Twelfth Night, Or What You Will\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Scene) AS cnt FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.LongTitle = 'Cymbeline, King of Britain'\n```"}]}, {"id": "train-3037", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all of the character descriptions in paragraph 20."}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.ParagraphNum = 20\n```"}]}, {"id": "train-3038", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many chapters have the name Gratiano as a character for \"friend to Antonio and Bassiano\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.chapter_id) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Gratiano' AND T1.Description = 'friend to Antonio and Bassiano'\n```"}]}, {"id": "train-3040", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the character names in paragraph 3?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.ParagraphNum = 3\n```"}]}, {"id": "train-3041", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all of the paragraphs that have the character name Aedile."}, {"from": "gpt", "value": "```sql\nSELECT T2.ParagraphNum FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Aedile'\n```"}]}, {"id": "train-3042", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any two character names in chapter 18708."}, {"from": "gpt", "value": "```sql\nSELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.chapter_id = 18708 LIMIT 2\n```"}]}, {"id": "train-3043", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many acts can be found in the comedy \"Two Gentlemen of Verona\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ACT) FROM chapters AS T1 LEFT JOIN works AS T2 ON T1.work_id = T2.id WHERE T2.GenreType = 'Comedy' AND T2.Title = 'Two Gentlemen of Verona'\n```"}]}, {"id": "train-3044", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of historical works that have not fewer than five scenes in the 1500s?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(( SELECT COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.GenreType = 'History' AND T1.DATE BETWEEN 1500 AND 1599 GROUP BY T1.id HAVING COUNT(T2.Scene) >= 5 ) AS REAL) * 100 / COUNT(id) FROM works WHERE GenreType = 'History' AND DATE BETWEEN 1500 AND 1599\n```"}]}, {"id": "train-3045", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of act number 5 in Titus Andronicus?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.act = 5, 1, 0)) AS REAL) * 100 / COUNT(T2.act) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Titus Andronicus'\n```"}]}, {"id": "train-3046", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the works of Shakespeare are Tragedy?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM works WHERE GenreType = 'Tragedy'\n```"}]}, {"id": "train-3047", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the works of Shakespeare, how many of them have the word \"Henry\" on its title?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM works WHERE Title LIKE '%Henry%'\n```"}]}, {"id": "train-3048", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the character's ID of the character that said the paragraph \"O my poor brother! and so perchance may he be.\""}, {"from": "gpt", "value": "```sql\nSELECT character_id FROM paragraphs WHERE PlainText = 'O my poor brother! and so perchance may he be.'\n```"}]}, {"id": "train-3049", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the paragraph number and paragraphs said by the character named \"Sir Andrew Aguecheek\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.ParagraphNum, T2.id FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Sir Andrew Aguecheek'\n```"}]}, {"id": "train-3050", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the title and the characters name of the most recent work of Shakespeare."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title, T4.CharName FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id ORDER BY T1.Date DESC LIMIT 1\n```"}]}, {"id": "train-3052", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the long title of the Shakespeare's work with Act 4 Scene 5 described as \"Mytilene. A street before the brothel.\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.LongTitle FROM works AS T1 RIGHT JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Description = 'Mytilene. A street before the brothel.'\n```"}]}, {"id": "train-3053", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the character that said \"This is Illyria, lady.\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.PlainText = 'This is Illyria, lady.'\n```"}]}, {"id": "train-3054", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Shakespeare's works between 1600 to 1610, how many of these have a character as a \"Third Servingman\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.work_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.DATE BETWEEN 1600 AND 1610 AND T4.CharName = 'Third Servingman'\n```"}]}, {"id": "train-3055", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the Venus and Adonis, what is the description of the last scene listed?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM works AS T1 RIGHT JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Venus and Adonis' ORDER BY T2.Scene DESC LIMIT 1\n```"}]}, {"id": "train-3056", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Act 1 Scene 2 of the Twelfth Night, what is the total number of of lines said by Viola?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T4.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T2.Act = 1 AND T2.Scene = 2 AND T4.id = 1238 AND T4.CharName = 'Viola' AND T1.Title = 'Twelfth Night'\n```"}]}, {"id": "train-3057", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the character and work ID of the text \"Fear not thou, man, thou shalt lose nothing here.\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.character_id, T1.work_id FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id WHERE T2.PlainText = 'Fear not thou, man, thou shalt lose nothing here.'\n```"}]}, {"id": "train-3059", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the scene numbers involving the character named Sir Toby Belch in the Twelfth Night."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Scene FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Twelfth Night' AND T4.CharName = 'Sir Toby Belch'\n```"}]}, {"id": "train-3060", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Shakespeare's works before 1600, list down the title of the tragic story he had written that involved a character named \"Tybalt\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.DATE < 1600 AND T1.GenreType = 'Tragedy' AND T4.CharName = 'Tybalt'\n```"}]}, {"id": "train-3061", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the chapter ID of the works with a year greater than the 89% of average year of all listed works of Shakespeare."}, {"from": "gpt", "value": "```sql\nSELECT T2.id FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.DATE > ( SELECT AVG(DATE) FROM works ) * 0.89\n```"}]}, {"id": "train-3062", "db_id": "shakespeare", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the comedy works of Shakespeare, what is the percentage of his works with a character named \"antonio\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T4.CharName = 'antonio', 1, 0)) AS REAL) * 100 / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.GenreType = 'Comedy'\n```"}]}, {"id": "train-3063", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cars with 8 cylinders, what is the name of the one that's the most expensive?"}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8 ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-3064", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cars over 3000lbs, how many of them cost less than $30000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.car_name) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.weight > 3000 AND T2.price < 30000\n```"}]}, {"id": "train-3065", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the acceleration of the most expensive car?"}, {"from": "gpt", "value": "```sql\nSELECT T1.acceleration FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-3066", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much US dollars does a Ford Torino cost?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford torino'\n```"}]}, {"id": "train-3067", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the origin country of the car model ford torino produced in 1970?"}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.car_name = 'ford torino' AND T2.model_year = 1970\n```"}]}, {"id": "train-3068", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the car models introduced in the market in 1970, how many of them have the USA as their origin country?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T1.model_year = 1970 AND T2.country = 'USA'\n```"}]}, {"id": "train-3069", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the car models whose origin country is the USA."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T2.country = T3.origin WHERE T3.country = 'USA'\n```"}]}, {"id": "train-3070", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the top 3 most expensive cars."}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 3\n```"}]}, {"id": "train-3071", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the years in which the car model Chevrolet Impala was introduced in the market."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.model_year FROM production AS T1 INNER JOIN data AS T2 ON T1.ID = T2.ID WHERE T2.car_name = 'chevrolet impala'\n```"}]}, {"id": "train-3072", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cars with an acceleration of over 10 miles per squared hour, how many of them cost more than $20000 and less than $30000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.acceleration > 10 AND T2.price BETWEEN 20000 AND 30000\n```"}]}, {"id": "train-3073", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the weights of all the cars with the price over $40000."}, {"from": "gpt", "value": "```sql\nSELECT T1.weight FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price > 40000\n```"}]}, {"id": "train-3074", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the maximum acceleration of a car with price over $40000?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.acceleration) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price > 40000\n```"}]}, {"id": "train-3075", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average price of cars with 8 cylinders?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8\n```"}]}, {"id": "train-3076", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the maximum sweep volume of a car that costs less than $30000?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.displacement / T1.cylinders) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price < 30000\n```"}]}, {"id": "train-3077", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cars in the database are originated from Europe?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'Europe'\n```"}]}, {"id": "train-3078", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the origin country of Chevrolet Malibu."}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.car_name = 'chevrolet malibu'\n```"}]}, {"id": "train-3079", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the miles per gallon of the most expensive car?"}, {"from": "gpt", "value": "```sql\nSELECT T1.mpg FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-3080", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the origin country of car no.382."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.country FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T1.ID = 382\n```"}]}, {"id": "train-3081", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which is the origin country of the $44274.40748 car?"}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.price = 44274.40748\n```"}]}, {"id": "train-3082", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the Volkswagen Dasher with 14.1 mph acceleration?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'volkswagen dasher' AND T1.acceleration = '14.1'\n```"}]}, {"id": "train-3083", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the engine displacement status of the $37443.85589 car."}, {"from": "gpt", "value": "```sql\nSELECT T1.displacement FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '37443.85589'\n```"}]}, {"id": "train-3084", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the $32650.65157 car introduced to the market? State the year."}, {"from": "gpt", "value": "```sql\nSELECT T1.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '32650.65157'\n```"}]}, {"id": "train-3085", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the price of the only Toyota Corona hardtop in the database."}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'toyota corona hardtop'\n```"}]}, {"id": "train-3086", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cylinders does the cheapest car have?"}, {"from": "gpt", "value": "```sql\nSELECT T1.cylinders FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY price ASC LIMIT 1\n```"}]}, {"id": "train-3087", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which car in the database provides the best crash protection based on its weight? How much is it?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ID, T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1\n```"}]}, {"id": "train-3088", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the origin country of the fastest car in the database."}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.horsepower DESC LIMIT 1\n```"}]}, {"id": "train-3089", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of Japanese cars in the database?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.country = 'Japan' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin\n```"}]}, {"id": "train-3090", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the swept volume of the $34538.97449 car."}, {"from": "gpt", "value": "```sql\nSELECT T1.displacement / T1.cylinders FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 34538.97449\n```"}]}, {"id": "train-3091", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the most expensive car?"}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-3092", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cars were released in the USA in 1981?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'USA' AND T1.model_year = 1981\n```"}]}, {"id": "train-3093", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the car with the highest sweep volume?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.displacement / T1.cylinders DESC LIMIT 1\n```"}]}, {"id": "train-3094", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the fastest car made by Japan?"}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Japan' ORDER BY T1.horsepower DESC LIMIT 1\n```"}]}, {"id": "train-3095", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times was Ford Maverick introduced to the market?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford maverick'\n```"}]}, {"id": "train-3096", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country produced the most fuel-efficient car?"}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.mpg DESC LIMIT 1\n```"}]}, {"id": "train-3097", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Dodge car is the cheapest?"}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name LIKE 'dodge%' ORDER BY T2.price ASC LIMIT 1\n```"}]}, {"id": "train-3098", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the most expensive car that was produced by the USA?"}, {"from": "gpt", "value": "```sql\nSELECT T4.car_name FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'USA' ORDER BY T1.price DESC LIMIT 1\n```"}]}, {"id": "train-3099", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cars with an engine displacement of no less than 400 cubic millimeter, how many cars cost at least 30,000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.displacement > 400 AND T2.price > 30000\n```"}]}, {"id": "train-3100", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year did Europe produce the most cars?"}, {"from": "gpt", "value": "```sql\nSELECT T1.model_year FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'Europe' GROUP BY T1.model_year ORDER BY COUNT(T1.model_year) DESC LIMIT 1\n```"}]}, {"id": "train-3101", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the Peugeot 505s Turbo Diesel?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'peugeot 505s turbo diesel'\n```"}]}, {"id": "train-3102", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the miles per square hour of the cheapest car produced by the USA?"}, {"from": "gpt", "value": "```sql\nSELECT T4.acceleration FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'USA' ORDER BY T1.price ASC LIMIT 1\n```"}]}, {"id": "train-3103", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country produced the highest number of cars? Calculate the annual average number of cars that the said country produced from the very start to the present."}, {"from": "gpt", "value": "```sql\nSELECT T2.country, CAST(COUNT(T1.ID) AS REAL) / COUNT(DISTINCT T1.model_year) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin GROUP BY T2.country ORDER BY COUNT(T2.country) DESC LIMIT 1\n```"}]}, {"id": "train-3104", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of cars that was produced by Japan among those that have a sweep volume of no less than 30?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.country = 'Japan' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.displacement / T1.cylinders > 30\n```"}]}, {"id": "train-3105", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of the cars with model year 1975."}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = 1975\n```"}]}, {"id": "train-3106", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average price of cars from Europe."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.price) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Europe'\n```"}]}, {"id": "train-3107", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the price of the car ID 15?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.ID = 15\n```"}]}, {"id": "train-3108", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the cars from Japan weighed less than 3000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' AND T4.weight < 3000\n```"}]}, {"id": "train-3109", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cars produced in year 1973, how many of the cars have horsepower less than 100?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = 1973 AND T1.horsepower < 100\n```"}]}, {"id": "train-3110", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ID of cars from Japan worth greater than 35000 and have an acceleration of 14."}, {"from": "gpt", "value": "```sql\nSELECT T4.ID FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' AND T1.price > 3500 AND T4.acceleration = 14\n```"}]}, {"id": "train-3111", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the model year of the heaviest car."}, {"from": "gpt", "value": "```sql\nSELECT T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1\n```"}]}, {"id": "train-3112", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the horsepower and model year of the car named Subaru Dl?"}, {"from": "gpt", "value": "```sql\nSELECT T1.horsepower, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'subaru dl'\n```"}]}, {"id": "train-3113", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cars originated from Japan, what is the name of the car with the highest price?"}, {"from": "gpt", "value": "```sql\nSELECT T4.car_name FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' ORDER BY T1.price DESC LIMIT 1\n```"}]}, {"id": "train-3114", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the cars worth 20000?"}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 20000\n```"}]}, {"id": "train-3115", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cars worth greater than 40000 were from the USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'USA' AND T1.price > 40000\n```"}]}, {"id": "train-3116", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the price and country origin of the car named Ford Maverick."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.price, T3.country FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T4.car_name = 'ford maverick'\n```"}]}, {"id": "train-3117", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the car's name with a price worth greater than 85% of the average price of all cars."}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price * 100 > ( SELECT AVG(price) * 85 FROM price )\n```"}]}, {"id": "train-3118", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference between the number of cars that has a horsepower of 130 with the model year 1970 and model year 1976"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.model_year = 1970 THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.model_year = 1976 THEN 1 ELSE 0 END) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.horsepower = 130\n```"}]}, {"id": "train-3119", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cars from Asia, list the IDs of cars that were introduced in 1979."}, {"from": "gpt", "value": "```sql\nSELECT T1.ID FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'Japan' AND T1.model_year = 1979\n```"}]}, {"id": "train-3120", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country produced the car with the lowest mileage per gallon?"}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.mpg ASC LIMIT 1\n```"}]}, {"id": "train-3121", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name, model, sweep volume, and introduced year of the car with the best crash protection."}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name, T1.model, T1.displacement / T1.cylinders, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1\n```"}]}, {"id": "train-3122", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cars introduced in 1977, provide the names and the horse powers of cars from Europe."}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name, T1.horsepower FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year = 1977 AND T3.country = 'Europe'\n```"}]}, {"id": "train-3123", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name and model of the car with the highest price."}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name, T1.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-3124", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the price of a Chevrolet Bel Air?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'chevrolet bel air'\n```"}]}, {"id": "train-3125", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average price per car produced in Japan?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.price) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Japan'\n```"}]}, {"id": "train-3126", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country produced the car with the lowest price?"}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.price ASC LIMIT 1\n```"}]}, {"id": "train-3127", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cars produced in 1975, provide IDs, names, and producing countries of the cars with the maximum number of cylinders."}, {"from": "gpt", "value": "```sql\nSELECT T1.ID, T1.car_name, T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year = 1975 ORDER BY T1.cylinders DESC LIMIT 1\n```"}]}, {"id": "train-3128", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which car is the cheapest? Provide its acceleration, number of cylinders, and producing year."}, {"from": "gpt", "value": "```sql\nSELECT T1.acceleration, T1.cylinders, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN price AS T3 ON T3.ID = T2.ID ORDER BY T3.price ASC LIMIT 1\n```"}]}, {"id": "train-3129", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names and prices of the cars with model 82 and mileage per gallon of greater than 30."}, {"from": "gpt", "value": "```sql\nSELECT T2.car_name, T1.price FROM price AS T1 INNER JOIN data AS T2 ON T1.ID = T2.ID WHERE T2.model = 82 AND T2.mpg > 30\n```"}]}, {"id": "train-3130", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many models of Ford Maverick were produced?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford maverick'\n```"}]}, {"id": "train-3131", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of cars that belong to the USA."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin\n```"}]}, {"id": "train-3132", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average production rate per year from 1971 to 1980. Among them, name the cars with a weight of fewer than 1800 lbs."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.ID) AS REAL) / 9 FROM production AS T1 INNER JOIN data AS T2 ON T2.ID = T1.ID WHERE T1.model_year BETWEEN 1971 AND 1980 UNION ALL SELECT DISTINCT T2.car_name FROM production AS T1 INNER JOIN data AS T2 ON T2.ID = T1.ID WHERE T1.model_year BETWEEN 1971 AND 1980 AND T2.weight < 1800\n```"}]}, {"id": "train-3133", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average price of model 70 cars?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.model = 70\n```"}]}, {"id": "train-3134", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the price of Chevrolet Vega 2300?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'chevrolet vega 2300'\n```"}]}, {"id": "train-3135", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country does Chevy C20 come from?"}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.car_name = 'chevy c20'\n```"}]}, {"id": "train-3136", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the price of Ford cars from model 1970 to 1980."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.price FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN price AS T3 ON T3.ID = T2.ID WHERE T1.car_name LIKE 'ford%' AND T2.model_year BETWEEN 1970 AND 1980\n```"}]}, {"id": "train-3137", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which is the most fuel efficient car in 1975?"}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = '1975' ORDER BY T1.mpg DESC LIMIT 1\n```"}]}, {"id": "train-3138", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which car consumes fuel the most and has the highest price?"}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.mpg DESC, T2.price DESC LIMIT 1\n```"}]}, {"id": "train-3139", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many American cars have an acceleration time of less than 12 seconds?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'USA' AND T1.acceleration < 12\n```"}]}, {"id": "train-3140", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Japanese cars weigh more than 2000 lbs?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Japan' AND T1.weight > 2000\n```"}]}, {"id": "train-3141", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of the most expensive car."}, {"from": "gpt", "value": "```sql\nSELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-3142", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What years did the Buick Skylark 320 get in production?"}, {"from": "gpt", "value": "```sql\nSELECT T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'buick skylark 320'\n```"}]}, {"id": "train-3143", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country produced the most expensive car in 1970?"}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN price AS T4 ON T4.ID = T1.ID WHERE T2.model_year = 1970 ORDER BY T4.price DESC LIMIT 1\n```"}]}, {"id": "train-3144", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cars with horsepower greater than 200 were produced in 1975?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.horsepower > 200 AND T2.model_year = 1975\n```"}]}, {"id": "train-3145", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of American cars among all cars."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country\n```"}]}, {"id": "train-3146", "db_id": "cars", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average weight of Japanese cars with 4 cylinders that were produced from 1975 to 1980?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.weight) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year BETWEEN 1975 AND 1980 AND T1.cylinders = 4 AND T3.country = 'Japan'\n```"}]}, {"id": "train-3147", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total amount of donations in 2012."}, {"from": "gpt", "value": "```sql\nSELECT SUM(donation_total) FROM donations WHERE donation_timestamp LIKE '2012%'\n```"}]}, {"id": "train-3148", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the highest amount of donated? How much was the amount?"}, {"from": "gpt", "value": "```sql\nSELECT donation_timestamp, donation_total FROM donations WHERE donation_total = ( SELECT donation_total FROM donations ORDER BY donation_total DESC LIMIT 1 )\n```"}]}, {"id": "train-3149", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total amount of donations made in 2011 for an honoree with payment via campaign page."}, {"from": "gpt", "value": "```sql\nSELECT SUM(donation_total) FROM donations WHERE donation_timestamp LIKE '2011%' AND via_giving_page = 't' AND for_honoree = 't'\n```"}]}, {"id": "train-3150", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For each donation not from a teacher, state the donor account id and calculate the percentage of donation given for optional support."}, {"from": "gpt", "value": "```sql\nSELECT donor_acctid, donation_optional_support / donation_total FROM donations WHERE is_teacher_acct = 'f'\n```"}]}, {"id": "train-3151", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all the project titles whereby project materials are intended mainly for literary."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.primary_focus_subject = 'Literacy'\n```"}]}, {"id": "train-3152", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the project titles meant for school whereby 65% of the students are on reduced lunch."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.poverty_level LIKE 'highest%'\n```"}]}, {"id": "train-3153", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For project titled 'Toot Your Flute!', what is the main subject of the project materials intended for? Name the other projects with the similar focus."}, {"from": "gpt", "value": "```sql\nSELECT T2.primary_focus_subject FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title = 'Toot Your Flute!'\n```"}]}, {"id": "train-3154", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the project titles created by teacher who acquired a doctor degree."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_message LIKE 'Donation on behalf of Matt Carpenter because I''m a strong believer in education.'\n```"}]}, {"id": "train-3155", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the project in which 320 students will be impacted if the project is funded? Name the project and state the project cost."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T2.total_price_excluding_optional_support FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.students_reached = 320\n```"}]}, {"id": "train-3156", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all donors from Texas City, list their donation message and name of the project they donated to."}, {"from": "gpt", "value": "```sql\nSELECT T2.donation_message, T1.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donor_city = 'Texas City'\n```"}]}, {"id": "train-3157", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the vendors who provide resources for project 'Lights, Camera, Action!'. List all the item names and unit price for each."}, {"from": "gpt", "value": "```sql\nSELECT T1.vendor_name, T1.item_name, T1.item_unit_price FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN essays AS T3 ON T2.projectid = T3.projectid WHERE T3.title = 'Lights, Camera, Action!'\n```"}]}, {"id": "train-3158", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much donations have been collected for project 'Whistle While We Work!'?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.donation_to_project) FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title = 'Whistle While We Work!'\n```"}]}, {"id": "train-3159", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name and describe all projects created by New York teachers."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T1.short_description FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.teacher_ny_teaching_fellow = 't'\n```"}]}, {"id": "train-3160", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: If funded, which are the projects that could impact at least 600 students for a school with moderate level of poverty? Name the projects and state the project cost."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.title, T1.total_price_excluding_optional_support FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.students_reached >= 600 AND T1.poverty_level LIKE 'moderate poverty'\n```"}]}, {"id": "train-3161", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From the total amount of donation to projects, what is the percentage of the amount is for school projects located in the rural area?"}, {"from": "gpt", "value": "```sql\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```"}]}, {"id": "train-3162", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the project that costs the most. How much has been collected from donation and what is the percentage amount still lacking?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title, SUM(T3.donation_to_project), CAST((T2.total_price_excluding_optional_support - SUM(T3.donation_to_project)) AS REAL) * 100 / SUM(T3.donation_to_project) FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid ORDER BY T2.total_price_excluding_optional_support DESC LIMIT 1\n```"}]}, {"id": "train-3163", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many schools in the West New York School District have the highest poverty level?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(poverty_level) FROM projects WHERE school_district = 'West New York School District' AND poverty_level = 'highest poverty'\n```"}]}, {"id": "train-3164", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many donations from teachers were done in the state of Colorado?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(donationid) FROM donations WHERE is_teacher_acct = 't' AND donor_state = 'CO'\n```"}]}, {"id": "train-3165", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which project have the highest total price including optional support? Indicate the project id."}, {"from": "gpt", "value": "```sql\nSELECT projectid FROM projects ORDER BY total_price_including_optional_support DESC LIMIT 1\n```"}]}, {"id": "train-3166", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which state have the highest number of PayPal donations for an honoree whose portion of a donation included corporate sponsored giftcard?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT donor_state FROM donations WHERE for_honoree = 't' AND payment_included_campaign_gift_card = 't' AND payment_method = 'paypal' AND donor_state = ( SELECT donor_state FROM donations GROUP BY donor_state ORDER BY SUM(donation_total) DESC LIMIT 1 )\n```"}]}, {"id": "train-3167", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the largest donor by amount? Give the donation id and the total amount of the donation."}, {"from": "gpt", "value": "```sql\nSELECT donationid, donation_total FROM donations ORDER BY donation_total DESC LIMIT 1\n```"}]}, {"id": "train-3168", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the id of the project that has the highest optional tip? Indicate the names of the resources that were requested."}, {"from": "gpt", "value": "```sql\nSELECT T1.projectid, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid ORDER BY T2.total_price_including_optional_support - T2.total_price_excluding_optional_support DESC LIMIT 1\n```"}]}, {"id": "train-3169", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What were the resources that were requested by the teacher for project \"d6ef27c07c30c81f0c16c32b6acfa2ff\"? Indicate the quantities as well and whether or not the teacher acquired P.h.D or doctor degree."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.item_name, T1.item_quantity, T2.teacher_prefix FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.projectid = 'd6ef27c07c30c81f0c16c32b6acfa2ff'\n```"}]}, {"id": "train-3170", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total price including optional support received by the teacher who posted the essay titled \"Recording Rockin' Readers\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.total_price_including_optional_support) FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title = 'Recording Rockin'' Readers'\n```"}]}, {"id": "train-3171", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the latitude and longitude of the school where the teacher who wrote \"Smile for the Camera!!!\" teaches?"}, {"from": "gpt", "value": "```sql\nSELECT T1.school_latitude, T1.school_longitude FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title = 'Smile for the Camera!!!'\n```"}]}, {"id": "train-3173", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the favorite project types of each of the top 10 donors?"}, {"from": "gpt", "value": "```sql\nSELECT project_resource_type FROM ( SELECT T1.donor_acctid, T3.project_resource_type FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN resources AS T3 ON T2.projectid = T3.projectid ORDER BY T1.donation_total DESC LIMIT 10 ) GROUP BY project_resource_type ORDER BY COUNT(project_resource_type) DESC LIMIT 1\n```"}]}, {"id": "train-3174", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the first ever project went live on the site and what were the names of the resources being requested? If there are multiple projects that have the same date, indicate each of them and their items."}, {"from": "gpt", "value": "```sql\nSELECT T2.date_posted, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.date_posted = ( SELECT date_posted FROM projects ORDER BY date_posted ASC LIMIT 1 )\n```"}]}, {"id": "train-3175", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the vendor that supplies resources to the project \"iMath\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.vendor_name FROM resources AS T1 INNER JOIN essays AS T3 ON T1.projectid = T3.projectid WHERE T3.title = 'iMath'\n```"}]}, {"id": "train-3176", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the project with the highest quantity went live on the site? Indicate the grade level for which the project materials are intended."}, {"from": "gpt", "value": "```sql\nSELECT T2.date_posted, T2.grade_level FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid ORDER BY T1.item_quantity DESC LIMIT 1\n```"}]}, {"id": "train-3177", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average amount of donations by people who donated in the project \"Recording Rockin' Readers\""}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.donation_to_project) FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Recording Rockin'' Readers'\n```"}]}, {"id": "train-3178", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the essay title of the project that have the highest total price excluding optional support and who is the biggest donor? Identify the donor and calculate how many percent did he/she donated in the project."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T3.donor_acctid, CAST(T3.donation_to_project AS REAL) / T2.total_price_excluding_optional_support FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid ORDER BY T3.donation_to_project DESC LIMIT 1\n```"}]}, {"id": "train-3179", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT T1.school_state, T2.donor_acctid, AVG(T2.donation_optional_support), T1.resource_type FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid ORDER BY T2.donation_optional_support DESC LIMIT 5\n```"}]}, {"id": "train-3180", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which project in Brooklyn that have the highest request of resources? State the the project ID including all of the name of item requested."}, {"from": "gpt", "value": "```sql\nSELECT T1.projectid, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_city LIKE 'Brooklyn' GROUP BY T1.item_name ORDER BY COUNT(T1.item_name) DESC LIMIT 1\n```"}]}, {"id": "train-3181", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many schools in urban area requested for books resources?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.schoolid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.resource_type = 'Books' AND T2.school_metro = 'urban'\n```"}]}, {"id": "train-3182", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which school requested the highest amount of resources from Amazon? State the school's ID."}, {"from": "gpt", "value": "```sql\nSELECT T2.schoolid FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name LIKE 'Amazon' GROUP BY T2.schoolid ORDER BY COUNT(T1.vendor_name) DESC LIMIT 1\n```"}]}, {"id": "train-3183", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many donors in Los Angeles donated to school in another city?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.schoolid) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_city = 'Los Angeles' AND T2.school_city NOT LIKE 'Los Angeles'\n```"}]}, {"id": "train-3184", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the prefix for the teacher who handled the 'Reading About Other Cultures' project?"}, {"from": "gpt", "value": "```sql\nSELECT T2.teacher_prefix FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Reading About Other Cultures'\n```"}]}, {"id": "train-3185", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students will be impacted for the Fit Firsties! Project?"}, {"from": "gpt", "value": "```sql\nSELECT T2.students_reached FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Fit Firsties!'\n```"}]}, {"id": "train-3186", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the title of all projects located in Chicago along with the ID of the donor."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T3.donor_acctid FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T2.school_city LIKE 'Chicago'\n```"}]}, {"id": "train-3188", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of vendor that supplies book resources to all school with literacy subject as their primary focus."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.vendor_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.primary_focus_subject LIKE 'Literacy'\n```"}]}, {"id": "train-3190", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the donors from New York, how many of them are teachers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(donationid) FROM donations WHERE is_teacher_acct = 't' AND donor_city = 'New York'\n```"}]}, {"id": "train-3191", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many donors from New Jersey have made a donation for an honoree?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(donationid) FROM donations WHERE for_honoree = 't' AND donor_state = 'NJ'\n```"}]}, {"id": "train-3192", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the donation message for donation ID a84dace1ff716f6f0c7af8ef9090a5d5?"}, {"from": "gpt", "value": "```sql\nSELECT donation_message FROM donations WHERE donationid = 'a84dace1ff716f6f0c7af8ef9090a5d5'\n```"}]}, {"id": "train-3193", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the types of resources that the vendor Lakeshore Learning Materials has provided for the projects."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT project_resource_type FROM resources WHERE vendor_name = 'Lakeshore Learning Materials'\n```"}]}, {"id": "train-3194", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the item that is provided in the biggest amount by the vendor Lakeshore Learning Materials?"}, {"from": "gpt", "value": "```sql\nSELECT item_name FROM resources WHERE vendor_name = 'Lakeshore Learning Materials' ORDER BY item_quantity DESC LIMIT 1\n```"}]}, {"id": "train-3195", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the projects created by a teacher from New York, how many of them have a donor from the same city?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.projectid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.teacher_ny_teaching_fellow = 't' AND T2.donor_city = 'New York'\n```"}]}, {"id": "train-3196", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many projects have their resources provided by the vendor Lakeshore Learning Materials and are created by a teacher with a doctor degree?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.projectid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Lakeshore Learning Materials' AND T2.teacher_prefix = 'Dr.'\n```"}]}, {"id": "train-3197", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the vendor providing resources for the projects of a school with the highest poverty level."}, {"from": "gpt", "value": "```sql\nSELECT T1.vendor_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.poverty_level = 'highest poverty'\n```"}]}, {"id": "train-3198", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT T2.schoolid FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Lakeshore Learning Materials' ORDER BY T2.fulfillment_labor_materials DESC LIMIT 1\n```"}]}, {"id": "train-3199", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the vendor of the resources needed by the project that had the highest cost of optional tip?"}, {"from": "gpt", "value": "```sql\nSELECT T1.vendor_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid ORDER BY T2.total_price_including_optional_support - T2.total_price_including_optional_support DESC LIMIT 1\n```"}]}, {"id": "train-3200", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total donated amount for projects created by a teacher working in a school in Brooklyn?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.donation_total) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city = 'Brooklyn'\n```"}]}, {"id": "train-3201", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the donation messages of the donations for the projects created by a teacher working in a public magnet school in Brooklyn."}, {"from": "gpt", "value": "```sql\nSELECT 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'\n```"}]}, {"id": "train-3202", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the donations with a portion using account credits redemption, how many of them are for projects created by teachers working in a public year-round school?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.projectid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.payment_included_acct_credit = 't' AND T1.school_year_round = 't'\n```"}]}, {"id": "train-3203", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total donation amount made for projects whose main subject area are Literacy & Language?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.dollar_amount) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.primary_focus_area = 'Literacy & Language'\n```"}]}, {"id": "train-3204", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which donor has donated the most for a project whose main subject area is Literacy & Language? Please give his or her ID."}, {"from": "gpt", "value": "```sql\nSELECT T2.donor_acctid FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.primary_focus_area = 'Literacy & Language' ORDER BY T2.donation_total DESC LIMIT 1\n```"}]}, {"id": "train-3205", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most requested item under the resource type \"Supplies\" for projects whose main subject area is Literacy & Language?"}, {"from": "gpt", "value": "```sql\nSELECT T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.primary_focus_area = 'Literacy & Language' AND T1.project_resource_type = 'Supplies' ORDER BY T1.item_quantity DESC LIMIT 1\n```"}]}, {"id": "train-3206", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which item provided to a project whose main subject area is Literacy & Language has the highest unit price?"}, {"from": "gpt", "value": "```sql\nSELECT T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.primary_focus_area = 'Literacy & Language' ORDER BY T1.item_unit_price DESC LIMIT 1\n```"}]}, {"id": "train-3207", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average donation amount to a project created by a teacher working in a school in Brooklyn?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.donation_total) / COUNT(donationid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city = 'Brooklyn'\n```"}]}, {"id": "train-3208", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which city did donor \u201c22cbc920c9b5fa08dfb331422f5926b5\u201d donate?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT donor_city FROM donations WHERE donor_acctid = '22cbc920c9b5fa08dfb331422f5926b5'\n```"}]}, {"id": "train-3209", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is donor \u201c22cbc920c9b5fa08dfb331422f5926b5\u201d a teacher?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT is_teacher_acct FROM donations WHERE donor_acctid = '22cbc920c9b5fa08dfb331422f5926b5'\n```"}]}, {"id": "train-3210", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Have the teacher \"42d43fa6f37314365d08692e08680973\" acquired P.h.D or doctor degree?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN teacher_prefix = 'Dr.' THEN 'Yes' ELSE 'NO' END FROM projects WHERE teacher_acctid = '42d43fa6f37314365d08692e08680973'\n```"}]}, {"id": "train-3211", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is teacher \"42d43fa6f37314365d08692e08680973\" a New York teacher?"}, {"from": "gpt", "value": "```sql\nSELECT teacher_ny_teaching_fellow end FROM projects WHERE teacher_acctid = '42d43fa6f37314365d08692e08680973'\n```"}]}, {"id": "train-3212", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of projects by which schools in Abington was donated."}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city LIKE 'Abington'\n```"}]}, {"id": "train-3213", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the resource names of project that teacher \"822b7b8768c17456fdce78b65abcc18e\" created."}, {"from": "gpt", "value": "```sql\nSELECT T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'\n```"}]}, {"id": "train-3214", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the schools' projects whose donation didn't use account credits redemption,how many schools are public magnet schools?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.schoolid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_magnet = 't' AND T2.payment_included_acct_credit = 'f'\n```"}]}, {"id": "train-3215", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the type of resource that donation \"b39547f29dfc25fb13c6e9e8d940dc43\" contain."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.project_resource_type FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T3.donationid LIKE 'b39547f29dfc25fb13c6e9e8d940dc43'\n```"}]}, {"id": "train-3216", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among public magnet schools,what percentage of schools that receive the donated resources as books?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.project_resource_type = 'Books' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.projectid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_magnet = 't'\n```"}]}, {"id": "train-3217", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the schools donated by the project of the resources provided by ABC School Supply, how many schools are public magnet schools?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.schoolid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_magnet = 't' AND T1.vendor_name = 'ABC School Supply'\n```"}]}, {"id": "train-3218", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the schools donated by donor \"000eebf28658900e63b538cf8a73afbd\",how many schools whose poverty level are highest?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.schoolid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.poverty_level = 'highest poverty' AND T2.donor_acctid = '000eebf28658900e63b538cf8a73afbd'\n```"}]}, {"id": "train-3219", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the short description of the project that gives donation to school \u201c301c9bf0a45d159d162b65a93fddd74e\u201d?"}, {"from": "gpt", "value": "```sql\nSELECT T2.short_description FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.schoolid = '301c9bf0a45d159d162b65a93fddd74e'\n```"}]}, {"id": "train-3220", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city does the school that project \"iMath\" donated to in?"}, {"from": "gpt", "value": "```sql\nSELECT T1.school_city FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'iMath'\n```"}]}, {"id": "train-3223", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is the donor who donated to school \"d4af834b1d3fc8061e1ee1b3f1a77b85\" a teacher?"}, {"from": "gpt", "value": "```sql\nSELECT T2.is_teacher_acct FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.schoolid = 'd4af834b1d3fc8061e1ee1b3f1a77b85'\n```"}]}, {"id": "train-3224", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the schools whose donators are teachers, what is the percentage of schools that are in Brooklyn?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.school_city LIKE 'Brooklyn' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.teacher_acctid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.is_teacher_acct = 't'\n```"}]}, {"id": "train-3225", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the projects whose donators are teachers, what is the percentage of projects that affected more than 30 students?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.students_reached > 30 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.projectid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.is_teacher_acct = 't'\n```"}]}, {"id": "train-3226", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many schools which have suburban metro are there in Bethlehem?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(schoolid) FROM projects WHERE school_city = 'Bethlehem' AND school_metro = 'suburban'\n```"}]}, {"id": "train-3227", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of the year round school in Los Angeles?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(school_year_round) FROM projects WHERE school_city = 'Los Angeles' AND school_year_round = 't'\n```"}]}, {"id": "train-3228", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of public magnet schools in New York Manhattan."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(schoolid) FROM projects WHERE school_county = 'New York (Manhattan)' AND school_magnet = 't'\n```"}]}, {"id": "train-3229", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teachers in Twin Falls have Math & Science as their primary focus area?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(teacher_acctid) FROM projects WHERE school_county = 'Twin Falls' AND primary_focus_area = 'Math & Science'\n```"}]}, {"id": "train-3230", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teachers that have Literature & Writing as their primary focus subject use 'Mr' as their teacher prefix?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(teacher_acctid) FROM projects WHERE teacher_prefix = 'Mr.' AND primary_focus_subject = 'Literature & Writing'\n```"}]}, {"id": "train-3231", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of projects that was created by the teachers that teach 3-5 grades in Boston Public School District?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(projectid) FROM projects WHERE school_district = 'Boston Public School District' AND grade_level = 'Grades 3-5'\n```"}]}, {"id": "train-3232", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the teacher who wrote the project 'ABC Read', which city was he/she in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.school_city FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title = 'ABC Read'\n```"}]}, {"id": "train-3233", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the teacher prefix for the teacher who wrote the project 'Creating Memories and Inspiring Dreams'?"}, {"from": "gpt", "value": "```sql\nSELECT T2.teacher_prefix FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Creating Memories and Inspiring Dreams%'\n```"}]}, {"id": "train-3234", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is the donor of the project 'Calculate, Financial Security For Tomorrow Starts Today! ' a teacher?"}, {"from": "gpt", "value": "```sql\nSELECT T2.is_teacher_acct FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Calculate, Financial Security For Tomorrow Starts Today! '\n```"}]}, {"id": "train-3235", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title for the project that got the donation message as \"Donation on behalf of Matt Carpenter because I'm a strong believer in education\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_message LIKE 'Donation on behalf of Matt Carpenter because I''m a strong believer in education.'\n```"}]}, {"id": "train-3236", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many number of donations did the project 'A Rug For Reaching Readers' get?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.donation_total) FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'A Rug For Reaching Readers'\n```"}]}, {"id": "train-3237", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total donation amount for the project 'Engaging Young Readers with a Leveled Classroom Library'?"}, {"from": "gpt", "value": "```sql\nSELECT 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 '\n```"}]}, {"id": "train-3238", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the donation optional support amount for the project 'Armenian Genocide'?"}, {"from": "gpt", "value": "```sql\nSELECT T2.donation_optional_support FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Armenian Genocide'\n```"}]}, {"id": "train-3240", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Did the project 'I Can't See It...Can You Help Me???' get the tip for the donation?"}, {"from": "gpt", "value": "```sql\nSELECT T2.donation_included_optional_support FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'I Can''t See It...Can You Help Me???'\n```"}]}, {"id": "train-3241", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the teacher's account ID for the project that got the donation at 11:38:43 on 2008/7/29 ?"}, {"from": "gpt", "value": "```sql\nSELECT T1.teacher_acctid FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_timestamp LIKE '2008-07-29 11:38:43.361'\n```"}]}, {"id": "train-3242", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the school id for the project 'Virtual Aquarium Needs Help!'."}, {"from": "gpt", "value": "```sql\nSELECT T2.schoolid FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Virtual Aquarium Needs Help!'\n```"}]}, {"id": "train-3244", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the donation of the project 'Awesome Audiobooks Make Avid Readers', what was the percentage of the tip in the total amount?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.donation_optional_support) AS REAL) * 100 / SUM(T2.donation_total) FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Awesome Audiobooks Make Avid Readers'\n```"}]}, {"id": "train-3245", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the all donations to the project 'Bringing Drama to Life', what is the percentage of the donation is paid by credit card?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.payment_method LIKE 'creditcard' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(donationid) FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Bringing Drama to Life'\n```"}]}, {"id": "train-3246", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the short description for the title Future Einsteins Of America?"}, {"from": "gpt", "value": "```sql\nSELECT short_description FROM essays WHERE title = 'Future Einsteins Of America'\n```"}]}, {"id": "train-3248", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many suburban metros are there in Livingston Parish School District?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(projectid) FROM projects WHERE school_district = 'Livingston Parish School Dist' AND school_metro = 'suburban'\n```"}]}, {"id": "train-3249", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the vendors that sell the item Classroom Keepers Management Center."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT vendor_name FROM resources WHERE item_name = 'Classroom Keepers Management Center'\n```"}]}, {"id": "train-3250", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the resource types available at Sax Arts & Crafts."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT project_resource_type FROM resources WHERE vendor_name = 'Sax Arts & Crafts'\n```"}]}, {"id": "train-3251", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which school county in the state of New York has a high number of low poverty levels?"}, {"from": "gpt", "value": "```sql\nSELECT school_county FROM projects WHERE poverty_level = 'low poverty' AND school_state = 'NY' GROUP BY school_state ORDER BY COUNT(poverty_level) DESC LIMIT 1\n```"}]}, {"id": "train-3252", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which school district was Future Einsteins Of America project located at?"}, {"from": "gpt", "value": "```sql\nSELECT T1.school_district FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Future Einsteins Of America'\n```"}]}, {"id": "train-3253", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What payment method was used for Needed Resource Materials For My Students?"}, {"from": "gpt", "value": "```sql\nSELECT T3.payment_method FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Needed Resource Materials For My Students'\n```"}]}, {"id": "train-3254", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many donations were paid via credit card to Memphis City School District?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.projectid) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.payment_method = 'creditcard' AND T2.school_district = 'Memphis City School District'\n```"}]}, {"id": "train-3255", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the school districts that have bought resources from Barnes and Noble."}, {"from": "gpt", "value": "```sql\nSELECT T2.school_district FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Barnes and Noble'\n```"}]}, {"id": "train-3256", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the coordinates of the buyer of R & A Plant Genetics from Benchmark Education."}, {"from": "gpt", "value": "```sql\nSELECT T2.school_latitude, T2.school_longitude FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.item_name = 'R & A Plant Genetics' AND T1.vendor_name = 'Benchmark Education'\n```"}]}, {"id": "train-3257", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which payment method is most comonly used by the schools in the state of Georgia for the payment of donations?"}, {"from": "gpt", "value": "```sql\nSELECT T1.payment_method FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_state = 'GA' GROUP BY T2.school_state ORDER BY COUNT(T1.payment_method) DESC LIMIT 1\n```"}]}, {"id": "train-3258", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the coordinates of the school where project 'Look, Look, We Need a Nook!' Was donated to and what resource type is it?"}, {"from": "gpt", "value": "```sql\nSELECT T2.school_latitude, T2.school_longitude, T2.resource_type FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Look, Look, We Need a Nook!'\n```"}]}, {"id": "train-3260", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What date did the project with he 'Lets Share Ideas essay' went live?"}, {"from": "gpt", "value": "```sql\nSELECT T1.date_posted FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Lets Share Ideas'\n```"}]}, {"id": "train-3261", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the message of the donor of the project with the title of Lets Share Ideas who paid with a credit card."}, {"from": "gpt", "value": "```sql\nSELECT T3.donation_message FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Lets Share Ideas' AND T3.payment_method = 'creditcard'\n```"}]}, {"id": "train-3262", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which resource type is commonly bought by the Los Angeles Unified School District?"}, {"from": "gpt", "value": "```sql\nSELECT T1.project_resource_type FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_district = 'Los Angeles Unif Sch Dist' GROUP BY T2.school_district ORDER BY COUNT(T1.project_resource_type) DESC LIMIT 1\n```"}]}, {"id": "train-3263", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which cities in the Los Angeles Unified School District has bought supplies from Quill.com?"}, {"from": "gpt", "value": "```sql\nSELECT T2.school_city FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_district = 'Los Angeles Unif Sch Dist' AND T1.vendor_name = 'Quill.com'\n```"}]}, {"id": "train-3264", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total price of items brought from ABC School Supply with a listed type of Other? Also include the list of the buyers' coordinates and school districts they belong to."}, {"from": "gpt", "value": "```sql\nSELECT T2.item_unit_price * T2.item_quantity price, T1.school_latitude, T1.school_longitude FROM projects AS T1 INNER JOIN resources AS T2 ON T1.projectid = T2.projectid WHERE T2.vendor_name = 'ABC School Supply' AND T2.project_resource_type = 'Other' AND T1.school_district = 'Hillsborough Co Pub Sch Dist'\n```"}]}, {"id": "train-3265", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the sum of all the total amount donated to the essay project titled 'Lets Share Ideas' which were paid through paypal and indicate the city and poverty level."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.donation_total), school_city, poverty_level FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Lets Share Ideas' AND T3.payment_method = 'paypal'\n```"}]}, {"id": "train-3266", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many donors who donated to the city of Pocatello are not teachers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(donationid) FROM donations WHERE donor_city = 'Pocatello' AND is_teacher_acct = 'f'\n```"}]}, {"id": "train-3267", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many schools in Suffolk County have Ph.D. teachers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(schoolid) FROM projects WHERE teacher_prefix = 'Dr.' AND school_county = 'Suffolk'\n```"}]}, {"id": "train-3268", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the sum of the total donated amounts paid through Amazon?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(donation_to_project) + SUM(donation_optional_support) FROM donations WHERE payment_method = 'amazon'\n```"}]}, {"id": "train-3269", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many donations of more than $100 were made for an honoree?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(donationid) FROM donations WHERE dollar_amount = '100_and_up' AND for_honoree = 't'\n```"}]}, {"id": "train-3270", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many resources with a unit price less than 15 are not technology type? List them by vendor id"}, {"from": "gpt", "value": "```sql\nSELECT vendorid FROM resources WHERE project_resource_type = 'Technology' AND item_unit_price <= 15\n```"}]}, {"id": "train-3271", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On how many projects where the teacher has ordered between 5 to 10 items are from are from Quill.com?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(projectid) FROM resources WHERE vendor_name = 'Quill.com' AND item_quantity BETWEEN 5 AND 10\n```"}]}, {"id": "train-3273", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which cities are Los Angeles County Suburban Metro Schools located?"}, {"from": "gpt", "value": "```sql\nSELECT school_city FROM projects WHERE school_metro = 'suburban' AND school_county = 'Los Angeles'\n```"}]}, {"id": "train-3274", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the vendors of the book-type projects? List them with the project ID."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT vendorid, projectid FROM resources WHERE project_resource_type = 'Books'\n```"}]}, {"id": "train-3275", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of projects that have not received a cash donation have received a portion of a donation included corporate sponsored giftcard?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN payment_included_campaign_gift_card = 't' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(donationid) FROM donations WHERE payment_method = 'no_cash_received'\n```"}]}, {"id": "train-3276", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of projects in the City of Santa Barbara are in suburban metro?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN school_metro = 'suburban' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(projectid) FROM projects WHERE school_city = 'Santa Barbara'\n```"}]}, {"id": "train-3277", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of payment methods of donations made in March 2013?"}, {"from": "gpt", "value": "```sql\nSELECT payment_method , CAST(COUNT(donationid) AS REAL) * 100 / 51090 FROM donations WHERE donation_timestamp LIKE '2013-03%' GROUP BY payment_method\n```"}]}, {"id": "train-3278", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average unit price of AKJ Books items?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(item_unit_price) / SUM(item_quantity) FROM resources WHERE vendor_name = 'AKJ Books'\n```"}]}, {"id": "train-3279", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many schools in Brooklyn with urban metro and donations for an honoree have requested TT992 - Refill Pack for Safety Name Tags as a resource?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.schoolid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T2.school_city = 'Brooklyn' AND T2.school_metro = 'urban' AND T3.for_honoree = 't' AND T1.item_name = 'TT992 - Refill Pack for Safety Name Tags'\n```"}]}, {"id": "train-3280", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many schools with the highest level of poverty have received a portion of a donation included corporate sponsored gift card?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.schoolid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.payment_included_campaign_gift_card = 't' AND T1.poverty_level = 'highest poverty'\n```"}]}, {"id": "train-3281", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city is there a greater number of schools that have received donations of less than 10 dollars?"}, {"from": "gpt", "value": "```sql\nSELECT T2.school_city FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.dollar_amount = 'under_10' GROUP BY T2.school_city ORDER BY COUNT(T2.schoolid) DESC LIMIT 1\n```"}]}, {"id": "train-3283", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find out if the project with the title Team More Books! has a New York teaching fellow."}, {"from": "gpt", "value": "```sql\nSELECT T2.teacher_ny_teaching_fellow FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Team More Books!'\n```"}]}, {"id": "train-3284", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the vendors that serve resources to schools whose primary focus area is Literature?"}, {"from": "gpt", "value": "```sql\nSELECT T1.vendor_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.primary_focus_area LIKE 'Literacy%' GROUP BY T1.vendor_name ORDER BY COUNT(T2.primary_focus_area) DESC LIMIT 1\n```"}]}, {"id": "train-3285", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the vendors serving material for projects for grades 9-12?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.vendor_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.grade_level = 'Grades 9-12'\n```"}]}, {"id": "train-3286", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teachers have made some type of donation for projects in Chicago?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.teacher_acctid) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.is_teacher_acct = 't' AND T2.school_city = 'Chicago'\n```"}]}, {"id": "train-3287", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Rock Hill City School projects have teacher donors?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.teacher_acctid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city = 'Rock Hill' AND is_teacher_acct = 't'\n```"}]}, {"id": "train-3288", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total sum of the donations paid with an optional support in projects that reach more than 300 students?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.dollar_amount) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.students_reached > 300 AND t2.donation_included_optional_support = 't'\n```"}]}, {"id": "train-3289", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many total items were requested for the Onslow Co School District urban metro school projects?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.item_quantity) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_metro = 'urban' AND T2.school_district = 'Onslow Co School District'\n```"}]}, {"id": "train-3290", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average total donations received by Fresno County colleges?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.donation_optional_support + T2.donation_to_project) / COUNT(donationid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_county = 'Fresno'\n```"}]}, {"id": "train-3291", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In what percentage of counties has the ABC Read project been launched?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.title LIKE 'ABC Read' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.school_county) FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid\n```"}]}, {"id": "train-3292", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average amount of resources from projects that have received donations per honoree?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.item_quantity) FROM resources AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.for_honoree = 't'\n```"}]}, {"id": "train-3293", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did the project \"Photojournalists Want to Exhibit Their Best Works\" go live?"}, {"from": "gpt", "value": "```sql\nSELECT T1.date_posted FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Photojournalists Want to Exhibit Their Best Works'\n```"}]}, {"id": "train-3294", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which item provided for projects with Mathematics as a primary subject is the most expensive?"}, {"from": "gpt", "value": "```sql\nSELECT T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.primary_focus_subject = 'Mathematics' ORDER BY T1.item_unit_price DESC LIMIT 1\n```"}]}, {"id": "train-3296", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many donations does the project \"Look, Look, We Need a Nook!\" have?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.donation_total) FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Look, Look, We Need a Nook!'\n```"}]}, {"id": "train-3297", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the poverty level of all the schools that received donations with the zip code \"7079\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.poverty_level FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_zip = 7079\n```"}]}, {"id": "train-3298", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the vendor that the project \"Bloody Times\" uses for their resources?"}, {"from": "gpt", "value": "```sql\nSELECT T3.vendor_name FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN resources AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Bloody Times'\n```"}]}, {"id": "train-3299", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the items from \"Sax Arts & Crafts\" and the zip code of the schools that received them."}, {"from": "gpt", "value": "```sql\nSELECT T2.school_zip, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Sax Arts & Crafts'\n```"}]}, {"id": "train-3300", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the coordinates of the school with the project \"Wiping Away Bad Grades\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.school_longitude, T1.school_latitude FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Wiping Away Bad Grades'\n```"}]}, {"id": "train-3301", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the primary subject of all the donations with a corporate sponsored giftcard."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.primary_focus_subject FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.payment_included_campaign_gift_card = 't'\n```"}]}, {"id": "train-3302", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most expensive book item? Please provide a short description of projects related to those."}, {"from": "gpt", "value": "```sql\nSELECT T1.item_name, T2.short_description FROM resources AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.project_resource_type = 'Books' ORDER BY T1.item_unit_price DESC LIMIT 1\n```"}]}, {"id": "train-3303", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For what grade was the project \"Too Close for Comfort\" for?"}, {"from": "gpt", "value": "```sql\nSELECT T1.grade_level FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Too Close for Comfort'\n```"}]}, {"id": "train-3304", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of students impacted by the projects with a donation from a donor with zip code \"22205\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.students_reached) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_zip = 22205\n```"}]}, {"id": "train-3305", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of donations are given via a giving or campaign page? List the primary area of those donations."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.via_giving_page = 't' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(donation_total), ( SELECT T2.primary_focus_area FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.via_giving_page = 't' GROUP BY T2.primary_focus_area ORDER BY SUM(T1.donation_total) DESC LIMIT 1 ) result FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid\n```"}]}, {"id": "train-3306", "db_id": "donor", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the technology items, what percentage of them are from Best Buy for Business? Provide the date of the project related to those items."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.vendor_name = 'Best Buy for Business' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.projectid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.project_resource_type = 'Technology' UNION ALL SELECT DISTINCT T1.date_posted FROM projects AS T1 INNER JOIN resources AS T2 ON T1.projectid = T2.projectid WHERE T2.vendor_name = 'Best Buy for Business' AND T2.project_resource_type = 'Technology'\n```"}]}, {"id": "train-3307", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more games were sold on game platform ID 50 than on game platform ID 51 in region ID 1?"}, {"from": "gpt", "value": "```sql\nSELECT (SUM(CASE WHEN T.game_platform_id = 50 THEN T.num_sales ELSE 0 END) - SUM(CASE WHEN T.game_platform_id = 51 THEN T.num_sales ELSE 0 END)) * 100000 AS nums FROM region_sales AS T WHERE T.region_id = 1\n```"}]}, {"id": "train-3308", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the games that have the same game genre as 3D Lemmings."}, {"from": "gpt", "value": "```sql\nSELECT T1.game_name FROM game AS T1 WHERE T1.genre_id = ( SELECT T.genre_id FROM game AS T WHERE T.game_name = '3D Lemmings' )\n```"}]}, {"id": "train-3309", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many action games are there in total?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Action'\n```"}]}, {"id": "train-3310", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre of 3D Lemmings?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '3D Lemmings'\n```"}]}, {"id": "train-3311", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the publisher of 3D Lemmings?"}, {"from": "gpt", "value": "```sql\nSELECT T3.publisher_name 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 WHERE T1.game_name = '3D Lemmings'\n```"}]}, {"id": "train-3312", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the games published by 10TACLE Studios."}, {"from": "gpt", "value": "```sql\nSELECT T1.game_name 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 WHERE T3.publisher_name = '10TACLE Studios'\n```"}]}, {"id": "train-3313", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the games published by 10TACLE Studios, how many of them are puzzles?"}, {"from": "gpt", "value": "```sql\nSELECT 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 T4.genre_name = 'Puzzle' AND T3.publisher_name = '10TACLE Studios'\n```"}]}, {"id": "train-3314", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the games published by 10TACLE Studios and are puzzles."}, {"from": "gpt", "value": "```sql\nSELECT T1.game_name 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 = '10TACLE Studios' AND T4.genre_name = 'Puzzle'\n```"}]}, {"id": "train-3315", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which publisher has published the most games?"}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T2.id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T1.publisher_id ORDER BY COUNT(T2.id) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3316", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On which platform was Panzer Tactics released in 2007?"}, {"from": "gpt", "value": "```sql\nSELECT T5.platform_name FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN game AS T3 ON T1.game_id = T3.id INNER JOIN game_platform AS T4 ON T1.id = T4.game_publisher_id INNER JOIN platform AS T5 ON T4.platform_id = T5.id WHERE T3.game_name = 'Panzer Tactics' AND T4.release_year = 2007\n```"}]}, {"id": "train-3317", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year was Panzer Tactics released on DS?"}, {"from": "gpt", "value": "```sql\nSELECT T4.release_year FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN game AS T3 ON T1.game_id = T3.id INNER JOIN game_platform AS T4 ON T1.id = T4.game_publisher_id INNER JOIN platform AS T5 ON T4.platform_id = T5.id WHERE T3.game_name = 'Panzer Tactics' AND T5.platform_name = 'DS'\n```"}]}, {"id": "train-3318", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the publishers of all the puzzle games."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.publisher_name 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 T4.genre_name = 'Puzzle'\n```"}]}, {"id": "train-3319", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the publisher that has published the most puzzle games?"}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM ( SELECT T3.publisher_name, COUNT(DISTINCT 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 T4.genre_name = 'Puzzle' GROUP BY T3.publisher_name ORDER BY COUNT(DISTINCT T1.id) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3320", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many publishers have published more than 3 puzzle games?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.publisher_name) FROM ( SELECT T3.publisher_name, COUNT(DISTINCT 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 T4.genre_name = 'Puzzle' GROUP BY T3.publisher_name HAVING COUNT(DISTINCT T1.id) > 3 ) t\n```"}]}, {"id": "train-3321", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the games published by Nintendo, what is the percentage of those in the genre of sports?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Sports' 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 = 'Nintendo'\n```"}]}, {"id": "train-3322", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games were sold on the DS platform on average in the 4 different regions?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.num_sales) * 100000 / 4 FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id INNER JOIN platform AS T3 ON T2.platform_id = T3.id WHERE T3.platform_name = 'DS'\n```"}]}, {"id": "train-3323", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of games whose publisher id is 352."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T.game_id FROM game_publisher AS T WHERE T.publisher_id = 352\n```"}]}, {"id": "train-3324", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the genre id of the game Pro Evolution Soccer 2012."}, {"from": "gpt", "value": "```sql\nSELECT T.genre_id FROM game AS T WHERE T.game_name = 'Pro Evolution Soccer 2012'\n```"}]}, {"id": "train-3325", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the region id of Japan."}, {"from": "gpt", "value": "```sql\nSELECT T.id FROM region AS T WHERE T.region_name = 'Japan'\n```"}]}, {"id": "train-3326", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the id of the game platform with the most sales in region 2."}, {"from": "gpt", "value": "```sql\nSELECT T1.game_platform_id FROM ( SELECT T.game_platform_id, SUM(T.num_sales) FROM region_sales AS T WHERE T.region_id = 2 GROUP BY T.game_platform_id ORDER BY SUM(T.num_sales) DESC LIMIT 1 ) T1\n```"}]}, {"id": "train-3327", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which genre has the most games? Show its id."}, {"from": "gpt", "value": "```sql\nSELECT genre_id FROM ( SELECT T.genre_id, COUNT(T.id) FROM game AS T GROUP BY T.genre_id ORDER BY COUNT(T.id) DESC LIMIT 1 )\n```"}]}, {"id": "train-3328", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the id of the game \"Resident Evil Archives: Resident Evil\"?"}, {"from": "gpt", "value": "```sql\nSELECT T.genre_id FROM game AS T WHERE T.game_name = 'Resident Evil Archives: Resident Evil'\n```"}]}, {"id": "train-3329", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the number of games which were released on X360 in 2010."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'X360' AND T2.release_year = 2010\n```"}]}, {"id": "train-3330", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the publisher name of the game \"ModNation Racers\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.publisher_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = 'ModNation Racers'\n```"}]}, {"id": "train-3331", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the id of game platform which makes the most sales in Japan."}, {"from": "gpt", "value": "```sql\nSELECT T.game_platform_id FROM ( SELECT T2.game_platform_id, MAX(T2.num_sales) FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Japan' ) t\n```"}]}, {"id": "train-3332", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many platforms are available for the game Pro Evolution Soccer 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id INNER JOIN game_publisher AS T3 ON T1.game_publisher_id = T3.id INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T4.game_name = 'Pro Evolution Soccer 2016'\n```"}]}, {"id": "train-3333", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games in the database belong to the genre of sports?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Sports'\n```"}]}, {"id": "train-3334", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name of the publisher of the game id 10031."}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.game_id = 10031\n```"}]}, {"id": "train-3335", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of the publisher with the most games."}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name ORDER BY COUNT(DISTINCT T1.game_id) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3336", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more sports games than simulation games?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T1.genre_name = 'Sports' THEN T2.id ELSE NULL END) - COUNT(CASE WHEN T1.genre_name = 'Simulation' THEN T2.id ELSE NULL END) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id\n```"}]}, {"id": "train-3337", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the genre of the game \"Resident Evil: Revelations\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Resident Evil: Revelations'\n```"}]}, {"id": "train-3338", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales does game platform id 3871 make in Europe?"}, {"from": "gpt", "value": "```sql\nSELECT T2.num_sales * 100000 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Europe' AND T2.game_platform_id = 3871\n```"}]}, {"id": "train-3339", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of games which were published by Ascaron Entertainment GmbH."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id WHERE T1.publisher_name = 'Ascaron Entertainment GmbH'\n```"}]}, {"id": "train-3340", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the name of the earliest platform in the database."}, {"from": "gpt", "value": "```sql\nSELECT T2.platform_name FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id ORDER BY T1.release_year ASC LIMIT 1\n```"}]}, {"id": "train-3341", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the games which were published by Namco Bandai Games, what percentage of them were adventure games?"}, {"from": "gpt", "value": "```sql\nSELECT 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'\n```"}]}, {"id": "train-3342", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times more is the number of games which were published by Atari than Athena?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.publisher_name = 'Atari' THEN T2.game_id ELSE NULL END) AS REAL) / COUNT(CASE WHEN T1.publisher_name = 'Athena' THEN T2.game_id ELSE NULL END) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id\n```"}]}, {"id": "train-3343", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games did Electronic Arts publish?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id WHERE T1.publisher_name = 'Electronic Arts'\n```"}]}, {"id": "train-3344", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre of the Advent Rising game?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Advent Rising'\n```"}]}, {"id": "train-3345", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many role-playing games did Microsoft Game Studios publish?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Role-Playing' AND T1.publisher_name = 'Microsoft Game Studios'\n```"}]}, {"id": "train-3346", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which publisher published the most games?"}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name ORDER BY COUNT(DISTINCT T1.game_id) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3347", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2004, what are the names of the platforms where Codemasters publish its games?"}, {"from": "gpt", "value": "```sql\nSELECT T4.platform_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T3.release_year = 2004 AND T1.publisher_name = 'Codemasters'\n```"}]}, {"id": "train-3348", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games were released on PS4 in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'PS4' AND T2.release_year = 2014\n```"}]}, {"id": "train-3349", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the publishers who published the oldest games?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.publisher_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id ORDER BY T1.release_year LIMIT 1\n```"}]}, {"id": "train-3350", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many publishers in Japan released a game on X360 in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.game_publisher_id) FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T4.platform_name = 'X360' AND T3.release_year = 2011 AND T1.region_name = 'Japan'\n```"}]}, {"id": "train-3351", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which game platform is the most popular in Europe?"}, {"from": "gpt", "value": "```sql\nSELECT T.platform_name FROM ( SELECT T4.platform_name, SUM(T2.num_sales) FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.region_name = 'Europe' ORDER BY T2.num_sales DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3352", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year has the most number of PC games releases?"}, {"from": "gpt", "value": "```sql\nSELECT T.release_year FROM ( SELECT T2.release_year, COUNT(DISTINCT T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'PC' GROUP BY T2.release_year ORDER BY COUNT(DISTINCT T3.game_id) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3353", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of all the publishers who published one game only."}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name HAVING COUNT(DISTINCT T1.game_id) = 1 ) t\n```"}]}, {"id": "train-3354", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the games that were published by 505 Games?"}, {"from": "gpt", "value": "```sql\nSELECT T3.game_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.publisher_name = '505 Games'\n```"}]}, {"id": "train-3355", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre ID of the game named 25 to Life?"}, {"from": "gpt", "value": "```sql\nSELECT T.genre_id FROM game AS T WHERE T.game_name = '25 to Life'\n```"}]}, {"id": "train-3356", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the game ID of games with genre ID 2."}, {"from": "gpt", "value": "```sql\nSELECT T.id FROM game AS T WHERE T.genre_id = 2\n```"}]}, {"id": "train-3357", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the release year of record ID 1 to 10."}, {"from": "gpt", "value": "```sql\nSELECT T.release_year FROM game_platform AS T WHERE T.id BETWEEN 1 AND 10\n```"}]}, {"id": "train-3358", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the game publisher ID of records with platform ID 15."}, {"from": "gpt", "value": "```sql\nSELECT T.game_publisher_id FROM game_platform AS T WHERE T.platform_id = 15\n```"}]}, {"id": "train-3359", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the record ID of records released between 2000 to 2003."}, {"from": "gpt", "value": "```sql\nSELECT T.id FROM game_platform AS T WHERE T.release_year BETWEEN 2000 AND 2003\n```"}]}, {"id": "train-3360", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of sales in region ID 2 with game platform ID 9615?"}, {"from": "gpt", "value": "```sql\nSELECT T.num_sales * 100000 FROM region_sales AS T WHERE T.region_id = 2 AND T.game_platform_id = 9615\n```"}]}, {"id": "train-3361", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the names of platform where the games released in 2016 can be played on."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.platform_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id WHERE T2.release_year = 2016\n```"}]}, {"id": "train-3362", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the game titled 3DS Classic Collection released?"}, {"from": "gpt", "value": "```sql\nSELECT T1.release_year FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = '3DS Classic Collection'\n```"}]}, {"id": "train-3363", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of sales in Japan?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.num_sales) * 100000 AS avg_japan FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Japan'\n```"}]}, {"id": "train-3364", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the genre of the games released from 2000 to 2002."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.genre_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T1.release_year BETWEEN 2000 AND 2002\n```"}]}, {"id": "train-3365", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the name of games published by 3DO."}, {"from": "gpt", "value": "```sql\nSELECT T1.game_name 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 WHERE T3.publisher_name = '3DO'\n```"}]}, {"id": "train-3366", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many role-playing games are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Role-Playing'\n```"}]}, {"id": "train-3367", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the region name where games reached 300000 sales and above."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.region_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T2.num_sales * 100000 > 300000\n```"}]}, {"id": "train-3368", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which company published the game with the most sales in North America?"}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM ( SELECT T5.publisher_name, SUM(T2.num_sales) * 100000 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHERE T1.region_name = 'North America' GROUP BY T5.publisher_name ORDER BY SUM(T2.num_sales) * 100000 DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3369", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the release year of the game that gained 350000 sales in North America?"}, {"from": "gpt", "value": "```sql\nSELECT T3.release_year FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id WHERE T2.num_sales * 100000 = 350000 AND T1.region_name = 'North America'\n```"}]}, {"id": "train-3370", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which platform does the game titled 15 Days available?"}, {"from": "gpt", "value": "```sql\nSELECT T1.platform_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T4.game_name = 'Counter Force'\n```"}]}, {"id": "train-3371", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the publisher of the game ID 75."}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.game_id = 75\n```"}]}, {"id": "train-3372", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the game that gained the most sales in Japan?"}, {"from": "gpt", "value": "```sql\nSELECT T.game_name FROM ( SELECT T5.game_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN game AS T5 ON T4.game_id = T5.id WHERE T1.region_name = 'Japan' ORDER BY T2.num_sales DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3373", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the game publisher's name of the game with sales greater than 90% of the average sales in Japan."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T5.publisher_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHERE T2.num_sales * 10000000 > ( SELECT AVG(T2.num_sales) * 100000 * 90 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Japan' )\n```"}]}, {"id": "train-3374", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the games released in 2004, what is the percentage of games on PSP?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.platform_name = 'PSP' THEN T3.game_id ELSE NULL END) AS REAL) * 100 / COUNT(T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T2.release_year = 2004\n```"}]}, {"id": "train-3375", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games were released in 1981?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.id) FROM game_platform AS T WHERE T.release_year = 1981\n```"}]}, {"id": "train-3376", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre ID of the '2Xtreme' game?"}, {"from": "gpt", "value": "```sql\nSELECT T.genre_id FROM game AS T WHERE T.game_name = '2Xtreme'\n```"}]}, {"id": "train-3377", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Sum the total game sales in every region for platform ID 9658."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.game_platform_id = 9658\n```"}]}, {"id": "train-3378", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ID of 1C Company."}, {"from": "gpt", "value": "```sql\nSELECT T.id FROM publisher AS T WHERE T.publisher_name = '1C Company'\n```"}]}, {"id": "train-3379", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the genre name of the genre ID 3."}, {"from": "gpt", "value": "```sql\nSELECT T.genre_name FROM genre AS T WHERE T.id = 3\n```"}]}, {"id": "train-3380", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the game IDs that were released in 2017."}, {"from": "gpt", "value": "```sql\nSELECT T.id FROM game_platform AS T WHERE T.release_year = 2017\n```"}]}, {"id": "train-3381", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the \"Adventure Island\" game released?"}, {"from": "gpt", "value": "```sql\nSELECT T3.release_year FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id WHERE T1.game_name = 'Adventure Island'\n```"}]}, {"id": "train-3382", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games are puzzle genre?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Puzzle'\n```"}]}, {"id": "train-3383", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the games that can be played on the SCD platform."}, {"from": "gpt", "value": "```sql\nSELECT T4.game_name FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id INNER JOIN game_publisher AS T3 ON T1.game_publisher_id = T3.id INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T2.platform_name = 'SCD'\n```"}]}, {"id": "train-3384", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games were published by Acclaim Entertainment?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Acclaim Entertainment'\n```"}]}, {"id": "train-3385", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the publisher of the Chronicles of the Sword game."}, {"from": "gpt", "value": "```sql\nSELECT T3.publisher_name 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 WHERE T1.game_name = 'Chronicles of the Sword'\n```"}]}, {"id": "train-3386", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of games sold in North America on the PS4 platform."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.num_sales * 100000) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T2.region_name = 'North America' AND T4.platform_name = 'PS4'\n```"}]}, {"id": "train-3387", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ID of the most popular platform in Europe."}, {"from": "gpt", "value": "```sql\nSELECT T.game_platform_id FROM ( SELECT T1.game_platform_id, SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T2.region_name = 'Europe' GROUP BY T1.game_platform_id ORDER BY SUM(T1.num_sales) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3388", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the game released in 2011."}, {"from": "gpt", "value": "```sql\nSELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2011\n```"}]}, {"id": "train-3389", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games can be played on the Wii platform?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T2.platform_name = 'Wii'\n```"}]}, {"id": "train-3390", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide any five games and release year under the sports genre."}, {"from": "gpt", "value": "```sql\nSELECT T3.game_name, T1.release_year FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Sports' LIMIT 5\n```"}]}, {"id": "train-3391", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the genre of the 2Xtreme."}, {"from": "gpt", "value": "```sql\nSELECT T2.id FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '2Xtreme'\n```"}]}, {"id": "train-3392", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the platform where the Panzer Tactics can be played."}, {"from": "gpt", "value": "```sql\nSELECT T4.platform_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.game_name = 'Panzer Tactics'\n```"}]}, {"id": "train-3393", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate how many percent of sales in North America is higher than the average sale per region for platform ID 9577."}, {"from": "gpt", "value": "```sql\nSELECT (SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) - AVG(T1.num_sales)) * 100.0 / AVG(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T1.game_platform_id = 9577\n```"}]}, {"id": "train-3394", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which game has the longest name?"}, {"from": "gpt", "value": "```sql\nSELECT T.game_name FROM game AS T ORDER BY LENGTH(T.game_name) DESC LIMIT 1\n```"}]}, {"id": "train-3395", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games were released in 2001?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.id) FROM game_platform AS T WHERE T.release_year = 2001\n```"}]}, {"id": "train-3396", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of sales across all regions?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T.num_sales) * 100000 FROM region_sales t\n```"}]}, {"id": "train-3397", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of games published by a publisher?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T.game_id) AS REAL) / COUNT(DISTINCT T.publisher_id) FROM game_publisher AS T\n```"}]}, {"id": "train-3398", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the first year a game is released?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(T.release_year) FROM game_platform t\n```"}]}, {"id": "train-3399", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the least common game genre?"}, {"from": "gpt", "value": "```sql\nSELECT T.game_name FROM ( SELECT T2.game_name, COUNT(T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id GROUP BY T2.game_name ORDER BY COUNT(T2.id) ASC LIMIT 1 ) t\n```"}]}, {"id": "train-3400", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which is the publisher for the game \"Prism: Light the Way\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.publisher_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = 'Prism: Light the Way'\n```"}]}, {"id": "train-3401", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the platforms that release the most games each year."}, {"from": "gpt", "value": "```sql\nSELECT T1.platform_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id GROUP BY T2.release_year, T1.platform_name ORDER BY COUNT(DISTINCT T3.game_id) DESC\n```"}]}, {"id": "train-3402", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games do not have any sales in Europe?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T2.region_name = 'Europe' AND T1.num_sales = 0\n```"}]}, {"id": "train-3403", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the games that were released in 2006?"}, {"from": "gpt", "value": "```sql\nSELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2006\n```"}]}, {"id": "train-3404", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre of the game \"Mario vs. Donkey Kong\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.genre_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T2.game_name = 'Mario vs. Donkey Kong'\n```"}]}, {"id": "train-3405", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which publisher published the most games?"}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM ( SELECT T1.publisher_name, COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id GROUP BY T1.publisher_name ORDER BY COUNT(DISTINCT T2.game_id) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3406", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the platform games."}, {"from": "gpt", "value": "```sql\nSELECT T2.game_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name = 'Platform'\n```"}]}, {"id": "train-3407", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the years that \"WiiU\" got a new game?"}, {"from": "gpt", "value": "```sql\nSELECT T2.release_year FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id WHERE T1.platform_name = 'WiiU' ORDER BY T2.release_year DESC LIMIT 1\n```"}]}, {"id": "train-3408", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which game has the most sales in Japan?"}, {"from": "gpt", "value": "```sql\nSELECT T5.game_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN game AS T5 ON T4.game_id = T5.id WHERE T1.region_name = 'Japan' ORDER BY T2.num_sales DESC LIMIT 1\n```"}]}, {"id": "train-3409", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the games from the publisher \"Activision\"."}, {"from": "gpt", "value": "```sql\nSELECT T3.game_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.publisher_name = 'Activision'\n```"}]}, {"id": "train-3410", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different publishers have published a game that starts with \"Marvel\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.publisher_id) FROM game_publisher AS T1 INNER JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.game_name LIKE 'Marvel%'\n```"}]}, {"id": "train-3411", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of games are sports?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.genre_name = 'Sports' THEN T2.id ELSE NULL END) AS REAL) * 100 / COUNT(T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id\n```"}]}, {"id": "train-3412", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of game sales between North America and Japan?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) / SUM(CASE WHEN T2.region_name = 'Japan' THEN T1.num_sales ELSE 0 END) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id\n```"}]}, {"id": "train-3413", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year has the most number of video game releases?"}, {"from": "gpt", "value": "```sql\nSELECT T1.release_year FROM ( SELECT T.release_year, COUNT(id) FROM game_platform AS T GROUP BY T.release_year ORDER BY COUNT(T.id) DESC LIMIT 1 ) T1\n```"}]}, {"id": "train-3414", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many video game publishers have Interactive in their names?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.id) FROM publisher AS T WHERE T.publisher_name LIKE '%Interactive%'\n```"}]}, {"id": "train-3415", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 2 platforms with the most sales in North America?"}, {"from": "gpt", "value": "```sql\nSELECT T4.platform_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.region_name = 'North America' ORDER BY T2.num_sales DESC LIMIT 2\n```"}]}, {"id": "train-3416", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games did BMG Interactive Entertainment release in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id WHERE T3.release_year = 2012\n```"}]}, {"id": "train-3417", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the publisher that released the most video games in 2007?"}, {"from": "gpt", "value": "```sql\nSELECT T3.publisher_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T1.release_year = 2007 GROUP BY T3.publisher_name ORDER BY COUNT(DISTINCT T2.game_id) DESC LIMIT 1\n```"}]}, {"id": "train-3418", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many publishers published the Minecraft game?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.publisher_id) FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id WHERE T1.game_name = 'Minecraft'\n```"}]}, {"id": "train-3419", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which publisher has published the most number of Action games?"}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM ( SELECT T4.publisher_name, COUNT(DISTINCT T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id INNER JOIN game_publisher AS T3 ON T2.id = T3.game_id INNER JOIN publisher AS T4 ON T3.publisher_id = T4.id WHERE T1.genre_name = 'Action' GROUP BY T4.publisher_name ORDER BY COUNT(DISTINCT T2.id) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3420", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Sports games did Nintendo publish?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Sports' AND T1.publisher_name = 'Nintendo'\n```"}]}, {"id": "train-3421", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre of the game '2 Games in 1: Sonic Advance & ChuChu Rocket!'?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '2 Games in 1: Sonic Advance & ChuChu Rocket!'\n```"}]}, {"id": "train-3422", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did other regions make positive sales in DS platform?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T1.id = T3.game_platform_id INNER JOIN region AS T4 ON T3.region_id = T4.id WHERE T1.platform_name = 'DS' AND T4.region_name = 'Other' AND T3.num_sales > 0\n```"}]}, {"id": "train-3423", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the games published by American Softworks?"}, {"from": "gpt", "value": "```sql\nSELECT T3.game_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.publisher_name = 'American Softworks'\n```"}]}, {"id": "train-3424", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many strategy games are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T1.genre_name = 'Strategy' THEN T2.id ELSE NULL END) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id\n```"}]}, {"id": "train-3425", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which publisher published Overwatch?"}, {"from": "gpt", "value": "```sql\nSELECT T3.publisher_name 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 WHERE T1.game_name = 'Overwatch'\n```"}]}, {"id": "train-3426", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the genre with the most number of video games?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T2.id = T1.genre_id GROUP BY T2.genre_name ORDER BY COUNT(T1.genre_id) DESC LIMIT 1\n```"}]}, {"id": "train-3427", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of games sold in Europe for game platform ID 26?"}, {"from": "gpt", "value": "```sql\nSELECT T2.num_sales * 100000 AS nums_eur FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T2.game_platform_id = 26 AND T1.region_name = 'Europe'\n```"}]}, {"id": "train-3428", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games were released in the year 2001?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM game_platform AS T WHERE T.release_year = 2001\n```"}]}, {"id": "train-3429", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games include the word 'Box' in their name?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT T.game_name FROM game AS T WHERE T.game_name LIKE '%Box%' )\n```"}]}, {"id": "train-3430", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the three largest numbers of games sold?"}, {"from": "gpt", "value": "```sql\nSELECT T.game_platform_id, SUM(T.num_sales) * 100000 FROM region_sales AS T GROUP BY game_platform_id ORDER BY SUM(T.num_sales) * 100000 DESC LIMIT 3\n```"}]}, {"id": "train-3431", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What year were the first game released?"}, {"from": "gpt", "value": "```sql\nSELECT T.release_year FROM game_platform AS T ORDER BY T.release_year ASC LIMIT 1\n```"}]}, {"id": "train-3432", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What publishers have the word 'Entertainment' in their name?"}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM publisher AS T WHERE T.publisher_name LIKE '%Entertainment%'\n```"}]}, {"id": "train-3433", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the name of all adventure games."}, {"from": "gpt", "value": "```sql\nSELECT T2.game_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name = 'Adventure'\n```"}]}, {"id": "train-3434", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of all games published by 'Pioneer LDC'."}, {"from": "gpt", "value": "```sql\nSELECT T3.game_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.publisher_name = 'Pioneer LDC'\n```"}]}, {"id": "train-3435", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the name of all the games published for the 'SCD' platform."}, {"from": "gpt", "value": "```sql\nSELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T4.platform_name = 'SCD'\n```"}]}, {"id": "train-3436", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of all games published in Japan."}, {"from": "gpt", "value": "```sql\nSELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN region_sales AS T4 ON T3.id = T4.game_platform_id INNER JOIN region AS T5 ON T4.region_id = T5.id WHERE T5.region_name = 'Japan'\n```"}]}, {"id": "train-3437", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What genres are the games published by 'Agatsuma Entertainment'?"}, {"from": "gpt", "value": "```sql\nSELECT T4.genre_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T1.publisher_name = 'Agatsuma Entertainment'\n```"}]}, {"id": "train-3438", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games are not of the genres 'Role-Playing', 'Shooter' and 'Simulation'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name NOT IN ('Role-Playing', 'Shooter', 'Simulation')\n```"}]}, {"id": "train-3439", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate, by region, which platform has sold the most games."}, {"from": "gpt", "value": "```sql\nSELECT T.region_name FROM ( SELECT T1.platform_name, T4.region_name, SUM(T3.num_sales) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T1.id = T3.game_platform_id INNER JOIN region AS T4 ON T3.region_id = T4.id GROUP BY T1.platform_name, T4.region_name ORDER BY SUM(T3.num_sales) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3440", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which publisher has published the most games in the 'Puzzle' genre?"}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM ( SELECT T1.publisher_name, COUNT(T3.id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Puzzle' GROUP BY T1.publisher_name ORDER BY COUNT(T3.id) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3441", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which game has sold the fewest units?"}, {"from": "gpt", "value": "```sql\nSELECT T.game_name FROM ( SELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN region_sales AS T4 ON T3.id = T4.game_platform_id ORDER BY T4.num_sales LIMIT 1 ) t\n```"}]}, {"id": "train-3442", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which publisher has published the game 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3'?"}, {"from": "gpt", "value": "```sql\nSELECT T1.publisher_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3'\n```"}]}, {"id": "train-3443", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which regions has the game 'Pengo' been sold?"}, {"from": "gpt", "value": "```sql\nSELECT T5.region_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN region_sales AS T4 ON T3.id = T4.game_platform_id INNER JOIN region AS T5 ON T4.region_id = T5.id WHERE T1.game_name = 'Pengo'\n```"}]}, {"id": "train-3444", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List by name all the games released in the year 2010."}, {"from": "gpt", "value": "```sql\nSELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id WHERE T3.release_year = '2010'\n```"}]}, {"id": "train-3445", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average game sales for the PS2 platform."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.num_sales * 100000) / COUNT(T1.id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T2.id = T3.game_platform_id WHERE T1.platform_name = 'PS2'\n```"}]}, {"id": "train-3446", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of games published by 'Brash Entertainment'?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.publisher_name = 'Brash Entertainment' THEN T2.game_id ELSE NULL END) AS REAL) * 100 / COUNT(T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id\n```"}]}, {"id": "train-3447", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of games sold in region ID 1?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T.num_sales * 100000) FROM region_sales AS T WHERE T.region_id = 1\n```"}]}, {"id": "train-3448", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many FIFA games are there across all platforms?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT T.game_name FROM game AS T WHERE T.game_name LIKE '%FIFA%' )\n```"}]}, {"id": "train-3449", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which platform is the most popular in Europe?"}, {"from": "gpt", "value": "```sql\nSELECT T.platform_name FROM ( SELECT T4.platform_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.region_name = 'Europe' ORDER BY T2.num_sales DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3450", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the publisher of the game 2002 FIFA World Cup?"}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN game AS T3 ON T1.game_id = T3.id WHERE T3.game_name = '2002 FIFA World Cup'\n```"}]}, {"id": "train-3451", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What platform is the game 3Xtreme available on?"}, {"from": "gpt", "value": "```sql\nSELECT T2.platform_name FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id INNER JOIN game_publisher AS T3 ON T1.game_publisher_id = T3.id INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T4.game_name = '3Xtreme'\n```"}]}, {"id": "train-3452", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What genre is the game 2010 FIFA World Cup South Africa?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '2010 FIFA World Cup South Africa'\n```"}]}, {"id": "train-3453", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region has the highest number of games sold on all platforms?"}, {"from": "gpt", "value": "```sql\nSELECT T.region_name FROM ( SELECT T2.region_name, SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id GROUP BY T4.platform_name ORDER BY SUM(T1.num_sales) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3454", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games were sold on PS3 platform in Japan?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.num_sales * 100000) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T2.region_name = 'Japan' AND T4.platform_name = 'PS3'\n```"}]}, {"id": "train-3455", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of games that were released in 2007?"}, {"from": "gpt", "value": "```sql\nSELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2007\n```"}]}, {"id": "train-3456", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games were published by Activision?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN game AS T3 ON T1.game_id = T3.id WHERE T2.publisher_name = 'Activision'\n```"}]}, {"id": "train-3457", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the release year of the game with more than 200000 sales in Japan."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.release_year FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id WHERE T2.num_sales * 100000 > 200000 AND T1.region_name = 'Japan'\n```"}]}, {"id": "train-3458", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2010, how many PS3 games were released?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'PS3' AND T2.release_year = 2010\n```"}]}, {"id": "train-3459", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the publisher who has published the most games of all time."}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name ORDER BY COUNT(DISTINCT T1.game_id) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-3460", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shooter games are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Shooter'\n```"}]}, {"id": "train-3461", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of games that were released on PS4 in 2014 among all platforms?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.platform_name = 'PS4' THEN T3.game_id ELSE NULL END) AS REAL) * 100 / COUNT(T3.game_id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id INNER JOIN game_publisher AS T3 ON T1.game_publisher_id = T3.id WHERE T1.release_year = 2014\n```"}]}, {"id": "train-3462", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much are the sales of the games in region ID 4?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.region_id = 4\n```"}]}, {"id": "train-3463", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the game platform IDs of games with a region ID of 1."}, {"from": "gpt", "value": "```sql\nSELECT T.game_platform_id FROM region_sales AS T WHERE T.region_id = 1\n```"}]}, {"id": "train-3464", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference between sales of games from region ID 2 and region ID 3."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T.region_id = 2 THEN T.num_sales ELSE 0 END) - SUM(CASE WHEN T.region_id = 3 THEN T.num_sales ELSE 0 END) FROM region_sales t\n```"}]}, {"id": "train-3465", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the platform IDs of the games released in 2007."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T.platform_id FROM game_platform AS T WHERE T.release_year = 2007\n```"}]}, {"id": "train-3466", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the game publisher IDs of the games with a platform ID of 16."}, {"from": "gpt", "value": "```sql\nSELECT T.game_publisher_id FROM game_platform AS T WHERE T.platform_id = 16\n```"}]}, {"id": "train-3467", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the number of game publisher IDs for games released in 1984."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.game_publisher_id) FROM game_platform AS T WHERE T.release_year = 1984\n```"}]}, {"id": "train-3468", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the platform IDs of the games with a region ID of 3."}, {"from": "gpt", "value": "```sql\nSELECT T2.id FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id WHERE T1.region_id = 3\n```"}]}, {"id": "train-3469", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the sales made by the games in Japan region?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.region_name = 'Japan' THEN T1.num_sales ELSE 0 END) AS nums FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id\n```"}]}, {"id": "train-3470", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many game publisher IDs have published games on the X360 platform?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.game_publisher_id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T2.platform_name = 'X360'\n```"}]}, {"id": "train-3471", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of the platforms for games released in 2000."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.platform_name FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T1.release_year = 2000\n```"}]}, {"id": "train-3472", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find out the difference between the number of publishers who released the games on the PS3 and X360."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T2.platform_name = 'PS3' THEN T1.game_publisher_id ELSE NULL END) - COUNT(CASE WHEN T2.platform_name = 'X360' THEN T1.game_publisher_id ELSE NULL END) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id\n```"}]}, {"id": "train-3473", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the game IDs of the games published by Bethesda Softworks?"}, {"from": "gpt", "value": "```sql\nSELECT T1.game_id FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Bethesda Softworks'\n```"}]}, {"id": "train-3474", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total number of IDs for the game published by Capcom and Sony Computer Entertainment."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name IN ('Capcom', 'Sony Computer Entertainment')\n```"}]}, {"id": "train-3475", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre of the game \"Grand Theft Auto V\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Grand Theft Auto V'\n```"}]}, {"id": "train-3476", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the names of the games in the racing genre."}, {"from": "gpt", "value": "```sql\nSELECT T1.game_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Racing'\n```"}]}, {"id": "train-3477", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the number of games in the fighting genre."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Fighting'\n```"}]}, {"id": "train-3478", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the genres of games published by the publisher with an ID of 464?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id INNER JOIN game_publisher AS T3 ON T1.id = T3.game_id WHERE T3.publisher_id = 464\n```"}]}, {"id": "train-3479", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find out the platform of the game \"Final Fantasy XIII-2\"."}, {"from": "gpt", "value": "```sql\nSELECT T4.platform_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.game_name = 'Final Fantasy XIII-2'\n```"}]}, {"id": "train-3480", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total sales made by the games released in 2000."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id WHERE T2.release_year = 2000\n```"}]}, {"id": "train-3481", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference in sales between the games released in 1990 and 2000."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.release_year = 2000 THEN T1.num_sales ELSE 0 END) - SUM(CASE WHEN T2.release_year = 1990 THEN T1.num_sales ELSE 0 END) FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id\n```"}]}, {"id": "train-3482", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the platform IDs of records released in 2006?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T.platform_id FROM game_platform AS T WHERE T.release_year = 2006\n```"}]}, {"id": "train-3483", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compute the average number of sales in region ID 3."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T.num_sales * 100000) FROM region_sales AS T WHERE T.region_id = 3\n```"}]}, {"id": "train-3484", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year did the record ID 19 with game publisher ID 6657 released?"}, {"from": "gpt", "value": "```sql\nSELECT T.release_year FROM game_platform AS T WHERE T.game_publisher_id = 6657 AND T.id = 19\n```"}]}, {"id": "train-3485", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total sales in all regions with game platform ID 66."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.game_platform_id = 66\n```"}]}, {"id": "train-3486", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the game name of the game ID 44."}, {"from": "gpt", "value": "```sql\nSELECT T.game_name FROM game AS T WHERE T.id = 44\n```"}]}, {"id": "train-3487", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the games available on Wii."}, {"from": "gpt", "value": "```sql\nSELECT T4.game_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T1.platform_name = 'Wii'\n```"}]}, {"id": "train-3488", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of games released in 2015."}, {"from": "gpt", "value": "```sql\nSELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2015\n```"}]}, {"id": "train-3489", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of adventure games released in 2005?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.id) FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Adventure' AND T1.release_year = 2005\n```"}]}, {"id": "train-3490", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the company that produced the game titled Adventure Time: Explore the Dungeon Because I Don't Know!?"}, {"from": "gpt", "value": "```sql\nSELECT T3.publisher_name 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 WHERE T1.game_name = 'Adventure Time: Explore the Dungeon Because I Don''t Know!'\n```"}]}, {"id": "train-3491", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the game platform ID and region name where the games achieved 20000 sales and below."}, {"from": "gpt", "value": "```sql\nSELECT T2.game_platform_id, T1.region_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T2.num_sales * 100000 <= 20000\n```"}]}, {"id": "train-3492", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of game produced by 505 Games in 2006."}, {"from": "gpt", "value": "```sql\nSELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN publisher AS T4 ON T2.publisher_id = T4.id WHERE T4.publisher_name = '505 Games' AND T1.release_year = 2006\n```"}]}, {"id": "train-3493", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre of the game ID 119?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.id = 119\n```"}]}, {"id": "train-3494", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the game IDs of the games produced by Abylight."}, {"from": "gpt", "value": "```sql\nSELECT T1.game_id FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Abylight'\n```"}]}, {"id": "train-3495", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which region where a game had the lowest number of sales?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.region_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id ORDER BY T2.num_sales LIMIT 1\n```"}]}, {"id": "train-3496", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the name of strategy games."}, {"from": "gpt", "value": "```sql\nSELECT T1.game_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Strategy'\n```"}]}, {"id": "train-3497", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In what platform does the game ID 178 available?"}, {"from": "gpt", "value": "```sql\nSELECT T3.platform_name FROM game_publisher AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.game_publisher_id INNER JOIN platform AS T3 ON T2.platform_id = T3.id WHERE T1.game_id = 178\n```"}]}, {"id": "train-3498", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the genre of the following game titled 'Airlock' , 'Airline Tycoon' , and 'Airblade', respectively."}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name IN ('Airlock', 'Airline Tycoon', 'Airblade')\n```"}]}, {"id": "train-3499", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total number of sales in North America."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.num_sales) * 100000 AS nums FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'North America'\n```"}]}, {"id": "train-3500", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down at least five publishers of the games with number of sales less than 10000."}, {"from": "gpt", "value": "```sql\nSELECT T.publisher_name FROM ( SELECT DISTINCT T5.publisher_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHERE T1.region_name = 'North America' AND T2.num_sales * 100000 < 10000 LIMIT 5 ) t\n```"}]}, {"id": "train-3501", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the platform ID of the game titled Airborne Troops: Countdown to D-Day."}, {"from": "gpt", "value": "```sql\nSELECT T1.platform_id FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = 'Airborne Troops: Countdown to D-Day'\n```"}]}, {"id": "train-3502", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games available on PSP were released in 2004?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'PSP' AND T2.release_year = 2004\n```"}]}, {"id": "train-3503", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre of the game titled '999: Nine Hours, Nine Persons, Nine Doors' ?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '999: Nine Hours, Nine Persons, Nine Doors'\n```"}]}, {"id": "train-3504", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the game ID 156 released?"}, {"from": "gpt", "value": "```sql\nSELECT T1.release_year FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id WHERE T2.game_id = 156\n```"}]}, {"id": "train-3505", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the diffrence between the number of games produced by Culture Brain that can be played on SNES and DS?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T1.platform_name = 'SNES' THEN T3.game_id ELSE NULL END) - COUNT(CASE WHEN T1.platform_name = 'DS' THEN T3.game_id ELSE NULL END) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id INNER JOIN publisher AS T4 ON T3.publisher_id = T4.id WHERE T4.publisher_name = 'Culture Brain'\n```"}]}, {"id": "train-3506", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In games that can be played on Wii, what is the percentage of games released in 2007?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.release_year = 2007 THEN T3.game_id ELSE NULL END) AS REAL) * 100 / COUNT(T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'Wii'\n```"}]}, {"id": "train-3507", "db_id": "video_games", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among games sold in Europe, list the platform ID of games with sales lesser than 30% of the average number of sales."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.platform_id FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id WHERE T1.region_name = 'Europe' AND T2.num_sales * 100 * 100000 < ( SELECT AVG(T2.num_sales * 100000) * 30 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Europe' )\n```"}]}, {"id": "train-3508", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many authors are affiliated with University of California Berkeley?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Id) FROM Author WHERE Affiliation = 'University of California Berkeley'\n```"}]}, {"id": "train-3509", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the paper \"Stitching videos streamed by mobile phones in real-time\" about?"}, {"from": "gpt", "value": "```sql\nSELECT Keyword FROM Paper WHERE Title = 'Stitching videos streamed by mobile phones in real-time'\n```"}]}, {"id": "train-3510", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of the papers published in the journal \"Concepts in Magnetic Resonance Part A\" in 2008."}, {"from": "gpt", "value": "```sql\nSELECT T2.Title FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Concepts in Magnetic Resonance Part A' AND T2.Year = 2008\n```"}]}, {"id": "train-3511", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers were published in the journal \"Concepts in Magnetic Resonance Part A\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Id) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Concepts in Magnetic Resonance Part A'\n```"}]}, {"id": "train-3512", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the url of the journal in which the paper \"Area Effects in Cepaea\" was published?"}, {"from": "gpt", "value": "```sql\nSELECT T1.HomePage FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T2.Title = 'Area Effects in Cepaea'\n```"}]}, {"id": "train-3513", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the papers published in the journal \"Molecular Brain\", how many of them were published in the year 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Id) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T2.Year = 2011 AND T1.FullName = 'Molecular Brain'\n```"}]}, {"id": "train-3514", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers were published in 2011 in the journal whose short name is \"Mol Brain\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Id) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T2.Year = 2011 AND T1.ShortName = 'Mol Brain'\n```"}]}, {"id": "train-3515", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many authors does the paper \"Equation Solving in Geometrical Theories\" have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.AuthorId) FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T2.Title = 'Equation Solving in Geometrical Theories'\n```"}]}, {"id": "train-3517", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the authors of the paper \"Stitching videos streamed by mobile phones in real-time\", how many of them are affiliated with Cairo Microsoft Innovation Lab?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.AuthorId) FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Affiliation = 'University of Tokyo' AND T2.Title = 'FIBER: A Generalized Framework for Auto-tuning Software'\n```"}]}, {"id": "train-3518", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of the paper whose authors include Klaus Zimmermann."}, {"from": "gpt", "value": "```sql\nSELECT T2.Title FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Name = 'Klaus Zimmermann'\n```"}]}, {"id": "train-3519", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which author of the paper \"Incremental Extraction of Keyterms for Classifying Multilingual Documents in the Web\" is affiliated with National Taiwan University Department of Computer Science and Information Engineering Taiwan?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T2.Title = 'Incremental Extraction of Keyterms for Classifying Multilingual Documents in the Web' AND T1.Affiliation = 'National Taiwan University Department of Computer Science and Information Engineering Taiwan'\n```"}]}, {"id": "train-3520", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the paper published in 1995 and whose author included Thomas Wiegand?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Title FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Name = 'Thomas Wiegand' AND T2.Year = 1995\n```"}]}, {"id": "train-3521", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers whose authors include Thomas Wiegand were published in 1995?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Title) FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Name = 'Thomas Wiegand' AND T2.Year = 1995\n```"}]}, {"id": "train-3522", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of papers published in the journal \"Molecular Brain\" every year from 2008 to 2011?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.Id) AS REAL) / COUNT(DISTINCT T2.Year) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Molecular Brain' AND T2.Year BETWEEN 2008 AND 2011\n```"}]}, {"id": "train-3523", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more papers in total were published in the journal \"Cases Journal\" than in the journal \"Molecular Brain\" in percentage?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.FullName = 'Cases Journal' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.FullName = 'Molecular Brain' THEN 1 ELSE 0 END) AS DIFF FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId\n```"}]}, {"id": "train-3524", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many journals have a word \"computing\" in its full name?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Id) FROM Journal WHERE FullName LIKE '%computing%'\n```"}]}, {"id": "train-3525", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Enumerate the paper and author ID of authors with affiliation with Cairo Microsoft Innovation Lab."}, {"from": "gpt", "value": "```sql\nSELECT PaperId, AuthorId FROM PaperAuthor WHERE Affiliation LIKE 'Cairo Microsoft Innovation Lab%'\n```"}]}, {"id": "train-3526", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the short name and full name of conference uses the homepage \"http://www.informatik.uni-trier.de/~ley/db/conf/ices/index.html\"?"}, {"from": "gpt", "value": "```sql\nSELECT ShortName, FullName FROM Conference WHERE HomePage = 'http://www.informatik.uni-trier.de/~ley/db/conf/ices/index.html'\n```"}]}, {"id": "train-3527", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the author ID of authors with a name of \"Peter\"."}, {"from": "gpt", "value": "```sql\nSELECT AuthorId FROM PaperAuthor WHERE Name = 'Peter'\n```"}]}, {"id": "train-3528", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the title of papers with a conference ID from 160 to 170, include their conference short name."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Title, T2.ShortName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.ConferenceId BETWEEN 160 AND 170\n```"}]}, {"id": "train-3529", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title and journal homepage of the latest published paper?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Title, T2.HomePage FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id ORDER BY T1.Year DESC LIMIT 1\n```"}]}, {"id": "train-3530", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In year 1999, list the titles and conference's short name of paper authored by someone named \"Philip\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title, T3.ShortName FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Conference AS T3 ON T1.ConferenceId = T3.Id WHERE T1.Year = 1999 AND T2.Name LIKE 'Philip%'\n```"}]}, {"id": "train-3531", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number and conference's homepage of papers held in a conference with an ID of 187 during 1990 to 2000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ConferenceId), T1.HomePage FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T2.Year BETWEEN 1990 AND 2000 AND T2.ConferenceId = 187\n```"}]}, {"id": "train-3532", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the paper published in 2003 by an author with affiliation with Department of Network Science, Graduate School of Information Systems, The University of Electro-Communications?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Title FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Affiliation = 'Department of Network Science, Graduate School of Information Systems, The University of Electro-Communications' AND T2.Year = 2003\n```"}]}, {"id": "train-3533", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the authors and journal short name of the papers with \"chemiluminescence\" in its title and has a journal ID from 245 to 250."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name, T3.ShortName FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id WHERE T1.JournalId BETWEEN 245 AND 250 AND T1.Title LIKE '%chemiluminescence%'\n```"}]}, {"id": "train-3534", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the papers with conference ID of 0, list down the authors of papers with a journal ID less than 100."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.ConferenceId = 0 AND T1.JournalId < 100\n```"}]}, {"id": "train-3535", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title and author ID of paper with conference ID less than 100 in year 2006?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Title, T2.AuthorId FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Year = 2006 AND T1.ConferenceId < 100\n```"}]}, {"id": "train-3536", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the paper IDs of papers presented in conferences has a homepage starts with \"http://www.informatik.uni-trier.de/~ley/db/conf/\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Id FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.HomePage LIKE 'http://www.informatik.uni-trier.de/~ley/db/conf/%'\n```"}]}, {"id": "train-3537", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the journal homepages and author ID of the papers published in 2000 to 2005 with a word \"social\" in its title?"}, {"from": "gpt", "value": "```sql\nSELECT T3.HomePage, T2.AuthorId FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id WHERE T1.Year BETWEEN 2000 AND 2005 AND T1.Title LIKE '%SOCIAL%'\n```"}]}, {"id": "train-3538", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the author ID and their affiliations of authors of the papers with a journal ID of 0 and published in 2009."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.AuthorId, T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.JournalId = 0 AND T1.Year = 2009 AND T2.Affiliation IS NOT NULL\n```"}]}, {"id": "train-3539", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.ConferenceId = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.ConferenceId) FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.JournalId BETWEEN 200 AND 300 AND T2.ShortName LIKE 'A%'\n```"}]}, {"id": "train-3540", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Within the year of 2001 to 2010, find the paper published rate of 2001."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN Year = 2001 THEN 1 ELSE 0 END) AS REAL) / COUNT(Id) FROM Paper WHERE Year >= 2001 AND Year < 2011\n```"}]}, {"id": "train-3541", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the conference full name of \"ICWE\" and it's homepage address."}, {"from": "gpt", "value": "```sql\nSELECT FullName, Homepage FROM Conference WHERE ShortName = 'ICWE'\n```"}]}, {"id": "train-3542", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between \"Standford University\" and \"Massachusetts Institute of Technolgy\", which organization had affiliated with more author.?"}, {"from": "gpt", "value": "```sql\nSELECT Affiliation FROM Author WHERE Affiliation IN ('Stanford University', 'Massachusetts Institute of Technology') GROUP BY Affiliation ORDER BY COUNT(Id) DESC LIMIT 1\n```"}]}, {"id": "train-3543", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of author with affiliation and without affiliation?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN Affiliation IS NULL THEN 1 ELSE 0 END) AS REAL) / COUNT(*) FROM Author\n```"}]}, {"id": "train-3544", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the author's name and IDs who are affiliated with Univeristiy of Oulu."}, {"from": "gpt", "value": "```sql\nSELECT Name, id FROM Author WHERE Affiliation = 'University of Oulu'\n```"}]}, {"id": "train-3545", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the title and affiliation of the preprinted paper written by \"Roger J.Marshal\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title, T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Roger J. Marshall' AND T1.ConferenceID = 0 AND T1.JournalID = 0\n```"}]}, {"id": "train-3546", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the paper ID, title, published year and journal's full name of the paper which included the most number in author."}, {"from": "gpt", "value": "```sql\nSELECT T1.Id, T1.Title, T1.Year, T3.FullName FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id GROUP BY T2.AuthorId ORDER BY COUNT(T2.AuthorId) DESC LIMIT 1\n```"}]}, {"id": "train-3547", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the paper title, published year, conference's short name and included author names in the paper ID of 15."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Title, T1.Year, T3.ShortName, T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Conference AS T3 ON T1.ConferenceId = T3.Id WHERE T1.Id = 15\n```"}]}, {"id": "train-3548", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among author ID of under 1000, who published the paper in affiliation with Zurich, ETH, provide paper ID, year and keyword if any."}, {"from": "gpt", "value": "```sql\nSELECT T2.Id, T2.Year, T2.Keyword FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.AuthorId < 1000 AND T1.Affiliation = 'Zurich, ETH'\n```"}]}, {"id": "train-3550", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the author name, affiliation, jounal short name and full name of the paper \"Decreased Saliva Secretion and Down-Regulation of AQP5 in Submandibular Gland in Irradiated Rats\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name, T2.Affiliation, T3.ShortName, T3.FullName FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id WHERE T1.Title = 'Decreased Saliva Secretion and Down-Regulation of AQP5 in Submandibular Gland in Irradiated Rats'\n```"}]}, {"id": "train-3551", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the paper title and journal ID which were published under the conference name of \"International Symposium of Robotics Research\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Title, T2.JournalId FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T1.FullName = 'International Symposium of Robotics Research' AND T2.Year = 2003\n```"}]}, {"id": "train-3552", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the title, year and keyword of the paper which were written by the author ID of 661002 with the affiliation of \"Scientific Computing and Imaging Institute, University of Utah, UT 84112, USA\" organization."}, {"from": "gpt", "value": "```sql\nSELECT T2.Title, T2.Year, T2.Keyword FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.AuthorId = 661002 AND T1.Affiliation = 'Scientific Computing and Imaging Institute, University of Utah, UT 84112, USA'\n```"}]}, {"id": "train-3553", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the differences of the paper number with the journal name of IWC in 2000 and 2010."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Year = 2000 THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.Year = 2010 THEN 1 ELSE 0 END) AS DIFF FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.ShortName = 'IWC'\n```"}]}, {"id": "train-3554", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide any four valid Journal ID along with short name and full name of the papers which were made in 2013."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.JournalId, T1.ShortName, T1.FullName FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T2.Year = 2013 AND T2.JournalId != 0 AND T2.JournalId != -1 LIMIT 4\n```"}]}, {"id": "train-3555", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Under the conference name of MICRO, calculate how many more paper is needed to published in 1971 to 1980 in average by yearly to get equivalent to the number of paper from 1991 to 2000. Write down the title and author name of the paper that were actually published during 1971 to 1980 with the conference name with MICRO."}, {"from": "gpt", "value": "```sql\nSELECT T2.title, T3.name, T1.FullName FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.id = T2.ConferenceId INNER JOIN PaperAuthor AS T3 ON T1.id = T3.PaperId WHERE T1.ShortName = 'MICRO' AND T2.Year BETWEEN '1971' AND '1980'\n```"}]}, {"id": "train-3556", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the papers are preprinted or not published?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Id) FROM Paper WHERE Year = 0\n```"}]}, {"id": "train-3557", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the full name of conference for paper \"The Dissimilarity Representation as a Tool for Three-Way Data Classification: A 2D Measure\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'The Dissimilarity Representation as a Tool for Three-Way Data Classification: A 2D Measure'\n```"}]}, {"id": "train-3558", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the homepage address for paper \"Energy-efficiency bounds for noise-tolerant dynamic circuits\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.HomePage FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'Energy-efficiency bounds for noise-tolerant dynamic circuits'\n```"}]}, {"id": "train-3559", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the name of authors for paper with id from 101 to 105."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Id > 100 AND T1.Id < 106\n```"}]}, {"id": "train-3560", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the papers published in 2009, pick 10 and list down the conference's short name of these papers."}, {"from": "gpt", "value": "```sql\nSELECT T2.PaperId, T4.ShortName FROM Author AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.AuthorId INNER JOIN Paper AS T3 ON T2.PaperId = T3.Id INNER JOIN Conference AS T4 ON T3.ConferenceId = T4.Id WHERE T3.Year = 2009 LIMIT 10\n```"}]}, {"id": "train-3561", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down homepage URL of journal for paper \"364: Induction of Mixed Chimerism and Transplantation Tolerance in a Non-Human Primate Lung Allograft Model: Early Results\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.HomePage FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Title = '364: Induction of Mixed Chimerism and Transplantation Tolerance in a Non-Human Primate Lung Allograft Model: Early Results'\n```"}]}, {"id": "train-3562", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all paper name that were published in conference \"International Conference on Internet Computing\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.FullName = 'International Conference on Internet Computing' AND T1.Title <> ''\n```"}]}, {"id": "train-3564", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many authors have written paper \"145 GROWTH HORMONE RECEPTORS AND THE ONSET OF HYPERINSULINEMIA IN THE OBESE ZUCKER RAT: \"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.Name) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = '145 GROWTH HORMONE RECEPTORS AND THE ONSET OF HYPERINSULINEMIA IN THE OBESE ZUCKER RAT: '\n```"}]}, {"id": "train-3565", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the co-authors for Jei Keon Chae and what is the title of paper written by them?"}, {"from": "gpt", "value": "```sql\nSELECT T2.AuthorId, T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Jei Keon Chae'\n```"}]}, {"id": "train-3567", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers were preprinted between the years 1990 and 2000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM Paper WHERE Year BETWEEN '1990' AND '2000' AND ConferenceId = 0 AND JournalId = 0\n```"}]}, {"id": "train-3568", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of all authors affiliated with Birkbeck University of London."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Author WHERE Affiliation = 'Birkbeck University of London'\n```"}]}, {"id": "train-3569", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the short name of all conferences whose full name begins with International Symposium."}, {"from": "gpt", "value": "```sql\nSELECT ShortName FROM Conference WHERE FullName LIKE 'International Symposium%'\n```"}]}, {"id": "train-3570", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many journals do not have a website?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(HomePage) FROM Journal WHERE HomePage = ''\n```"}]}, {"id": "train-3571", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List author name for articles that are preprinted but not published."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Year = 0\n```"}]}, {"id": "train-3572", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List author affiliation for papers whose topic is Quantum Physics."}, {"from": "gpt", "value": "```sql\nSELECT T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Keyword = 'Quantum Physics'\n```"}]}, {"id": "train-3573", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify by conference full name all papers in which a journal was not published but a conference."}, {"from": "gpt", "value": "```sql\nSELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.ConferenceId != 0 AND T1.JournalId = 0 AND T1.Year != 0\n```"}]}, {"id": "train-3574", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify by papers title those in which conferences have been published that do not have a website.."}, {"from": "gpt", "value": "```sql\nSELECT T2.Title FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T1.HomePage = '' AND T2.Title <> ''\n```"}]}, {"id": "train-3575", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify by publication year in the paper database all journals that don't have short name."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Year, FullName FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.ShortName = ''\n```"}]}, {"id": "train-3577", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the name of all the journals published in the paper database in the year 2001."}, {"from": "gpt", "value": "```sql\nSELECT T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Year = 2001 AND T1.ConferenceId > 0 AND T1.JournalId > 0\n```"}]}, {"id": "train-3578", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the co-authors of the paper titled 'Particle identification using the time-over-threshold method in the ATLAS Transition Radiation Tracker'?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T2.Title = 'Particle identification using the time-over-threshold method in the ATLAS Transition Radiation Tracker'\n```"}]}, {"id": "train-3579", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In how many papers and in what years was the International Conference on Database Theory published?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Id) AS PAPER, COUNT(DISTINCT T1.Year) AS YEARS FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE year != 0 AND T2.FullName = 'International Conference on Database Theory'\n```"}]}, {"id": "train-3580", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the journals that are published in the database papers whose topic is Sustainability?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Keyword = 'Sustainability'\n```"}]}, {"id": "train-3581", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the authors of papers in which conferences have been published whose full name includes the word Workshop?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Conference AS T3 ON T1.ConferenceId = T3.Id WHERE T3.FullName LIKE '%Workshop%'\n```"}]}, {"id": "train-3582", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of authors of the paper about Charged particle multiplicity are affiliated with INFN?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(CASE WHEN T1.Affiliation LIKE '%INFN%' THEN 1 ELSE 0 END)) AS REAL) * 100 / COUNT(T2.Id) FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T2.Title LIKE '%Charged particle multiplicity%'\n```"}]}, {"id": "train-3583", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of journals whose short name begins with ANN were published in the paper database in 1989?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(CASE WHEN T1.ShortName LIKE 'ANN%' THEN 1 ELSE 0 END)) AS REAL) * 100 / COUNT(T1.ShortName) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T2.Year = 1989\n```"}]}, {"id": "train-3584", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many authors were associated with the Microsoft Research when paper number 1 was written?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(PaperId) FROM PaperAuthor WHERE Affiliation LIKE '%Microsoft Research%'\n```"}]}, {"id": "train-3585", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the topic of the article \"A Formal Approach to Service Component Architecture\" and when was it published?"}, {"from": "gpt", "value": "```sql\nSELECT Keyword, Year FROM Paper WHERE Title = 'A Formal Approach to Service Component Architecture'\n```"}]}, {"id": "train-3586", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of papers were preprinted after the year 2000?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN Year > 2000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Id) FROM Paper\n```"}]}, {"id": "train-3587", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the authors of the paper \"Hypermethylation of the TPEF/HPP1 Gene in Primary and Metastatic Colorectal Cancers\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Hypermethylation of the TPEF/HPP1 Gene in Primary and Metastatic Colorectal Cancers'\n```"}]}, {"id": "train-3588", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the journal that published the paper \"Multiple paternity in a natural population of a salamander with long-term sperm storage\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Title = 'Multiple paternity in a natural population of a salamander with long-term sperm storage'\n```"}]}, {"id": "train-3589", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers were in the journal \"Iet Software/iee Proceedings - Software\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.JournalId) FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T2.FullName = 'Iet Software/iee Proceedings - Software'\n```"}]}, {"id": "train-3590", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the conference where paper number 5 was published?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Id = 5\n```"}]}, {"id": "train-3591", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of any two papers that Jundu has written."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name LIKE 'Jun du%' LIMIT 2\n```"}]}, {"id": "train-3592", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the paper that was written by Cheng Huang and affiliated with Microsoft?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Cheng Huang' AND T2.Affiliation = 'Microsoft'\n```"}]}, {"id": "train-3593", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the full name of the conference where one of the papers of Jean-luc Hainaut were published."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.FullName FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Conference AS T3 ON T1.ConferenceId = T3.Id WHERE T2.Name = 'Jean-luc Hainaut' LIMIT 1\n```"}]}, {"id": "train-3594", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the three journals that the papers written by Andrew Cain were published in? Please provide your answer with the full name of each journal."}, {"from": "gpt", "value": "```sql\nSELECT T3.FullName FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id WHERE T2.Name = 'Andrew Cain'\n```"}]}, {"id": "train-3595", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all of the associations that the authors of the paper \"FIBER: A Generalized Framework for Auto-tuning Software\" are affiliated with."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'FIBER: A Generalized Framework for Auto-tuning Software'\n```"}]}, {"id": "train-3596", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the titles of any two papers that are either preprinted or unpublished along with the full name of the journal to which those papers belong."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title, T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Year < 1 LIMIT 2\n```"}]}, {"id": "train-3597", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the journal's short and full names that feature papers on the \"Materials\" topic?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ShortName, T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Keyword LIKE '%Materials%'\n```"}]}, {"id": "train-3598", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of authors affiliated with the University of Oxford in alphabetical order."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Author WHERE Affiliation = 'University of Oxford' ORDER BY Name ASC\n```"}]}, {"id": "train-3599", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the short name and home page URL of all the international conferences on artificial intelligence."}, {"from": "gpt", "value": "```sql\nSELECT ShortName, HomePage FROM Conference WHERE FullName LIKE 'International Conference on Artificial Intelligence%'\n```"}]}, {"id": "train-3600", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the names of papers which are published in the year 1996."}, {"from": "gpt", "value": "```sql\nSELECT Title FROM Paper WHERE year = 1996\n```"}]}, {"id": "train-3601", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the title and author's name of papers published in the 2007 Neoplasia journal."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title, T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id WHERE T3.FullName = 'Neoplasia' AND T1.Year = 2007\n```"}]}, {"id": "train-3602", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the authors affiliated with Soongsil University, list the authors' names and papers published during the year 2000."}, {"from": "gpt", "value": "```sql\nSELECT T2.Title, T1.Name FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Affiliation = 'Soongsil University' AND T2.Year = 2000\n```"}]}, {"id": "train-3603", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the title and author's name of the papers published between 2000 and 2005 that include the topic optical properties."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title, T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Keyword LIKE '%optical properties%' AND T1.Year BETWEEN 2000 AND 2005 AND T1.Title <> ''\n```"}]}, {"id": "train-3604", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of papers published in the World Computer Congress each year?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.FullName = 'International Congress Series' THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.Id) AS Div1, T1.Year FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id GROUP BY T1.YEAR HAVING Div1 != 0\n```"}]}, {"id": "train-3605", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the Title and author's name of the books that were preprint in 1997."}, {"from": "gpt", "value": "```sql\nSELECT 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 <> ''\n```"}]}, {"id": "train-3606", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the titles of papers published by Adam Jones and the journal name in which it was published from 2005 to 2010."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id WHERE T2.Name = 'Adam Jones' AND T1.Year BETWEEN 2005 AND 2010\n```"}]}, {"id": "train-3607", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many authors is affiliated to the organization \"Otterbein University\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Name) FROM Author WHERE Affiliation = 'Otterbein University'\n```"}]}, {"id": "train-3608", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many authors drafted the paper \"Subcellular localization of nuclease in barley aleurone\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.Name) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Subcellular localization of nuclease in barley aleurone'\n```"}]}, {"id": "train-3609", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the conference in which the paper titled \"Extended Fuzzy Regression Models\" was published?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'Extended Fuzzy Regression Models'\n```"}]}, {"id": "train-3610", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers are published under the conference \"Mathematics of Program Construction\n\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Id) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.FullName = 'Mathematics of Program Construction'\n```"}]}, {"id": "train-3611", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the author of the paper titled \"Open Sourcing Social Solutions (Building Communities of Change)\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Open Sourcing Social Solutions (Building Communities of Change)'\n```"}]}, {"id": "train-3612", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the title of the paper that Jianli Hua published."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Jianli Hua'\n```"}]}, {"id": "train-3613", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who authored the paper titled \"Testing timed automata\n\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Testing timed automata'\n```"}]}, {"id": "train-3614", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers are published in year 2000 under the conference \"SSPR\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Id) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Year = 2000 AND T2.ShortName = 'SSPR'\n```"}]}, {"id": "train-3615", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the paper that the journal \"Theoretical Computer Science\n\" published in 2003."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Title FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T2.FullName = 'Theoretical Computer Science' AND T1.Year = 2003 AND T1.Title <> ''\n```"}]}, {"id": "train-3616", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the conference homepage URL of the paper titled \"Quality evaluation of long duration audiovisual content\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.HomePage FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'Quality evaluation of long duration audiovisual content'\n```"}]}, {"id": "train-3617", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the author who drafted the paper \"A Randomized Comparison of Sirolimus- Versus Paclitaxel-Eluting Stent Implantation in Patients With Diabetes Mellitus\", which of them is/are affiliated with the Asan Medical Center, University of Ulsan College of Medicine, Seoul, Korea\n?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Affiliation = 'Asan Medical Center, University of Ulsan College of Medicine, Seoul, Korea' AND T1.Title = 'A Randomized Comparison of Sirolimus- Versus Paclitaxel-Eluting Stent Implantation in Patients With Diabetes Mellitus'\n```"}]}, {"id": "train-3618", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers are published under the journal \"Software - Practice and Experience\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Id) FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T2.FullName = 'Software - Practice and Experience'\n```"}]}, {"id": "train-3619", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the paper that were under the conference homepage URL \"http://www.irma-international.org/\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.HomePage = 'http://www.irma-international.org/'\n```"}]}, {"id": "train-3620", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total average number of papers published from 2002 to 2010 under the conference \"Information and Knowledge Engineering\"."}, {"from": "gpt", "value": "```sql\nSELECT 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\n```"}]}, {"id": "train-3621", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From year 1991 to 2000, calculate the difference betweeen the total number of papers published under the conference \"International Conference on Supercomputing \" and \"Informatik & Schule\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.FullName = 'Informatik & Schule' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.FullName = 'International Conference on Supercomputing' THEN 1 ELSE 0 END) AS DIFF FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Year > 1990 AND T1.Year < 2001\n```"}]}, {"id": "train-3622", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the short name for \"Software - Concepts and Tools / Structured Programming\"?"}, {"from": "gpt", "value": "```sql\nSELECT ShortName FROM Journal WHERE FullName = 'Software - Concepts and Tools / Structured Programming'\n```"}]}, {"id": "train-3623", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which journal was the paper \"Education, democracy and growth\" published on? Give the full name of the journal."}, {"from": "gpt", "value": "```sql\nSELECT T1.FullName FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T2.Title = 'Education, democracy and growth'\n```"}]}, {"id": "train-3624", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of papers that were published on \"IEEE Transactions on Nuclear Science\" in 1999."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Id) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'IEEE Transactions on Nuclear Science' AND T2.Year = 1999\n```"}]}, {"id": "train-3625", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the name of the paper that was published on \"IEEE Transactions on Pattern Analysis and Machine Intelligence\" in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Title FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'IEEE Transactions on Pattern Analysis and Machine Intelligence' AND T2.Year = 2011 AND T2.Title <> ''\n```"}]}, {"id": "train-3626", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the keywords for the paper which was published on \"Modeling Identification and Control\" in 1994?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Keyword FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Modeling Identification and Control' AND T2.Year = 1994\n```"}]}, {"id": "train-3627", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the paper which was presented by \"Zvezdan Proti\u0107\", was it preprinted?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T1.Year = 0 THEN 'TRUE' ELSE 'FALSE' END FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Zvezdan Proti\u0107' AND T1.ConferenceId = 0 AND T1.JournalId = 0\n```"}]}, {"id": "train-3628", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: At which conference was the paper \"Skew-Circulant Preconditioners for Systems of LMF-Based ODE Codes\" presented?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'Skew-Circulant Preconditioners for Systems of LMF-Based ODE Codes'\n```"}]}, {"id": "train-3629", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of papers that were presented at \"International Symposium on Software Testing and Analysis\" conference."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Id) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.FullName = 'International Symposium on Software Testing and Analysis'\n```"}]}, {"id": "train-3630", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Gives the home page of the conference where the paper \"Increasing the Concurrency in Estelle\" is presented."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.HomePage FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'Increasing the Concurrency in Estelle'\n```"}]}, {"id": "train-3631", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many authors finished the paper \"An Improved Active Suspension Model for Attitude Control of Electric Vehicles\" together?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.AuthorId) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'An Improved Active Suspension Model for Attitude Control of Electric Vehicles'\n```"}]}, {"id": "train-3632", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the year 2012, which conference had the most papers presented? Give the short name of the conference."}, {"from": "gpt", "value": "```sql\nSELECT T2.ShortName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Year = '2012' GROUP BY T1.ConferenceId ORDER BY COUNT(T1.Id) DESC LIMIT 1\n```"}]}, {"id": "train-3633", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers were presented at 'ECSQARU' in 2003?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Id) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.ShortName = 'ECSQARU' AND T1.Year = '2003'\n```"}]}, {"id": "train-3634", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the keywords of the paper that was presented at \"International Radar Symposium\" in 2012."}, {"from": "gpt", "value": "```sql\nSELECT T1.Keyword FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.FullName = 'International Radar Symposium' AND T1.Year = 2012\n```"}]}, {"id": "train-3635", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times more for the papers that were presented at the \"International Conference on Thermoelectrics\" conference than \"International Conference on Wireless Networks, Communications and Mobile Computing\u201c conference?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.FullName = 'International Conference on Thermoelectrics' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.FullName = 'International Conference on Wireless Networks, Communications and Mobile Computing' THEN 1 ELSE 0 END) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id\n```"}]}, {"id": "train-3636", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of preprints of John Van Reenen's papers?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.ConferenceId = 0 AND T1.JournalId = 0 THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.Id) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'John Van Reenen'\n```"}]}, {"id": "train-3637", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the oldest published book?"}, {"from": "gpt", "value": "```sql\nSELECT Title FROM Paper WHERE Year > 0 ORDER BY Year ASC LIMIT 1\n```"}]}, {"id": "train-3638", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which conference has the longest name?"}, {"from": "gpt", "value": "```sql\nSELECT FullName FROM Conference ORDER BY LENGTH(FullName) DESC LIMIT 1\n```"}]}, {"id": "train-3639", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many authors are affiliated with NASA Langley Research Center?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Name) FROM Author WHERE Affiliation = 'NASA Langley Research Center'\n```"}]}, {"id": "train-3640", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many journals don\u2019t have a short name?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ShortName) FROM Journal WHERE ShortName = ''\n```"}]}, {"id": "train-3641", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the papers are preprinted?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Id) FROM Paper WHERE ConferenceId = 0 AND JournalId = 0\n```"}]}, {"id": "train-3642", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the paper with the most authors?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Title FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id GROUP BY T1.PaperId ORDER BY COUNT(T1.PaperId) DESC LIMIT 1\n```"}]}, {"id": "train-3643", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which paper published by the \"TUBERCLE LUNG DIS\" journal is the oldest?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Title FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.ShortName = 'TUBERCLE LUNG DIS' ORDER BY T2.Year ASC LIMIT 1\n```"}]}, {"id": "train-3644", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of the papers written by the author \"Karin Rengefors.\""}, {"from": "gpt", "value": "```sql\nSELECT T2.Title FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Name = 'Karin Rengefors'\n```"}]}, {"id": "train-3645", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers were published by the \"Virtual Reality, IEEE Annual International Symposium\" conference in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Id) FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T1.FullName = 'Virtual Reality, IEEE Annual International Symposium' AND T2.Year = 2012\n```"}]}, {"id": "train-3646", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the short name for the journal that published the paper \"A Case of Unilateral Ashy Dermatosis\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ShortName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Title = 'A Case of Unilateral Ashy Dermatosis'\n```"}]}, {"id": "train-3647", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the affiliations of the author \"Mark A. Musen\" written on and off paper?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Affiliation FROM PaperAuthor AS T1 INNER JOIN Author AS T2 ON T1.AuthorId = T2.Id WHERE T2.Name = 'Mark A. Musen'\n```"}]}, {"id": "train-3649", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the titles and their publishing journals from the 60's."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title, T1.JournalId FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Year >= 1960 AND T1.Year <= 1970\n```"}]}, {"id": "train-3650", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year did the \"Internet, Multimedia Systems and Applications\" conference publish the most papers?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Year FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T1.FullName = 'Internet, Multimedia Systems and Applications' GROUP BY T2.Year ORDER BY COUNT(T2.Id) DESC LIMIT 1\n```"}]}, {"id": "train-3651", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the different ways the name of the author, Randall Davis, is written on their papers?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Name FROM PaperAuthor AS T1 INNER JOIN Author AS T2 ON T1.AuthorId = T2.Id WHERE T2.Name = 'Randall Davis' AND T1.Name != 'Randall Davis'\n```"}]}, {"id": "train-3652", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of the conferences where a paper was published in 2008."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Year = 2008\n```"}]}, {"id": "train-3653", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the homepage URL for the journal that published the most papers?"}, {"from": "gpt", "value": "```sql\nSELECT T2.HomePage FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id GROUP BY T1.JournalId ORDER BY COUNT(T1.JournalId) DESC LIMIT 1\n```"}]}, {"id": "train-3654", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the proportion of the papers that have the keyword \"cancer\"? Please provide a list of authors and their affiliations."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Keyword = 'cancer' THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.Id), T2.Name, T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId\n```"}]}, {"id": "train-3655", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of author with the ID of 1722?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Author WHERE Id = 1722\n```"}]}, {"id": "train-3656", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers are preprint or not published?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Id) FROM Paper WHERE Year = 0 OR (ConferenceId = 0 AND JournalId = 0)\n```"}]}, {"id": "train-3657", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of the author that affiliated with University of Illinois Chicago?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Author WHERE Affiliation = 'University of Illinois Chicago'\n```"}]}, {"id": "train-3658", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers were published in 2005. Calculate the difference between the number of paper published in 2005 and the number of paper published in the previous year."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Year = 2005 THEN 1 ELSE 0 END) , SUM(CASE WHEN year = 2005 THEN 1 ELSE 0 END) - SUM(CASE WHEN year = 2004 THEN 1 ELSE 0 END) AS diff FROM Paper\n```"}]}, {"id": "train-3659", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the title of papers published in the Ibm Journal of Research and Development."}, {"from": "gpt", "value": "```sql\nSELECT T2.Title FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Ibm Journal of Research and Development'\n```"}]}, {"id": "train-3660", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name and affiliation of author for the 'Education, democracy and growth' paper?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name, T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Education, democracy and growth'\n```"}]}, {"id": "train-3661", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many author published papers in the 'IEEE Computer' journal?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Name) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id WHERE T3.FullName = 'IEEE Computer'\n```"}]}, {"id": "train-3662", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where was the 'A context-based navigation paradigm for accessing Web data' paper published? State the name of the conference."}, {"from": "gpt", "value": "```sql\nSELECT T2.FullName FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T1.Title = 'A context-based navigation paradigm for accessing Web data'\n```"}]}, {"id": "train-3663", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers were published in International Workshop on Inductive Logic Programming from 2001 to 2009?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Id) FROM Paper AS T1 INNER JOIN Conference AS T2 ON T1.ConferenceId = T2.Id WHERE T2.FullName = 'International Workshop on Inductive Logic Programming' AND T1.Year BETWEEN 2001 AND 2009\n```"}]}, {"id": "train-3664", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average of authors for each paper from the year of 1990 to 2000."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(DISTINCT T2.AuthorId) AS REAL) / COUNT(DISTINCT T1.Title) FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Year BETWEEN 1990 AND 2000\n```"}]}, {"id": "train-3665", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the year and a full name of the journal in which the publication named 'Area Effects in Cepaea' was published."}, {"from": "gpt", "value": "```sql\nSELECT T1.Year, T2.FullName FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id WHERE T1.Title = 'Area Effects in Cepaea'\n```"}]}, {"id": "train-3666", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the author of the publication named 'Real-Time Automata'?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Real-Time Automata'\n```"}]}, {"id": "train-3667", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of the author who is affiliated with the organization named 'ABB Electrical Machines'."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Author WHERE Affiliation = 'ABB Electrical Machines'\n```"}]}, {"id": "train-3668", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of publications published in the journal named 'Academic Medicine' between 2005 and 2010."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.JournalId) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Academic Medicine' AND T2.Year BETWEEN 2005 AND 2010\n```"}]}, {"id": "train-3669", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the title of the latest publication published by it's author 'Zuliang Du'."}, {"from": "gpt", "value": "```sql\nSELECT T2.Title FROM PaperAuthor AS T1 INNER JOIN Paper AS T2 ON T1.PaperId = T2.Id WHERE T1.Name = 'Zuliang Du' ORDER BY T2.Year DESC LIMIT 1\n```"}]}, {"id": "train-3670", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many publications were published in relation to the conference 'Adaptive Multimedia Retrieval' in 2007?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ConferenceId) FROM Conference AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.ConferenceId WHERE T1.FullName = 'Adaptive Multimedia Retrieval' AND T2.Year = 2007\n```"}]}, {"id": "train-3671", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the average number of papers that are published in the journal named 'Information Sciences' annually."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.JournalId) AS REAL) / COUNT(DISTINCT T2.Year) FROM Journal AS T1 INNER JOIN Paper AS T2 ON T1.Id = T2.JournalId WHERE T1.FullName = 'Information Sciences'\n```"}]}, {"id": "train-3672", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many publications were published by author named 'Howard F. Lipson'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(PaperId) FROM PaperAuthor WHERE Name = 'Howard F. Lipson'\n```"}]}, {"id": "train-3673", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all publications containing keywords 'Turbulent Fluids', what percentage of them was published in the journal named 'Physics of Fluids'?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Keyword = 'Turbulent Fluids' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.FullName = 'Physics of Fluids' THEN 1 ELSE 0 END) FROM Paper AS T1 INNER JOIN Journal AS T2 ON T1.JournalId = T2.Id\n```"}]}, {"id": "train-3674", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the number of authors affiliated with the organization named 'Arizona State University'."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Name) FROM Author WHERE Affiliation = 'Arizona State University'\n```"}]}, {"id": "train-3675", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the full name and URL link of ICCI?"}, {"from": "gpt", "value": "```sql\nSELECT FullName, HomePage FROM Conference WHERE ShortName = 'ICCI'\n```"}]}, {"id": "train-3676", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the titile of paper writen by Joe Lograsso."}, {"from": "gpt", "value": "```sql\nSELECT T1.Title FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Joe Lograsso'\n```"}]}, {"id": "train-3677", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers were written by authors who cooperated with University of Hong Kong?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.PaperId) FROM Author AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.AuthorId WHERE T1.Affiliation = 'University of Hong Kong'\n```"}]}, {"id": "train-3680", "db_id": "authors", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the name of author for paper id 5 and state the keyword of this page."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T3.Keyword 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 = 5\n```"}]}, {"id": "train-3682", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the all the institutes from the state with the most number of American Indian in 2007."}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2007 AND T2.race = 'Ai' GROUP BY T1.chronname ORDER BY COUNT(T1.chronname) DESC LIMIT 1\n```"}]}, {"id": "train-3683", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name and website of the institutes from the state with 209 graduate cohort in 2011."}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname, T1.site FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2011 AND T2.grad_cohort = 209\n```"}]}, {"id": "train-3684", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of female graduates between 2011 to 2013 from the state where 'Gateway Community College' is located?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year BETWEEN 2011 AND 2013 AND T1.chronname = 'Gateway Community College' AND T2.gender = 'F'\n```"}]}, {"id": "train-3685", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total male graduates in 2012 in the state whereby the institute with the highest average amount of student aid going to undergraduate recipients is located?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2012 AND T2.gender = 'M' ORDER BY T1.aid_value DESC LIMIT 1\n```"}]}, {"id": "train-3686", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the average median SAT value for institutes in the state with the most male graduate cohort in 2013."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.med_sat_value) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2013 AND T2.gender = 'M' GROUP BY T2.grad_cohort ORDER BY COUNT(T2.grad_cohort) DESC LIMIT 1\n```"}]}, {"id": "train-3687", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the state with the most number of graduate cohort in 2012 from private institute for profit? List all such institutes in the mentioned state."}, {"from": "gpt", "value": "```sql\nSELECT T1.state, T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2012 AND T1.control = 'Private for-profit' GROUP BY T2.grad_cohort ORDER BY COUNT(T2.grad_cohort) DESC LIMIT 1\n```"}]}, {"id": "train-3688", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the public institutes from the state with the least number of graduate cohort in 2013."}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2013 AND T1.control = 'Public' ORDER BY T2.grad_cohort LIMIT 1\n```"}]}, {"id": "train-3689", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the institute name with less than 200 graduate cohort of all races and genders in 2013. Also, please state the total number of full-time equivalent undergraduates for the institute."}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname, T2.grad_cohort FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.year = 2013 AND T2.gender = 'B' AND T2.race = 'X' AND T2.grad_cohort < 200\n```"}]}, {"id": "train-3690", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of female graduate for all students cohort from Oakwood University in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.year = 2013 AND T2.gender = 'F' AND T2.race = 'X' AND T1.chronname = 'Oakwood University'\n```"}]}, {"id": "train-3691", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2012, how many Asian female graduates were seeking another type of degree or certificate at the 4-year institution at University of Alaska at Anchorage?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.gender = 'F' AND T2.race = 'A' AND T1.chronname = 'University of Alaska at Anchorage' AND T2.cohort = '4y other'\n```"}]}, {"id": "train-3692", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compare the graduate cohort for Auburn University from 2011 to 2013?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.year = 2011 THEN T2.grad_cohort ELSE 0 END), SUM(CASE WHEN T2.year = 2012 THEN T2.grad_cohort ELSE 0 END), SUM(CASE WHEN T2.year = 2013 THEN T2.grad_cohort ELSE 0 END) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.gender = 'B' AND T2.race = 'X' AND T1.chronname = 'Auburn University'\n```"}]}, {"id": "train-3693", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of Black students in all private for profit institutions."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.race = 'B' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.race = 'B' AND T1.control = 'Private for-profit'\n```"}]}, {"id": "train-3694", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of Asian students among students of other races who graduated from institution in Alabama in year 2013 within 100 percent of normal / expected time."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.race = 'A' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T2.year = 2013 AND T1.state = 'Alabama'\n```"}]}, {"id": "train-3695", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of Asian male graduates to Asian female graduates from Harvard University in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Gender = 'M' THEN T2.grad_cohort ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Gender = 'F' THEN T2.grad_cohort ELSE 0 END) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Harvard University' AND T2.year = 2013 AND T2.race = 'A'\n```"}]}, {"id": "train-3696", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From which institute is harder to graduate for a bachelor, Amridge University or Auburn University?"}, {"from": "gpt", "value": "```sql\nSELECT chronname FROM institution_details WHERE chronname IN ('Amridge University', 'Auburn University') ORDER BY grad_100_value LIMIT 1\n```"}]}, {"id": "train-3697", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many institutes are private and not-for profit?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM institution_details WHERE control = 'Private not-for-profit'\n```"}]}, {"id": "train-3698", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In total, how many Hispanic male students graduated from Amridge University?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Amridge University' AND T2.gender = 'M' AND T2.race = 'H'\n```"}]}, {"id": "train-3699", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students that graduated from Lincoln College in 2011 belong to the cohort type of Bachelor's/equivalent seeking cohort at 4-year institutions?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.unitid) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Lincoln College' AND T2.year = 2011 AND T2.cohort = '4y bach'\n```"}]}, {"id": "train-3700", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the number of male Hispanic students who graduated from Central Alabama Community College in 2011 within 100 percent of normal/expected time?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.grad_100) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year = 2011 AND T2.gender = 'M' AND T2.race = 'H'\n```"}]}, {"id": "train-3701", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students graduated from Central Alabama Community College in 2011 in total?"}, {"from": "gpt", "value": "```sql\nSELECT T2.grad_cohort FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T1.unitid = T2.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year = 2011\n```"}]}, {"id": "train-3702", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which cohort had the higher percentage of students who graduated from Central Alabama Community College in 2011 within 150 percent of normal/expected time, female White students or male White students?"}, {"from": "gpt", "value": "```sql\nSELECT IIF(SUM(CASE WHEN T2.gender = 'F' THEN T2.grad_150 ELSE 0 END) > SUM(CASE WHEN T2.gender = 'M' THEN T2.grad_150 ELSE 0 END), 'female White students', 'male White students') FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year = 2011 AND T2.race = 'W'\n```"}]}, {"id": "train-3703", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which institute has the highest percentage of male White students graduating in 2011 within 150 percent of normal/expected time?"}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2011 AND T2.gender = 'M' AND T2.race = 'W' AND T2.grad_150 = ( SELECT MAX(T2.grad_150) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2011 AND T2.gender = 'M' AND T2.race = 'W' )\n```"}]}, {"id": "train-3704", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the institutes with the percentage of male White students graduating in 2011 within 150 percent of normal/expected time over 20."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN T2.grad_150 > 20 THEN T1.chronname ELSE NULL END AS T FROM institution_details T1 INNER JOIN institution_grads T2 ON T2.unitid = T1.unitid WHERE T2.year = 2011 AND T2.gender = 'M' AND T2.race = 'W' ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-3705", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students for both genders graduated from a 2-year institute in Alabama in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.cohort = '2y all' AND T2.year = 2011 AND T1.state = 'Alabama'\n```"}]}, {"id": "train-3706", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more students in total graduated from Central Alabama Community College in 2012 than in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.year = 2012 THEN T2.grad_cohort ELSE 0 END) - SUM(CASE WHEN T2.year = 2011 THEN T2.grad_cohort ELSE 0 END) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College'\n```"}]}, {"id": "train-3707", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the institutes in the state of Alabama whose percent rank for median SAT value within sector is 77, how many of them have over 500 graduates in total in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' AND T1.med_sat_percentile = '100' AND T2.year = 2011 AND T2.grad_cohort > 500\n```"}]}, {"id": "train-3708", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the public institutes in the state of Alabama, how many of them have over 30 students who graduated within 100 percent of normal/expected time in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.chronname) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' AND T1.control = 'Public' AND T2.year = 2011 AND T2.grad_100 > 30\n```"}]}, {"id": "train-3709", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the institutes in the state of Alabama whose all graduates in total exceeded 500 in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' AND T2.year = 2011 AND T2.race = 'X' AND T2.grad_cohort > 500\n```"}]}, {"id": "train-3710", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the average number of graduates for Central Alabama Community College in the 3 consecutive years from 2011 to 2013?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year IN (2011, 2012, 2013) AND T2.gender = 'B' AND T2.race = 'X'\n```"}]}, {"id": "train-3711", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average percentage of students graduating within 100 percent of normal/expected time for Central Alabama Community College?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.grad_100_rate) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College'\n```"}]}, {"id": "train-3712", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the web site address for \"Swarthmore College\"."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN chronname = 'Swarthmore College' THEN site ELSE NULL END AS T FROM institution_details ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-3713", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which state is \"Mercer University\" located in?"}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN chronname = 'Mercer University' THEN state ELSE NULL END AS T FROM institution_details ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-3714", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city is \"Rensselaer Polytechnic Institute\" located in?"}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN chronname = 'Rensselaer Polytechnic Institute' THEN city ELSE NULL END AS T FROM institution_details ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-3715", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the abbreviation for \"Delaware\" state."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN state = 'Delaware' THEN state_abbr ELSE NULL END AS T FROM state_sector_grads ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-3716", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 2-year public schools are there in \"California\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(stateid) FROM state_sector_details WHERE state = 'California' AND level = '2-year' AND control = 'Public'\n```"}]}, {"id": "train-3717", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the post name of \"Idaho\" state."}, {"from": "gpt", "value": "```sql\nSELECT T FROM ( SELECT DISTINCT CASE WHEN state = 'Idaho' THEN state_post ELSE NULL END AS T FROM state_sector_details ) WHERE T IS NOT NULL\n```"}]}, {"id": "train-3718", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the name of school in \"NJ\" that could get the bachelor's degree with highest students number."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'NJ' AND T1.level = '4-year' AND T1.student_count = ( SELECT MAX(T1.student_count) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'NJ' AND T1.level = '4-year' )\n```"}]}, {"id": "train-3719", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the web site address for the school in \"PA\" state with the highest latitude."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.site FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'PA' AND T1.lat_y = ( SELECT MAX(T1.lat_y) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'PA' )\n```"}]}, {"id": "train-3720", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of 4-year public schools in UT whose graduation rate exceeds the average for the state."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'UT' AND T1.level = '4-year' AND T1.control = 'Public' AND T1.awards_per_value > T1.awards_per_state_value\n```"}]}, {"id": "train-3721", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 2-year private nonprofit schools in \"CT\" whose graduation rate falls below the average for the state?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'CT' AND T2.level = '2-year' AND T1.control = 'Private not-for-profit' AND T1.awards_per_value < T1.awards_per_natl_value\n```"}]}, {"id": "train-3722", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the 4-year public school in \"ID\" with the lowest graduation 100 value."}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'ID' AND T1.level = '4-year' AND T1.control = 'Public' GROUP BY T1.chronname ORDER BY SUM(T1.grad_100_value) ASC LIMIT 1\n```"}]}, {"id": "train-3723", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which 4-year private for-profit school in \"KY\" has the highest graudation 150 value? Give the ID for the school."}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname, T1.unitid FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.state = T1.state WHERE T2.state_abbr = 'KY' AND T1.level = '4-year' AND T1.control = 'Private for-profit' GROUP BY T1.chronname ORDER BY SUM(T1.grad_150_value) DESC LIMIT 1\n```"}]}, {"id": "train-3724", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the number of female Hispanic students who graduated within 100 percent of expected time for \"Pennsylvania State University-Altoona\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.grad_100) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Pennsylvania State University-Altoona' AND T2.gender = 'F' AND T2.race = 'H'\n```"}]}, {"id": "train-3725", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the cohort name for the school with biggest cohort size."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.cohort_size = ( SELECT MAX(T1.cohort_size) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid )\n```"}]}, {"id": "train-3726", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of 4-year private not-for-profit schools in the home state of \"Brevard Community College\"."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.chronname) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state WHERE T2.level = '4-year' AND T2.control = 'Private not-for-profit' AND T1.chronname = 'Brevard Community College'\n```"}]}, {"id": "train-3727", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the total number of all graduated students from a 2-year public schools in Alabama in 2011."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.state = 'Alabama' AND T2.year = 2011 AND T1.level = '2-year' AND T1.control = 'Public' AND T2.race = 'X'\n```"}]}, {"id": "train-3728", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.level = '2-year' AND T2.control = 'Public' AND T2.gender = 'B' AND T2.race = 'A' AND T2.cohort = '2y all' AND T1.schools_count = 113\n```"}]}, {"id": "train-3729", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the number of 4-year public schools from Madison Area Technical College's home state in the Alabama?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(DISTINCT CASE WHEN T1.state = ( SELECT T1.state FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state WHERE T1.chronname = 'Madison Area Technical College' ) AND T1.level = '4-year' AND T1.control = 'Public' THEN T1.chronname ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT CASE WHEN T2.state = 'Alabama' THEN T1.chronname ELSE NULL END) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state\n```"}]}, {"id": "train-3730", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the state and name of institutions in year of data release from 2010 to 2012 with black students."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.state, T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'B' AND T2.year BETWEEN 2010 AND 2012\n```"}]}, {"id": "train-3731", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the states in 2011 with a national sector average of 20 and below."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.state FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.year = 2011 AND T1.awards_per_natl_value <= 20\n```"}]}, {"id": "train-3732", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the race of all students, what is the control of institution and level of institution with highest number of students?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.control, T1.level FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'X' AND T1.student_count = ( SELECT MAX(T1.student_count) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'X' )\n```"}]}, {"id": "train-3733", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the states with a public school count of 20 and below, list their race."}, {"from": "gpt", "value": "```sql\nSELECT 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'\n```"}]}, {"id": "train-3734", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the basic of the institution in 2012 with race of all male students."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.basic, T2.race FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2012 AND T2.gender = 'M' AND t2.race = 'X'\n```"}]}, {"id": "train-3735", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Alaska with school count of 1 from year 2011 to 2013, how many of the students are white?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.race) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.schools_count = 1 AND T2.year BETWEEN 2011 AND 2013 AND T2.race = 'W' AND T1.state = 'Alaska'\n```"}]}, {"id": "train-3736", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the institution's name of american students within the number of degree-seeking students in the cohort that ranges from 1 to 3?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.grad_cohort BETWEEN 1 AND 3 AND T2.race = 'Ai'\n```"}]}, {"id": "train-3737", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the states that start with letter A and attained a national sector average of 16.5, give the number of degree-seeking students in the cohort of those students in 2012 ."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.state LIKE 'A%' AND T1.awards_per_natl_value = 16.5 AND T2.year = 2012\n```"}]}, {"id": "train-3738", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the site of institution within the student count of 500 to 1000 that has the recent year of data release."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.site FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.student_count BETWEEN 500 AND 1000 AND T2.year = ( SELECT MAX(T2.year) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid )\n```"}]}, {"id": "train-3739", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the state name of male graduate in 2011 from a private for profit institution with black students?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.state FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.gender = 'M' AND T2.race = 'B' AND T1.control = 'Private for-profit' AND T2.year = 2011\n```"}]}, {"id": "train-3740", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the black students in 2011, list the institution site and name of those who has 20 t0 30 degree-seeking students in the cohort."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.site, T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.year = 2011 AND T2.race = 'B' AND T2.grad_cohort BETWEEN 20 AND 30\n```"}]}, {"id": "train-3741", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In female students in year 2012, how many of them from a state with number of schools ranges from 10 to 20?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.race) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.gender = 'F' AND schools_count BETWEEN 10 AND 20 AND T2.year = 2012\n```"}]}, {"id": "train-3742", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the race of institutions in Alabama with number of students greater than the 90% of average number of students of all institutions?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.race FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.student_count > ( SELECT AVG(T1.student_count) * 0.9 FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.state = 'Alabama' ) AND T1.state = 'Alabama'\n```"}]}, {"id": "train-3743", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In year 2010 at schools located in Hawaii, what is the percentage of schools offers an associate's degree?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.level = '2-year' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.level) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.state = 'Hawaii' AND T2.year = 2010\n```"}]}, {"id": "train-3744", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the state of Connecticut, what is the name of the instution with the highest percent rank for freshman retention percentage within the sector?"}, {"from": "gpt", "value": "```sql\nSELECT chronname FROM institution_details WHERE state = 'Connecticut' AND retain_percentile = ( SELECT MAX(retain_percentile) FROM institution_details WHERE state = 'Connecticut' )\n```"}]}, {"id": "train-3745", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the website address of the institution with the highest number of White degree-seeking students at 2-year institutions in 2008?"}, {"from": "gpt", "value": "```sql\nSELECT T1.site FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.race = 'W' AND T2.cohort = '2y all' AND T2.year = 2008 ORDER BY T2.grad_cohort DESC LIMIT 1\n```"}]}, {"id": "train-3746", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Harvard University, which year recorded the highest number of first-time, full-time, degree-seeking students in the cohort being tracked, minus any exclusions?"}, {"from": "gpt", "value": "```sql\nSELECT T2.year FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Harvard University' GROUP BY T2.year ORDER BY SUM(T2.grad_cohort) DESC LIMIT 1\n```"}]}, {"id": "train-3747", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the state with the highest state appropriations to higher education in fiscal year 2011 per resident, which institution has the lowest number of undergraduates in 2010?"}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN institution_grads AS T3 ON T3.unitid = T1.unitid WHERE T1.student_count = ( SELECT MIN(T1.student_count) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN institution_grads AS T3 ON T3.unitid = T1.unitid WHERE T3.year = 2010 ) AND T3.year = 2010 GROUP BY T1.state ORDER BY SUM(T2.state_appr_value) DESC LIMIT 1\n```"}]}, {"id": "train-3748", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Yale University, what is the average number of Black students per year who were bachelor's/equivalent-seeking cohort at 4-year institutions between 2002 to 2005?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.grad_cohort) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Yale University' AND T2.year BETWEEN 2002 AND 2005 AND T2.race = 'B' AND T2.cohort = '4y bach'\n```"}]}, {"id": "train-3749", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the Ivy League Schools, which school have the highest number of Hispanic graduates of all time?"}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' ) AND T2.race = 'H' GROUP BY T1.chronname ORDER BY SUM(T2.grad_cohort) DESC LIMIT 1\n```"}]}, {"id": "train-3750", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 4-year public institutions are there in the state of Florida? Give all of their names."}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 WHERE T2.level = '4-year' AND T2.control = 'Public' AND T2.state = 'Florida'\n```"}]}, {"id": "train-3751", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between the Ivy League Schools, which school's state have the lowest sate appropriations to higher education in fiscal year 2011 per resident?"}, {"from": "gpt", "value": "```sql\nSELECT T1.state FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state WHERE T1.chronname IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' ) GROUP BY T1.state ORDER BY SUM(T2.state_appr_value) ASC LIMIT 1\n```"}]}, {"id": "train-3752", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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? List all of the institutions' names."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(t1.unitid), t1.chronname FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON t1.state = t2.state WHERE t1.ft_pct > 90 ORDER BY t2.schools_count DESC LIMIT 1\n```"}]}, {"id": "train-3753", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average SAT value for incoming students in all of the schools located in the state with the lowest state appropriations to higher education in fiscal year 2011 per resident?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(t1.med_sat_value) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON t1.state = t2.state ORDER BY t2.state_appr_value LIMIT 1\n```"}]}, {"id": "train-3754", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the school with the highest number of first-time, full-time, degree-seeking female students in the cohort being tracked, minus any exclusions who were seeking another type of degree or certificate at a 4-year institution?"}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T2.gender = 'F' AND T2.cohort = '4y other' ORDER BY T2.grad_cohort DESC LIMIT 1\n```"}]}, {"id": "train-3755", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the Ivy League Schools in 2013, which schools have the highest number of Black students who graduated within 150 percent of normal/expected time who were seeking a bachelor's/equivalent cohort at 4-year institutions?"}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' ) AND T2.year = 2013 AND T2.race = 'B' AND T2.cohort = '4y bach' ORDER BY T2.grad_cohort DESC LIMIT 1\n```"}]}, {"id": "train-3756", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 2011 to 2013, what is the average number of male Hispanic degree-seeking students at 2-year institutions who graduated within 150 percent of normal/expected time in United Education Institute-Huntington Park Campus?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.grad_150) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'United Education Institute-Huntington Park Campus' AND T2.year BETWEEN 2011 AND 2013 AND T2.gender = 'M' AND T2.race = 'H'\n```"}]}, {"id": "train-3757", "db_id": "college_completion", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT T1.chronname, T2.state_appr_value FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state ORDER BY T1.awards_per_value - T2.awards_per_natl_value DESC LIMIT 1\n```"}]}, {"id": "train-3758", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Yelp businesses are there in 'AZ' with less than \"3\" stars?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND stars < 3\n```"}]}, {"id": "train-3759", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the quantity of the closed or not running Yelp Businesses in 'AZ'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND active LIKE 'False'\n```"}]}, {"id": "train-3760", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many long reviews does user No. 36139 give for the Yelp businesses?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(review_length) FROM Reviews WHERE user_id = 36139 AND review_length LIKE 'long'\n```"}]}, {"id": "train-3761", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users have \"uber\" number of fans?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_id) FROM Users WHERE user_fans LIKE 'Uber'\n```"}]}, {"id": "train-3762", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Yelp businesses are opened 24 hours?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name LIKE 'Open 24 Hours' AND T2.attribute_value LIKE 'TRUE'\n```"}]}, {"id": "train-3763", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What kind of \"wi-fi\" does Yelp business No.\"10172\" have?"}, {"from": "gpt", "value": "```sql\nSELECT T2.attribute_value FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.business_id = 10172 AND T1.attribute_name LIKE 'wi-fi'\n```"}]}, {"id": "train-3764", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"bars\" are there in the Yelp business?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.category_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id WHERE T1.category_name LIKE 'Bars'\n```"}]}, {"id": "train-3765", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more \"buffets\" than \"gyms\" in Yelp business?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.category_name LIKE 'Buffets' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.category_name LIKE 'Gyms' THEN 1 ELSE 0 END) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id\n```"}]}, {"id": "train-3766", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What business category is the Yelp business which got the most 5 star reviews in?"}, {"from": "gpt", "value": "```sql\nSELECT T1.category_name 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 Reviews AS T4 ON T3.business_id = T4.business_id WHERE T4.review_stars = 5 GROUP BY T1.category_name ORDER BY COUNT(T1.category_name) DESC LIMIT 1\n```"}]}, {"id": "train-3767", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year did the user who gave the most number of \"5\" star reviews join the Yelp?"}, {"from": "gpt", "value": "```sql\nSELECT T2.user_yelping_since_year FROM Reviews AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.review_stars = 5 GROUP BY T2.user_yelping_since_year ORDER BY COUNT(T1.review_stars) DESC LIMIT 1\n```"}]}, {"id": "train-3768", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the user who gave the most number of long reviews, what is his/her averge ratings of all review?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.review_stars) AS REAL) / COUNT(T1.review_stars) FROM Reviews AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.review_length LIKE 'Long' GROUP BY T1.user_id ORDER BY COUNT(T1.review_length) DESC LIMIT 1\n```"}]}, {"id": "train-3769", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the Yelp business which had the most number of \"long\" reviews, which category does it belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T4.category_name FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T1.review_length LIKE 'Long' GROUP BY T2.business_id ORDER BY COUNT(T1.review_length) DESC LIMIT 1\n```"}]}, {"id": "train-3770", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the Yelp business which had the most number of \"short\" tips, which category does it belong to?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.category_name 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 Tips AS T4 ON T3.business_id = T4.business_id WHERE T4.tip_length LIKE 'short'\n```"}]}, {"id": "train-3771", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year did the user who has given the most number of \"short\" tips join the Yelp?"}, {"from": "gpt", "value": "```sql\nSELECT T2.user_yelping_since_year FROM Tips AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.tip_length LIKE 'short' GROUP BY T2.user_yelping_since_year ORDER BY COUNT(T1.tip_length) DESC LIMIT 1\n```"}]}, {"id": "train-3772", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: User No. 70271 only has given one tip to the Yelp business, which category was that business belonged to?"}, {"from": "gpt", "value": "```sql\nSELECT T4.category_name FROM Tips AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T1.user_id = 70271\n```"}]}, {"id": "train-3773", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: There was only one tip that user No. 69722 gave to the Yelp business, what was the ratings of that business?"}, {"from": "gpt", "value": "```sql\nSELECT T2.stars FROM Tips AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.user_id = 69722\n```"}]}, {"id": "train-3774", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the percentage of \"Automotive\" businesses among all the Yelp businesses."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.category_name LIKE 'Automotive' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) AS \"percentage\" FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id\n```"}]}, {"id": "train-3775", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage more for the \"Women's Clothing\" Yelp businesses to \"Men's Clothing\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.category_name LIKE 'Women''s Clothing' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) - CAST(SUM(CASE WHEN T2.category_name LIKE 'Men''s Clothing' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) AS \"more percentage\" FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id\n```"}]}, {"id": "train-3776", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of users who joined Yelp since \"2004\"."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2004\n```"}]}, {"id": "train-3777", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users who have joined Yelp since \"2005\" but have no fans?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2005 AND user_fans LIKE 'None'\n```"}]}, {"id": "train-3778", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of actively running Yelp businesses in \"Tolleson\"."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE city LIKE 'Tolleson' AND active LIKE 'TRUE'\n```"}]}, {"id": "train-3779", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of reviews from user No. \"21679\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(review_length) FROM Reviews WHERE user_id = 21679\n```"}]}, {"id": "train-3780", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"5\" star reviews does the Yelp business No. \"10682\" get?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(review_length) FROM Reviews WHERE business_id = 10682 AND review_stars = 5\n```"}]}, {"id": "train-3781", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which closed/not running Yelp business in \"Sun City\" has got the most reviews? Give the business id."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Sun City' AND T1.active LIKE 'FALSE' GROUP BY T1.business_id ORDER BY COUNT(T2.review_length) DESC LIMIT 1\n```"}]}, {"id": "train-3782", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the only Yelp business in \"Yuma\" city, how many \"medium\" reviews did it get?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.review_length) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Yuma' AND T2.review_length LIKE 'Medium'\n```"}]}, {"id": "train-3783", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Does Yelp business No.\"4960\" have TV?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT CASE WHEN T1.attribute_name LIKE 'Has TV' THEN 'yes' ELSE 'no' END FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.business_id = 4960\n```"}]}, {"id": "train-3784", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of \"dogs allowed\" Yelp businesses."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name LIKE 'Dogs Allowed' AND T2.attribute_value LIKE 'TRUE'\n```"}]}, {"id": "train-3785", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many hours does the Yelp business No. \"5734\" open on Saturday?"}, {"from": "gpt", "value": "```sql\nSELECT T1.closing_time - T1.opening_time AS \"hour\" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week LIKE 'Saturday' AND T1.business_id = 5734\n```"}]}, {"id": "train-3786", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of \"hair removal\" Yelp businesses."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.category_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id WHERE T1.category_name LIKE 'Hair Removal'\n```"}]}, {"id": "train-3787", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more \"Chinese\" than \"Filipino\" Yelp businesses?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.category_name LIKE 'Chinese' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.category_name LIKE 'Filipino' THEN 1 ELSE 0 END) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id\n```"}]}, {"id": "train-3788", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: User No.\"63469\" has got \"1\" like for a tip to the Yelp business, which city is that business located in?"}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM Business AS T1 INNER JOIN Tips AS T2 ON T1.business_id = T2.business_id WHERE T2.likes = 1 AND T2.user_id = 63469\n```"}]}, {"id": "train-3789", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many types of music does Yelp business No.\"1141\" have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.attribute_name) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value LIKE 'TRUE' AND T2.business_id = 1141\n```"}]}, {"id": "train-3790", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"cute\" type of compliments does user No. 57400 get?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.compliment_type) FROM Compliments AS T1 INNER JOIN Users_Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.compliment_type LIKE 'cute' AND T2.user_id = 57400\n```"}]}, {"id": "train-3791", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who has got the most number of \"funny\" type of compliments? Give the user ID."}, {"from": "gpt", "value": "```sql\nSELECT user_id FROM Users_Compliments WHERE compliment_id IN ( SELECT compliment_id FROM Compliments WHERE compliment_type LIKE 'funny' )\n```"}]}, {"id": "train-3792", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of \"drive-thru\" businesses in \"Scottsdale\" with business ID number less than \"1000\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.business_id FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T3.business_id < 1000 AND T3.city LIKE 'Scottsdale' AND T1.attribute_name LIKE 'Drive-Thru' AND T2.attribute_value LIKE 'TRUE'\n```"}]}, {"id": "train-3793", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating for the all Yelp businesses that open 24 hours?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T3.stars) AS REAL) / COUNT(T2.business_id) AS \"avg\" FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.attribute_name LIKE 'Open 24 Hours' AND T2.attribute_value LIKE 'TRUE'\n```"}]}, {"id": "train-3794", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the Yelp businesses that allow customers bring their own beer, what percentage of them are in \"Phoenix\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.business_id) AS \"percentage\" FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.attribute_name LIKE 'BYOB' AND T2.attribute_value LIKE 'TRUE'\n```"}]}, {"id": "train-3795", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of business in AZ with a rating of 5."}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM Business WHERE state LIKE 'AZ' AND stars = 5\n```"}]}, {"id": "train-3796", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many active businesses of city are underrated?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE review_count LIKE 'Low' AND active LIKE 'TRUE'\n```"}]}, {"id": "train-3797", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many user ids from 1 to 20 have no fan users and have low ratings?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_id) FROM Users WHERE user_id BETWEEN 1 AND 20 AND user_fans LIKE 'None' AND user_review_count LIKE 'Low'\n```"}]}, {"id": "train-3798", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the opening hours of businesses are with category in fashion."}, {"from": "gpt", "value": "```sql\nSELECT T4.opening_time 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_Hours AS T4 ON T3.business_id = T4.business_id WHERE T1.category_name LIKE 'Fashion'\n```"}]}, {"id": "train-3799", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses operating in the shopping business have opening times before 8AM?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.business_id) 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_Hours AS T4 ON T3.business_id = T4.business_id WHERE T4.opening_time < '8AM' AND T1.category_name LIKE 'Shopping'\n```"}]}, {"id": "train-3801", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses with the category are open from Monday to Thursday?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) 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_Hours AS T4 ON T3.business_id = T4.business_id INNER JOIN Days AS T5 ON T4.day_id = T5.day_id WHERE T5.day_of_week LIKE 'Monday' OR T5.day_of_week LIKE 'Tuesday' OR T5.day_of_week LIKE 'Wednesday' OR T5.day_of_week LIKE 'Thursday'\n```"}]}, {"id": "train-3802", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate the review count of the \"active life\" businesses in Phoenix."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) 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 WHERE T1.category_name = 'Active Life' AND T3.city = 'Phoenix'\n```"}]}, {"id": "train-3803", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the businesses name with a rating less than 5 whose category name is men's clothing."}, {"from": "gpt", "value": "```sql\nSELECT T2.business_id 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 WHERE T1.category_name LIKE 'Men''s Clothing' AND T3.stars < 5\n```"}]}, {"id": "train-3804", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which businesses are no longer in business but have a low number of votes useful?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.business_id FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T2.active LIKE 'FALSE' AND T1.review_votes_useful LIKE 'Low'\n```"}]}, {"id": "train-3805", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the businesses names whose length of user review is long with business id from 1 to 20."}, {"from": "gpt", "value": "```sql\nSELECT T4.category_name FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T1.review_length LIKE 'Long' AND T3.category_id BETWEEN 1 AND 20 GROUP BY T4.category_name\n```"}]}, {"id": "train-3806", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the attribute values \u200b\u200bof the bussinesses with fashion in Scottsdale."}, {"from": "gpt", "value": "```sql\nSELECT T2.attribute_value FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T1.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T4.category_name LIKE 'Fashion' AND T1.city LIKE 'Scottsdale'\n```"}]}, {"id": "train-3807", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many compliments received from medium users that Phoenix city achieved?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.number_of_compliments) FROM Users_Compliments AS T1 INNER JOIN Reviews AS T2 ON T1.user_id = T2.user_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T3.city LIKE 'Phoenix' AND T1.number_of_compliments LIKE 'Medium'\n```"}]}, {"id": "train-3808", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the businesses name in Tempe city whose opening hours are earlier than 8AM."}, {"from": "gpt", "value": "```sql\nSELECT T1.category_name 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_Hours AS T4 ON T3.business_id = T4.business_id WHERE T3.city LIKE 'Tempe' AND T4.opening_time < '8AM'\n```"}]}, {"id": "train-3809", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses in Glendale city that are still running is opened from 8AM to 6PM?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.category_name) 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_Hours AS T4 ON T3.business_id = T4.business_id WHERE T3.city LIKE 'Glendale' AND T4.opening_time LIKE '8AM' AND T4.closing_time LIKE '6PM'\n```"}]}, {"id": "train-3810", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses are there in Phoenix city? Find the percentage of businesses in Phoenix city in the total city."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS \"num\" , CAST(SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.city) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id\n```"}]}, {"id": "train-3811", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities have businesses with active life category? Find the percentage of the city where the review count that is low in total review count."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.category_name LIKE 'Active Life' THEN 1 ELSE 0 END) AS \"num\" , CAST(SUM(CASE WHEN T3.city LIKE 'Phoenix' THEN 1 ELSE 0 END) AS REAL) * 100 / ( SELECT COUNT(T3.review_count) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T3.review_count LIKE 'Low' ) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id\n```"}]}, {"id": "train-3812", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many active businesses are there in Phoenix?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE city LIKE 'Phoenix' AND active LIKE 'TRUE'\n```"}]}, {"id": "train-3813", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses in Scottsdale are rated as \"wonderful experience\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE city LIKE 'Scottsdale' AND stars > 3\n```"}]}, {"id": "train-3814", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating of inactive businesses?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(stars) AS REAL) / COUNT(business_id) AS \"average\" FROM Business WHERE active LIKE 'FALSE'\n```"}]}, {"id": "train-3815", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses in AZ state have the beer_and_wine attribute?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id WHERE T2.attribute_value LIKE 'beer_and_wine' AND T1.state LIKE 'AZ'\n```"}]}, {"id": "train-3816", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city has the most businesses whose attribute is full_bar?"}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id WHERE T2.attribute_value LIKE 'full_bar' GROUP BY T1.city\n```"}]}, {"id": "train-3817", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses in the fashion industry are rated 5 stars?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.stars = 5 AND T3.category_name LIKE 'Fashion'\n```"}]}, {"id": "train-3818", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city has the highest number of businesses in the food industry whose number of reviews is high?"}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.review_count LIKE 'High' AND T3.category_name LIKE 'Food' GROUP BY T1.city\n```"}]}, {"id": "train-3819", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all business IDs in Mesa city that review stars of over 3."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Mesa' AND T2.review_stars > 3 GROUP BY T1.business_id\n```"}]}, {"id": "train-3820", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city has the least number of businesses whose amount of funny votes is low?"}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T2.review_votes_funny LIKE 'low' GROUP BY T1.city\n```"}]}, {"id": "train-3821", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of businesses are in the Real Estate sector and have the rating of 5 out of all businesses in Chandler?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.stars = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) AS \"percentage\" FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.city LIKE 'Chandler' AND T3.category_name LIKE 'Real Estate'\n```"}]}, {"id": "train-3822", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users who started yelping since 2012 have sent a high number of funny votes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2012 AND user_votes_funny LIKE 'High'\n```"}]}, {"id": "train-3823", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of useful votes that the user 52592 received when reviewed for business number 2?"}, {"from": "gpt", "value": "```sql\nSELECT review_votes_useful FROM Reviews WHERE user_id = 52592 AND business_id = 2\n```"}]}, {"id": "train-3824", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the attribute numbers that are related to payment?"}, {"from": "gpt", "value": "```sql\nSELECT attribute_id FROM Attributes WHERE attribute_name LIKE '%payment%'\n```"}]}, {"id": "train-3825", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long was the review for business number 2 that user number 612 wrote?"}, {"from": "gpt", "value": "```sql\nSELECT review_length FROM Reviews WHERE user_id = 612 AND review_stars = 5 AND business_id = 2\n```"}]}, {"id": "train-3826", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses are actively running in Gilbert City?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE city LIKE 'Gilbert' AND active LIKE 'True'\n```"}]}, {"id": "train-3827", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses in the AZ state got low quality of reviews?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND review_count LIKE 'Low'\n```"}]}, {"id": "train-3828", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please state any three business numbers in AZ state that have received the \"Great experience\" review stars."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.business_id FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.state LIKE 'AZ' AND T1.review_stars = 5 LIMIT 3\n```"}]}, {"id": "train-3829", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please name one attribute that business number 2 does not have."}, {"from": "gpt", "value": "```sql\nSELECT T1.attribute_name FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value LIKE 'none' LIMIT 1\n```"}]}, {"id": "train-3830", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"cool\" compliments did user number 33 receive?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.compliment_type) FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.user_id = 33 AND T2.compliment_type LIKE 'cool'\n```"}]}, {"id": "train-3831", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the opening hours of business number 53 on Friday?"}, {"from": "gpt", "value": "```sql\nSELECT T1.closing_time - T1.opening_time AS \"opening hours\" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week LIKE 'Friday' AND T1.business_id = 53\n```"}]}, {"id": "train-3832", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the attributes that business number 56 have?"}, {"from": "gpt", "value": "```sql\nSELECT T1.attribute_name FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value LIKE 'TRUE' AND T2.business_id = 56\n```"}]}, {"id": "train-3833", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the categories that business number 15 belongs to?"}, {"from": "gpt", "value": "```sql\nSELECT T2.category_name FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id WHERE T1.business_id = 15\n```"}]}, {"id": "train-3834", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses are there in Scottsdale city under the category of \"Beauty & Spas\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) 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 WHERE T3.city LIKE 'Scottsdale' AND T1.category_name LIKE 'Beauty & Spas'\n```"}]}, {"id": "train-3835", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any two user numbers that have an \"Uber\" number of cute compliments."}, {"from": "gpt", "value": "```sql\nSELECT T1.user_id FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.number_of_compliments LIKE 'Uber' AND T2.compliment_type LIKE 'cute' LIMIT 2\n```"}]}, {"id": "train-3836", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses operating in the \"Accessories\" category have received a \"wonderful experience\" review from users?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) 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 WHERE T3.stars > 3 AND T1.category_name LIKE 'Accessories'\n```"}]}, {"id": "train-3837", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long does business number 12 in Scottsdale stay open on day number 3?"}, {"from": "gpt", "value": "```sql\nSELECT T2.closing_time - T2.opening_time AS \"hour\" FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.business_id = 12 AND T1.city LIKE 'Scottsdale' AND T2.day_id = 3\n```"}]}, {"id": "train-3838", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses in AZ state do not open on Thursday?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Checkins AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.label_time_4 LIKE 'None' AND T1.state LIKE 'AZ' AND T3.day_of_week LIKE 'Thursday'\n```"}]}, {"id": "train-3839", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses of Yelp are in Scottsdale?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE city LIKE 'Scottsdale'\n```"}]}, {"id": "train-3840", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the Yelp_Businesses in Arizona, how many of them are still running?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND active LIKE 'True'\n```"}]}, {"id": "train-3841", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Yelp_Businesses in Scottsdale have received positive comments in the Elitestar rating?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE city LIKE 'Scottsdale' AND stars > 3\n```"}]}, {"id": "train-3842", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city has more Yelp_Business that's more appealing to users, Scottsdale or Anthem?"}, {"from": "gpt", "value": "```sql\nSELECT city FROM Business ORDER BY review_count DESC LIMIT 1\n```"}]}, {"id": "train-3843", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Yelp_Businesses in Arizona have a Elitestar rating of over 4?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND stars > 4\n```"}]}, {"id": "train-3844", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Yelp_Businesses are there in Arizona in total?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ'\n```"}]}, {"id": "train-3845", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the cities of the Yelp_Businesses that have gotten a 5 in the Elitestar rating."}, {"from": "gpt", "value": "```sql\nSELECT city FROM Business WHERE stars = 5 GROUP BY city\n```"}]}, {"id": "train-3846", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many reviews have the user whose ID is 3 posted?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(review_length) FROM Reviews WHERE user_id = 3\n```"}]}, {"id": "train-3847", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many reviews made by user whose ID is 3 are long?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(review_length) FROM Reviews WHERE user_id = 3 AND review_length LIKE 'Long'\n```"}]}, {"id": "train-3848", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the long reviews made by user ID 3, how many of them have received a medium number of useful votes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(review_length) FROM Reviews WHERE user_id = 3 AND review_length LIKE 'Long' AND review_votes_useful LIKE 'Medium'\n```"}]}, {"id": "train-3849", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users have joined Yelp since the year 2012?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2012\n```"}]}, {"id": "train-3850", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the users who have a high number of followers."}, {"from": "gpt", "value": "```sql\nSELECT user_id FROM Users WHERE user_fans LIKE 'High' GROUP BY user_id\n```"}]}, {"id": "train-3851", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Yelp_Businesses do not provide alcohol?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.attribute_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name LIKE 'Alcohol' AND T2.attribute_value LIKE 'none'\n```"}]}, {"id": "train-3852", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the Yelp_Businesses in Arizona, how many of them do not provide alcohol?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.attribute_name LIKE 'Alcohol' AND T2.attribute_value LIKE 'none' AND T3.state LIKE 'AZ'\n```"}]}, {"id": "train-3853", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the business IDs of all the Yelp_Businesses that are good for kids."}, {"from": "gpt", "value": "```sql\nSELECT T2.business_id FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name LIKE 'Good for Kids' AND T2.attribute_value LIKE 'TRUE'\n```"}]}, {"id": "train-3854", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Yelp_Business falls under the category of \"Shopping\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.category_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id WHERE T1.category_name LIKE 'Shopping'\n```"}]}, {"id": "train-3855", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Under which categories is Yelp_Business no. 1?"}, {"from": "gpt", "value": "```sql\nSELECT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id WHERE T2.business_id = 1\n```"}]}, {"id": "train-3856", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the Yelp_Businesses which are still running, how many of them fall under the category of \"Food\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.business_id) 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 Tips AS T4 ON T3.business_id = T4.business_id WHERE T1.category_name LIKE 'Food' AND T3.active LIKE 'TRUE'\n```"}]}, {"id": "train-3857", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Yelp_Business in Anthem are under the category of \"Food\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.business_id) 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 WHERE T1.category_name LIKE 'Food' AND T3.city LIKE 'Anthem'\n```"}]}, {"id": "train-3858", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the business ID of the Yelp_Business with the highest Elitestar rating under the category \"Food\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.business_id 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 WHERE T1.category_name LIKE 'Food' ORDER BY T3.stars DESC LIMIT 1\n```"}]}, {"id": "train-3859", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Yelp_Business under the category of \"Food\" are good for kids?"}, {"from": "gpt", "value": "```sql\nSELECT 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'\n```"}]}, {"id": "train-3860", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Yelp_Business in Arizona has user no. 3 reviewed?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.state LIKE 'AZ' AND T1.user_id = 3\n```"}]}, {"id": "train-3861", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the categories of the Yelp_Business in Arizona."}, {"from": "gpt", "value": "```sql\nSELECT T1.category_name 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 WHERE T3.state LIKE 'AZ' GROUP BY T1.category_name\n```"}]}, {"id": "train-3864", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Yelp_Business close after 8PM on Mondays?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week LIKE 'Monday' AND T1.closing_time > '8PM'\n```"}]}, {"id": "train-3865", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the opening time on Mondays of all the Yelp_Businesses in Anthem that are still running."}, {"from": "gpt", "value": "```sql\nSELECT T1.opening_time FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T2.day_of_week LIKE 'Monday' AND T3.city LIKE 'Anthem' AND T3.active LIKE 'True' GROUP BY T1.opening_time\n```"}]}, {"id": "train-3866", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the Yelp_Business in Arizona, how many of them closes at 12PM on Sundays?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T2.day_of_week LIKE 'Sunday' AND T1.closing_time LIKE '12PM' AND T3.state LIKE 'AZ'\n```"}]}, {"id": "train-3867", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the categories of the Yelp_Business that closes at 12PM on Sundays."}, {"from": "gpt", "value": "```sql\nSELECT T4.category_name FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business_Categories AS T3 ON T1.business_id = T3.business_id INNER JOIN Categories AS T4 ON T4.category_id = T4.category_id WHERE T1.closing_time = '12PM' AND T2.day_of_week = 'Sunday' GROUP BY T4.category_name\n```"}]}, {"id": "train-3868", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"Good for Kids\" Yelp_Businesses are open everyday of the week?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business_Attributes AS T3 ON T1.business_id = T3.business_id INNER JOIN Attributes AS T4 ON T4.attribute_id = T4.attribute_id WHERE T2.day_id IN (1, 2, 3, 4, 5, 6, 7) AND T4.attribute_name = 'Good for Kids' AND T3.attribute_value = 'true'\n```"}]}, {"id": "train-3869", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users became an elite user the same year they joined Yelp?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id WHERE T1.user_yelping_since_year = T2.year_id\n```"}]}, {"id": "train-3870", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the longest business time on Mondays for a Yelp_Business under the category \"Shopping\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.closing_time + 12 - T1.opening_time AS \"hour\" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id INNER JOIN Business_Categories AS T4 ON T3.business_id = T4.business_id INNER JOIN Categories AS T5 ON T4.category_id = T5.category_id WHERE T2.day_of_week LIKE 'Monday' AND T5.category_name LIKE 'Shopping' ORDER BY T1.closing_time + 12 - T1.opening_time DESC LIMIT 1\n```"}]}, {"id": "train-3871", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the business IDs of the Yelp_Business that have a business time of longer than 12 hours on Sundays."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T1.closing_time + 12 - T1.opening_time > 12 AND T2.day_of_week LIKE 'Sunday' GROUP BY T1.business_id\n```"}]}, {"id": "train-3872", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many elite users have reviewed Yelp_Business no.1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id INNER JOIN Reviews AS T3 ON T1.user_id = T3.user_id WHERE T3.business_id = 1\n```"}]}, {"id": "train-3873", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users who have posted more than 10 reviews, how many users are elite users?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T4.user_id) FROM ( SELECT T1.user_id FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id INNER JOIN Reviews AS T3 ON T1.user_id = T3.user_id WHERE T3.user_id IS NOT NULL GROUP BY T3.user_id HAVING COUNT(T3.user_id) > 10 ) T4\n```"}]}, {"id": "train-3874", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Yelp_Business in Arizona gets the most number of reviews?"}, {"from": "gpt", "value": "```sql\nSELECT T1.user_id FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.state LIKE 'AZ' GROUP BY T1.user_id ORDER BY COUNT(T1.user_id) DESC LIMIT 1\n```"}]}, {"id": "train-3875", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stars on average does a Yelp_Business in Anthem get from a user review?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.review_stars) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Anthem'\n```"}]}, {"id": "train-3876", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stars on average does user no.3 give to Yelp_Business in Arizona?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.review_stars) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.state LIKE 'AZ' AND T2.user_id = 3\n```"}]}, {"id": "train-3878", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average Elitestar rating for a Yelp_Business that closes at 12PM on Sundays?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T3.stars) AS REAL) / COUNT(T1.business_id) AS \"average stars\" FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T2.day_of_week LIKE 'Sunday' AND T1.closing_time LIKE '12PM'\n```"}]}, {"id": "train-3879", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the busineses are in Casa Grande?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(city) FROM Business WHERE city LIKE 'Casa Grande'\n```"}]}, {"id": "train-3880", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of active businesses in AZ with a low review count?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND active LIKE 'True' AND review_count LIKE 'low'\n```"}]}, {"id": "train-3881", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the business ID with a star range from 2 to 3, located at Mesa."}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM Business WHERE city LIKE 'Mesa' AND stars BETWEEN 2 AND 3\n```"}]}, {"id": "train-3882", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In users yelping since 2011 to 2013, how many of them have high count of fans?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year BETWEEN 2011 AND 2013 AND user_fans LIKE 'High'\n```"}]}, {"id": "train-3883", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the review length of user 35026 to business with business ID 2?"}, {"from": "gpt", "value": "```sql\nSELECT review_length FROM Reviews WHERE user_id = 35026 AND business_id = 2\n```"}]}, {"id": "train-3884", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses in Chandler, list the attribute of the business with a low review count."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.attribute_id, T3.attribute_name FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.attribute_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.review_count = 'Low' AND T1.city = 'Chandler'\n```"}]}, {"id": "train-3885", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In businesses with a category of mexican, how many of them has a star rating below 4?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.stars < 4 AND T3.category_name LIKE 'Mexican'\n```"}]}, {"id": "train-3886", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the active business ID and its stars of the businesses fall under the category of Fashion."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id, T1.stars FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'TRUE' AND T3.category_name LIKE 'Fashion'\n```"}]}, {"id": "train-3887", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the category of businesses with highest star rating?"}, {"from": "gpt", "value": "```sql\nSELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id ORDER BY T1.stars DESC LIMIT 1\n```"}]}, {"id": "train-3888", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the category of the business with medium review length and highest review stars within business ID from 6 t0 9?"}, {"from": "gpt", "value": "```sql\nSELECT T4.category_name FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T1.review_length LIKE 'Medium' AND T2.business_id BETWEEN 6 AND 9 ORDER BY T1.review_stars DESC LIMIT 1\n```"}]}, {"id": "train-3889", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the active businesses that has an attribute of caters with low review count."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T3.attribute_name LIKE 'Caters' AND T1.review_count LIKE 'Low' AND T1.active LIKE 'TRUE'\n```"}]}, {"id": "train-3890", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the closing and opening time of businesses located at Tempe with highest star rating?"}, {"from": "gpt", "value": "```sql\nSELECT T2.closing_time, T2.opening_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Tempe' ORDER BY T1.stars DESC LIMIT 1\n```"}]}, {"id": "train-3891", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the active businesses located at Chandler, AZ, list the category and atrributes of business with a medium review count."}, {"from": "gpt", "value": "```sql\nSELECT T3.category_name, T5.attribute_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id INNER JOIN Business_Attributes AS T4 ON T1.business_id = T4.business_id INNER JOIN Attributes AS T5 ON T4.attribute_id = T5.attribute_id WHERE T1.active LIKE 'TRUE' AND T1.state LIKE 'AZ' AND T1.city LIKE 'Chandler' AND T1.review_count LIKE 'Medium'\n```"}]}, {"id": "train-3892", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the categories of active businesses in Surprise, AZ."}, {"from": "gpt", "value": "```sql\nSELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'TRUE' AND T1.state LIKE 'AZ' AND T1.city LIKE 'Surprise' GROUP BY T3.category_name\n```"}]}, {"id": "train-3893", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the location of businesses that have business hours from 8 am to 9 pm every Friday."}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.closing_time LIKE '9PM' AND T2.opening_time LIKE '8AM' AND T3.day_of_week LIKE 'Friday' GROUP BY T1.city\n```"}]}, {"id": "train-3895", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the opening time of the active businesses in Chandler that has a medium review count."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.opening_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city LIKE 'Chandler' AND T1.active LIKE 'TRUE' AND T1.review_count LIKE 'Medium'\n```"}]}, {"id": "train-3896", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses with a category of Accessories, what is the percentage of the business with less than 4 stars?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.stars < 4 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.stars) AS \"percentage\" FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T3.category_name LIKE 'Accessories'\n```"}]}, {"id": "train-3897", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the closing time and day of week of active businesses in Tempe with stars greater than the 70% of average age of star rating."}, {"from": "gpt", "value": "```sql\nSELECT T2.closing_time, T3.day_of_week FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city LIKE 'Tempe' AND T1.active LIKE 'TRUE' AND T1.stars > 0.7 * ( SELECT AVG(T1.stars) FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city LIKE 'Tempe' AND T1.active LIKE 'TRUE' )\n```"}]}, {"id": "train-3898", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many active businesses are located at Phoenix, Arizona?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE city LIKE 'Phoenix' AND active LIKE 'True'\n```"}]}, {"id": "train-3899", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses are with high review count?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE review_count LIKE 'High'\n```"}]}, {"id": "train-3900", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses ID sell beer and wine?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business_Attributes WHERE attribute_id = 1 AND attribute_value = 'beer_and_wine'\n```"}]}, {"id": "train-3901", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many attributes ID owned by business ID 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(attribute_id) FROM Business_Attributes WHERE business_id = 2\n```"}]}, {"id": "train-3902", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users received high compliment type in photo?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.number_of_compliments LIKE 'High' AND T2.compliment_id = 1\n```"}]}, {"id": "train-3903", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses in Phoenix, Arizona is attributed to waiter service?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.city LIKE 'Phoenix' AND T3.attribute_name LIKE 'waiter_service' AND T2.attribute_id = 2\n```"}]}, {"id": "train-3904", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find out which business is opened for 24/7 and list out what is the business attribute."}, {"from": "gpt", "value": "```sql\nSELECT T5.attribute_name FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.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 T2.day_id LIKE '1' AND '2' AND '3' AND '4' AND '5' AND '6' AND '7' AND T1.opening_time = T1.closing_time GROUP BY T5.attribute_name\n```"}]}, {"id": "train-3905", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which business in fashion category has the most review?"}, {"from": "gpt", "value": "```sql\nSELECT T3.business_id 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 Reviews AS T4 ON T3.business_id = T4.business_id WHERE T1.category_name LIKE 'Fashion' AND T1.category_id = 7 GROUP BY T3.business_id ORDER BY COUNT(T4.user_id) DESC LIMIT 1\n```"}]}, {"id": "train-3906", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out which business category that are most likely to have average good review in Arizona?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.category_name FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T2.state LIKE 'AZ' AND T1.review_stars >= 3\n```"}]}, {"id": "train-3907", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of having the best to worse elite user in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.user_average_stars = 1 THEN 1 ELSE 0 END) AS REAL) / COUNT(T2.user_id) , SUM(CASE WHEN T1.user_average_stars = 5 THEN 1 ELSE 0 END) * 1.0 / COUNT(T2.user_id) FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id WHERE T2.year_id = 2013\n```"}]}, {"id": "train-3908", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the increment percentage of elite user for each year since year 2005."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN year_id < 2014 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(CASE WHEN year_id = 2005 THEN 1.0 ELSE NULL END) AS increment FROM Elite\n```"}]}, {"id": "train-3909", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many business have been reviewed by user ID 3 and how long have this user been with Yelp?"}, {"from": "gpt", "value": "```sql\nSELECT 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\n```"}]}, {"id": "train-3910", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the yearly average review done by user ID 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(review_stars) / (strftime('%Y', 'now') - T1.user_yelping_since_year) FROM Users AS T1 INNER JOIN Reviews AS T2 ON T1.user_id = T2.user_id WHERE T1.user_id = 3\n```"}]}, {"id": "train-3911", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of review received by each business given that the user is an elite?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.user_id) AS REAL) / COUNT(DISTINCT T1.business_id) FROM Reviews AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id\n```"}]}, {"id": "train-3912", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the user who is an elite user for consecutively 5 years or more and what is the user average star? How many likes does this user gets?"}, {"from": "gpt", "value": "```sql\nSELECT T2.user_average_stars, COUNT(T3.likes) FROM Elite AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id INNER JOIN Tips AS T3 ON T3.user_id = T2.user_id GROUP BY T1.user_id HAVING COUNT(T1.user_id) > 5\n```"}]}, {"id": "train-3913", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find out which hotel and travel business having the most review? Calculate the standard deviation of the review star for this business."}, {"from": "gpt", "value": "```sql\nSELECT T2.category_id FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Reviews AS T3 ON T3.business_id = T1.business_id WHERE T2.category_name = 'Hotels & Travel' GROUP BY T2.category_id ORDER BY COUNT(T2.category_id) DESC LIMIT 1\n```"}]}, {"id": "train-3914", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the correlation between the review starts and business stars?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.review_stars) AS REAL) / COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id\n```"}]}, {"id": "train-3915", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the businesses are active?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE active LIKE 'True'\n```"}]}, {"id": "train-3916", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the business ID with a low review count in Phoenix."}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM Business WHERE city LIKE 'Phoenix' AND review_count LIKE 'Low'\n```"}]}, {"id": "train-3917", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of active business in AZ with a high review count?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE state LIKE 'AZ' AND review_count LIKE 'High' AND active LIKE 'True'\n```"}]}, {"id": "train-3918", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the business ID with a star range from 3 to 4, located at Tempe."}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM Business WHERE city LIKE 'Tempe' AND stars BETWEEN 3 AND 4\n```"}]}, {"id": "train-3919", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In users yelping since 2010 to 2012, how many of them has an low fans?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year BETWEEN 2010 AND 2012 AND user_fans LIKE 'Low'\n```"}]}, {"id": "train-3920", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the review length of user 60776 to business with business ID 1?"}, {"from": "gpt", "value": "```sql\nSELECT review_length FROM Reviews WHERE user_id = 60776 AND business_id = 1\n```"}]}, {"id": "train-3921", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses in Scottsdale, list the attribute of the business with a high review count."}, {"from": "gpt", "value": "```sql\nSELECT T3.attribute_name FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.review_count LIKE 'High' AND T1.city LIKE 'Scottsdale' GROUP BY T3.attribute_name\n```"}]}, {"id": "train-3922", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In businesses with a category of automotive, how many of them has an star rating below 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T3.category_name LIKE 'Automotive' AND T1.stars < 3\n```"}]}, {"id": "train-3923", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the active business ID and its stars of the businesses fall under the category of Pets."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id, T1.stars FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'TRUE' AND T3.category_name LIKE 'Pets'\n```"}]}, {"id": "train-3924", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the attribute of the business with highest star rating?"}, {"from": "gpt", "value": "```sql\nSELECT T3.attribute_name FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id ORDER BY T1.stars DESC LIMIT 1\n```"}]}, {"id": "train-3925", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the category of the business with short review length and highest review stars within business ID from 5 t0 10?"}, {"from": "gpt", "value": "```sql\nSELECT T4.category_name FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T1.review_length LIKE 'Short' AND T2.business_id BETWEEN 5 AND 10 ORDER BY T1.review_stars DESC LIMIT 1\n```"}]}, {"id": "train-3926", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the active businesses that has an attribute of Wi-Fi with medium review count."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T3.attribute_name LIKE 'Wi-Fi' AND T1.active LIKE 'TRUE' AND T1.review_count LIKE 'Medium'\n```"}]}, {"id": "train-3927", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the closing and opening time of businesses located at Gilbert with highest star rating?"}, {"from": "gpt", "value": "```sql\nSELECT T2.closing_time, T2.opening_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Gilbert' ORDER BY T1.stars DESC LIMIT 1\n```"}]}, {"id": "train-3928", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the active businesses located at Mesa, AZ, list the category and attributes of business with a low review count."}, {"from": "gpt", "value": "```sql\nSELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T1.review_count = 'Low' AND T1.city = 'Mesa' AND T1.active = 'true' AND T1.state = 'AZ'\n```"}]}, {"id": "train-3929", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the categories of inactive businesses in AZ."}, {"from": "gpt", "value": "```sql\nSELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'FALSE' AND T1.state LIKE 'AZ'\n```"}]}, {"id": "train-3930", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the location of businesses that has business hours from 9 am to 9 pm every Saturday."}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.closing_time LIKE '9PM' AND T2.opening_time LIKE '9AM' AND T3.day_of_week LIKE 'Saturday' GROUP BY T1.city\n```"}]}, {"id": "train-3931", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the attribute value of an inactive business with a medium review count and 3.5 stars which is located at Phoenix, AZ?"}, {"from": "gpt", "value": "```sql\nSELECT T2.attribute_value FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.state LIKE 'AZ' AND T1.review_count LIKE 'Medium' AND T1.active LIKE 'FALSE' AND T1.city LIKE 'Phoenix' AND T1.stars = 3.5\n```"}]}, {"id": "train-3932", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the opening time of the active businesses in Surprise that has a low review count."}, {"from": "gpt", "value": "```sql\nSELECT T2.opening_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city LIKE 'Surprise' AND T1.active LIKE 'TRUE' AND T1.review_count LIKE 'Low' GROUP BY T2.opening_time\n```"}]}, {"id": "train-3933", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses with a category of Local Services, what is the percentage of the business with less than 3 stars?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.stars < 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.stars) AS \"percentage\" FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T3.category_name LIKE 'Local Services'\n```"}]}, {"id": "train-3934", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the closing time and day of week of active businesses in Scottsdale with stars greater than the 60% of average age of star rating."}, {"from": "gpt", "value": "```sql\nSELECT T2.closing_time, T3.day_of_week FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city LIKE 'Scottsdale' AND T1.active LIKE 'TRUE' AND T1.stars > 0.6 * ( SELECT AVG(T1.stars) FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city LIKE 'Scottsdale' AND T1.active LIKE 'TRUE' )\n```"}]}, {"id": "train-3935", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users have no followers in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year = 2004 AND user_fans LIKE 'None'\n```"}]}, {"id": "train-3936", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 5 users that has received less than 5 low compliments from\nother users."}, {"from": "gpt", "value": "```sql\nSELECT user_id FROM Users_Compliments WHERE number_of_compliments LIKE 'Low' GROUP BY user_id ORDER BY COUNT(number_of_compliments) > 5 LIMIT 5\n```"}]}, {"id": "train-3937", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 10 users ID that has 4 as an average ratings of all reviews sent."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_id) FROM Users WHERE user_average_stars = 4 LIMIT 10\n```"}]}, {"id": "train-3938", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What city does the business have a business hour from 10 am to 12 pm on Sunday?"}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.opening_time LIKE '10AM' AND T2.closing_time LIKE '12PM' AND T3.day_of_week LIKE 'Sunday'\n```"}]}, {"id": "train-3939", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses are opened for 24 hours?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value LIKE 'TRUE' AND T1.attribute_name LIKE 'Open 24 Hours'\n```"}]}, {"id": "train-3941", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the active businesses in Ahwatukee, which of them are still open in Sunday?"}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city LIKE 'Ahwatukee' AND T1.active LIKE 'TRUE' AND T3.day_of_week LIKE 'Sunday'\n```"}]}, {"id": "train-3942", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the categories of all active businesses that were not in Arizona."}, {"from": "gpt", "value": "```sql\nSELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'TRUE' AND T1.state NOT LIKE 'AZ'\n```"}]}, {"id": "train-3943", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the category of the business with high review count but received 2 stars."}, {"from": "gpt", "value": "```sql\nSELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.stars = 2 AND T1.review_count LIKE 'High'\n```"}]}, {"id": "train-3944", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses have a romantic ambiance?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value = 'true' AND T1.attribute_name = 'ambience_romantic'\n```"}]}, {"id": "train-3945", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the city of the business where they open from 1 pm to 6 pm on Saturday."}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.closing_time LIKE '6PM' AND T2.opening_time LIKE '1PM' AND T3.day_of_week LIKE 'Saturday'\n```"}]}, {"id": "train-3946", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of fans or followers who received most likes of their comments in the business?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_fans) FROM Users AS T1 INNER JOIN Tips AS T2 ON T1.user_id = T2.user_id ORDER BY COUNT(T2.likes) DESC LIMIT 1\n```"}]}, {"id": "train-3948", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses have shopping centers and received high review count?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) 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 WHERE T1.category_name = 'Shopping Centers' AND T3.review_count = 'High'\n```"}]}, {"id": "train-3949", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses accept insurance?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business_Attributes AS T1 INNER JOIN Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_name = 'Accepts Insurance' AND T1.attribute_value = 'true'\n```"}]}, {"id": "train-3950", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average review star from users in businesses located in South Carolina and California state."}, {"from": "gpt", "value": "```sql\nSELECT 1.0 * (( SELECT SUM(T1.stars) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.state = 'SC' ) + ( SELECT SUM(T1.stars) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.state = 'CA' )) / ( SELECT SUM(T1.stars) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id ) AS reslut\n```"}]}, {"id": "train-3951", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compare and get the difference of the number of businesses that are open in Monday and Tuesday from 10 am to 9 pm."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.day_of_week = 'Monday' THEN 1 ELSE 0 END) - SUM(CASE WHEN T3.day_of_week = 'Tuesday' THEN 1 ELSE 0 END) AS DIFF FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.opening_time = '10AM' AND T2.closing_time = '9PM'\n```"}]}, {"id": "train-3952", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the ID number for the attribute named \"Accepts Insurance\"?"}, {"from": "gpt", "value": "```sql\nSELECT attribute_id FROM Attributes WHERE attribute_name = 'Accepts Insurance'\n```"}]}, {"id": "train-3953", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many actively running Yelp businesses are there located in \"Phoenix\" city?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE active = 'true' AND city = 'Phoenix'\n```"}]}, {"id": "train-3954", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of \"4\" stars Yelp businesses in \"Mesa\" city."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE stars = 4 AND city = 'Mesa'\n```"}]}, {"id": "train-3955", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of Yelp businesses in \"Gilbert\" which got a\" high\" review count."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE review_count = 'High' AND city = 'Gilbert'\n```"}]}, {"id": "train-3956", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which actively running Yelp business in \"Gilbert\" has got the most reviews? Give the business id."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.active = 'true' AND T1.city = 'Gilbert' AND T1.review_count = 'Uber'\n```"}]}, {"id": "train-3957", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the Yelp business in \"Tempe\" city which got \"3.5\" stars and review count as \"Uber\", how many \"long\" reviews did it get?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.review_length) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Tempe' AND T1.stars = '3.5' AND T1.review_count = 'Uber' AND T2.review_length = 'Long'\n```"}]}, {"id": "train-3958", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How is the \"noise level\" for the only Yelp business in \u201cMesa\u201d which got a \"Uber\" review count?"}, {"from": "gpt", "value": "```sql\nSELECT T3.attribute_name FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.city = 'Mesa' AND T1.review_count = 'Uber' AND T3.attribute_name = 'Noise Level'\n```"}]}, {"id": "train-3959", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is the Yelp business No. 14033 good for supper?"}, {"from": "gpt", "value": "```sql\nSELECT T1.attribute_value FROM Business_Attributes AS T1 INNER JOIN Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_name = 'good_for_dinner' AND T1.business_id = 14033\n```"}]}, {"id": "train-3960", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long is the Yelp business No. 15098 opened on Monday?"}, {"from": "gpt", "value": "```sql\nSELECT SUBSTR(T1.closing_time, 1, 2) + 12 - SUBSTR(T1.opening_time, 1, 2) AS YYSJ FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T2.day_of_week = 'Monday' AND T1.business_id = 15098\n```"}]}, {"id": "train-3961", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the Yelp businesses which received a \"5\" star review with \"uber\" number of votes for funny, which one is located in \"Phoenix\"? Give the business ID."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Phoenix' AND T2.review_stars = 5 AND T2.review_votes_funny = 'Uber'\n```"}]}, {"id": "train-3962", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city is the business that got a \"medium\" length tip with \"3\" likes located in?"}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM Business AS T1 INNER JOIN Tips AS T2 ON T1.business_id = T2.business_id WHERE T2.tip_length = 'Medium' AND T2.likes = 3\n```"}]}, {"id": "train-3963", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the user who joined Yelp in \"2010\", with an average of \"4.5\" stars review and has got uber number of fans, how many \"funny\" compliments has he/she received from other users?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.user_id) FROM Users AS T1 INNER JOIN Users_Compliments AS T2 ON T1.user_id = T2.user_id INNER JOIN Compliments AS T3 ON T2.compliment_id = T3.compliment_id WHERE T1.user_yelping_since_year = 2010 AND T1.user_average_stars = 4.5 AND T1.user_fans = 'Uber' AND T3.compliment_type = 'funny'\n```"}]}, {"id": "train-3964", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"cool\" type compliments does user No. 41717 get?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.number_of_compliments) FROM Compliments AS T1 INNER JOIN Users_Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.compliment_type = 'cool' AND T2.user_id = 41717\n```"}]}, {"id": "train-3965", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Does Yelp business No.\"11825\" have a \"parking lot\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.attribute_value FROM Business_Attributes AS T1 INNER JOIN Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.business_id = 11825 AND T2.attribute_name = 'parking_lot'\n```"}]}, {"id": "train-3966", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is the payment in mastercard possible for the Yelp business No.\"12476\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.attribute_value FROM Business_Attributes AS T1 INNER JOIN Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.business_id = 12476 AND T2.attribute_name = 'payment_types_mastercard'\n```"}]}, {"id": "train-3967", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage for the Yelp businesses in \"Pets\" category of all businesses?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.category_name = 'Pets' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.category_name) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id\n```"}]}, {"id": "train-3968", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times is the number of \"Women's Clothing\" Yelp businesses to \"Men's Clothing\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.category_name = 'Women''s Clothing' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.category_name = 'Men''s Clothing' THEN 1 ELSE 0 END) AS TIMES FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id\n```"}]}, {"id": "train-3969", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the ID, active status and city of the business which are in CA state."}, {"from": "gpt", "value": "```sql\nSELECT business_id, active, city FROM Business WHERE state = 'CA' AND active = 'true'\n```"}]}, {"id": "train-3970", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of running business among all business."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN active = 'true' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(business_id) FROM Business\n```"}]}, {"id": "train-3971", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all attribute names, list down the ID and attribute name which start with \"music\"."}, {"from": "gpt", "value": "```sql\nSELECT attribute_id, attribute_name FROM Attributes WHERE attribute_name LIKE 'music%'\n```"}]}, {"id": "train-3972", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 2006 and 2007, which year ID had the greater number in elite user?"}, {"from": "gpt", "value": "```sql\nSELECT year_id FROM Elite WHERE year_id IN (2006, 2007) GROUP BY year_id ORDER BY COUNT(user_id) DESC LIMIT 1\n```"}]}, {"id": "train-3973", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Based on all user compliments, find the percentage of low number of compliments on all compliments ID."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN number_of_compliments = 'Low' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(user_id) FROM Users_compliments\n```"}]}, {"id": "train-3974", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the business ID and user ID who got uber for cool votes."}, {"from": "gpt", "value": "```sql\nSELECT business_id, user_id FROM Reviews WHERE review_votes_cool = 'Uber'\n```"}]}, {"id": "train-3975", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the user ID, business ID and tips length of who started using Yelp since 2004 and had high followers."}, {"from": "gpt", "value": "```sql\nSELECT T1.user_id, T2.business_id, T2.tip_length FROM Users AS T1 INNER JOIN Tips AS T2 ON T1.user_id = T2.user_id WHERE T1.user_yelping_since_year = 2004 AND T1.user_fans = 'High'\n```"}]}, {"id": "train-3976", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the review votes of funny and cool hit uber with long review length, describe the business ID, active status, user ID and user year of joining Yelp."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id, T1.active, T3.user_id, T3.user_yelping_since_year FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id INNER JOIN Users AS T3 ON T2.user_id = T3.user_id WHERE T2.review_votes_cool = 'Uber' AND T2.review_votes_funny = 'Uber' AND T2.review_length = 'Long'\n```"}]}, {"id": "train-3977", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Under the attribute name of \"music_playlist\", describe the attribute ID, business ID, city and inactive status."}, {"from": "gpt", "value": "```sql\nSELECT T1.attribute_id, T2.business_id, T3.city FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.attribute_name = 'music_playlist' AND T3.active = 'false'\n```"}]}, {"id": "train-3978", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of business with attribute name of \"Accepts Credit Cards\"."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.attribute_name = 'Accepts Credit Cards' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.attribute_name) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id\n```"}]}, {"id": "train-3979", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the stopped businesses in San Tan Valley city, list down the user ID and review length of who had great experience."}, {"from": "gpt", "value": "```sql\nSELECT T2.user_id, T2.review_length FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'San Tan Valley' AND T1.active = 'false' AND T2.review_stars = 5\n```"}]}, {"id": "train-3980", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the user average star, elite year and the compliment type of user ID 6027 whereby number of compliments reach uber."}, {"from": "gpt", "value": "```sql\nSELECT T2.user_average_stars, T1.year_id, T4.compliment_type, T3.number_of_compliments FROM Elite AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id INNER JOIN Users_Compliments AS T3 ON T2.user_id = T3.user_id INNER JOIN Compliments AS T4 ON T3.compliment_id = T4.compliment_id INNER JOIN Years AS T5 ON T1.year_id = T5.year_id WHERE T3.number_of_compliments = 'Uber' AND T3.user_id = 6027\n```"}]}, {"id": "train-3981", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Under the category name of \"Coffee & Tea\", mention any 5 business ID , their state and city."}, {"from": "gpt", "value": "```sql\nSELECT T2.business_id, T3.state, T3.city 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 WHERE T1.category_name = 'Coffee & Tea' LIMIT 5\n```"}]}, {"id": "train-3982", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe category name which had above 10% in comparing with all business and categories."}, {"from": "gpt", "value": "```sql\nSELECT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id GROUP BY T2.category_id HAVING COUNT(T2.business_id) > ( SELECT COUNT(T3.business_id) FROM Business_Categories AS T3 ) * 0.1\n```"}]}, {"id": "train-3983", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the business with great experience existed in Sun Lakes city, provide the user ID who gave review on it and user followers."}, {"from": "gpt", "value": "```sql\nSELECT T3.user_id, T3.user_fans FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id INNER JOIN Users AS T3 ON T2.user_id = T3.user_id WHERE T1.city = 'Sun Lakes' AND T1.stars = 5\n```"}]}, {"id": "train-3984", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compare the number of business between the category of \"Men's Clothing\" and \"Women's Clothing\"."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.category_name = 'Men''s Clothing' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.category_name = 'Women''s Clothing' THEN 1 ELSE 0 END) AS diff FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id\n```"}]}, {"id": "train-3985", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among highest quality user of under ID 100, mention compliment type which got highest compliment number and user's followers."}, {"from": "gpt", "value": "```sql\nSELECT T1.compliment_type, T3.user_fans FROM Compliments AS T1 INNER JOIN Users_Compliments AS T2 ON T1.compliment_id = T2.compliment_id INNER JOIN Users AS T3 ON T2.user_id = T3.user_id WHERE T2.number_of_compliments = 'Uber' AND T2.user_id < 100\n```"}]}, {"id": "train-3986", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the businesses that closed at 8PM."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT business_id FROM Business_Hours WHERE closing_time = '8PM'\n```"}]}, {"id": "train-3987", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 2 stars rated business located in Phoenix, Arizona?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE city = 'Phoenix' AND state = 'AZ' AND stars = 2\n```"}]}, {"id": "train-3988", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses in Tempe are rated as 'Wonderful experience?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE city = 'Phoenix' AND stars > 3\n```"}]}, {"id": "train-3989", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the users with average star less than 3 stars in 2012"}, {"from": "gpt", "value": "```sql\nSELECT user_id FROM Users WHERE user_yelping_since_year = 2012 AND user_average_stars < 3\n```"}]}, {"id": "train-3990", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the percentage of 5 stars rated business."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN stars = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(stars) FROM Business\n```"}]}, {"id": "train-3991", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate difference between business that have the highest number of reviews and business that have the lowest number of reviews."}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT COUNT(business_id) FROM Reviews GROUP BY business_id ORDER BY COUNT(business_id) DESC LIMIT 1 ) - ( SELECT COUNT(business_id) FROM Reviews GROUP BY business_id ORDER BY COUNT(business_id) ASC LIMIT 1 ) AS DIFF\n```"}]}, {"id": "train-3992", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the tires businesses that are opened everyday."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.business_id 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_Hours AS T4 ON T3.business_id = T4.business_id WHERE T1.category_name = 'Tires' GROUP BY T2.business_id HAVING COUNT(day_id) = 7\n```"}]}, {"id": "train-3993", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which users become an elite in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.user_id FROM Elite AS T1 INNER JOIN Years AS T2 ON T1.year_id = T2.year_id WHERE T2.actual_year = 2012\n```"}]}, {"id": "train-3994", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the business ID of shopping business that have 4 stars ratings."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'Shopping' AND T1.stars = 4\n```"}]}, {"id": "train-3995", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many business have low check-in on Sunday at 10AM?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Days AS T1 INNER JOIN Checkins AS T2 ON T1.day_id = T2.day_id WHERE T1.day_of_week = 'Sunday' AND T2.label_time_10 = 'Low'\n```"}]}, {"id": "train-3996", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses in Glendale are reviewed by user with the ID of 20241?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Glendale' AND T2.user_id = 20241\n```"}]}, {"id": "train-3997", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the locations of all Pet Services business."}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'Pet Services'\n```"}]}, {"id": "train-3998", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many photos type compliment given from users with high cool votes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Users_Compliments AS T2 ON T1.user_id = T2.user_id INNER JOIN Compliments AS T3 ON T2.compliment_id = T3.compliment_id INNER JOIN Reviews AS T4 ON T1.user_id = T4.user_id WHERE T3.compliment_type = 'photos' AND T4.review_votes_cool = 'High'\n```"}]}, {"id": "train-3999", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many closed businesses that have more than 10 attributes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Business WHERE business_id IN ( SELECT T1.business_id FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id WHERE T1.active = 'false' GROUP BY T1.business_id HAVING COUNT(DISTINCT T2.attribute_id) > 10 )\n```"}]}, {"id": "train-4000", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the business located in Mesa that have alcohol attribute."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.city = 'Mesa' AND T3.attribute_name = 'Alcohol'\n```"}]}, {"id": "train-4001", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Based on business in Phoenix, calculate the percentage of business with low funny votes."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.review_votes_funny = 'Low' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Phoenix'\n```"}]}, {"id": "train-4002", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio between business in shopping category and business in pets category?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.category_name = 'Shopping' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.category_name = 'Pets' THEN 1 ELSE 0 END) AS radio FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id\n```"}]}, {"id": "train-4003", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses are registered in the database under 'Banks & Credit Unions' category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id WHERE T1.category_name = 'Banks & Credit Unions'\n```"}]}, {"id": "train-4004", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many active businesses from Casa Grande are registered in the database?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE active = 'true' AND city = 'Casa Grande'\n```"}]}, {"id": "train-4005", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What time does the business with ID no.12 open on Monday?"}, {"from": "gpt", "value": "```sql\nSELECT T1.opening_time FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T1.business_id = 12 AND T2.day_of_week = 'Monday'\n```"}]}, {"id": "train-4006", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses that are registered in the database can be attributed to 'Good for Kids'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name = 'Good for Kids' AND T2.attribute_value = 'true'\n```"}]}, {"id": "train-4007", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the most popular and appealing active business in Gilbert based on users' reviews."}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM Business WHERE city = 'Gilbert' AND active = 'true' AND review_count = 'High' ORDER BY stars DESC LIMIT 1\n```"}]}, {"id": "train-4008", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the 5-star business in Ahwatukee, AZ and identify it's business category."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id, T3.category_name FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T1.city = 'Ahwatukee' AND T1.stars = 5\n```"}]}, {"id": "train-4009", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all closed businesses in Avondale, AZ what percent have obtained a 'wonderful experience' rating of the business."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN stars > 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(stars) FROM Business WHERE city = 'Avondale' AND active = 'false'\n```"}]}, {"id": "train-4010", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the user who has been yelping since 2004. Is he or she an Yelp Elite member?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.user_id FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id WHERE T1.user_yelping_since_year = 2004\n```"}]}, {"id": "train-4011", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the percent of long reviews among all 5-star reviews given to businesses by the Yelp users."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN review_length = 'Long' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(review_length) FROM Reviews WHERE review_stars = 5\n```"}]}, {"id": "train-4012", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the users with the average ratings of at least 4 and above of all reviews, calculate the percent that have no fans or followers."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN user_fans = 'None' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(user_id) FROM Users WHERE user_average_stars >= 4\n```"}]}, {"id": "train-4013", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many short tips were left for the business with ID no.2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Tips WHERE business_id = 2 AND tip_length = 'Short'\n```"}]}, {"id": "train-4015", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the operating hours of businesses in Black Canyon City with review count greater than average."}, {"from": "gpt", "value": "```sql\nSELECT T2.opening_time, T2.closing_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city = 'Black Canyon City' GROUP BY t2.business_id HAVING T1.review_count > AVG(T1.review_count)\n```"}]}, {"id": "train-4016", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the users who received the high number of compliments, what percent received the 'cute' type of compliment."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.compliment_type = 'cute' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.user_id) FROM Compliments AS T1 INNER JOIN Users_Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T2.number_of_compliments = 'High'\n```"}]}, {"id": "train-4017", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the number of businesses that have no any attribute."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business_Attributes WHERE attribute_value IN ('none', 'no', 'false')\n```"}]}, {"id": "train-4019", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out city name of businesses which have medium length of review."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.city FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T2.review_length = 'Medium'\n```"}]}, {"id": "train-4021", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses which have short length of review, which one located in Phoenix?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Phoenix' AND T2.review_length = 'Short'\n```"}]}, {"id": "train-4022", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users whose fan is medium, how many users received high compliments from other users."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Users_Compliments AS T2 ON T1.user_id = T2.user_id WHERE T2.number_of_compliments = 'High' AND T1.user_fans = 'Medium'\n```"}]}, {"id": "train-4023", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users who received low compliments from other users, which users joined Yelp in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.user_id FROM Users AS T1 INNER JOIN Users_Compliments AS T2 ON T1.user_id = T2.user_id WHERE T1.user_yelping_since_year = 2012 AND T2.number_of_compliments = 'Low'\n```"}]}, {"id": "train-4024", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses without attribute, how many businesses located in Gilbert?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Business_Attributes AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.city = 'Gilbert' AND T1.attribute_value IN ('None', 'no', 'false')\n```"}]}, {"id": "train-4025", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses with average rating, how many business has attribute of full_bar."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business_Attributes AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.attribute_value = 'full_bar'\n```"}]}, {"id": "train-4026", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the state of businesses which have opening time at 1AM."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.state FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T2.opening_time = '1AM'\n```"}]}, {"id": "train-4027", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the category name of business id 5."}, {"from": "gpt", "value": "```sql\nSELECT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id WHERE T2.business_id = 5\n```"}]}, {"id": "train-4028", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the user id that has compliment type of photos."}, {"from": "gpt", "value": "```sql\nSELECT T2.user_id FROM Compliments AS T1 INNER JOIN Users_Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.compliment_type = 'photos'\n```"}]}, {"id": "train-4029", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of medium tip length in the list. List out the time when users of medium tip length join Yelp."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.tip_length = 'Medium' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.tip_length), T2.user_yelping_since_year FROM Tips AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id\n```"}]}, {"id": "train-4030", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of businesses who located in Mesa. What is attribute value of these businesses."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.city) AS REAL) * 100 / ( SELECT COUNT(business_id) FROM Business ), T2.attribute_value FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Mesa'\n```"}]}, {"id": "train-4031", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the state of businesses which have closing time at 12AM."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.state FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T2.closing_time = '12AM'\n```"}]}, {"id": "train-4032", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses which have attribute of beer_and_wine, how many business located in Peoria?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business_Attributes AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.city = 'Peoria' AND T1.attribute_value = 'beer_and_wine'\n```"}]}, {"id": "train-4033", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users who received high compliments from other users, which users joined Yelp earliest?"}, {"from": "gpt", "value": "```sql\nSELECT T2.user_id FROM Users AS T1 INNER JOIN Users_Compliments AS T2 ON T1.user_id = T2.user_id WHERE T2.number_of_compliments = 'High' AND T1.user_yelping_since_year = ( SELECT MIN(user_yelping_since_year) FROM Users )\n```"}]}, {"id": "train-4034", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which business ID has the most reviews?"}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM Reviews GROUP BY business_id ORDER BY COUNT(user_id) DESC LIMIT 1\n```"}]}, {"id": "train-4035", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year has the most elite users?"}, {"from": "gpt", "value": "```sql\nSELECT year_id FROM Elite GROUP BY year_id ORDER BY COUNT(user_id) DESC LIMIT 1\n```"}]}, {"id": "train-4036", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 5 star businesses have uber review votes for funny?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Reviews WHERE review_stars = 5 AND review_votes_funny = 'Uber'\n```"}]}, {"id": "train-4037", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users have uber review votes for funny from the fans?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT user_id) FROM Reviews WHERE review_votes_funny = 'Uber'\n```"}]}, {"id": "train-4038", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which business ID have the shortest business operating hours?"}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM Business_Hours ORDER BY closing_time - opening_time LIMIT 1\n```"}]}, {"id": "train-4039", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find out which business ID are opened all the time."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT business_id FROM Business_Hours WHERE day_id >= 1 AND day_id < 8 AND opening_time = closing_time\n```"}]}, {"id": "train-4040", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Does the length of the tip influence the number of likes for hotel and travel business category?"}, {"from": "gpt", "value": "```sql\nSELECT T3.tip_length, SUM(T3.likes) AS likes FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Tips AS T3 ON T2.business_id = T3.business_id WHERE T1.category_name = 'Hotels & Travel' GROUP BY T3.tip_length\n```"}]}, {"id": "train-4041", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users manage to get uber votes for all of the review category? Find out what are the user average star."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.user_id) AS USER_IDS, T2.user_average_stars FROM Reviews AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.review_votes_funny = 'Uber' AND T1.review_votes_useful = 'Uber' AND T1.review_votes_cool = 'Uber'\n```"}]}, {"id": "train-4042", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of good to bad business star for a businesses that are opened all the time?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.stars BETWEEN 3.5 AND 5 THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.stars BETWEEN 1 AND 2.5 THEN 1 ELSE 0 END) AS ratio FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id\n```"}]}, {"id": "train-4043", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out 10 business ID that are being reviewed the most by users and list out what are top 3 business categories."}, {"from": "gpt", "value": "```sql\nSELECT T2.business_id, T3.category_name FROM Reviews AS T1 INNER JOIN Business_categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id GROUP BY T2.business_id ORDER BY COUNT(T1.user_id) DESC LIMIT 10\n```"}]}, {"id": "train-4044", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses in Arizona having an average review less than 3 stars?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE business_id IN ( SELECT DISTINCT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.state = 'AZ' GROUP BY T1.business_id HAVING SUM(T2.review_stars) / COUNT(T2.user_id) < 3 )\n```"}]}, {"id": "train-4045", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of user not becoming an elite user?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((( SELECT COUNT(user_id) FROM Users ) - ( SELECT COUNT(DISTINCT user_id) FROM Elite )) AS REAL) * 100 / ( SELECT COUNT(user_id) FROM Users )\n```"}]}, {"id": "train-4046", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the most common compliments types received by user with uber number of fans?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.compliment_type FROM Users AS T1 INNER JOIN Users_Compliments AS T2 ON T1.user_id = T2.user_id INNER JOIN Compliments AS T3 ON T2.compliment_id = T3.compliment_id WHERE T1.user_fans = 'Uber'\n```"}]}, {"id": "train-4047", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average year needed by a user with uber fans to become an elite user?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.year_id - T1.user_yelping_since_year) AS REAL) / COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id WHERE T1.user_fans = 'Uber'\n```"}]}, {"id": "train-4048", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average year for a user to be upgraded to elite user?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.year_id - T1.user_yelping_since_year) AS REAL) / COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id\n```"}]}, {"id": "train-4049", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many business are opened for more than 8 hour in Mesa and what is the percentage of the active businesses?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.active = 'true' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.business_id) AS ACT FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Mesa'\n```"}]}, {"id": "train-4050", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many active businesses are opened during late afternoon in the Phoenix city? List out the top 3 categories name for these businesses."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.category_name FROM Business_Hours AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T2.active = 'true' AND T2.city = 'Phoenix' AND T1.opening_time >= '5PM' LIMIT 3\n```"}]}, {"id": "train-4051", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which user has done the most review on a business attributed to delivery?"}, {"from": "gpt", "value": "```sql\nSELECT T3.user_id FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Reviews AS T3 ON T2.business_id = T3.business_id WHERE T1.attribute_name = 'Delivery' GROUP BY T3.user_id ORDER BY COUNT(T2.business_id) DESC LIMIT 1\n```"}]}, {"id": "train-4052", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of reviews written for active businesses that operate not more than 30 hours a week?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.user_id) FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Reviews AS T3 ON T1.business_id = T3.business_id WHERE T1.active = 'true' GROUP BY T2.closing_time - T2.opening_time HAVING SUM(T2.closing_time - T2.opening_time) < 30\n```"}]}, {"id": "train-4053", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many business ids have opening hours from 8AM to 6PM?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT business_id FROM Business_Hours WHERE opening_time = '8AM' AND closing_time = '6PM'\n```"}]}, {"id": "train-4054", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide business ids with opening hours 10AM on Saturday."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT business_id FROM Business_Hours WHERE day_id = 6 AND opening_time = '10AM'\n```"}]}, {"id": "train-4055", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the business id and days which are opened from 8AM to 6PM."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT day_id FROM Business_Hours WHERE opening_time = '8AM' AND closing_time = '6PM'\n```"}]}, {"id": "train-4056", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses id are rated more than 4?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE stars > 4\n```"}]}, {"id": "train-4057", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the categories of businesses that have opening time on Sunday?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business_Hours AS T3 ON T2.business_id = T3.business_id INNER JOIN Days AS T4 ON T3.day_id = T4.day_id WHERE T4.day_of_week = 'Sunday' AND T3.opening_time <> ''\n```"}]}, {"id": "train-4058", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate the opening day of businesses whose category is pets."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.day_of_week FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business_Hours AS T3 ON T1.business_id = T3.business_id INNER JOIN Days AS T4 ON T3.day_id = T4.day_id WHERE T2.category_name = 'Pets'\n```"}]}, {"id": "train-4059", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate the closing hours and business days of the businesses with the category named Doctors."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.opening_time, T3.day_id FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business_Hours AS T3 ON T1.business_id = T3.business_id INNER JOIN Days AS T4 ON T3.day_id = T4.day_id WHERE T2.category_name = 'Doctors'\n```"}]}, {"id": "train-4060", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the working days from Monday to Saturday, which businesses with the category names work the most days?"}, {"from": "gpt", "value": "```sql\nSELECT T2.category_name FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business_Hours AS T3 ON T1.business_id = T3.business_id INNER JOIN Days AS T4 ON T3.day_id = T4.day_id GROUP BY T2.category_name ORDER BY COUNT(T3.day_id) DESC LIMIT 1\n```"}]}, {"id": "train-4061", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate the business id have the closing time with the category of Arts & Entertainment on Sunday."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id, T3.closing_time FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business_Hours AS T3 ON T1.business_id = T3.business_id INNER JOIN Days AS T4 ON T3.day_id = T4.day_id WHERE T2.category_name = 'Arts & Entertainment' AND T4.day_of_week = 'Sunday'\n```"}]}, {"id": "train-4062", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In businesses with a category of \"DJs\", how many businesses are rated less than 5?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'DJs' AND T1.stars < 5\n```"}]}, {"id": "train-4063", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List active business ids with opening times of 7AM and closing times of 8PM."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.business_id FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business_Hours AS T3 ON T2.business_id = T3.business_id INNER JOIN Business AS T4 ON T3.business_id = T4.business_id WHERE T4.active = 'true' AND T3.opening_time = '7AM' AND T3.closing_time = '8PM'\n```"}]}, {"id": "train-4064", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses with the category named Stadiums & Arenas are rated highest?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T2.category_name = 'Stadiums & Arenas' AND T3.stars = ( SELECT MAX(stars) FROM Business )\n```"}]}, {"id": "train-4065", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many category id have low review count and rating more than 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.category_id) 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 WHERE T3.review_count = 'Low' AND T3.stars > 2\n```"}]}, {"id": "train-4067", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the active businesses in Arizona, how many businesses work after 12PM?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.business_id) FROM Business_Hours AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Business_Categories AS T3 ON T2.business_id = T3.business_id INNER JOIN Categories AS T4 ON T3.category_id = T4.category_id WHERE T2.active = 'true' AND T2.state = 'AZ' AND T1.opening_time > '12PM'\n```"}]}, {"id": "train-4068", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the name of businesses with user id \"16328\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.category_name FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Tips AS T3 ON T2.business_id = T3.business_id WHERE T3.user_id = 16328\n```"}]}, {"id": "train-4069", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses have the category named food? List those businesses and find the percentage of businesses with less than 2 stars."}, {"from": "gpt", "value": "```sql\nSELECT T3.business_id, CAST((( SELECT COUNT(business_id) FROM Business WHERE stars < 2 ) - ( SELECT COUNT(business_id) FROM Business WHERE stars > 2 )) AS REAL) * 100 / ( SELECT COUNT(stars) FROM Business ) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T2.category_name = 'Food'\n```"}]}, {"id": "train-4070", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of businesses with the category name food that are open from 7AM to 8PM in the businesses with the same time."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.category_name = 'Food' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.category_name) FROM Business_Categories AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T1.category_id = T3.category_id\n```"}]}, {"id": "train-4071", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the number of running business with each review count in Cave Creek city."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN review_count = 'High' THEN 1 ELSE 0 END) AS high , SUM(CASE WHEN review_count = 'Medium' THEN 1 ELSE 0 END) AS Medium , SUM(CASE WHEN review_count = 'Low' THEN 1 ELSE 0 END) AS low FROM Business WHERE city = 'Cave Creek' AND active = 'true'\n```"}]}, {"id": "train-4072", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the yearly average user who started using Yelp from the year of 2005 to 2014."}, {"from": "gpt", "value": "```sql\nSELECT AVG(user_id) FROM Users WHERE user_yelping_since_year >= 2005 AND user_yelping_since_year <= 2015\n```"}]}, {"id": "train-4073", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the active and inactive ratio of the business with the review count of low."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN active = 'true' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN active = 'false' THEN 1 ELSE 0 END) AS radio FROM Business WHERE review_count = 'Low'\n```"}]}, {"id": "train-4074", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List any five of user ID who became elite user in 2006."}, {"from": "gpt", "value": "```sql\nSELECT user_id FROM Elite WHERE year_id = 2006 LIMIT 5\n```"}]}, {"id": "train-4075", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the any five of ID and name of category that starts with alphabet \"P\"."}, {"from": "gpt", "value": "```sql\nSELECT category_id, category_name FROM Categories WHERE category_name LIKE 'P%' LIMIT 5\n```"}]}, {"id": "train-4076", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the list of user ID along with review star of which has the review length of medium with business ID of 35."}, {"from": "gpt", "value": "```sql\nSELECT user_id, review_stars FROM Reviews WHERE business_id = 15 AND review_length = 'Medium'\n```"}]}, {"id": "train-4077", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the business ID and attribute value of the attribute name of \"payment_types_visa\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.business_id, T2.attribute_value FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name = 'payment_types_visa'\n```"}]}, {"id": "train-4078", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe ID and active status of the business under category of \"Diagnostic Imaging\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.business_id, T3.active 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 WHERE T1.category_name = 'Diagnostic Imaging'\n```"}]}, {"id": "train-4079", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the user ID and their year of joining Yelp who had great experience on business ID 143."}, {"from": "gpt", "value": "```sql\nSELECT T2.user_id, T2.user_yelping_since_year FROM Reviews AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.business_id = 143 AND T1.review_stars = 5\n```"}]}, {"id": "train-4080", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the user ID with number in compliment of uber on profile, list any 5 user ID and the year when they join Yelp."}, {"from": "gpt", "value": "```sql\nSELECT T3.user_id, T3.user_yelping_since_year FROM Compliments AS T1 INNER JOIN Users_Compliments AS T2 ON T1.compliment_id = T2.compliment_id INNER JOIN Users AS T3 ON T2.user_id = T3.user_id WHERE T1.compliment_type = 'profile' AND T2.number_of_compliments = 'Uber' LIMIT 5\n```"}]}, {"id": "train-4081", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the user ID, business ID with review length of the business which received the most likes in tips."}, {"from": "gpt", "value": "```sql\nSELECT T1.user_id, T1.business_id, T2.review_length FROM Tips AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id ORDER BY T1.likes DESC LIMIT 1\n```"}]}, {"id": "train-4082", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the elite users of 10 consecutive year from 2005 to 2014, list down the user ID and their number of compliment on photos."}, {"from": "gpt", "value": "```sql\nSELECT T2.user_id, T2.number_of_compliments FROM Compliments AS T1 INNER JOIN Users_Compliments AS T2 ON T1.compliment_id = T2.compliment_id INNER JOIN Elite AS T3 ON T2.user_id = T3.user_id WHERE T3.year_id BETWEEN 2005 AND 2014 AND T1.compliment_type = 'photos'\n```"}]}, {"id": "train-4083", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of business which opened on Sunday from 9AM to 9PM based on the number of business opened on Sunday."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.opening_time = '9AM' AND T2.closing_time = '9PM' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.day_id) FROM Days AS T1 INNER JOIN Business_Hours AS T2 ON T1.day_id = T2.day_id WHERE T1.day_of_week = 'Sunday'\n```"}]}, {"id": "train-4084", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the ID and opening day of a week for the business which are running in Black Canyon City."}, {"from": "gpt", "value": "```sql\nSELECT T2.business_id, T3.day_of_week FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city = 'Black Canyon City' AND T1.active = 'true'\n```"}]}, {"id": "train-4086", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which business ID received the review of 4 star and above by 65% of user? Describe their active status and city."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.business_id, T2.city FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.review_stars >= 4 AND ( SELECT CAST(( SELECT COUNT(DISTINCT T1.user_id) FROM Reviews AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.review_stars >= 4 ) AS REAL) * 100 / ( SELECT COUNT(user_id) FROM Users ) > 65 )\n```"}]}, {"id": "train-4087", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference between running business in Glendale City and Mesa City."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN city = 'Glendale' THEN 1 ELSE 0 END) - SUM(CASE WHEN city = 'Mesa' THEN 1 ELSE 0 END) AS diff FROM Business WHERE active = 'true'\n```"}]}, {"id": "train-4088", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many likes did short comment left by users who joined in 2010 get?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.likes) FROM Users AS T1 INNER JOIN Tips AS T2 ON T1.user_id = T2.user_id WHERE T1.user_yelping_since_year = 2010\n```"}]}, {"id": "train-4090", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Sum up the likes get by short reviews on businesses located in City Goodyear."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.likes) AS likes FROM Business AS T1 INNER JOIN Tips AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Goodyear'\n```"}]}, {"id": "train-4091", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For businesses with long length reviews, which state are they located?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.state FROM Business AS T1 INNER JOIN Tips AS T2 ON T1.business_id = T2.business_id WHERE T2.tip_length = 'Long'\n```"}]}, {"id": "train-4092", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much time do businesses in El Mirage City, AZ State operate in average daily?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.closing_time - T2.opening_time) FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'El Mirage' AND T1.state = 'AZ'\n```"}]}, {"id": "train-4094", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the category of businesses whose stars ratings are 5."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T1.stars = 5\n```"}]}, {"id": "train-4095", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the states of businesses with attribute of beer and wine located?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.state FROM Business_Attributes AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T1.attribute_value = 'beer_and_wine'\n```"}]}, {"id": "train-4096", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many user's compliment in photo has medium in number?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.user_id) FROM Compliments AS T1 INNER JOIN Users_Compliments AS T2 ON T1.compliment_id = T2.compliment_id WHERE T1.compliment_type = 'photos' AND T2.number_of_compliments = 'Medium'\n```"}]}, {"id": "train-4098", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Sum up the number of business with \"ambience_romantic\" attribute."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name = 'ambience_romantic' AND T2.attribute_value = 'true'\n```"}]}, {"id": "train-4099", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of businesses with \"Good for Kids\" attribute over the other attributes?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN attribute_name = 'Good for Kids' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T2.attribute_value = 'true'\n```"}]}, {"id": "train-4100", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses are not closed in the city of Mesa?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE city = 'Mesa' AND active = 'true'\n```"}]}, {"id": "train-4101", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In how many businesses have customers had a bad or terrible experience?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE stars IN (1, 2)\n```"}]}, {"id": "train-4102", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List by ID the businesses with the reviews with the lowest veracity of Paradise Valley."}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM Business WHERE stars > 3 AND city = 'Paradise Valley' AND review_count = 'Low'\n```"}]}, {"id": "train-4103", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses have more than 1 attribute?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business_Attributes WHERE attribute_value > 1\n```"}]}, {"id": "train-4104", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses are opened the same number of hours every day of the week?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business_Hours WHERE opening_time = '8AM' AND closing_time = '6PM'\n```"}]}, {"id": "train-4105", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many reviews of businesses that are still open received an uber rating on the funny vote?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T2.review_votes_funny = 'Uber' AND T1.active = 'true'\n```"}]}, {"id": "train-4106", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the users who use a high number of compliments do not have any fans?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.user_id) FROM Users_Compliments AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.number_of_compliments = 'High' AND T2.user_fans = 'None'\n```"}]}, {"id": "train-4107", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common type of compliments that a user has received from other users?"}, {"from": "gpt", "value": "```sql\nSELECT T2.compliment_type FROM Users_Compliments AS T1 INNER JOIN Compliments AS T2 ON T1.compliment_id = T2.compliment_id GROUP BY T2.compliment_type ORDER BY COUNT(T2.compliment_type) DESC LIMIT 1\n```"}]}, {"id": "train-4108", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stars does each of the 3 top users with the most likes in their reviews have?"}, {"from": "gpt", "value": "```sql\nSELECT T2.user_average_stars FROM Tips AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id GROUP BY T2.user_id ORDER BY SUM(T1.likes) DESC LIMIT 3\n```"}]}, {"id": "train-4109", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which categories does the only business located in the city of Arcadia appear?"}, {"from": "gpt", "value": "```sql\nSELECT T1.category_name 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 WHERE T3.city = 'Arcadia'\n```"}]}, {"id": "train-4110", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List by their id all businesses that are open on Sunday."}, {"from": "gpt", "value": "```sql\nSELECT T1.business_id FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id WHERE T1.day_id = 1\n```"}]}, {"id": "train-4111", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses with music_karaoke attribute are closed?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.attribute_name = 'music_karaoke' AND T3.active = 'false' AND T2.attribute_value IN ('none', 'no', 'false')\n```"}]}, {"id": "train-4112", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many open businesses in the City of Phoenix have users left a long review?"}, {"from": "gpt", "value": "```sql\nSELECT 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'\n```"}]}, {"id": "train-4113", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users who have received a low cool vote have also received at least 1 low cool vote for some of their reviews?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.user_id) FROM Users AS T1 INNER JOIN Reviews AS T2 ON T1.user_id = T2.user_id WHERE T1.user_votes_cool = 'Low' AND T2.review_votes_cool = 'Low'\n```"}]}, {"id": "train-4114", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users with a long tip and 2 likes for their tip have a high number of fans?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.user_id) FROM Users AS T1 INNER JOIN Tips AS T2 ON T1.user_id = T2.user_id WHERE T2.tip_length = 'Long' AND T2.likes = 2 AND T1.user_fans = 'High'\n```"}]}, {"id": "train-4115", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In how many businesses with the ambience_trendy attribute?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id WHERE T1.attribute_name = 'ambience_trendy' AND T2.attribute_value IN ('none', 'no', 'false')\n```"}]}, {"id": "train-4116", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses in the city of Scottsdale open on Sunday at 12PM?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.business_id) FROM Business AS T1 INNER JOIN Business_hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city = 'Scottsdale' AND T3.day_of_week = 'Sunday' AND T2.opening_time = '12PM'\n```"}]}, {"id": "train-4117", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of stars for businesses in the Obstetricians & Gynecologists category?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.stars) AS REAL) / COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'Obstetricians & Gynecologists'\n```"}]}, {"id": "train-4118", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of users with a high number of fans who were elite in 2011."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.user_fans = 'High' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.user_fans) FROM Years AS T1 INNER JOIN Elite AS T2 ON T1.year_id = T2.year_id INNER JOIN Users AS T3 ON T2.user_id = T3.user_id WHERE T1.actual_year = 2011\n```"}]}, {"id": "train-4119", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the businesses are in Surprise?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE city = 'Surprise'\n```"}]}, {"id": "train-4120", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the business ID with a high review count in Tempe."}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM Business WHERE review_count = 'High' AND city = 'Tempe'\n```"}]}, {"id": "train-4121", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of active businesses in AZ with a medium review count?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM Business WHERE review_count = 'Medium' AND state = 'AZ' AND active = 'true'\n```"}]}, {"id": "train-4122", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the business ID with a star range from 3 to 5, located at Chandler."}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM Business WHERE stars >= 3 AND stars < 6 AND city = 'Chandler'\n```"}]}, {"id": "train-4123", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In users yelping since 2009 to 2011, how many of them have low count of fans?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(user_id) FROM Users WHERE user_yelping_since_year >= 2009 AND user_yelping_since_year < 2012 AND user_fans = 'Low'\n```"}]}, {"id": "train-4124", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the review length of user 11021 to business with business ID 3?"}, {"from": "gpt", "value": "```sql\nSELECT review_length FROM Reviews WHERE user_id = 11021 AND business_id = 3\n```"}]}, {"id": "train-4125", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses in Tempe, list the attribute of the business with a medium review count."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.attribute_name FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.city = 'Tempe' AND T1.review_count = 'Medium'\n```"}]}, {"id": "train-4126", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In businesses with a category of food, how many of them have a star rating below 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'Food' AND T1.stars < 3\n```"}]}, {"id": "train-4127", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the active business ID and its stars of the businesses fall under the category of Food."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.business_id, T1.stars FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'Food' AND T1.active = 'true'\n```"}]}, {"id": "train-4128", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the category and attributes of businesses with highest star rating?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.category_name, T5.attribute_name FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id INNER JOIN Business_Attributes AS T4 ON T2.business_id = T4.business_id INNER JOIN Attributes AS T5 ON T4.attribute_id = T5.attribute_id WHERE T1.stars = ( SELECT MAX(stars) FROM Business )\n```"}]}, {"id": "train-4129", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the category of the business with short review length and highest review stars within business ID from 7 to 14?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.category_name FROM Reviews AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T2.business_id >= 7 AND T2.business_id < 15 AND T1.review_length = 'Short' AND T1.review_stars = ( SELECT MAX(review_stars) FROM Reviews )\n```"}]}, {"id": "train-4130", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the active businesses that has an attribute of BYOB with high review count."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.business_id) FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T3.attribute_name = 'BYOB' AND T1.review_count = 'High' AND T1.active = 'true'\n```"}]}, {"id": "train-4131", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the closing and opening time of businesses located at Glendale with highest star rating?"}, {"from": "gpt", "value": "```sql\nSELECT T2.opening_time, T2.closing_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T1.city = 'Glendale' ORDER BY T1.stars DESC LIMIT 1\n```"}]}, {"id": "train-4133", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the categories of active businesses in Glendale, AZ."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.category_name FROM Business_Categories AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T1.category_id = T3.category_id WHERE T2.active = 'true' AND T2.state = 'AZ' AND T2.city = 'Glendale'\n```"}]}, {"id": "train-4134", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the location of businesses that has business hours from 7 am to 7 pm every Wednesday."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.city FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.opening_time = '7AM' AND T2.closing_time = '7PM' AND T3.day_of_week = 'Wednesday'\n```"}]}, {"id": "train-4135", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the attribute value of an active business with a low review count and 3 stars which is located at Goodyear, AZ?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.attribute_value FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.state = 'AZ' AND T1.city = 'Goodyear' AND T1.active = 'true' AND T1.stars = 3 AND T1.review_count = 'Low'\n```"}]}, {"id": "train-4136", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the opening time of the active businesses in Glendale that have a medium review count."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.opening_time FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.city = 'Glendale' AND T1.review_count = 'Medium' AND T1.active = 'true'\n```"}]}, {"id": "train-4137", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses with a category of Food, what is the percentage of the business with greater than 3 stars?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.stars > 3 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.stars) FROM Business AS T1 INNER JOIN Business_Categories AS T2 ON T1.business_id = T2.business_id INNER JOIN Categories AS T3 ON T2.category_id = T3.category_id WHERE T3.category_name = 'Food'\n```"}]}, {"id": "train-4138", "db_id": "public_review_platform", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the closing time and day of week of active businesses in Goodyear with stars greater than the 80% of average age of star rating."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.closing_time, T3.day_of_week FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T1.active = 'true' AND T1.city = 'Goodyear' AND T1.stars > ( SELECT AVG(stars) * 0.8 FROM Business WHERE active = 'true' AND city = 'Goodyear' )\n```"}]}, {"id": "train-4139", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the citation, what is the percentage of paper ID under the Agents classification?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN class_label = 'Agents' THEN paper_id ELSE NULL END) AS REAL) * 100 / COUNT(paper_id) FROM paper\n```"}]}, {"id": "train-4140", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most cited word? How many papers was that word cited in?"}, {"from": "gpt", "value": "```sql\nSELECT word_cited_id, COUNT(paper_id) FROM content GROUP BY word_cited_id ORDER BY COUNT(word_cited_id) DESC LIMIT 1\n```"}]}, {"id": "train-4141", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of word cited under that class labelled 'AI'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI'\n```"}]}, {"id": "train-4142", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all words cited in paper ID 315017, state the other paper ID and class label which also cited those words."}, {"from": "gpt", "value": "```sql\nSELECT T1.class_label, T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.paper_id = 315017\n```"}]}, {"id": "train-4143", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the DB class type citation, which word is the most frequently cited?"}, {"from": "gpt", "value": "```sql\nSELECT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'DB' GROUP BY T2.word_cited_id ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1\n```"}]}, {"id": "train-4144", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of words used in Agents class label."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(DISTINCT CASE WHEN T1.class_label = 'Agents' THEN T2.word_cited_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id\n```"}]}, {"id": "train-4145", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which paper ID cited the most word? In which class label does it belongs to?"}, {"from": "gpt", "value": "```sql\nSELECT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id GROUP BY T1.paper_id, T1.class_label ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1\n```"}]}, {"id": "train-4146", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the paper ID and its class type that cited the word 'word1002'."}, {"from": "gpt", "value": "```sql\nSELECT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T2.word_cited_id = 'word1002'\n```"}]}, {"id": "train-4147", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all words cited in the AI class label."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI'\n```"}]}, {"id": "train-4148", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the class label of paper ID 'chakrabarti01integrating'. How many words were cited by this paper ID?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.class_label, COUNT(T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.paper_id = 'chakrabarti01integrating' GROUP BY T1.class_label\n```"}]}, {"id": "train-4149", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all paper ID and its class type with more than 20 cited words."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.paper_id, T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id GROUP BY T2.paper_id, T1.class_label HAVING COUNT(T2.word_cited_id) > 20\n```"}]}, {"id": "train-4150", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the words that are cited in both AI and IR class label."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'AI' OR T1.class_label = 'IR'\n```"}]}, {"id": "train-4151", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the paper which is cited most times and the paper which is cited least times? Also, find the number of times each one is cited."}, {"from": "gpt", "value": "```sql\nSELECT cited_paper_id, COUNT(cited_paper_id), ( SELECT cited_paper_id FROM cites GROUP BY cited_paper_id ORDER BY COUNT(cited_paper_id) ASC LIMIT 1 ), ( SELECT COUNT(cited_paper_id) FROM cites GROUP BY cited_paper_id ORDER BY COUNT(cited_paper_id) ASC LIMIT 1 ) FROM cites GROUP BY cited_paper_id ORDER BY COUNT(cited_paper_id) DESC LIMIT 1\n```"}]}, {"id": "train-4152", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On average, how many papers are under the ML class?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN class_label = 'ML' THEN paper_id ELSE NULL END) AS REAL) / COUNT(paper_id) FROM paper\n```"}]}, {"id": "train-4153", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the words cited in papers that are cited by sima01computational?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.word_cited_id FROM cites AS T1 INNER JOIN content AS T2 ON T1.cited_paper_id = T2.paper_id WHERE T1.citing_paper_id = 'sima01computational'\n```"}]}, {"id": "train-4154", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many papers were cited by schmidt99advanced cited word3555?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.paper_id) FROM cites AS T1 INNER JOIN content AS T2 ON T1.cited_paper_id = T2.paper_id WHERE T1.citing_paper_id = 'schmidt99advanced' AND T2.word_cited_id = 'word3555'\n```"}]}, {"id": "train-4155", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Under what classification do the papers that cited word1163 belong?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.class_label FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T2.word_cited_id = 'word1163'\n```"}]}, {"id": "train-4156", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the papers under DB classification, which paper has the highest number of words cited?"}, {"from": "gpt", "value": "```sql\nSELECT T1.paper_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'DB' GROUP BY T1.paper_id ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1\n```"}]}, {"id": "train-4157", "db_id": "citeseer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the papers classified as ML, how many cited butz01algorithmic?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.paper_id) FROM paper AS T1 INNER JOIN cites AS T2 ON T1.paper_id = T2.citing_paper_id WHERE T1.class_label = 'ML' AND T2.cited_paper_id = 'butz01algorithmic'\n```"}]}, {"id": "train-4158", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which crew member of the simpson 20s is the oldest?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM Person WHERE birthdate IS NOT NULL ORDER BY birthdate ASC LIMIT 1;\n```"}]}, {"id": "train-4159", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the nickname for Dan Castellaneta?"}, {"from": "gpt", "value": "```sql\nSELECT nickname FROM Person WHERE name = 'Dan Castellaneta';\n```"}]}, {"id": "train-4160", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the crew members of the simpson 20s born in the New York city, how many of them were born after the year 1970?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM Person WHERE birth_region = 'New York' AND SUBSTR(birthdate, 1, 4) > '1970';\n```"}]}, {"id": "train-4161", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which country was the winner of the Outstanding Voice-Over Performance award of 2009 born?"}, {"from": "gpt", "value": "```sql\nSELECT T1.birth_country FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award = 'Outstanding Voice-Over Performance' AND T2.year = 2009 AND T2.result = 'Winner';\n```"}]}, {"id": "train-4162", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the awards won by the crew member whose nickname is Doofus."}, {"from": "gpt", "value": "```sql\nSELECT T2.award FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T1.nickname = 'Doofus' AND T2.result = 'Winner';\n```"}]}, {"id": "train-4163", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crew members who were born in the USA were nominated for the Outstanding Animated Program (For Programming Less Than One Hour) award in 2009?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T1.birth_country = 'USA' AND T2.result = 'Nominee' AND T2.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T2.year = 2009;\n```"}]}, {"id": "train-4164", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which character won the Outstanding Voice-Over Performance award in 2009?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.character FROM Character_Award AS T1 INNER JOIN Award AS T2 ON T1.award_id = T2.award_id WHERE T2.award = 'Outstanding Voice-Over Performance' AND T2.year = 2009 AND T2.result = 'Winner';\n```"}]}, {"id": "train-4165", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the keywords of the episode Lost Verizon."}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Lost Verizon';\n```"}]}, {"id": "train-4166", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many keywords does the episode that was aired on 2008/10/19 have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.air_date = '2008-10-19';\n```"}]}, {"id": "train-4167", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the rating of the episode in which Dan Castellaneta won the Outstanding Voice-Over Performance award in 2009?"}, {"from": "gpt", "value": "```sql\nSELECT T2.rating FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Outstanding Voice-Over Performance' AND SUBSTR(T1.year, 1, 4) = '2009' AND T1.person = 'Dan Castellaneta';\n```"}]}, {"id": "train-4168", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 7-star votes in star score did the episode Lost Verizon have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lost Verizon' AND T2.stars = 7;\n```"}]}, {"id": "train-4169", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stars did most of the voters give in star score for the episode Lost Verizon?"}, {"from": "gpt", "value": "```sql\nSELECT T2.stars FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lost Verizon' ORDER BY T2.votes DESC LIMIT 1;\n```"}]}, {"id": "train-4170", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of the episodes that have over 200 voters voting a 10 in star score."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.votes > 200 AND T2.stars = 10;\n```"}]}, {"id": "train-4171", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many episodes aired in the year 2009 have over 15% of voters giving 10 stars in star score?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2009' AND T2.stars = 10 AND T2.percent > 15;\n```"}]}, {"id": "train-4172", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the title of the episode that got the most 7-star votes in star score?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 7 ORDER BY T2.votes DESC LIMIT 1;\n```"}]}, {"id": "train-4173", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stars on average does the episode Lost Verizon have?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.votes * T2.stars) AS REAL) / SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lost Verizon';\n```"}]}, {"id": "train-4174", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of Primetime Emmy nominated episodes with a rating over 7 to all the episodes that have a rating over 7?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.award_category = 'Primetime Emmy' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.rating > 7 AND T1.result = 'Nominee';\n```"}]}, {"id": "train-4175", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the title of the episode where Pamela Hayden voiced the character 'Ruthie.'"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Pamela Hayden' AND T2.role = 'Ruthie';\n```"}]}, {"id": "train-4176", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all the roles of Matt Groening on the episode titled 'In the Name of the Grandfather' along with the episode number and series number."}, {"from": "gpt", "value": "```sql\nSELECT T2.role, T1.episode, T1.number_in_series FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Matt Groening' AND T1.title = 'In the Name of the Grandfather';\n```"}]}, {"id": "train-4177", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the title and summary of the episode with the keyword 'eviction.'"}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T1.summary FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = 'eviction';\n```"}]}, {"id": "train-4178", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of stars received by the episode titled 'Wedding for Disaster.'"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.stars) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Wedding for Disaster';\n```"}]}, {"id": "train-4179", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the title and all the keywords of the episode that was aired on 3/22/2009."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.air_date = '2009-03-22';\n```"}]}, {"id": "train-4180", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the birth name of the person who voiced 'Helen Lovejoy?'"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.birth_name FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T2.role = 'Helen Lovejoy';\n```"}]}, {"id": "train-4181", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage ratio between uncredited and credited roles on the episode that won the 2017 Jupiter Award for Best International TV Series? Please include the title of the episode and the names of the persons who were uncredited alongside their role in that episode."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.credited = 'false' THEN 1 END) AS REAL) * 100 / SUM(CASE WHEN T2.credited = 'true' THEN 1 END), T3.title, T2.person FROM Award AS T1 INNER JOIN Credit AS T2 ON T2.episode_id = T1.episode_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2017' AND T1.award_category = 'Jupiter Award' AND T1.award = 'Best International TV Series' AND T1.result = 'Winner';\n```"}]}, {"id": "train-4182", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many episodes have more than 1000 votes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(episode_id) FROM Episode WHERE votes > 1000;\n```"}]}, {"id": "train-4183", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many persons were born in New York, USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM Person WHERE birth_place = 'New York City' AND birth_country = 'USA';\n```"}]}, {"id": "train-4184", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of all awards along with the award category, nominated by Marc Wilmore."}, {"from": "gpt", "value": "```sql\nSELECT award_id, award_category FROM Award WHERE person = 'Marc Wilmore';\n```"}]}, {"id": "train-4185", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crew have their own nickname? List their full name along with the nickname."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM Person WHERE nickname IS NOT NULL;\n```"}]}, {"id": "train-4186", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the average height for each person."}, {"from": "gpt", "value": "```sql\nSELECT AVG(height_meters) FROM Person;\n```"}]}, {"id": "train-4187", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference between the highest votes for episode and the lowest votes for episode."}, {"from": "gpt", "value": "```sql\nSELECT MAX(votes) - MIN(votes) FROM Vote;\n```"}]}, {"id": "train-4188", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name character awarded for the Outstanding Voice-Over Performance award in 2009."}, {"from": "gpt", "value": "```sql\nSELECT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.year = 2009 AND T1.award = 'Outstanding Voice-Over Performance';\n```"}]}, {"id": "train-4189", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the person nominated for the Comedy Series Award in 2009, how many of them were born in California?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.year = 2009 AND T2.award = 'Comedy Series' AND T1.birth_region = 'California';\n```"}]}, {"id": "train-4190", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of episode that won the Best International TV Series Award in 2017?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2017' AND T1.award = 'Best International TV Series' AND T1.result = 'Winner';\n```"}]}, {"id": "train-4191", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of persons who were not included in the credit for the 'How the Test Was Won' episode."}, {"from": "gpt", "value": "```sql\nSELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'How the Test Was Won' AND T2.credited = 'false';\n```"}]}, {"id": "train-4192", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of episode that has a keyword of 'riot' and 'cake'?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword IN ('riot', 'cake');\n```"}]}, {"id": "train-4193", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode has the most vote for 10 stars rating?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 10 ORDER BY T1.votes DESC LIMIT 1;\n```"}]}, {"id": "train-4194", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all the person who involved in the making of simpson 20s episode that aired between October to November."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.air_date, 6, 2) BETWEEN '10' AND '11';\n```"}]}, {"id": "train-4195", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of director for the 'Treehouse of Horror XIX' episode."}, {"from": "gpt", "value": "```sql\nSELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Treehouse of Horror XIX' AND T2.role = 'director';\n```"}]}, {"id": "train-4196", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Based on the credits, state how many roles were played in the 5th episode of simpson 20."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.role) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 5;\n```"}]}, {"id": "train-4197", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the keyword for 'Take My Life, Please' episode."}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Take My Life, Please';\n```"}]}, {"id": "train-4198", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the episode that get more than 950 votes, how many of the episodes were nominated for the 'Outstanding Voice-Over Performance Award in 2009'? Find the percentage of the episodes."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.award = 'Outstanding Voice-Over Performance' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.episode_id) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.votes > 950 AND T1.year = 2009;\n```"}]}, {"id": "train-4199", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio between the 5 stars votes for 'No Loan Again, Naturally' episode and 'Coming to Homerica' episode?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.title = 'No Loan Again, Naturally' THEN T1.votes ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.title = 'Coming to Homerica' THEN T1.votes ELSE 0 END) AS ratio FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 5;\n```"}]}, {"id": "train-4200", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times was Ian Maxtone-Graham nominated for an award in Writers Guild of America, USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(award_id) FROM Award WHERE person = 'Ian Maxtone-Graham' AND organization = 'Writers Guild of America, USA' AND result = 'Nominee';\n```"}]}, {"id": "train-4201", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the person that has the highest number of nominated award but didn't win?"}, {"from": "gpt", "value": "```sql\nSELECT person FROM Award WHERE result = 'Nominee' GROUP BY person ORDER BY COUNT(person) DESC LIMIT 1;\n```"}]}, {"id": "train-4202", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the episode that received the lowest rating?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM Episode ORDER BY rating LIMIT 1;\n```"}]}, {"id": "train-4203", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What year did the Simpsons receive its first ever award for Favorite Animated Comedy in People's Choice Award?"}, {"from": "gpt", "value": "```sql\nSELECT year FROM Award WHERE result = 'Winner' AND award = 'Favorite Animated Comedy' ORDER BY year DESC LIMIT 1;\n```"}]}, {"id": "train-4204", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many episodes was Dell Hake not included in the credit list?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Credit WHERE person = 'Dell Hake' AND credited = 'false';\n```"}]}, {"id": "train-4205", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How old was the awardee when he/she won the first-ever award for Outstanding Voice-Over Performance in Primetime Emmy Awards?"}, {"from": "gpt", "value": "```sql\nSELECT T2.year - CAST(SUBSTR(T1.birthdate, 1, 4) AS int) AS age FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award = 'Outstanding Voice-Over Performance' AND T2.organization = 'Primetime Emmy Awards' AND T2.result = 'Winner';\n```"}]}, {"id": "train-4206", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What character did Dan Castellaneta play that won him an award for Outstanding Voice-Over Performance in 2009 in the Primetime Emmy Awards?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.person = 'Dan Castellaneta' AND T1.award = 'Outstanding Voice-Over Performance' AND T1.organization = 'Primetime Emmy Awards' AND T1.year = 2009;\n```"}]}, {"id": "train-4207", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the episodes aired on April of 2009, how many episodes won an award?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.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 T2.air_date LIKE '2009-04%';\n```"}]}, {"id": "train-4208", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the birth place of the cast or crew member who won the Best Voice-Over Performance in Online Film & Television Association in 2009?"}, {"from": "gpt", "value": "```sql\nSELECT T1.birth_place FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award = 'Best Voice-Over Performance' AND T2.organization = 'Online Film & Television Association' AND T2.year = 2009;\n```"}]}, {"id": "train-4209", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 10 star votes did the top 4 episodes with the highest rating received?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 10 ORDER BY T1.rating DESC LIMIT 4;\n```"}]}, {"id": "train-4210", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In \"No Loan Again, Naturally\", how many stars received votes of no more than 50?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'No Loan Again, Naturally' AND T2.votes < 50;\n```"}]}, {"id": "train-4211", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many award winners are from the USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T1.birth_country = 'USA' AND T2.result = 'Winner';\n```"}]}, {"id": "train-4212", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Season 20 Episode 11, how many times was Doofus included in the credit list?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.nickname = 'Doofus' AND T2.credited = 'true' AND T2.episode_id = 'S20-E11';\n```"}]}, {"id": "train-4213", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT T2.award, T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.result = 'Winner' ORDER BY T2.year LIMIT 1;\n```"}]}, {"id": "train-4214", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In \"Sex, Pies and Idiot Scrapes\", how many percentage of votes did the 9 star score has?"}, {"from": "gpt", "value": "```sql\nSELECT T2.percent FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Sex, Pies and Idiot Scrapes' AND T2.stars = 9;\n```"}]}, {"id": "train-4215", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the award name and persons who won the award in 2009."}, {"from": "gpt", "value": "```sql\nSELECT award, person FROM Award WHERE result = 'Winner' AND SUBSTR(year, 1, 4) = '2009';\n```"}]}, {"id": "train-4216", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT name, birthdate FROM Person WHERE birth_place = 'Los Angeles' AND height_meters >= 1.8;\n```"}]}, {"id": "train-4217", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the episode number, title and rating of which were aired in October, 2008."}, {"from": "gpt", "value": "```sql\nSELECT episode, title, rating FROM Episode WHERE SUBSTR(air_date, 1, 7) LIKE '2008-10%';\n```"}]}, {"id": "train-4218", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the award ID, award name and winner for character named \"Homer simpson 20\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.award_id, T1.award, T1.person FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Homer Simpson' AND T1.result = 'Winner';\n```"}]}, {"id": "train-4219", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the award name, result, credit category and credited status of the \"Billy Kimball\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.award, T1.result, T2.category, T2.credited FROM Award AS T1 INNER JOIN Credit AS T2 ON T2.episode_id = T1.episode_id WHERE T2.person = 'Billy Kimball';\n```"}]}, {"id": "train-4220", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the person, award, organization, result and credited status of the assistant director in S20-E13."}, {"from": "gpt", "value": "```sql\nSELECT T1.person, T1.award, T1.organization, T1.result, T2.credited FROM Award AS T1 INNER JOIN Credit AS T2 ON T2.episode_id = T1.episode_id WHERE T2.episode_id = 'S20-E13' AND T2.role = 'assistant director';\n```"}]}, {"id": "train-4221", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the birth country, height and person name who were not included in credit list with category of casting."}, {"from": "gpt", "value": "```sql\nSELECT T1.birth_country, T1.height_meters, T1.name FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T2.category = 'Cast' AND T2.credited = 'false';\n```"}]}, {"id": "train-4222", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the nominee, keywords and episode ID of the title \"The Good, the Sad and the Drugly\"."}, {"from": "gpt", "value": "```sql\nSELECT T3.person, T1.keyword, T1.episode_id FROM Keyword AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Award AS T3 ON T2.episode_id = T3.episode_id WHERE T2.title = 'The Good, the Sad and the Drugly' AND T3.result = 'Nominee';\n```"}]}, {"id": "train-4223", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the voting numbers and percentage of the best rating scale of the episode which had keyword of \"arab stereotype\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.votes, T2.percent FROM Keyword AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.keyword = 'arab stereotype' AND T2.stars = 10;\n```"}]}, {"id": "train-4224", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the episode who won the award held by Jupiter Award, describe award name, aired date and rating of that episode."}, {"from": "gpt", "value": "```sql\nSELECT T1.award, T2.air_date, T2.rating FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.organization = 'Jupiter Award' AND T1.result = 'Winner';\n```"}]}, {"id": "train-4225", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the episode ID, title and any three keywords of the episode which get the most number of votes in star classification of worst."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.episode_id, T2.title, T1.keyword FROM Keyword AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Vote AS T3 ON T2.episode_id = T3.episode_id WHERE T3.stars = 1 ORDER BY T3.votes DESC LIMIT 3;\n```"}]}, {"id": "train-4226", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the episodes with excellent rating which were aired in 2008, describe the title, episode's image, award name and person who were nominated."}, {"from": "gpt", "value": "```sql\nSELECT T2.title, T2.episode_image, T1.award, T1.person FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.rating BETWEEN 7 AND 10 AND SUBSTR(T2.air_date, 1, 4) = '2008' AND T1.result = 'Nominee';\n```"}]}, {"id": "train-4227", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the award title, person and character name of the award ID 326."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.award, T1.person, T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.award_id = 326;\n```"}]}, {"id": "train-4228", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe name, birth country, role in episode and age in 2022 of the oldest crew member.."}, {"from": "gpt", "value": "```sql\nSELECT T1.name, T1.birth_place, T2.role, 2022 - CAST(SUBSTR(T1.birthdate, 1, 4) AS int) AS age FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.birthdate IS NOT NULL ORDER BY T1.birthdate LIMIT 1;\n```"}]}, {"id": "train-4229", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of credits, category, role and birthplace of the crew member who was born in North Korea."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.credited, T2.category, T2.role, T1.birth_place FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.birth_country = 'North Korea';\n```"}]}, {"id": "train-4230", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the winning rate of award in 2010. Describe the winner name, award name, episode title and role of the winner in that episode."}, {"from": "gpt", "value": "```sql\nSELECT T3.rate, T4.person, T4.award, T5.title, T4.role FROM ( SELECT CAST(SUM(CASE WHEN T1.result = 'Winner' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.result IN ('Winner', 'Nominee') THEN 1 ELSE 0 END) AS rate , T1.person, T1.award, T2.title, T1.role FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2010' ) AS T3 INNER JOIN Award AS T4 INNER JOIN Episode AS T5 ON T4.episode_id = T5.episode_id WHERE T4.year = 2010 AND T4.result = 'Winner';\n```"}]}, {"id": "train-4231", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the title of the episode that received the highest star score and the highest number of votes."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id ORDER BY T2.stars DESC, T2.votes DESC LIMIT 1;\n```"}]}, {"id": "train-4232", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of awards won by The simpson 20s: Season 20?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(award_id) FROM Award WHERE result = 'Winner';\n```"}]}, {"id": "train-4234", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of stars assigned to The simpson 20s: S20-E12? What is the said episode all about?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.stars), T1.summary FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.episode_id = 'S20-E12';\n```"}]}, {"id": "train-4236", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the birth name of Al Jean and his role in creating The simpson 20s: Season 20?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.birth_name, T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.name = 'Al Jean';\n```"}]}, {"id": "train-4237", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many nominations have Billy Kimball received in 2010 for The simpson 20s: Season 20?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(award_id) FROM Award WHERE person = 'Billy Kimball' AND SUBSTR(year, 1, 4) = '2010' AND result = 'Nominee';\n```"}]}, {"id": "train-4238", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all keywords associated with the episode 'Take My Life, Please'."}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Take My Life, Please';\n```"}]}, {"id": "train-4239", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the name and category of the most recent award received by the show."}, {"from": "gpt", "value": "```sql\nSELECT award, award_category FROM Award WHERE result = 'Winner' ORDER BY year DESC LIMIT 1;\n```"}]}, {"id": "train-4240", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is The simpson 20s: Season 20 average awards winning rate?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN result = 'Winner' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(award) AS rate FROM Award;\n```"}]}, {"id": "train-4241", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many episodes were aired between October and November 2008?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(episode_id) FROM Episode WHERE air_date LIKE '2008-10%' OR air_date LIKE '2008-11%';\n```"}]}, {"id": "train-4242", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among episodes aired in 2009, which episode has received the worst response based on the rating."}, {"from": "gpt", "value": "```sql\nSELECT episode_id FROM Episode WHERE air_date LIKE '2009%' ORDER BY rating LIMIT 1;\n```"}]}, {"id": "train-4243", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the categories for which Bonita Pietila was given credit and her role in creating the episodes."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT category, role FROM Credit WHERE person = 'Bonita Pietila';\n```"}]}, {"id": "train-4244", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who from The simpson 20s: Season 20 cast and crew was born in October 29, 1957 in Chicago, Illinois?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM Person WHERE birthdate = '1957-10-29' AND birth_place = 'Chicago' AND birth_region = 'Illinois';\n```"}]}, {"id": "train-4245", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who produced The simpson 20s: Season 20?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT person FROM Credit WHERE role = 'producer';\n```"}]}, {"id": "train-4246", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How old was composer of the show when he was nominated for Emmy's Outstanding Music Composition for a Series in 2009. Indicate his full name as well."}, {"from": "gpt", "value": "```sql\nSELECT T1.year - T2.birthdate AS ageIn2009, T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person = T2.name WHERE T1.role = 'composer' AND T1.organization = 'Primetime Emmy Awards' AND T1.award = 'Outstanding Music Composition for a Series (Original Dramatic Score)' AND T1.result = 'Nominee' AND T1.year = 2009;\n```"}]}, {"id": "train-4247", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode of The simpson 20s: Season 20 has received the most nominations? Indicate the title."}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.episode_id ORDER BY COUNT(*) DESC LIMIT 1;\n```"}]}, {"id": "train-4248", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate the birthplace of the crew which name is Dan Castellaneta."}, {"from": "gpt", "value": "```sql\nSELECT birth_place FROM Person WHERE name = 'Dan Castellaneta';\n```"}]}, {"id": "train-4249", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crews were born in the USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM Person WHERE birth_country = 'USA';\n```"}]}, {"id": "train-4250", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the name of crew that were born before 1970."}, {"from": "gpt", "value": "```sql\nSELECT name FROM Person WHERE SUBSTR(birthdate, 1, 4) < '1970';\n```"}]}, {"id": "train-4252", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode ids are rated 5 stars and have more than 100 votes?"}, {"from": "gpt", "value": "```sql\nSELECT episode_id FROM Vote WHERE stars = 5 AND votes > 100;\n```"}]}, {"id": "train-4253", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate the keywords of the title \"Double, Double, Boy in Trouble\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Double, Double, Boy in Trouble';\n```"}]}, {"id": "train-4254", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among episodes from 10 to 20, which episode has more than 200 votes?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.episode FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.episode BETWEEN 10 AND 20 AND T2.votes > 200;\n```"}]}, {"id": "train-4255", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate the keywords of the episode that won the Primetime Emmy Award category."}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Award AS T1 INNER JOIN Keyword AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award_category = 'Primetime Emmy';\n```"}]}, {"id": "train-4256", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the recipient of the Primetime Emmy Award with the most votes?"}, {"from": "gpt", "value": "```sql\nSELECT T1.person FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award_category = 'Primetime Emmy' ORDER BY T2.votes DESC LIMIT 1;\n```"}]}, {"id": "train-4257", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode id did award Outstanding Animated Program (For Programming Less Than One Hour) with an episode star score of 10?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.episode_id FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T2.stars = 10;\n```"}]}, {"id": "train-4259", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate which writer has an episode star score greater than 5 in 2009."}, {"from": "gpt", "value": "```sql\nSELECT T1.person 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.role = 'writer' AND T2.votes > 5;\n```"}]}, {"id": "train-4260", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many WGA Award (TV) award recipients were born in the USA from 2009 to 2010?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award_category = 'WGA Award (TV)' AND T1.birth_country = 'USA' AND T2.year BETWEEN 2009 AND 2010;\n```"}]}, {"id": "train-4261", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode did the composer win for Outstanding Music Composition for a Series (Original Dramatic Score) with more than 200 votes?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.episode_id FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.role = 'composer' AND T1.award = 'Outstanding Music Composition for a Series (Original Dramatic Score)' AND T2.votes > 200;\n```"}]}, {"id": "train-4262", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The person named Al Jean achieved the Primetime Emmy Award category in 2009, which episode did AI Jean achieve?"}, {"from": "gpt", "value": "```sql\nSELECT 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';\n```"}]}, {"id": "train-4263", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much more votes for episode 1 than for episode 5?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.episode = 1 THEN T2.votes ELSE 0 END) - SUM(CASE WHEN T1.episode = 5 THEN T2.votes ELSE 0 END) AS diff FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id;\n```"}]}, {"id": "train-4264", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What award did the character Homer simpson 20 achieve in 2009?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.award FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.year = 2009 AND T2.character = 'Homer Simpson';\n```"}]}, {"id": "train-4265", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many episodes have won the award for Outstanding Animated Program (Programming Under One Hour) with less than 100 votes? Calculate the percentage of episodes with less than 100 votes out of total episodes."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.votes < 100 THEN 1 ELSE 0 END) AS num , CAST(SUM(CASE WHEN T2.votes < 100 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Award AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)';\n```"}]}, {"id": "train-4266", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many recipients of the Primetime Emmy Award category that were born in the USA? Find the percentage of Americans in the total number of the country."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.birth_country = 'USA' THEN 1 ELSE 0 END) AS num , CAST(SUM(CASE WHEN T1.birth_country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award_category = 'Primetime Emmy' AND T2.person = 'Dan Castellaneta';\n```"}]}, {"id": "train-4267", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list two people who are the nominees for the \"Outstanding Voice-Over Performance\" award for season 20."}, {"from": "gpt", "value": "```sql\nSELECT person FROM Award WHERE result = 'Nominee' AND award = 'Outstanding Voice-Over Performance' AND episode_id LIKE 'S20%' LIMIT 2;\n```"}]}, {"id": "train-4268", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many executive producers are the nominees for the award of \"Outstanding Animated Program (For Programming Less Than One Hour)\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Award WHERE role = 'executive producer' AND result = 'Nominee' AND award = 'Outstanding Animated Program (For Programming Less Than One Hour)';\n```"}]}, {"id": "train-4269", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the crew, who was born in 1962 in California?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM Person WHERE SUBSTR(birthdate, 1, 4) = '1962' AND birth_region = 'California';\n```"}]}, {"id": "train-4270", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the crew members who are taller than 1.70m were born in Canada?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM Person WHERE height_meters > 1.70 AND birth_country = 'Canada';\n```"}]}, {"id": "train-4271", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people were considered as prospective recipients of the \"Animation\" award?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Award WHERE award = 'Animation' AND result = 'Nominee';\n```"}]}, {"id": "train-4272", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three episodes that have an excellent rating."}, {"from": "gpt", "value": "```sql\nSELECT title FROM Episode WHERE rating BETWEEN 7 AND 10 LIMIT 3;\n```"}]}, {"id": "train-4273", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top five most popular episodes?"}, {"from": "gpt", "value": "```sql\nSELECT episode_id FROM Episode ORDER BY votes DESC LIMIT 5;\n```"}]}, {"id": "train-4274", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the three episodes with the highest number of votes for the worst star rating."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = ( SELECT MIN(stars) FROM Vote ) ORDER BY T2.votes DESC LIMIT 3;\n```"}]}, {"id": "train-4275", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the character that Dan Castellaneta did the voice over for and was awarded?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.award LIKE '%Voice-Over%' AND T1.person = 'Dan Castellaneta';\n```"}]}, {"id": "train-4276", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all of the episodes that aired in 2008 that have the highest number of votes for the maximum star rating."}, {"from": "gpt", "value": "```sql\nSELECT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2008' ORDER BY T2.votes DESC LIMIT 1;\n```"}]}, {"id": "train-4277", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the keywords of the episode \"Take My Life, Please\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Take My Life, Please';\n```"}]}, {"id": "train-4278", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide any two episodes' names that have the same keyword of \"1930s to 2020s\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = '1930s to 2020s' LIMIT 2;\n```"}]}, {"id": "train-4279", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2010, which episode did Joel H. Cohen win an award for?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2010' AND T1.person = 'Joel H. Cohen';\n```"}]}, {"id": "train-4280", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many votes of 5-star did the episode \"Lisa the Drama Queen\" receive?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lisa the Drama Queen' AND T2.stars = 5;\n```"}]}, {"id": "train-4281", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of votes for 10-star for the episode that has the keyword \"reference to the fantastic four\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.votes FROM Keyword AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 AND T1.keyword = 'reference to the fantastic four';\n```"}]}, {"id": "train-4282", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference between the number of votes for 1-star vs. 10-star for the episode \"The Burns and the Bees\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.stars = 10 THEN T2.votes ELSE 0 END) - SUM(CASE WHEN T2.stars = 1 THEN T2.votes ELSE 0 END) AS Difference FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'The Burns and the Bees';\n```"}]}, {"id": "train-4283", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the keywords of the least popular episode?"}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id ORDER BY T1.votes LIMIT 1;\n```"}]}, {"id": "train-4284", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the episodes that have the average rating with more than 20 of 2-star votes?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 2 AND T2.votes > 20 AND T1.rating > 5.0 AND T1.rating <= 7.0;\n```"}]}, {"id": "train-4285", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode has the largest number of votes?"}, {"from": "gpt", "value": "```sql\nSELECT episode FROM Episode WHERE votes = ( SELECT MAX(votes) FROM Episode );\n```"}]}, {"id": "train-4286", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the oldest among all the casts and crews?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM Person ORDER BY birthdate ASC LIMIT 1;\n```"}]}, {"id": "train-4287", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the episodes Oscar Cervantes is credited with?"}, {"from": "gpt", "value": "```sql\nSELECT episode_id FROM Credit WHERE person = 'Oscar Cervantes' AND credited = 'true';\n```"}]}, {"id": "train-4288", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the roles of the cast and crew from countries other than the USA?"}, {"from": "gpt", "value": "```sql\nSELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.birth_country != 'USA';\n```"}]}, {"id": "train-4289", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 1 star ratings are there in the worst rated episode of the season?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 1 ORDER BY T1.rating LIMIT 1;\n```"}]}, {"id": "train-4290", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which character did the \"Outstanding Voice-Over Performance\" winner voice?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.award = 'Outstanding Voice-Over Performance' AND T1.result = 'Winner';\n```"}]}, {"id": "train-4291", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the summary of the episode in which Emily Blunt is featured in?"}, {"from": "gpt", "value": "```sql\nSELECT T1.summary FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Emily Blunt';\n```"}]}, {"id": "train-4292", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who did \"The Tiny Canadian\" play as in the show?"}, {"from": "gpt", "value": "```sql\nSELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.nickname = 'The Tiny Canadian';\n```"}]}, {"id": "train-4293", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the episodes with an award nominee or winner, which has the highest percent of 5 star votes?"}, {"from": "gpt", "value": "```sql\nSELECT T1.episode_id FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 5 ORDER BY T2.percent DESC LIMIT 1;\n```"}]}, {"id": "train-4294", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the credited cast for the episode \"In the Name of the Grandfather\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'In the Name of the Grandfather' AND T2.category = 'Cast' AND T2.credited = 'true';\n```"}]}, {"id": "train-4295", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of the award winners' birth dates."}, {"from": "gpt", "value": "```sql\nSELECT T1.birthdate FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.result = 'Winner';\n```"}]}, {"id": "train-4297", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What award did the episode that aired on 11/30/2008 win?"}, {"from": "gpt", "value": "```sql\nSELECT T1.award FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.result = 'Winner' AND T2.air_date = '2008-11-30';\n```"}]}, {"id": "train-4298", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of the information about the music department's casts and crews."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT person, name, birthdate, birth_name, birth_place , birth_region, birth_country, height_meters, nickname FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T2.category = 'Music Department';\n```"}]}, {"id": "train-4299", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the keywords for episode 426 of the series?"}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.number_in_series = 426;\n```"}]}, {"id": "train-4300", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the titles of the episodes that have received more 7-star votes than the season average?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 7 AND T2.votes > 0.7 * ( SELECT CAST(COUNT(votes) AS REAL) / COUNT(CASE WHEN stars = 7 THEN 1 ELSE 0 END) FROM Vote );\n```"}]}, {"id": "train-4301", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of votes are from the nominated episodes?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.result = 'Nominee' THEN T2.votes ELSE 0 END) AS REAL) * 100 / SUM(T2.votes) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id;\n```"}]}, {"id": "train-4302", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down person's name who has nickname."}, {"from": "gpt", "value": "```sql\nSELECT name FROM Person WHERE nickname IS NOT NULL;\n```"}]}, {"id": "train-4303", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the tallest person in the crew?"}, {"from": "gpt", "value": "```sql\nSELECT birth_country FROM Person ORDER BY height_meters DESC LIMIT 1;\n```"}]}, {"id": "train-4304", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average height of people from USA?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(height_meters) FROM Person WHERE birth_country = 'USA';\n```"}]}, {"id": "train-4305", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of people who were born after 1970 and from California."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN birth_region = 'California' AND SUBSTR(birthdate, 1, 4) > '1970' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(birthdate) FROM Person;\n```"}]}, {"id": "train-4306", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people were not born in Connecticut, USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM Person WHERE birth_region != 'Connecticut' AND birth_country != 'USA';\n```"}]}, {"id": "train-4307", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the title of episode S20-E1, S20-E2 & S20-E3."}, {"from": "gpt", "value": "```sql\nSELECT title FROM Episode WHERE episode_id IN ('S20-E1', 'S20-E2', 'S20-E3');\n```"}]}, {"id": "train-4308", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the website address which stores the episode image of episode 5."}, {"from": "gpt", "value": "```sql\nSELECT episode_image FROM Episode WHERE episode = 5;\n```"}]}, {"id": "train-4309", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of votes for episode with rating of 7 and above."}, {"from": "gpt", "value": "```sql\nSELECT votes FROM Episode WHERE rating > 7;\n```"}]}, {"id": "train-4310", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many title's crew members are working from Casting Department?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.category = 'Casting Department';\n```"}]}, {"id": "train-4311", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many additional timers were born in USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T2.role = 'additional timer' AND T1.birth_country = 'USA';\n```"}]}, {"id": "train-4312", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people who were born after 1970 are animation executive producer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE STRFTIME(T1.birthdate) > '1970' AND T2.role = 'animation executive producer';\n```"}]}, {"id": "train-4313", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the summary of episode whereby it has crew members that are not included in the credit list."}, {"from": "gpt", "value": "```sql\nSELECT T1.summary FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.credited = 'false';\n```"}]}, {"id": "train-4314", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the rating of episodes that were produced by Jason Bikowski."}, {"from": "gpt", "value": "```sql\nSELECT T1.rating FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Jason Bikowski';\n```"}]}, {"id": "train-4315", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average heights of crew members from Animation Department?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.height_meters) FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T2.category = 'Animation Department';\n```"}]}, {"id": "train-4316", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the character that won the award in Primetime Emmy 2009?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.award_category = 'Primetime Emmy' AND T1.year = 2009 AND T1.result = 'Winner';\n```"}]}, {"id": "train-4317", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the characters that were nominated for Primetime Emmy Award from 2009 to 2010 but did not win?"}, {"from": "gpt", "value": "```sql\nSELECT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.award_category = 'Primetime Emmy' AND T1.year BETWEEN 2009 AND 2010 AND T1.result != 'Winner';\n```"}]}, {"id": "train-4318", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total votes of episodes that Adam Kuhlman had involved."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.votes) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Adam Kuhlman';\n```"}]}, {"id": "train-4319", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the keyword and crew member's name for episode id S20-E1."}, {"from": "gpt", "value": "```sql\nSELECT T1.keyword, T2.person FROM Keyword AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode_id = 'S20-E1';\n```"}]}, {"id": "train-4321", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of star score 5 that was collected by title \"Sex, Pies and Idiot Scrapes\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.stars = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Sex, Pies and Idiot Scrapes';\n```"}]}, {"id": "train-4322", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please check is \"limbo dancing\" the keyword for title \"Dangerous Curves\"?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T2.Keyword = 'limbo dancing' THEN 'Yes' ELSE 'No' END AS result FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Dangerous Curves';\n```"}]}, {"id": "train-4323", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which title is the winner of Best International TV Series in 2017?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Best International TV Series' AND SUBSTR(T1.year, 1, 4) = '2017';\n```"}]}, {"id": "train-4324", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down all the keywords for winner of \"WGA Award (TV)\" award."}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Award AS T1 INNER JOIN Keyword AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award_category = 'WGA Award (TV)';\n```"}]}, {"id": "train-4325", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the birth place of co-executive producer for nominee of \"Outstanding Animated Program (For Programming Less Than One Hour)\" award."}, {"from": "gpt", "value": "```sql\nSELECT T1.birth_place FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T2.role = 'co-executive producer';\n```"}]}, {"id": "train-4326", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Sum up the votes from star 1 to 5 for all of the contestants in Blimp Award."}, {"from": "gpt", "value": "```sql\nSELECT T2.stars, SUM(T2.stars) FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award_category = 'Blimp Award' AND T2.stars BETWEEN 1 AND 5 GROUP BY T2.stars;\n```"}]}, {"id": "train-4327", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total rating of winners in OFTA Television Award and WGA Award (TV)."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.rating) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award_category IN ('Jupiter Award ', 'WGA Award (TV)');\n```"}]}, {"id": "train-4328", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT 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;\n```"}]}, {"id": "train-4329", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many episodes have the star score greater than 8?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT episode_id) FROM Vote WHERE stars > 8;\n```"}]}, {"id": "train-4330", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which episode has the highest number of vote of the star score?"}, {"from": "gpt", "value": "```sql\nSELECT episode_id FROM Vote ORDER BY votes DESC LIMIT 1;\n```"}]}, {"id": "train-4331", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many episodes have the keyword \"2d animation\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(episode_id) FROM Keyword WHERE keyword = '2d animation';\n```"}]}, {"id": "train-4332", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the organization which hold the award id 328."}, {"from": "gpt", "value": "```sql\nSELECT organization FROM Award WHERE award_id = 328;\n```"}]}, {"id": "train-4333", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many awards had been held in 2009?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(award_id) FROM Award WHERE SUBSTR(year, 1, 4) = '2009';\n```"}]}, {"id": "train-4334", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many awards classified as \"Primetime Emmy\" category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(award_id) FROM Award WHERE award_category = 'Primetime Emmy';\n```"}]}, {"id": "train-4335", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the birth name of crews who are co-executive producer and higher than 1.60 meters."}, {"from": "gpt", "value": "```sql\nSELECT T1.birth_name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.role = 'co-executive producer' AND T1.height_meters > 1.60;\n```"}]}, {"id": "train-4336", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of the nominees who were born in USA."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.birth_country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.result = 'Nominee';\n```"}]}, {"id": "train-4337", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of the winners who are higher than 1.75 meters."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.height_meters > 1.75 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.result = 'Winner';\n```"}]}, {"id": "train-4338", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the title of episodes which have star score of 2."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 2;\n```"}]}, {"id": "train-4339", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the star scores of episode which has title of \"How the Test Was Won\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.stars FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'How the Test Was Won';\n```"}]}, {"id": "train-4340", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the episodes which have star score greater than 5, how many episodes have air date in 2008?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE strftime('%Y', T1.air_date) = '2008' AND T2.stars > 5;\n```"}]}, {"id": "train-4341", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the names of the awarded character in the awards held in 2009."}, {"from": "gpt", "value": "```sql\nSELECT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.year = 2009;\n```"}]}, {"id": "train-4342", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which are the years that character Mr. Burns won an award?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.year FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Mr. Burns';\n```"}]}, {"id": "train-4343", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the awarded category that the awarded character Lenny won?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.award_category FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Lenny';\n```"}]}, {"id": "train-4344", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of actor who took the role Smithers?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.person FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Smithers';\n```"}]}, {"id": "train-4345", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the keywords of the episode which has title as Dangerous Curves?"}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Dangerous Curves';\n```"}]}, {"id": "train-4346", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the keywords of the episodes which have the air date in 2008?"}, {"from": "gpt", "value": "```sql\nSELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2008';\n```"}]}, {"id": "train-4347", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the episodes which have star score less than 8, how many episodes were aired in 2009?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE strftime('%Y', T1.air_date) = '2009' AND T2.stars < 8;\n```"}]}, {"id": "train-4349", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many awards did simpson 20 won in 2009?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(award_id) FROM Award WHERE SUBSTR(year, 1, 4) = '2009' AND result = 'Winner';\n```"}]}, {"id": "train-4350", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of episode with a rating below 7?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(episode_id) FROM Episode WHERE rating < 7;\n```"}]}, {"id": "train-4351", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the names of person born in California, USA."}, {"from": "gpt", "value": "```sql\nSELECT name FROM Person WHERE birth_region = 'California' AND birth_country = 'USA';\n```"}]}, {"id": "train-4352", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In between the episode 5 and10 of season 2, how many of them are credited for casting?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(credited) FROM Credit WHERE episode_id IN ( 'S20-E5', 'S20-E6', 'S20-E7', 'S20-E8', 'S20-E9', 'S20-E10' ) AND credited = 'true' AND role = 'casting';\n```"}]}, {"id": "train-4353", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the episode ID that received 2 stars and 9 votes?"}, {"from": "gpt", "value": "```sql\nSELECT episode_id FROM Vote WHERE stars = 2 AND votes = 9;\n```"}]}, {"id": "train-4354", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the title of the episode won in Primetime Emmy Awards 2009."}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.organization = 'Primetime Emmy Awards' AND T1.year = 2009 AND T1.result = 'Winner';\n```"}]}, {"id": "train-4355", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the episode ID of episodes aired in 2008 with 5 stars and below."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2008' AND T2.stars < 5;\n```"}]}, {"id": "train-4356", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the episode with highest votes, what is the category credited to Carlton Batten?"}, {"from": "gpt", "value": "```sql\nSELECT T2.category FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Carlton Batten' AND T2.credited = 'true' ORDER BY T1.votes DESC LIMIT 1;\n```"}]}, {"id": "train-4357", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the episodes aired in 2008 with votes ranges from 920 to 950, list their percent."}, {"from": "gpt", "value": "```sql\nSELECT T2.percent FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2008' AND T1.votes BETWEEN 950 AND 960;\n```"}]}, {"id": "train-4358", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the episode ID and title of episode where casting was credited to Bonita Pietila."}, {"from": "gpt", "value": "```sql\nSELECT T1.episode_id, T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.credited = 'true' AND T2.person = 'Bonita Pietila' AND T2.role = 'casting';\n```"}]}, {"id": "train-4359", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In episode nominated in Annie Awards, how many of the episodes have a percent greater than 6?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.organization = 'Annie Awards' AND T1.result = 'Nominee' AND T2.percent > 6;\n```"}]}, {"id": "train-4360", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of episode nominated for WGA Award (TV) with votes greater than 1000?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.votes > 1000 AND T1.award_category = 'WGA Award (TV)' AND T1.result = 'Nominee';\n```"}]}, {"id": "train-4361", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the people in Animation Department, who are credited for additional time in the episode titled by \"How the Test Was Won\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'How the Test Was Won' AND T2.role = 'additional timer' AND T2.credited = 'true' AND T2.category = 'Animation Department';\n```"}]}, {"id": "train-4362", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the stars of episodes aired in November 2008."}, {"from": "gpt", "value": "```sql\nSELECT T2.stars FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 7) = '2008-11';\n```"}]}, {"id": "train-4363", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of episode with 5 stars and nominated for Prism Award which is aired on April 19, 2009?"}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM Award AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE T3.air_date = '2009-04-19' AND T1.award_category = 'Prism Award' AND T2.stars = 5 AND T1.result = 'Nominee';\n```"}]}, {"id": "train-4364", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In episode with the highest votes, list the category of awards it is nominated for."}, {"from": "gpt", "value": "```sql\nSELECT T1.award_category FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.result = 'Nominee' ORDER BY T2.votes DESC LIMIT 1;\n```"}]}, {"id": "train-4365", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In episodes aired in 2009, how many of them are credited to Sam Im for additional timer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.credited = 'true' AND T2.person = 'Sam Im' AND SUBSTR(T1.air_date, 1, 4) = '2009' AND T2.role = 'additional timer';\n```"}]}, {"id": "train-4366", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the title of the episode with stars greater than the 70% of average stars of all episodes."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars > 0.7 * ( SELECT AVG(stars) FROM Vote );\n```"}]}, {"id": "train-4367", "db_id": "simpson_episodes", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In year 2009, what is the percentage of the episode titled by \"Gone Maggie Gone\" being nominated?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(CASE WHEN T1.result = 'Nominee' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.result = 'Winner' THEN 1 ELSE 0 END)) AS REAL) * 100 / COUNT(T1.result) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.title = 'Gone Maggie Gone' AND T1.year = 2009;\n```"}]}, {"id": "train-4368", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students have never been absent from school?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM longest_absense_from_school WHERE `month` = 0\n```"}]}, {"id": "train-4369", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the students who have been absent from school for the longest time, how many months have they been absent?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(month) FROM longest_absense_from_school\n```"}]}, {"id": "train-4370", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students belong to the navy department?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'navy'\n```"}]}, {"id": "train-4371", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students that have been absent from school for more than 5 months, how many of them are male?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN male AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` >= 5\n```"}]}, {"id": "train-4372", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the male students that belong to the navy department."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM enlist AS T1 INNER JOIN male AS T2 ON T1.`name` = T2.`name` WHERE T1.organ = 'navy'\n```"}]}, {"id": "train-4373", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students that have filed for bankruptcy, how many of them have been absent from school for over 5 months?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM filed_for_bankrupcy AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.`name` = T2.`name` WHERE T2.`month` > 5\n```"}]}, {"id": "train-4374", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students from the navy department, how many of them have payment due?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN no_payment_due AS T2 ON T1.`name` = T2.`name` WHERE T1.organ = 'navy' AND T2.bool = 'pos'\n```"}]}, {"id": "train-4375", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the male students that are disabled and have filed for bankruptcy."}, {"from": "gpt", "value": "```sql\nSELECT T1.name, T2.name, T3.name FROM disabled AS T1 INNER JOIN male AS T2 ON T1.`name` = T2.`name` INNER JOIN filed_for_bankrupcy AS T3 ON T1.`name` = T3.`name`\n```"}]}, {"id": "train-4376", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female students are disabled?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM disabled WHERE name NOT IN ( SELECT name FROM male )\n```"}]}, {"id": "train-4377", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are unemployed and have payment due?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN no_payment_due AS T2 ON T1.`name` = T2.`name`\n```"}]}, {"id": "train-4378", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the longest time for a student from the navy department to be absent from school?"}, {"from": "gpt", "value": "```sql\nSELECT T1.month FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T2.organ = 'navy' ORDER BY T1.`month` DESC LIMIT 1\n```"}]}, {"id": "train-4379", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many disabled students have never been absent from school?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` = 0\n```"}]}, {"id": "train-4380", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the departments the students are absent from school for 9 months are in."}, {"from": "gpt", "value": "```sql\nSELECT T2.organ FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` = 9\n```"}]}, {"id": "train-4381", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which department has the most disabled students?"}, {"from": "gpt", "value": "```sql\nSELECT T2.organ, COUNT(T1.name) FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` GROUP BY T2.organ ORDER BY COUNT(T1.name) DESC LIMIT 1\n```"}]}, {"id": "train-4382", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the female students that have filed for bankruptcy."}, {"from": "gpt", "value": "```sql\nSELECT name FROM filed_for_bankrupcy WHERE name NOT IN ( SELECT name FROM male )\n```"}]}, {"id": "train-4383", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of male students in the navy department?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM enlist AS T1 LEFT JOIN male AS T2 ON T1.`name` = T2.`name` WHERE T1.organ = 'navy'\n```"}]}, {"id": "train-4384", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average time for a disabled student to be absent from school?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name`\n```"}]}, {"id": "train-4385", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all students enlisted in the foreign legion."}, {"from": "gpt", "value": "```sql\nSELECT name FROM enlist WHERE organ = 'foreign_legion'\n```"}]}, {"id": "train-4386", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Does student348 have a due payment?"}, {"from": "gpt", "value": "```sql\nSELECT bool FROM no_payment_due WHERE name = 'student348'\n```"}]}, {"id": "train-4387", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which school is student829 enrolled in?"}, {"from": "gpt", "value": "```sql\nSELECT school FROM enrolled WHERE name = 'student829'\n```"}]}, {"id": "train-4388", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many months has student217 been absent?"}, {"from": "gpt", "value": "```sql\nSELECT month FROM longest_absense_from_school WHERE name = 'student217'\n```"}]}, {"id": "train-4389", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all students that have been absent for 6 months."}, {"from": "gpt", "value": "```sql\nSELECT name FROM longest_absense_from_school WHERE `month` = 6\n```"}]}, {"id": "train-4390", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which organization did student285 enlist?"}, {"from": "gpt", "value": "```sql\nSELECT organ FROM enlist WHERE name = 'student285'\n```"}]}, {"id": "train-4391", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is student281 disabled and which school is the student enrolled in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name, T1.school FROM enrolled AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name` WHERE T1.name = 'student281'\n```"}]}, {"id": "train-4392", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all students in the air force and which school they were enrolled at."}, {"from": "gpt", "value": "```sql\nSELECT T1.name, T1.school FROM enrolled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T2.organ = 'air_force'\n```"}]}, {"id": "train-4393", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List 10 students that have no due payments and are not males."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM no_payment_due AS T1 INNER JOIN person AS T2 ON T1.`name` = T2.`name` WHERE T2.`name` NOT IN ( SELECT name FROM male ) AND T1.bool = 'neg'\n```"}]}, {"id": "train-4394", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name 5 students with due payments that are enlisted alongside which organization they were enlisted."}, {"from": "gpt", "value": "```sql\nSELECT T2.organ, T1.name FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T1.bool = 'pos' LIMIT 5\n```"}]}, {"id": "train-4395", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all disabled students that are enrolled in SMC."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM enrolled AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name` WHERE T1.school = 'smc'\n```"}]}, {"id": "train-4397", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male students have no due payments?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN male AS T2 ON T1.name = T2.name WHERE T1.bool = 'neg'\n```"}]}, {"id": "train-4398", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which students that are in the marines have been absent for 6 months?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T2.organ = 'marines' AND T1.`month` = 6\n```"}]}, {"id": "train-4399", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students from SMC are unemployed?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM enrolled AS T1 INNER JOIN unemployed AS T2 ON T1.`name` = T2.`name` WHERE T1.school = 'smc'\n```"}]}, {"id": "train-4400", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unemployed students are there that have been absent for 6 months?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T1.`name` = T2.name WHERE T1.`month` = 6\n```"}]}, {"id": "train-4401", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the number of students from UCSD enlisted in the peace corps."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T1.`name` = T2.`name` WHERE T2.school = 'ucsd' AND T1.organ = 'peace_corps'\n```"}]}, {"id": "train-4402", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Student21 is enlisted in which organization and has the student been absent?"}, {"from": "gpt", "value": "```sql\nSELECT T2.month, T1.organ FROM enlist AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.`name` = T2.`name` WHERE T1.name = 'student21'\n```"}]}, {"id": "train-4403", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage ratio of students who are enlisted in foreign legions that have a due payment?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.bool = 'pos', 1, 0)) AS REAL) * 100 / SUM(IIF(T1.bool = 'neg', 1, 0)) FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T2.organ = 'foreign_legion'\n```"}]}, {"id": "train-4404", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of students who enlisted in the navy make up the number of students enrolled in OCC?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.school = 'occ', 1.0, 0)) AS REAL) * 100 / COUNT(T1.name) FROM enrolled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T2.organ = 'navy'\n```"}]}, {"id": "train-4405", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out student IDs that have the longest absence duration from school."}, {"from": "gpt", "value": "```sql\nSELECT name FROM longest_absense_from_school WHERE `month` = ( SELECT MAX(month) FROM longest_absense_from_school )\n```"}]}, {"id": "train-4406", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of students in the school?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM person\n```"}]}, {"id": "train-4407", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the longest students absence duration from school?"}, {"from": "gpt", "value": "```sql\nSELECT name, month FROM longest_absense_from_school WHERE `month` = ( SELECT MAX(month) FROM longest_absense_from_school )\n```"}]}, {"id": "train-4408", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students were absence for 4 month?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM longest_absense_from_school WHERE month = 4\n```"}]}, {"id": "train-4409", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of unemployed and bankrupt students?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name\n```"}]}, {"id": "train-4410", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Does disable students join organization. If yes, please indicate the organization joined by the students."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.organ FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name`\n```"}]}, {"id": "train-4411", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unemployed and bankrupt students that have payment dues?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name INNER JOIN no_payment_due AS T3 ON T2.name = T3.name WHERE T3.bool = 'pos'\n```"}]}, {"id": "train-4412", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please check if student 124 is disabled male."}, {"from": "gpt", "value": "```sql\nSELECT IIF(T2.name IS NULL, 'female', 'male') FROM male AS T1 LEFT JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.name = 'student124'\n```"}]}, {"id": "train-4413", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the employment, disability, gender and school debt status for student180 and student117?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT COUNT(name) FROM disabled WHERE name IN ('student180', 'student117') ), ( SELECT COUNT(name) FROM unemployed WHERE name IN ('student180', 'student117') ), ( SELECT COUNT(name) FROM male WHERE name IN ('student180', 'student117') ), ( SELECT COUNT(name) FROM no_payment_due WHERE name IN ('student180', 'student117'))\n```"}]}, {"id": "train-4414", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female students joined a marines and air force organization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ IN ('marines', 'air_force') AND name NOT IN ( SELECT name FROM male )\n```"}]}, {"id": "train-4416", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of disable female to male students?"}, {"from": "gpt", "value": "```sql\nSELECT 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`\n```"}]}, {"id": "train-4417", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female students are not joining any of the organization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM person WHERE name NOT IN ( SELECT name FROM male ) AND name NOT IN ( SELECT name FROM enrolled )\n```"}]}, {"id": "train-4419", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average absence period of a student?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(month) FROM longest_absense_from_school\n```"}]}, {"id": "train-4420", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average of absence for an employed students?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(month) FROM longest_absense_from_school WHERE name NOT IN ( SELECT name FROM unemployed )\n```"}]}, {"id": "train-4421", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average absence period of a disabled student?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name\n```"}]}, {"id": "train-4423", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students enlisted in the fire-department?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'fire_department'\n```"}]}, {"id": "train-4424", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students who have never been absent from school?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM longest_absense_from_school WHERE month = 0\n```"}]}, {"id": "train-4425", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students have been absent above 2 months?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM longest_absense_from_school WHERE month > 2\n```"}]}, {"id": "train-4426", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of students do not have payment due."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM no_payment_due WHERE bool = 'neg'\n```"}]}, {"id": "train-4427", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of students who have payment due."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM no_payment_due WHERE bool = 'pos'\n```"}]}, {"id": "train-4428", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the name of disabled students who have never been absent from school."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM disabled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name WHERE T2.month = 0\n```"}]}, {"id": "train-4429", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unemployed students are enlisted in the navy organization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'navy'\n```"}]}, {"id": "train-4430", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the number of male students who belong to foreign legion."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM male AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'foreign_legion'\n```"}]}, {"id": "train-4431", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the number of female students who enlisted in the air force."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'air_force' AND name NOT IN ( SELECT name FROM male )\n```"}]}, {"id": "train-4432", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State name of disabled students who have the longest duration of absense from school."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM disabled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name ORDER BY T2.month DESC LIMIT 1\n```"}]}, {"id": "train-4433", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the unemployed students who enlisted in marines."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM unemployed AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'marines'\n```"}]}, {"id": "train-4434", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average duration of absense of disabled students."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name\n```"}]}, {"id": "train-4435", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of unemployed students who have been absent for 5 months from school?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.month > 5, 1, 0)) AS REAL) * 100 / COUNT(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name\n```"}]}, {"id": "train-4436", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unemployed disabled students have been absent for 8 months from school?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name INNER JOIN disabled AS T3 ON T2.name = T3.name WHERE T1.month = 8\n```"}]}, {"id": "train-4437", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State name of unemployed students who have the longest duration of absense from school."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name ORDER BY T1.month DESC LIMIT 1\n```"}]}, {"id": "train-4438", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the name of unemployed students who have never been absent from school."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name WHERE T1.month = 0\n```"}]}, {"id": "train-4439", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many disabled students have been absent for 3 months from school?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.month = 3\n```"}]}, {"id": "train-4440", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the name of students who filed for bankruptcy and have never been absent from school."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name WHERE T1.month = 0\n```"}]}, {"id": "train-4441", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State name of students who filed for bankruptcy and have the longest duration of absense from school."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name ORDER BY T1.month DESC LIMIT 1\n```"}]}, {"id": "train-4442", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the gender of student1000?"}, {"from": "gpt", "value": "```sql\nSELECT IIF(T.result = 0, 'female', 'male') AS re FROM ( SELECT COUNT(name) AS result FROM male WHERE name = 'studenT1000' ) T\n```"}]}, {"id": "train-4443", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are disabled?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM disabled\n```"}]}, {"id": "train-4444", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students have been absents for more than 6 months?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM longest_absense_from_school WHERE month > 6\n```"}]}, {"id": "train-4445", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which students have absents the most?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM longest_absense_from_school WHERE month = ( SELECT MAX(month) FROM longest_absense_from_school )\n```"}]}, {"id": "train-4446", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are enlisted in the army?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'army'\n```"}]}, {"id": "train-4447", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the average number of absences for each student."}, {"from": "gpt", "value": "```sql\nSELECT AVG(month) FROM longest_absense_from_school\n```"}]}, {"id": "train-4448", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Sum up the number of students enlisted in foreign legion, peace corps and army."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ IN ('army', 'peace_corps', 'foreign_legion')\n```"}]}, {"id": "train-4449", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students enlisted in marines, how many of them are disabled?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.organ = 'marines'\n```"}]}, {"id": "train-4450", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unemployed students still have payment due?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T2.bool = 'pos'\n```"}]}, {"id": "train-4451", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which female students had never been absent?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM male AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name <> T2.name WHERE T2.month = 0\n```"}]}, {"id": "train-4452", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which school has the highest number of disabled students?"}, {"from": "gpt", "value": "```sql\nSELECT T.school FROM ( SELECT T2.school, COUNT(T2.name) AS num FROM disabled AS T1 INNER JOIN enrolled AS T2 ON T1.name = T2.name GROUP BY T2.school ) T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-4453", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the organisations of students who filed for bankcrupcy."}, {"from": "gpt", "value": "```sql\nSELECT T2.organ FROM filed_for_bankrupcy AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name\n```"}]}, {"id": "train-4454", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male students join more than one organization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.a) FROM ( SELECT COUNT(DISTINCT T1.name) AS a, COUNT(T2.organ) AS num FROM male AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name GROUP BY T1.name ) T WHERE T.num > 1\n```"}]}, {"id": "train-4455", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the navy students who are disabled."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'navy'\n```"}]}, {"id": "train-4456", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many SMC's students that absent for 7 months?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM enrolled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name WHERE T1.school = 'smc' AND T2.month = 7\n```"}]}, {"id": "train-4457", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the disabled female students."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM disabled AS T1 INNER JOIN male AS T2 ON T1.name <> T2.name\n```"}]}, {"id": "train-4458", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the ratio between unemployed students and disabled students."}, {"from": "gpt", "value": "```sql\nSELECT CAST(( SELECT COUNT(name) FROM unemployed ) AS REAL ) / ( SELECT COUNT(name) FROM disabled )\n```"}]}, {"id": "train-4459", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the percentage of male students enlisted in the fire department."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM enlist AS T1 LEFT JOIN male AS T2 ON T1.name = T2.name WHERE T1.organ = 'fire_department'\n```"}]}, {"id": "train-4460", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students has the longest absense from school for 5 months?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM longest_absense_from_school WHERE month = 5\n```"}]}, {"id": "train-4461", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are enlisted in the Army organization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'army'\n```"}]}, {"id": "train-4462", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are enrolled in UCLA school?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enrolled WHERE school = 'ucla'\n```"}]}, {"id": "train-4463", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 5 students who has the longest absense from schoool?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM longest_absense_from_school ORDER BY month DESC LIMIT 5\n```"}]}, {"id": "train-4464", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the students joined two organization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ >= 2\n```"}]}, {"id": "train-4465", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are enlisted in the Navy organization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'navy'\n```"}]}, {"id": "train-4466", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male stuents do not have payment due?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM male AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T2.bool = 'neg'\n```"}]}, {"id": "train-4467", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are enlisted in the Peace Corps organization are enrolled in UCSD school?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T1.name = T2.name WHERE T1.organ = 'peace_corps' AND T2.school = 'ucsd'\n```"}]}, {"id": "train-4468", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the unemployed students, how many of them have no payment due?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T2.bool = 'neg'\n```"}]}, {"id": "train-4469", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female students have no payment due?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM no_payment_due WHERE name NOT IN ( SELECT name FROM male )\n```"}]}, {"id": "train-4470", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unemployed students have never been absent?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.name) FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name WHERE T1.month = 0\n```"}]}, {"id": "train-4471", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 10 students who have no payment due and are enlisted in Fire Department organization."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T2.name = T1.name WHERE T1.bool = 'neg' AND T2.organ = 'fire_department' LIMIT 10\n```"}]}, {"id": "train-4472", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female students are enlisted in the Navy organization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'navy' AND name NOT IN ( SELECT name FROM male )\n```"}]}, {"id": "train-4473", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unemployed students are enlisted in the Army organization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name WHERE T1.organ = 'army'\n```"}]}, {"id": "train-4474", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unemployed students have payment due?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name WHERE T1.bool = 'pos'\n```"}]}, {"id": "train-4475", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 5 students who have payment due and are enlisted in Peace Corps organization?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T2.name = T1.name WHERE T2.organ = 'peace_corps' AND T1.bool = 'pos' LIMIT 5\n```"}]}, {"id": "train-4476", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many disabled students are female?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM disabled WHERE name NOT IN ( SELECT name FROM male )\n```"}]}, {"id": "train-4477", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many disabled students have payment due?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM disabled AS T1 INNER JOIN no_payment_due AS T2 ON T2.name = T1.name WHERE T2.bool = 'pos'\n```"}]}, {"id": "train-4478", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of female students who are disabled and who joined Foreign Legion organization."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T3.name IS NULL, 1, 0)) AS REAL) / COUNT(T1.name) FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T2.name = T3.name WHERE T2.organ = 'foreign_legion'\n```"}]}, {"id": "train-4479", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the ratio in percentage between the average number of female and male students who joined Fire Department organization."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.name IS NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.name), CAST(SUM(IIF(T2.name IS NOT NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.name) FROM enlist AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name WHERE T1.organ = 'fire_department'\n```"}]}, {"id": "train-4480", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students enlisted in the navy?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'navy'\n```"}]}, {"id": "train-4481", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of students who have never been absent."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(month = 0, 1, 0)) AS REAL) * 100 / COUNT(name) FROM longest_absense_from_school\n```"}]}, {"id": "train-4482", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of students who have payment due and those who do not have payment due?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(`bool` = 'pos', 1, 0)) AS REAL) / SUM(IIF(`bool` = 'neg', 1, 0)) FROM no_payment_due\n```"}]}, {"id": "train-4483", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the students' names and schools who enrolled for 15 months."}, {"from": "gpt", "value": "```sql\nSELECT name, school FROM enrolled WHERE month = 15\n```"}]}, {"id": "train-4484", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average enlisted students per organization."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(NAME) AS REAL) * 100 / COUNT(DISTINCT organ) FROM enlist\n```"}]}, {"id": "train-4485", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the enrolled schools and duration of student214."}, {"from": "gpt", "value": "```sql\nSELECT school, month FROM enrolled WHERE name = 'student214'\n```"}]}, {"id": "train-4486", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all students, calculate the percentage of disabled students."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM person AS T1 LEFT JOIN disabled AS T2 ON T2.name = T1.name\n```"}]}, {"id": "train-4487", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among students who have been absent for nine months, how many of them are disabled?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM disabled AS T1 LEFT JOIN longest_absense_from_school AS T2 ON T2.name = T1.name WHERE T2.month = 9\n```"}]}, {"id": "train-4488", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the student names who did not file for bankruptcy."}, {"from": "gpt", "value": "```sql\nSELECT name FROM person WHERE name NOT IN ( SELECT name FROM filed_for_bankrupcy )\n```"}]}, {"id": "train-4489", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List any five female students' names who enlisted for the air force."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM enlist AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name WHERE T2.name IS NULL AND T1.organ = 'air_force' LIMIT 5\n```"}]}, {"id": "train-4490", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the number of students who are not disabled."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T2.name IS NULL THEN T1.name END) AS \"number\" FROM person AS T1 LEFT JOIN disabled AS T2 ON T2.name = T1.name\n```"}]}, {"id": "train-4491", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Define the gender of \"student995\" and his/her enrolled schools."}, {"from": "gpt", "value": "```sql\nSELECT IIF(T2.name IS NULL, 'female', 'male') AS gen , T1.school FROM enrolled AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name WHERE T1.name = 'student995'\n```"}]}, {"id": "train-4492", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students with disabilities, list any five students' names who are unemployed."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM disabled AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name LIMIT 5\n```"}]}, {"id": "train-4493", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unemployed students filed for bankruptcy?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T2.name = T1.name\n```"}]}, {"id": "train-4494", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students who have been absent for four months, provide any five students' names and enlisted organizations."}, {"from": "gpt", "value": "```sql\nSELECT T2.name, T2.organ FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T2.name = T1.name WHERE T1.month = 4 LIMIT 5\n```"}]}, {"id": "train-4495", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students with payment due, how many of them are unemployed?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name WHERE T1.bool = 'pos'\n```"}]}, {"id": "train-4496", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the enlisted organizations of student160 and status of his/her payment due."}, {"from": "gpt", "value": "```sql\nSELECT T1.organ, T2.bool FROM enlist AS T1 INNER JOIN no_payment_due AS T2 ON T2.name = T1.name WHERE T1.name = 'student160'\n```"}]}, {"id": "train-4497", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List any ten male students who enlisted for foreign legion."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM enlist AS T1 INNER JOIN male AS T2 ON T2.name = T1.name WHERE T1.organ = 'foreign_legion' LIMIT 10\n```"}]}, {"id": "train-4498", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of female students."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.name IS NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.name) FROM person AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name\n```"}]}, {"id": "train-4499", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are filed for bankruptcy?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM filed_for_bankrupcy\n```"}]}, {"id": "train-4500", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are enrolled in smc during month 1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enrolled WHERE school = 'smc' AND month = 1\n```"}]}, {"id": "train-4501", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students enlist in the air force organization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'air_force'\n```"}]}, {"id": "train-4502", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the organization enlisted by student168?"}, {"from": "gpt", "value": "```sql\nSELECT organ FROM enlist WHERE name = 'student168'\n```"}]}, {"id": "train-4503", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many disabled male students joined an organization?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM disabled AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name INNER JOIN enlist AS T3 ON T3.name = T2.name\n```"}]}, {"id": "train-4504", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide a disability breakdown for each school."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM enrolled AS T1 INNER JOIN disabled AS T2 ON T2.name = T1.name GROUP BY T1.school\n```"}]}, {"id": "train-4505", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide a gender breakdown for each organization."}, {"from": "gpt", "value": "```sql\nSELECT IIF(T2.name IS NULL, 'female', 'male') AS gender FROM enlist AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name GROUP BY T1.organ\n```"}]}, {"id": "train-4506", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out student names that enrolled in two schools and two organizations?"}, {"from": "gpt", "value": "```sql\nSELECT T.name FROM ( SELECT T1.name, COUNT(T1.organ) AS num FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T1.name = T2.name GROUP BY T1.name ) T WHERE T.num = 2\n```"}]}, {"id": "train-4507", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage difference between month 0 absence and month 9 absence?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(((SUM(IIF(month = 0, 1, 0)) - SUM(IIF(month = 9, 1, 0)))) AS REAL) * 100 / SUM(IIF(month = 0, 1, 0)) FROM longest_absense_from_school\n```"}]}, {"id": "train-4508", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which school have the highest student enrollment? How many of those students are filed for bankruptcy?"}, {"from": "gpt", "value": "```sql\nSELECT T.school, num FROM ( SELECT T1.school, COUNT(T2.name) AS num FROM enrolled AS T1 LEFT JOIN filed_for_bankrupcy AS T2 ON T2.name = T1.name GROUP BY T1.school ) T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-4509", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students is disabled and unemployed at the same time?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM disabled AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name\n```"}]}, {"id": "train-4510", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out students that enrolled in occ school and enlisted in a fire department."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T2.name = T1.name WHERE T2.school = 'occ' AND T1.organ = 'fire_department'\n```"}]}, {"id": "train-4511", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which male students are unemployed, disable and were absent for 5 month?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM unemployed AS T1 INNER JOIN disabled AS T2 ON T2.name = T1.name INNER JOIN longest_absense_from_school AS T3 ON T3.name = T2.name WHERE T3.month = 5\n```"}]}, {"id": "train-4512", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out female students that enrolled in occ school and ulca?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM enrolled WHERE school IN ('occ', 'ulca') AND name NOT IN ( SELECT name FROM male )\n```"}]}, {"id": "train-4513", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the school and organization enrolled by student211?"}, {"from": "gpt", "value": "```sql\nSELECT T2.school, T1.organ FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T2.name = T1.name WHERE T1.name = 'student211'\n```"}]}, {"id": "train-4514", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male students filed for bankruptcy as compare to female students?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.name) - SUM(IIF(T2.name IS NULL, 1, 0)) AS num FROM filed_for_bankrupcy AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name\n```"}]}, {"id": "train-4515", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average absent month for a unemployed male students?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.month) AS avg FROM unemployed AS T1 INNER JOIN longest_absense_from_school AS T2 ON T2.name = T1.name INNER JOIN male AS T3 ON T3.name = T2.name\n```"}]}, {"id": "train-4516", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage difference between the attendence of disabled and non-disable students? Do the disable students show better attendance than non-disable students?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(IIF(T2.name IS NOT NULL AND T1.month = 0, 1, 0)) - SUM(IIF(T2.name IS NULL AND T1.month = 0, 1, 0))) AS REAL) * 100 / COUNT(T1.name), IIF(SUM(IIF(T2.name IS NOT NULL AND T1.month = 0, 1, 0)) - SUM(IIF(T2.name IS NULL AND T1.month = 0, 1, 0)) > 0, 'YES', 'NO') AS isHigh FROM longest_absense_from_school AS T1 LEFT JOIN disabled AS T2 ON T2.name = T1.name\n```"}]}, {"id": "train-4517", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average duration of absense of disabled male students."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T2.name = T1.name INNER JOIN male AS T3 ON T3.name = T2.name\n```"}]}, {"id": "train-4518", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the ratio of unemployed students who have never been absent from school."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.month = 0, 1, 0)) AS REAL) * 100 / COUNT(T1.name) FROM unemployed AS T1 INNER JOIN longest_absense_from_school AS T2 ON T2.name = T1.name\n```"}]}, {"id": "train-4519", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of male students who do not have payment due."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN male AS T2 ON T2.name = T1.name WHERE T1.bool = 'pos'\n```"}]}, {"id": "train-4520", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of students who filed for bankruptcy and have payment due."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM filed_for_bankrupcy AS T1 INNER JOIN no_payment_due AS T2 ON T2.name = T1.name WHERE T2.bool = 'pos'\n```"}]}, {"id": "train-4521", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the status of payment of student 124?"}, {"from": "gpt", "value": "```sql\nSELECT `bool` FROM no_payment_due WHERE name = 'student124'\n```"}]}, {"id": "train-4522", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of disabled students who have payment due."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.bool = 'neg'\n```"}]}, {"id": "train-4523", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State name of students who have the longest duration of absense from school and do not have payment due."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T2.bool = 'neg' ORDER BY T1.month DESC LIMIT 1\n```"}]}, {"id": "train-4524", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State name of students who have been absent for 5 months from school and do not have payment due."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T1.month = 5 AND T2.bool = 'neg'\n```"}]}, {"id": "train-4525", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the number of disabled students who enlisted in marines."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'marines'\n```"}]}, {"id": "train-4526", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the number of students who have the longest duration of absense from school and enlisted in the peace corps."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.NAME) FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'peace_corps' ORDER BY T1.month DESC LIMIT 1\n```"}]}, {"id": "train-4527", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the number of students who filed for bankruptcy and enlisted in navy."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name WHERE T1.organ = 'navy'\n```"}]}, {"id": "train-4528", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of students who enlisted in marines and have payment due."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T1.bool = 'pos' AND T2.organ = 'marines'\n```"}]}, {"id": "train-4529", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the ratio of disabled students who have never been absent from school."}, {"from": "gpt", "value": "```sql\nSELECT 100 * SUM(IIF(T2.month = 0, 1, 0)) AS num FROM disabled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name\n```"}]}, {"id": "train-4530", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students in the Air Force?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'air_force'\n```"}]}, {"id": "train-4531", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students have been absent less than 4 months?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM longest_absense_from_school WHERE month < 4\n```"}]}, {"id": "train-4532", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the number of female students who belong to marines organization."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM person AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T1.name = T3.name WHERE T2.organ = 'marines' AND T3.name IS NULL\n```"}]}, {"id": "train-4533", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average duration of absense of female students."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.month) FROM person AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T1.name = T3.name WHERE T3.name IS NULL\n```"}]}, {"id": "train-4534", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State name of female students who filed for bankruptcy."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM person AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T1.name = T3.name WHERE T3.name IS NULL\n```"}]}, {"id": "train-4535", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the status of payment of student 299."}, {"from": "gpt", "value": "```sql\nSELECT bool FROM no_payment_due WHERE name = 'student299'\n```"}]}, {"id": "train-4536", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students are enlisted to the air force?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'air_force'\n```"}]}, {"id": "train-4537", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students have absent from school?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM longest_absense_from_school WHERE month > 1\n```"}]}, {"id": "train-4538", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names of the students enlisted in the fire department."}, {"from": "gpt", "value": "```sql\nSELECT name FROM enlist WHERE organ = 'fire_department'\n```"}]}, {"id": "train-4539", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many disabled students have payment due?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.bool = 'pos'\n```"}]}, {"id": "train-4540", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students that filed for bankruptcy, how many of them have been enrolled in OCC?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM filed_for_bankrupcy AS T1 INNER JOIN enrolled AS T2 ON T1.name = T2.name WHERE T2.school = 'occ'\n```"}]}, {"id": "train-4541", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many disabled students are male?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM male AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name\n```"}]}, {"id": "train-4542", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of disabled students enlisted in the navy."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM enlist AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.organ = 'navy'\n```"}]}, {"id": "train-4543", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the male students, list down the names of students with payment due."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM male AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T2.bool = 'pos'\n```"}]}, {"id": "train-4545", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all students, calculate the percentage of male students."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM person AS T1 LEFT JOIN male AS T2 ON T1.name = T2.name\n```"}]}, {"id": "train-4546", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the school and gender of student34?"}, {"from": "gpt", "value": "```sql\nSELECT T1.school , IIF(T3.name IS NULL, 'female', 'male') AS gender FROM enrolled AS T1 INNER JOIN person AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T2.name = T3.name WHERE T2.name = 'student34'\n```"}]}, {"id": "train-4547", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the longest duration of absense for a student enlisted in the fire department."}, {"from": "gpt", "value": "```sql\nSELECT T1.month FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'fire_department' ORDER BY T1.month DESC LIMIT 1\n```"}]}, {"id": "train-4548", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among students with 1 month of absenses, how many of them are enlisted in the air force department?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T1.month = 1 AND T2.organ = 'air_force'\n```"}]}, {"id": "train-4549", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of disabled male students that are unemployed."}, {"from": "gpt", "value": "```sql\nSELECT T2.NAME FROM unemployed AS T1 INNER JOIN male AS T2 ON T1.name = T2.name INNER JOIN disabled AS T3 ON T3.name = T2.name\n```"}]}, {"id": "train-4550", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male students are enrolled at OCC?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM enrolled AS T1 INNER JOIN male AS T2 ON T1.name = T2.name WHERE T1.school = 'occ'\n```"}]}, {"id": "train-4551", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students enrolled in UCLA, what is the percentage of male students in the air force department?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T4.name) AS REAL) * 100 / COUNT(T2.name) FROM enlist AS T1 INNER JOIN person AS T2 ON T1.name = T2.name INNER JOIN enrolled AS T3 ON T3.name = T2.name LEFT JOIN male AS T4 ON T2.name = T4.name WHERE T3.school = 'ucla' AND T1.organ = 'air_force'\n```"}]}, {"id": "train-4552", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of disabled female students enrolled in UCI."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.school = 'uci' AND T4.name IS NULL, 1, 0)) AS REAL) / COUNT(T1.name) FROM enrolled AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name INNER JOIN person AS T3 ON T1.name = T3.name LEFT JOIN male AS T4 ON T3.name = T4.name\n```"}]}, {"id": "train-4553", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students have never been absent in school?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM longest_absense_from_school WHERE month = 0\n```"}]}, {"id": "train-4554", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the students who joined the Marines?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM enlist WHERE organ = 'marines'\n```"}]}, {"id": "train-4555", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students enlisted in the Navy?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM enlist WHERE organ = 'navy'\n```"}]}, {"id": "train-4556", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the student with the longest duration of absence?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM longest_absense_from_school WHERE month = ( SELECT MAX(month) FROM longest_absense_from_school )\n```"}]}, {"id": "train-4557", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the organization which most of the students are enlisted in?"}, {"from": "gpt", "value": "```sql\nSELECT organ FROM ( SELECT organ, COUNT(organ) AS num FROM enlist GROUP BY organ ) T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-4558", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students have absences of no more than 3 months?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM longest_absense_from_school WHERE month < 3\n```"}]}, {"id": "train-4559", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students that have a payment due, how many students are unemployed?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name WHERE T1.bool = 'pos'\n```"}]}, {"id": "train-4560", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female students have enlisted for the Army?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T3.name IS NULL, 1, 0)) AS \"result\" FROM enlist AS T1 INNER JOIN person AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T2.name = T3.name WHERE T1.organ = 'army'\n```"}]}, {"id": "train-4561", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which organization has the least number of male students?"}, {"from": "gpt", "value": "```sql\nSELECT T.organ FROM ( SELECT T2.organ, COUNT(T1.name) AS num FROM male AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name GROUP BY T2.organ ) T ORDER BY T.num LIMIT 1\n```"}]}, {"id": "train-4562", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many disabled students have zero absences?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM disabled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name WHERE T2.month = 0\n```"}]}, {"id": "train-4563", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the unemployed students are disabled?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name\n```"}]}, {"id": "train-4564", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the disabled students who were absent from school for more than 5 months."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.month > 5\n```"}]}, {"id": "train-4565", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many bankrupt students are there in the Marines?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM filed_for_bankrupcy AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'marines'\n```"}]}, {"id": "train-4566", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students who filed for bankruptcy, how many students are disabled?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM disabled AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name\n```"}]}, {"id": "train-4567", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many months did a student in the Air Force miss school the most?"}, {"from": "gpt", "value": "```sql\nSELECT T1.month FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name ORDER BY T1.month DESC LIMIT 1\n```"}]}, {"id": "train-4568", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the students who filed for bankruptcy with an absence in school of no more than 6 months, how many students enlisted for the fire department?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name INNER JOIN enlist AS T3 ON T3.name = T2.name WHERE T3.organ = 'fire_department'\n```"}]}, {"id": "train-4569", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employed disabled students have zero absences?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name INNER JOIN unemployed AS T3 ON T3.name = T2.name WHERE T1.month = 0\n```"}]}, {"id": "train-4570", "db_id": "student_loan", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which organization has the highest number of male students? Calculate for the percentage of the male students in the said organization."}, {"from": "gpt", "value": "```sql\nSELECT T.organ, T.per FROM ( SELECT T1.organ, CAST(COUNT(T3.name) AS REAL) / COUNT(T2.name) AS per , COUNT(T3.name) AS num FROM enlist AS T1 INNER JOIN person AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T2.name = T3.name GROUP BY T1.organ ) T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-4571", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users answered \"No\" to question 19?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(QuestionID) FROM Answer WHERE QuestionID = 19 AND AnswerText LIKE 'No'\n```"}]}, {"id": "train-4572", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 2016 to 2019, how many users each year were asked the question 13?"}, {"from": "gpt", "value": "```sql\nSELECT SurveyID, COUNT(UserID) FROM Answer WHERE QuestionID = 13 AND SurveyID BETWEEN 2016 AND 2019 GROUP BY SurveyID\n```"}]}, {"id": "train-4573", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users, between the age 27 to 35, were surveyed in 2018?"}, {"from": "gpt", "value": "```sql\nSELECT T1.UserID FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.SurveyID = 2018 AND T2.questionid = 1 AND T1.AnswerText BETWEEN '27' AND '35'\n```"}]}, {"id": "train-4574", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2019, how many users in the United States have a family history of mental illness?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN ( SELECT T2.questionid FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.SurveyID = 2019 AND T2.questionid = 6 AND T1.AnswerText LIKE 'Yes' ) AS T2 ON T1.QuestionID = T2.questionid WHERE T1.SurveyID = 2019 AND T2.questionid = 3 AND T1.AnswerText LIKE 'United States'\n```"}]}, {"id": "train-4575", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Betweeen 2016 to 2019, which year recorded the highest number of people with mental illness?"}, {"from": "gpt", "value": "```sql\nSELECT T1.SurveyID FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.SurveyID BETWEEN 2016 AND 2019 AND T2.questionid = 34 AND T1.AnswerText LIKE 'Yes' GROUP BY T1.SurveyID ORDER BY COUNT(T1.UserID) DESC LIMIT 1\n```"}]}, {"id": "train-4576", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female users were surveyed in the mental health survey for 2017 in the state of Nebraska?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT T2.UserID FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID INNER JOIN Survey AS T3 ON T2.SurveyID = T3.SurveyID WHERE T3.Description = 'mental health survey for 2017' AND T1.questionid = 2 AND T2.AnswerText = 'Female' UNION SELECT T2.UserID FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID INNER JOIN Survey AS T3 ON T2.SurveyID = T3.SurveyID WHERE T1.questionid = 4 AND T2.AnswerText = 'Nebraska' AND T3.Description = 'mental health survey for 2017' )\n```"}]}, {"id": "train-4577", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users believed that their productivity is ever affected by a mental health issue overall?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questionid = 54 AND T1.AnswerText LIKE 'Yes'\n```"}]}, {"id": "train-4578", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the ages of the oldest and youngest user that were surveyed? Indicate their user id."}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.AnswerText), MIN(T1.AnswerText) , ( SELECT T1.UserID FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questionid = 1 ORDER BY T1.AnswerText LIMIT 1 ) AS \"youngest id\" FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questionid = 1\n```"}]}, {"id": "train-4579", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country have the least number of users being surveyed? Indicate the name of the country. If there are multiple countries having the same number of users, indicate all of their names."}, {"from": "gpt", "value": "```sql\nSELECT T1.AnswerText FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questionid = 3 GROUP BY T1.AnswerText ORDER BY COUNT(T1.UserID) DESC LIMIT 1\n```"}]}, {"id": "train-4580", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of the survey respondents in the United States?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.AnswerText) AS REAL) / COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN ( SELECT T1.UserID FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questionid = 3 AND T1.AnswerText = 'United States' ) AS T2 ON T1.UserID = T2.UserID INNER JOIN Question AS T3 ON T1.QuestionID = T3.questionid WHERE T3.questionid = 1\n```"}]}, {"id": "train-4581", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the the users who would bring up a mental health issue with a potential employer in an interview?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.AnswerText LIKE 'Yes' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questionid = 12\n```"}]}, {"id": "train-4582", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many questions in 2014's survey had more than 200 answers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(QuestionID) FROM Answer WHERE SurveyID LIKE 2014 GROUP BY QuestionID ORDER BY COUNT(QuestionID) > 200 LIMIT 1\n```"}]}, {"id": "train-4583", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the oldest age of the users in 2014's survey?"}, {"from": "gpt", "value": "```sql\nSELECT T2.AnswerText FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T1.questiontext = 'What is your age?' AND T2.SurveyID = 2014 ORDER BY T2.AnswerText DESC LIMIT 1\n```"}]}, {"id": "train-4584", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users answered \"No\" to the question \"Would you bring up a mental health issue with a potential employer in an interview?\" in 2014's survey?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T1.questiontext = 'Would you bring up a mental health issue with a potential employer in an interview?' AND T2.SurveyID = 2014 AND T2.AnswerText LIKE 'NO'\n```"}]}, {"id": "train-4585", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the users who answered \"Yes\" to the question \"Do you think that discussing a physical health issue with your employer would have negative consequences?\" in 2014's survey."}, {"from": "gpt", "value": "```sql\nSELECT T2.UserID FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T1.questiontext = 'Do you think that discussing a physical health issue with your employer would have negative consequences?' AND T2.AnswerText LIKE 'Yes' AND T2.SurveyID = 2014\n```"}]}, {"id": "train-4586", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users participated in the mental health survey for 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.UserID) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2014'\n```"}]}, {"id": "train-4587", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the answers to the question \"Any additional notes or comments\" that are not null in 2014's survey."}, {"from": "gpt", "value": "```sql\nSELECT T2.AnswerText FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T1.questiontext = 'Any additional notes or comments' AND T2.SurveyID = 2014 AND T2.AnswerText <> -1\n```"}]}, {"id": "train-4588", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the common questions in 2014's survey and 2016's survey."}, {"from": "gpt", "value": "```sql\nSELECT T1.questiontext FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID IN (2014, 2016) GROUP BY T1.questiontext\n```"}]}, {"id": "train-4589", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users lived in Canada according to 2018's survey?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID = 2018 AND T1.questiontext = 'What country do you live in?' AND T2.AnswerText = 'Canada'\n```"}]}, {"id": "train-4590", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the questions in the mental health survey for 2014."}, {"from": "gpt", "value": "```sql\nSELECT T2.questiontext FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid INNER JOIN Survey AS T3 ON T1.SurveyID = T3.SurveyID WHERE T3.Description LIKE 'mental health survey for 2014' GROUP BY T2.questiontext\n```"}]}, {"id": "train-4591", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: According to 2016's survey, what is the number of users with a mental health disorder in the past?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID = 2016 AND T1.questiontext LIKE 'Have you had a mental health disorder in the past?' AND T2.AnswerText = 'Yes'\n```"}]}, {"id": "train-4592", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users answered \"Yes\" to the question \"Have you had a mental health disorder in the past?\" in 3 consecutive years starting from 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID IN (2016, 2017, 2018) AND T1.questiontext LIKE 'Have you had a mental health disorder in the past?' AND T2.AnswerText = 'Yes'\n```"}]}, {"id": "train-4593", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average result of the question \"What is your age?\" in 2014's survey?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.AnswerText) AS REAL) / COUNT(T2.UserID) AS \"avg\" FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID = 2014 AND T1.questiontext LIKE 'What is your age?'\n```"}]}, {"id": "train-4594", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the rate of increase of users with a current mental disorder from 2019's survey to 2016's survey?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(( SELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID = 2019 AND T1.questiontext LIKE 'Do you currently have a mental health disorder?' AND T2.AnswerText = 'Yes' ) - ( SELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID = 2016 AND T1.questiontext LIKE 'Do you currently have a mental health disorder?' AND T2.AnswerText = 'Yes' ) AS REAL) * 100 / ( SELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID = 2016 AND T1.questiontext LIKE 'Do you currently have a mental health disorder?' AND T2.AnswerText = 'Yes' )\n```"}]}, {"id": "train-4595", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the question ID for \"Would you bring up a physical health issue with a potential employer in an interview?\"."}, {"from": "gpt", "value": "```sql\nSELECT questionid FROM Question WHERE questiontext LIKE 'Would you bring up a physical health issue with a potential employer in an interview?'\n```"}]}, {"id": "train-4596", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users answered the question No.20?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(UserID) - MIN(UserID) + 1 FROM Answer WHERE QuestionID = 20\n```"}]}, {"id": "train-4597", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many questions did user No.5 answer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(QuestionID) FROM Answer WHERE UserID = 5\n```"}]}, {"id": "train-4598", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users participated in the Survey No.2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT UserID) FROM Answer WHERE SurveyID LIKE 2016\n```"}]}, {"id": "train-4599", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of questions that were asked in the \"mental health survey for 2018\"."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.QuestionID) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2018'\n```"}]}, {"id": "train-4600", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of surveys that contained the question \u201cWhat country do you work in?\u201d."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.QuestionID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid INNER JOIN Survey AS T3 ON T1.SurveyID = T3.SurveyID WHERE T2.questiontext = 'What country do you work in?'\n```"}]}, {"id": "train-4601", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What answer did user No. 2681 give to the question \"Do you currently have a mental health disorder?\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.AnswerText FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext = 'Do you currently have a mental health disorder?' AND T1.UserID = 2681\n```"}]}, {"id": "train-4602", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of users who took part in the \"mental health survey for 2016\"."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.UserID) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2016'\n```"}]}, {"id": "train-4603", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the most common answer for the question \"What country do you work in?\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.AnswerText FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext = 'What country do you work in?' GROUP BY T1.AnswerText ORDER BY COUNT(T1.AnswerText) DESC LIMIT 1\n```"}]}, {"id": "train-4604", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different answers did the question \"Describe the conversation you had with your previous employer about your mental health, including their reactions and actions taken to address your mental health issue/questions.\" get?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.AnswerText) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Describe the conversation you had with your previous employer about your mental health, including their reactions and actions taken to address your mental health issue/questions.'\n```"}]}, {"id": "train-4605", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the question \u201cWhat US state or territory do you work in?\u201d, how many people gave \"Kansas\" as the answer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'What US state or territory do you work in?' AND T1.AnswerText = 'Kansas'\n```"}]}, {"id": "train-4606", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people wrote comments for the question \"Any additional notes or comments.\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Any additional notes or comments' AND T1.AnswerText IS NOT NULL\n```"}]}, {"id": "train-4607", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the users who have been asked \"Have you ever been diagnosed with a mental health disorder?\", how many of them said \"Yes\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Have you ever been diagnosed with a mental health disorder?' AND T1.AnswerText = 'Yes'\n```"}]}, {"id": "train-4608", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of users who took the \"mental health survey for 2018\"."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.UserID) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2018'\n```"}]}, {"id": "train-4609", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many users answered the question \"Overall, how much importance does your employer place on physical health?\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Overall, how much importance does your employer place on physical health?'\n```"}]}, {"id": "train-4611", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the percentage for the answer of \"Yes\" was given to the question \"Has your employer ever formally discussed mental health (for example, as part of a wellness campaign or other official communication)?\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.AnswerText LIKE 'Yes' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Has your employer ever formally discussed mental health (for example, as part of a wellness campaign or other official communication)?'\n```"}]}, {"id": "train-4612", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times more for the number of users who took the \"mental health survey for 2017\" than \"mental health survey for 2018\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.UserID) AS REAL) / ( SELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2018' ) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2017'\n```"}]}, {"id": "train-4613", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among respondents who participated in the survey in 2016, what percentage had a mental health disorder in the past?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.AnswerText LIKE 'Yes' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.SurveyID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.QuestionID = 32 AND T1.SurveyID = 2016\n```"}]}, {"id": "train-4614", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many respondents younger than 25 years old did participate in the survey in 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.QuestionID = 1 AND T1.SurveyID = 2016 AND T1.AnswerText <= 25\n```"}]}, {"id": "train-4615", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of respondents per survey between 2014 and 2019?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(SurveyID) AS REAL) / 5 FROM Answer WHERE SurveyID BETWEEN 2014 AND 2019\n```"}]}, {"id": "train-4616", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many respondents who participated in the survey in 2019 have ever sought treatment for a mental health disorder from a mental health professional?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.QuestionID = 7 AND T1.SurveyID = 2019 AND T1.AnswerText = 1\n```"}]}, {"id": "train-4617", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many respondents who participated in the survey in 2014 work remotely at least 50% of the time?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.AnswerText) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.QuestionID = 93 AND T1.SurveyID = 2014 AND T1.AnswerText = 'Yes'\n```"}]}, {"id": "train-4618", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many questions were asked in the questionary for the mental health survey?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(questiontext) FROM Question\n```"}]}, {"id": "train-4619", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many respondents of the mental health survey were diagnosed with 'Substance Use Disorder'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(AnswerText) FROM Answer WHERE AnswerText LIKE 'Substance Use Disorder'\n```"}]}, {"id": "train-4620", "db_id": "mental_health_survey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the top three popular responses to the question of the survey in 2017 with the question ID no.85."}, {"from": "gpt", "value": "```sql\nSELECT AnswerText FROM Answer WHERE QuestionID = 85 AND SurveyID = 2017 GROUP BY AnswerText ORDER BY COUNT(AnswerText) DESC LIMIT 3\n```"}]}, {"id": "train-4621", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much more total box office gross did the Walt Disney Company have in revenue in 1998 than in 1997?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN `Year` = 1998 THEN Total ELSE 0 END) - SUM(CASE WHEN `Year` = 1997 THEN Total ELSE 0 END) FROM revenue\n```"}]}, {"id": "train-4622", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which segment did the Walt Disney Company earned a bigger revenue in 1998, Studio Entertainment or Disney Media Networks?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN 'Studio Entertainment[NI 1]' > 'Disney Media Networks' THEN 'Studio Entertainment[NI 1]' ELSE 'Disney Media Networks' END FROM revenue WHERE `Year` = 1998\n```"}]}, {"id": "train-4623", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the director of the movie Pinocchio?"}, {"from": "gpt", "value": "```sql\nSELECT director FROM director WHERE name = 'Pinocchio'\n```"}]}, {"id": "train-4624", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the villains of all the movies directed by Wolfgang Reitherman."}, {"from": "gpt", "value": "```sql\nSELECT T2.villian FROM director AS T1 INNER JOIN characters AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Wolfgang Reitherman' AND T2.villian IS NOT NULL\n```"}]}, {"id": "train-4625", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the movies directed by Wolfgang Reitherman, how many of them were released in December?"}, {"from": "gpt", "value": "```sql\nSELECT 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'\n```"}]}, {"id": "train-4626", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The song \"Once Upon a Dream\" is associated with the movie directed by whom?"}, {"from": "gpt", "value": "```sql\nSELECT T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.song = 'Once Upon a Dream'\n```"}]}, {"id": "train-4627", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the voice actor for the villain of the movie \"Alice in Wonderland\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`voice-actor` FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T1.character LIKE '%' OR T2.villian OR '%' AND T2.movie_title = 'Alice in Wonderland'\n```"}]}, {"id": "train-4628", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the release dates of all the movies in which Alan Tudyk is a voice actor."}, {"from": "gpt", "value": "```sql\nSELECT T2.release_date FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T1.`voice-actor` = 'Alan Tudyk'\n```"}]}, {"id": "train-4629", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the movies in which Alan Tudyk is a voice actor, how many of them were released after 2012?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.movie) FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T2.`voice-actor` = 'Alan Tudyk' AND SUBSTR(release_date, INSTR(release_date, '-') + 5) > 12\n```"}]}, {"id": "train-4630", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the movies directed by Wolfgang Reitherman, how many of them are Comedies?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.name) FROM ( SELECT T2.name FROM `movies_total_gross` AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Wolfgang Reitherman' AND T1.genre = 'Comedy' GROUP BY T2.name ) T3\n```"}]}, {"id": "train-4631", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the movies directed by Wolfgang Reitherman, which one of them was the most popular?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Wolfgang Reitherman' ORDER BY T2.total_gross DESC LIMIT 1\n```"}]}, {"id": "train-4632", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the movies directed by Wolfgang Reitherman that can be watched by the general audience."}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title FROM `movies_total_gross` AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.MPAA_rating = 'G' AND T2.director = 'Wolfgang Reitherman'\n```"}]}, {"id": "train-4633", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which character is the villain of the most popular movie?"}, {"from": "gpt", "value": "```sql\nSELECT T2.villian FROM `movies_total_gross` AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title ORDER BY T1.total_gross DESC LIMIT 1\n```"}]}, {"id": "train-4634", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the genre of the movie whose villain is Commander Rourke?"}, {"from": "gpt", "value": "```sql\nSELECT T2.genre FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie_title WHERE T1.villian = 'Commander Rourke'\n```"}]}, {"id": "train-4635", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the villain of the movie \"Beauty and the Beast\"?"}, {"from": "gpt", "value": "```sql\nSELECT villian FROM characters WHERE movie_title = 'Beauty and the Beast'\n```"}]}, {"id": "train-4636", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movie is the character Robin Hood in?"}, {"from": "gpt", "value": "```sql\nSELECT movie_title FROM characters WHERE hero = 'Robin Hood'\n```"}]}, {"id": "train-4637", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the movie which the song \"I Thought I Lost You\" is associated with."}, {"from": "gpt", "value": "```sql\nSELECT movie_title FROM characters WHERE song = 'I Thought I Lost You'\n```"}]}, {"id": "train-4638", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the voice actor of the character \"Binkie Muddlefoot\"?"}, {"from": "gpt", "value": "```sql\nSELECT `voice-actor` FROM `voice-actors` WHERE character = 'Binkie Muddlefoot'\n```"}]}, {"id": "train-4639", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the hero character of the movie whose total gross was $222,527,828?"}, {"from": "gpt", "value": "```sql\nSELECT T1.hero FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie_title WHERE T2.total_gross = '$222,527,828'\n```"}]}, {"id": "train-4640", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which song is associated with the most popular Disney movie in 1970s?"}, {"from": "gpt", "value": "```sql\nSELECT T2.song FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE CAST(SUBSTR(T1.release_date, INSTR(T1.release_date, ', ') + 1) AS int) BETWEEN 1970 AND 1979 ORDER BY CAST(REPLACE(SUBSTR(T1.total_gross, 2), ',', '') AS float) DESC LIMIT 1\n```"}]}, {"id": "train-4641", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the hero character of the Disney movie directed by Will Finn?"}, {"from": "gpt", "value": "```sql\nSELECT T1.hero FROM characters AS T1 INNER JOIN director AS T2 ON T2.name = T1.movie_title WHERE T2.director = 'Will Finn'\n```"}]}, {"id": "train-4642", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the voice actor of the hero character from the movie The Little Mermaid?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`voice-actor` FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T2.movie = T1.movie_title WHERE T1.movie_title = 'The Little Mermaid' AND T2.character = T1.hero\n```"}]}, {"id": "train-4643", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the director of the movie in which Verna Felton was the voice actor for its character \"Aunt Sarah\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.director FROM director AS T1 INNER JOIN `voice-actors` AS T2 ON T2.movie = T1.name WHERE T2.character = 'Aunt Sarah' AND T2.`voice-actor` = 'Verna Felton'\n```"}]}, {"id": "train-4644", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the movie in which Tress MacNeille was the voice actor for its character \"Hyacinth Hippo\", what was the release date of that movie?"}, {"from": "gpt", "value": "```sql\nSELECT T1.release_date FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T2.movie = T1.movie_title WHERE T2.character = 'Hyacinth Hippo' AND T2.`voice-actor` = 'Tress MacNeille'\n```"}]}, {"id": "train-4645", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the director of the adventure movie which was released on 2007/3/30?"}, {"from": "gpt", "value": "```sql\nSELECT T1.director FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.name WHERE T2.genre = 'Adventure' AND T2.release_date = 'Mar 30, 2007'\n```"}]}, {"id": "train-4646", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Wolfgang Reitherman has directed several Disney movies, which one has the highest grossing after accounting for inflation?"}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Wolfgang Reitherman' ORDER BY CAST(REPLACE(SUBSTR(inflation_adjusted_gross, 2), ',', '') AS REAL) DESC LIMIT 1\n```"}]}, {"id": "train-4647", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the hero character of the adventure movie which was released on 2016/3/4?"}, {"from": "gpt", "value": "```sql\nSELECT 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'\n```"}]}, {"id": "train-4649", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies did Wolfgang Reitherman direct?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(name) FROM director WHERE director = 'Wolfgang Reitherman'\n```"}]}, {"id": "train-4650", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the most productive director?"}, {"from": "gpt", "value": "```sql\nSELECT director FROM director GROUP BY director ORDER BY COUNT(name) DESC LIMIT 1\n```"}]}, {"id": "train-4651", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restricted horror movies were released between 1/1/1990 to 12/31/2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movie_title) FROM movies_total_gross WHERE MPAA_rating = 'R' AND genre = 'Horror' AND CAST(SUBSTR(release_date, INSTR(release_date, ', ') + 1) AS int) BETWEEN 1990 AND 2015\n```"}]}, {"id": "train-4653", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the total gross of the movie with a song titled \"Little Wonders\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.total_gross FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie_title WHERE T2.song = 'Little Wonders'\n```"}]}, {"id": "train-4654", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the Motion Picture Association of America rating for the movie featuring a villain named Turbo?"}, {"from": "gpt", "value": "```sql\nSELECT T1.MPAA_rating FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie_title WHERE T2.villian = 'Turbo'\n```"}]}, {"id": "train-4655", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies for mature audiences or parental guidance suggested did Bill Thompson work as a voice actor?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.movie) FROM ( SELECT T1.movie FROM `voice-actors` AS T1 INNER JOIN movies_total_gross AS T2 ON T1.movie = T2.movie_title WHERE MPAA_rating = 'PG' AND `voice-actor` = 'Bill Thompson' GROUP BY T1.movie ) AS T\n```"}]}, {"id": "train-4656", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of Gary Trousdale's movies are adventure movies?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.name) FROM ( SELECT T1.name FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Gary Trousdale' AND T2.genre = 'Adventure' GROUP BY T1.name ) T\n```"}]}, {"id": "train-4657", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which director did Bill Thompson work the most with?"}, {"from": "gpt", "value": "```sql\nSELECT director FROM director AS T1 INNER JOIN `voice-actors` AS T2 ON T1.name = T2.movie WHERE T2.`voice-actor` = 'Bill Thompson' GROUP BY director ORDER BY COUNT(director) DESC LIMIT 1\n```"}]}, {"id": "train-4658", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most popular movie directed by Ron Clements?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T2.name = T1.movie_title WHERE T2.director = 'Ron Clements' ORDER BY CAST(REPLACE(SUBSTR(total_gross, 2), ',', '') AS int) DESC LIMIT 1\n```"}]}, {"id": "train-4659", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the voice actors in the movie directed by Ben Sharpsteen which was released on February 9, 1940."}, {"from": "gpt", "value": "```sql\nSELECT T2.`voice-actor` FROM director AS T1 INNER JOIN `voice-actors` AS T2 INNER JOIN movies_total_gross AS T3 ON T1.name = T2.movie AND T2.movie = T3.movie_title WHERE T1.director = 'Ben Sharpsteen' AND T3.release_date = 'Feb 9, 1940' AND T2.`voice-actor` != 'None' GROUP BY T2.`voice-actor`\n```"}]}, {"id": "train-4660", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many PG adventure movies did Ron Clements direct?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Ron Clements' AND T2.MPAA_rating = 'PG' AND T2.genre = 'Adventure'\n```"}]}, {"id": "train-4661", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many horror movies are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movie_title) FROM `movies_total_gross` WHERE genre = 'Horror'\n```"}]}, {"id": "train-4662", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the villain in the movie \"The Great Mouse Detective\"?"}, {"from": "gpt", "value": "```sql\nSELECT villian FROM characters WHERE movie_title = 'The Great Mouse Detective'\n```"}]}, {"id": "train-4663", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the voice actors from the movie \"Meet the Robinsons\"."}, {"from": "gpt", "value": "```sql\nSELECT 'voice-actor' FROM `voice-actors` WHERE movie = 'Meet the Robinsons'\n```"}]}, {"id": "train-4664", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which director has made the most movies?"}, {"from": "gpt", "value": "```sql\nSELECT director, COUNT(name) FROM director GROUP BY director ORDER BY COUNT(name) DESC LIMIT 1\n```"}]}, {"id": "train-4665", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 2000 to 2010, in which year did the studio entertainment segment make the most revenue?"}, {"from": "gpt", "value": "```sql\nSELECT `Year` FROM revenue WHERE `Year` BETWEEN 2000 AND 2010 ORDER BY `Studio Entertainment[NI 1]` DESC LIMIT 1\n```"}]}, {"id": "train-4666", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the songs associated with drama movies."}, {"from": "gpt", "value": "```sql\nSELECT song FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE T1.genre = 'Drama' GROUP BY song\n```"}]}, {"id": "train-4667", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the voice actors for all the heroes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`voice-actor` FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T2.character = T1.hero WHERE T2.movie = T1.movie_title\n```"}]}, {"id": "train-4668", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide a list of directors from the 1990s."}, {"from": "gpt", "value": "```sql\nSELECT T2.director FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name AND CAST(SUBSTR(release_date, INSTR(release_date, ', ') + 1) AS int) BETWEEN 1990 AND 2000 GROUP BY T2.director\n```"}]}, {"id": "train-4669", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who voiced the villain in \"The Rescuers\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`voice-actor` FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie WHERE T2.movie_title = 'The Rescuers' AND T1.character = T2.villian\n```"}]}, {"id": "train-4670", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of Wolfgang Reitherman's movies and their voice actors."}, {"from": "gpt", "value": "```sql\nSELECT T1.name, T2.`voice-actor` FROM director AS T1 INNER JOIN `voice-actors` AS T2 ON T1.name = T2.movie WHERE T1.director = 'Wolfgang Reitherman'\n```"}]}, {"id": "train-4671", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the characters in the PG movies?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.character FROM movies_total_gross AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T1.MPAA_rating = 'PG'\n```"}]}, {"id": "train-4672", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest grossing movie without a song?"}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie_title WHERE T2.song IS NULL ORDER BY CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1\n```"}]}, {"id": "train-4673", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who directed the movie with the most voice actors?"}, {"from": "gpt", "value": "```sql\nSELECT T2.director, COUNT(DISTINCT T1.`voice-actor`) FROM `voice-actors` AS T1 INNER JOIN director AS T2 ON T1.movie = T2.name GROUP BY T2.director ORDER BY COUNT(DISTINCT T1.`voice-actor`) DESC LIMIT 1\n```"}]}, {"id": "train-4674", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the voice actors in the movie that came out on 11/24/2010?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`voice-actor` FROM movies_total_gross AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T1.release_date = 'Nov 24, 2010'\n```"}]}, {"id": "train-4675", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the directors of movies that feature a song."}, {"from": "gpt", "value": "```sql\nSELECT T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.song IS NOT NULL GROUP BY T2.director\n```"}]}, {"id": "train-4676", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the total grosses for the movies with Jim Cummings as the voice actor?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM `voice-actors` AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie WHERE T1.`voice-actor` = 'Jim Cummings' ORDER BY CAST(REPLACE(trim(T2.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1\n```"}]}, {"id": "train-4677", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of the movies directed by Ron Clements has the highest total gross?"}, {"from": "gpt", "value": "```sql\nSELECT T2.movie_title FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Ron Clements' ORDER BY CAST(REPLACE(trim(T2.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1\n```"}]}, {"id": "train-4678", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average total gross for the movies featuring Sterling Holloway?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CAST(REPLACE(trim(T2.total_gross, '$'), ',', '') AS REAL)) / COUNT(T2.movie_title) FROM `voice-actors` AS T1 INNER JOIN movies_total_gross AS T2 ON T1.movie = T2.movie_title WHERE T1.`voice-actor` = 'Sterling Holloway'\n```"}]}, {"id": "train-4679", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What proportion of the total gross of all movies is from movies with songs?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.song IS NOT NULL THEN T2.movie_title ELSE NULL END) AS REAL) * 100 / COUNT(T2.movie_title) FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T1.movie_title = T2.movie_title\n```"}]}, {"id": "train-4680", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the movies and genres released in 2016."}, {"from": "gpt", "value": "```sql\nSELECT movie_title, genre FROM movies_total_gross WHERE SUBSTR(release_date, LENGTH(release_date) - 3, LENGTH(release_date)) = '2016'\n```"}]}, {"id": "train-4682", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the movie titles directed by Jack Kinney."}, {"from": "gpt", "value": "```sql\nSELECT name FROM director WHERE director = 'Jack Kinney'\n```"}]}, {"id": "train-4683", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the movie titles and the estimated inflation rate of the highest total grossed movie."}, {"from": "gpt", "value": "```sql\nSELECT movie_title, CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) / CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL) FROM movies_total_gross ORDER BY CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1\n```"}]}, {"id": "train-4684", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the PG-13 romantic comedy movie titles and their release dates."}, {"from": "gpt", "value": "```sql\nSELECT movie_title, release_date FROM movies_total_gross WHERE MPAA_rating = 'PG-13' AND genre = 'Romantic Comedy'\n```"}]}, {"id": "train-4686", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the movie titles and associated songs directed by Ron Clements."}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title, T1.song FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Ron Clements'\n```"}]}, {"id": "train-4687", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the titles, main characters, and associated songs of the movies directed by Wolfgang Reitherman in 1977."}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title, T2.hero, T2.song FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title INNER JOIN director AS T3 ON T1.movie_title = T3.name WHERE T3.director = 'Wolfgang Reitherman' AND SUBSTR(T1.release_date, LENGTH(T1.release_date) - 3, LENGTH(T1.release_date)) = '1977'\n```"}]}, {"id": "train-4688", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movies had the main character named Donald Duck and who directed them?"}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title, T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.hero = 'Donald Duck'\n```"}]}, {"id": "train-4689", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the hero, director, and the release date of Mulan."}, {"from": "gpt", "value": "```sql\nSELECT T1.hero, T2.director, T1.release_date FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.movie_title = 'Mulan'\n```"}]}, {"id": "train-4690", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the title, total gross, and MPAA rating of the movie which has a hero named Elsa."}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title, T1.total_gross, T1.MPAA_rating FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title INNER JOIN director AS T3 ON T3.name = T1.movie_title WHERE T2.hero = 'Elsa'\n```"}]}, {"id": "train-4691", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the title, director, and release date of the movie voice-acted by Freddie Jones."}, {"from": "gpt", "value": "```sql\nSELECT T1.movie, T3.director, T2.release_date FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title INNER JOIN director AS T3 ON T3.name = T2.movie_title WHERE T1.`voice-actor` = 'Freddie Jones'\n```"}]}, {"id": "train-4692", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among Frank Welker's voice-acted movies, list the movie titles and the total gross when the estimated inflation rate was less than 2."}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title, T1.total_gross FROM movies_total_gross AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T2.`voice-actor` = 'Frank Welker' AND CAST(REPLACE(trim(T1.inflation_adjusted_gross, '$'), ',', '') AS REAL) * 1.0 / CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) * 1.0 < 2\n```"}]}, {"id": "train-4693", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who directed the most popular movie?"}, {"from": "gpt", "value": "```sql\nSELECT T2.director FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name ORDER BY CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1\n```"}]}, {"id": "train-4694", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the voice actors and villains in Cinderella."}, {"from": "gpt", "value": "```sql\nSELECT T1.`voice-actor`, T2.villian FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T2.movie_title = 'Cinderella'\n```"}]}, {"id": "train-4697", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the movies released from 1991 to 2000, calculate the percentage of comedy movies. Provide any five movie titles and directors."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.genre = 'Comedy' THEN T1.movie_title ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_title), group_concat(T1.movie_title), group_concat(T2.director) FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE SUBSTR(T1.release_date, LENGTH(T1.release_date) - 3, LENGTH(T1.release_date)) BETWEEN '1991' AND '2000'\n```"}]}, {"id": "train-4699", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the voice actor of the character Calliope in the movie Hercules."}, {"from": "gpt", "value": "```sql\nSELECT `voice-actor` FROM `voice-actors` WHERE movie = 'Hercules' AND character = 'Calliope'\n```"}]}, {"id": "train-4700", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many voice actors for the movie Aladdin?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT('voice-actor') FROM `voice-actors` WHERE movie = 'Aladdin'\n```"}]}, {"id": "train-4702", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the director's name of Wreck-It Ralph movie."}, {"from": "gpt", "value": "```sql\nSELECT director FROM director WHERE name = 'Wreck-It Ralph'\n```"}]}, {"id": "train-4703", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What movies did director Jack Kinney direct?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM director WHERE director = 'Jack Kinney'\n```"}]}, {"id": "train-4704", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies were released between 1937 and 1950?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movie_title) FROM characters WHERE SUBSTR(release_date, LENGTH(release_date) - 1, LENGTH(release_date)) BETWEEN '37' AND '50'\n```"}]}, {"id": "train-4705", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of the song from the movie directed by Ben Sharpsteen."}, {"from": "gpt", "value": "```sql\nSELECT T1.song FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Ben Sharpsteen'\n```"}]}, {"id": "train-4706", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the release date of the film The Lion King directed by Roger Allers."}, {"from": "gpt", "value": "```sql\nSELECT T1.release_date FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Roger Allers' AND T1.movie_title = 'The Lion King'\n```"}]}, {"id": "train-4708", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movies of director Wolfgang Reitherman do not have villain?"}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Wolfgang Reitherman' AND T1.villian IS NULL\n```"}]}, {"id": "train-4709", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the titles of movies directed by Jack Kinney that were released before 1947."}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Jack Kinney' AND SUBSTR(T1.release_date, LENGTH(T1.release_date) - 1, LENGTH(T1.release_date)) < '47'\n```"}]}, {"id": "train-4710", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the directors whose films grossed over $100 million."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name INNER JOIN movies_total_gross AS T3 ON T1.movie_title = T3.movie_title WHERE CAST(REPLACE(trim(T3.total_gross, '$'), ',', '') AS REAL) > 100000000\n```"}]}, {"id": "train-4711", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movie's song title has the highest total gross?"}, {"from": "gpt", "value": "```sql\nSELECT T2.song FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title ORDER BY CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1\n```"}]}, {"id": "train-4712", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which director had the most popular film from 1937 to 1990?"}, {"from": "gpt", "value": "```sql\nSELECT T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name INNER JOIN movies_total_gross AS T3 ON T3.movie_title = T1.movie_title WHERE SUBSTR(T3.release_date, LENGTH(T3.release_date) - 3, LENGTH(T3.release_date)) BETWEEN '1937' AND '1990' ORDER BY CAST(REPLACE(trim(T3.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1\n```"}]}, {"id": "train-4713", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the main characters of the movie that are comedy genre."}, {"from": "gpt", "value": "```sql\nSELECT T2.hero FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE T1.genre = 'Comedy'\n```"}]}, {"id": "train-4714", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names of voice actors for the characters of films directed by Wolfgang Reitherman."}, {"from": "gpt", "value": "```sql\nSELECT T2.hero, T1.`voice-actor` FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title INNER JOIN director AS T3 ON T3.name = T2.movie_title WHERE T3.director = 'Wolfgang Reitherman'\n```"}]}, {"id": "train-4715", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What genre of movie has Taran as the main character?"}, {"from": "gpt", "value": "```sql\nSELECT T1.genre FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE T2.hero = 'Taran'\n```"}]}, {"id": "train-4716", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The main character Elsa is voiced by which actor and who is the director of the movie?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`voice-actor`, T3.director FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title INNER JOIN director AS T3 ON T2.movie_title = T3.name WHERE T2.hero = 'Elsa'\n```"}]}, {"id": "train-4717", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of directors whose films grossed over $100 million."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(DISTINCT CASE WHEN CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) > 100000000 THEN T3.director ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T3.director) FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title INNER JOIN director AS T3 ON T1.movie_title = T3.name\n```"}]}, {"id": "train-4718", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of voice actors whose main character in the movie is in the Drama genre."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.genre = 'Drama' THEN T3.`voice-actor` ELSE NULL END) AS REAL) * 100 / COUNT(T3.`voice-actor`) FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title INNER JOIN `voice-actors` AS T3 ON T3.movie = T1.movie_title\n```"}]}, {"id": "train-4719", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the first movie released by Disney."}, {"from": "gpt", "value": "```sql\nSELECT movie_title FROM characters ORDER BY SUBSTR(release_date, LENGTH(release_date) - 1, LENGTH(release_date)) ASC LIMIT 1\n```"}]}, {"id": "train-4720", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies were released by Disney between 2010 and 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(movie_title) FROM characters WHERE SUBSTR(release_date, LENGTH(release_date) - 1, LENGTH(release_date)) BETWEEN '10' AND '16'\n```"}]}, {"id": "train-4721", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the first ever Disney villain?"}, {"from": "gpt", "value": "```sql\nSELECT villian FROM characters ORDER BY SUBSTR(release_date, LENGTH(release_date) - 1, LENGTH(release_date)) DESC LIMIT 1\n```"}]}, {"id": "train-4722", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is Disney's highest grossing action movie?"}, {"from": "gpt", "value": "```sql\nSELECT movie_title FROM movies_total_gross WHERE genre = 'Action' ORDER BY CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1\n```"}]}, {"id": "train-4723", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which actor voices Akela from The Jungle Book?"}, {"from": "gpt", "value": "```sql\nSELECT `voice-actor` FROM `voice-actors` WHERE character = 'Akela'\n```"}]}, {"id": "train-4724", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Determine Disney's total box office gross between 2010 and 2016."}, {"from": "gpt", "value": "```sql\nSELECT SUM(Total) FROM revenue WHERE `Year` BETWEEN 2010 AND 2016\n```"}]}, {"id": "train-4725", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the main character of Disney's most popular adventure movie based on its inflation-adjusted gross."}, {"from": "gpt", "value": "```sql\nSELECT T2.hero FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE T1.genre = 'Adventure' ORDER BY CAST(REPLACE(trim(T1.inflation_adjusted_gross, '$'), ',', '') AS REAL) DESC LIMIT 1\n```"}]}, {"id": "train-4726", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the director of Disney's lowest grossing movie."}, {"from": "gpt", "value": "```sql\nSELECT T2.director FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name ORDER BY CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) ASC LIMIT 1\n```"}]}, {"id": "train-4727", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find out what proportion of total revenue Walt Disney Parks and Resorts received in 2010."}, {"from": "gpt", "value": "```sql\nSELECT SUM(`Walt Disney Parks and Resorts`) / SUM(Total) * 100 FROM revenue WHERE year = 2010\n```"}]}, {"id": "train-4728", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Determine the average gross for Disney's PG-13-rated action movies."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL)) / COUNT(movie_title) FROM movies_total_gross WHERE MPAA_rating = 'PG-13'\n```"}]}, {"id": "train-4729", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many voice-actors were involved in the Bambi movie?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT 'voice-actor') FROM `voice-actors` WHERE movie = 'Bambi'\n```"}]}, {"id": "train-4730", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the estimated inflation rate that was used to adjust the 1995 box office revenue for Disney's films."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL)) / SUM(CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL)) FROM movies_total_gross WHERE SUBSTR(release_date, LENGTH(release_date) - 3, LENGTH(release_date)) = '1995' GROUP BY SUBSTR(release_date, LENGTH(release_date) - 3, LENGTH(release_date)) = '1995'\n```"}]}, {"id": "train-4731", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in the current gross of Cars and its sequel, Cars 2? Which movie is more popular?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN movie_title = 'Cars' THEN CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) ELSE 0 END), SUM(CASE WHEN movie_title = 'Cars 2' THEN CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) ELSE 0 END) FROM movies_total_gross\n```"}]}, {"id": "train-4732", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the most recent movie directed by Chris Buck. Which of his movies was more successful in terms of grossing? Use the current gross for comparison."}, {"from": "gpt", "value": "```sql\nSELECT T1.movie_title, MAX(T1.release_date), MAX(T1.inflation_adjusted_gross) FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Chris Buck'\n```"}]}, {"id": "train-4733", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name actors who voiced more than five Disney characters."}, {"from": "gpt", "value": "```sql\nSELECT 'voice-actor' FROM `voice-actors` GROUP BY 'voice-actor' HAVING COUNT(movie) > 5\n```"}]}, {"id": "train-4734", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the top 5 highest-grossing Disney movies adjusted for inflation. Identify the percentage they contributed to the total of Disney's current gross."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) > 1236035515 THEN CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) ELSE 0 END) * 100 / SUM(CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL)) FROM movies_total_gross\n```"}]}, {"id": "train-4735", "db_id": "disney", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all Disney movies directed by Gary Trousdale, determine the percentage that earned over USD100m based on actual grossing."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) > 100000000 THEN T1.movie_title ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_title) FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Gary Trousdale'\n```"}]}, {"id": "train-4736", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many current legislators do not have an account on ballotpedia.org ?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current WHERE ballotpedia_id = '' OR ballotpedia_id IS NULL\n```"}]}, {"id": "train-4737", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the official full names of all the current legislators who do not have an account on C-SPAN's video website."}, {"from": "gpt", "value": "```sql\nSELECT official_full_name FROM current WHERE cspan_id IS NULL OR cspan_id = ''\n```"}]}, {"id": "train-4738", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many current legislators were born after the year 1960?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(bioguide_id) FROM current WHERE birthday_bio >= '1961-01-01'\n```"}]}, {"id": "train-4739", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the current female legislators, how many of them have not been registered in Federal Election Commission data?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current WHERE (fec_id IS NULL OR fec_id = '') AND gender_bio = 'F'\n```"}]}, {"id": "train-4740", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the google entity ID of current legislator Sherrod Brown?"}, {"from": "gpt", "value": "```sql\nSELECT google_entity_id_id FROM current WHERE official_full_name = 'Sherrod Brown'\n```"}]}, {"id": "train-4741", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which current legislator is older, Sherrod Brown or Maria Cantwell?"}, {"from": "gpt", "value": "```sql\nSELECT official_full_name FROM current WHERE official_full_name = 'Sherrod Brown' OR official_full_name = 'Maria Cantwell' ORDER BY birthday_bio LIMIT 1\n```"}]}, {"id": "train-4742", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the username of the current official Facebook presence of current legislator Todd Young?"}, {"from": "gpt", "value": "```sql\nSELECT T1.facebook FROM `social-media` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.official_full_name = 'Todd Young'\n```"}]}, {"id": "train-4743", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many current legislators do not have an account on instagram?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T1.instagram IS NULL\n```"}]}, {"id": "train-4744", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which current legislator does twitter ID234128524 belong? Please give his or her full official name."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T2.twitter_id = 234128524\n```"}]}, {"id": "train-4745", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the current official YouTube usernames of all the current female legislators."}, {"from": "gpt", "value": "```sql\nSELECT T2.youtube FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.gender_bio = 'F'\n```"}]}, {"id": "train-4746", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the username of the current official Facebook presence of the oldest current legislator?"}, {"from": "gpt", "value": "```sql\nSELECT T2.facebook FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id ORDER BY T1.birthday_bio LIMIT 1\n```"}]}, {"id": "train-4747", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the current legislators who do not have accounts on OpenSecrets.org., how many of them do not have instagram accounts either?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.instagram IS NULL THEN 1 ELSE 0 END) AS count FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T2.opensecrets_id IS NULL OR T2.opensecrets_id = ''\n```"}]}, {"id": "train-4748", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Current legislator Roger F. Wicker has not been a representative for how many terms?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.official_full_name = 'Roger F. Wicker' THEN 1 ELSE 0 END) AS count FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.district IS NULL OR T2.district = ''\n```"}]}, {"id": "train-4749", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many terms has current legislator Sherrod Brown served?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Sherrod Brown'\n```"}]}, {"id": "train-4750", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the official full names of all the current legislators who were once a senator during his or her terms."}, {"from": "gpt", "value": "```sql\nSELECT T2.official_full_name FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.state_rank IS NOT NULL\n```"}]}, {"id": "train-4751", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For which state did current legislator Sherrod Brown serve during his term that started on 1993/1/5?"}, {"from": "gpt", "value": "```sql\nSELECT T1.state FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.start = '1993-01-05' AND T2.official_full_name = 'Sherrod Brown'\n```"}]}, {"id": "train-4752", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the female current legislators, how many of them have served for more than 4 terms?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CID) FROM ( SELECT T1.bioguide_id AS CID FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F' GROUP BY T2.bioguide HAVING COUNT(T2.bioguide) > 4 )\n```"}]}, {"id": "train-4753", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the current legislators who have served for more than 6 terms, how many of them were born after 1960?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CID) FROM ( SELECT T1.bioguide_id AS CID FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio >= '1960-01-01' GROUP BY T2.bioguide HAVING COUNT(T2.bioguide) > 6 )\n```"}]}, {"id": "train-4754", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of terms for a current female legislator?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.bioguide) AS REAL) / COUNT(DISTINCT T1.bioguide_id) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F'\n```"}]}, {"id": "train-4755", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the current legislators whose religion is Roman Catholic, what is the percentage of the ones without an instagram account?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.instagram IS NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T2.religion_bio = 'Roman Catholic'\n```"}]}, {"id": "train-4756", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many males were members of the current legislators?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current WHERE gender_bio = 'M'\n```"}]}, {"id": "train-4757", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many current legislators chose Republican as their political party?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM `current-terms` WHERE party = 'Republican'\n```"}]}, {"id": "train-4758", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many legislators have an Instagram account?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM `social-media` WHERE instagram IS NOT NULL AND instagram <> ''\n```"}]}, {"id": "train-4759", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many females were members of the past legislators?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM historical WHERE gender_bio = 'F'\n```"}]}, {"id": "train-4760", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male legislators are Roman Catholic?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current WHERE religion_bio = 'Roman Catholic' AND gender_bio = 'M'\n```"}]}, {"id": "train-4761", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What type of political party Sherrod Brown has in 2005?"}, {"from": "gpt", "value": "```sql\nSELECT T1.party FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.first_name = 'Sherrod' AND T2.last_name = 'Brown' AND T1.start LIKE '%2005%'\n```"}]}, {"id": "train-4762", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name of all the senior senators in year 2013."}, {"from": "gpt", "value": "```sql\nSELECT T2.official_full_name FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.state_rank = 'senior' AND T1.type = 'sen' AND T1.start LIKE '2013%'\n```"}]}, {"id": "train-4763", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the current official Youtube username of Chris Van Hollen?"}, {"from": "gpt", "value": "```sql\nSELECT T2.youtube FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.official_full_name = 'Chris Van Hollen'\n```"}]}, {"id": "train-4764", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many official social media does Mark Warner have?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T1.facebook IS NOT NULL THEN 1 END + CASE WHEN T1.instagram IS NOT NULL THEN 1 END + CASE WHEN T1.twitter IS NOT NULL THEN 1 END + CASE WHEN T1.youtube IS NOT NULL THEN 1 END AS COUNTSOCIAL FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T2.first_name = 'Mark' AND T2.last_name = 'Warner'\n```"}]}, {"id": "train-4765", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the last name of all current legislators who live in California."}, {"from": "gpt", "value": "```sql\nSELECT T1.last_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state = 'CA' GROUP BY T1.last_name\n```"}]}, {"id": "train-4766", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name of all current female senators."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.type = 'sen' AND T2.gender_bio = 'F' GROUP BY T2.ballotpedia_id\n```"}]}, {"id": "train-4767", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the numeric ID of Chris Van Hollen on GovTrack.us?"}, {"from": "gpt", "value": "```sql\nSELECT T2.govtrack FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.official_full_name = 'Chris Van Hollen'\n```"}]}, {"id": "train-4768", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the current official Twitter handle of Roger F. Wicker?"}, {"from": "gpt", "value": "```sql\nSELECT T2.twitter FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.official_full_name = 'Roger F. Wicker'\n```"}]}, {"id": "train-4769", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name of all past legislators that chose Pro-Administration as their political party in year 1791."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Pro-Administration' AND CAST(T2.start AS DATE) <= 1791 AND CAST(T2.END AS DATE) >= 1791\n```"}]}, {"id": "train-4771", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the district number that Chris Van Hollen serving?"}, {"from": "gpt", "value": "```sql\nSELECT T2.district FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Chris Van Hollen' AND T2.district IS NOT NULL GROUP BY T2.district\n```"}]}, {"id": "train-4772", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did Richard Durbin become a legislator in district 20?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.district = 20 THEN 1 ELSE 0 END) AS count FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Richard' AND T1.last_name = 'Durbin'\n```"}]}, {"id": "train-4773", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of current male legislators who chose Democrat from 2000 until 2021."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.bioguide_id) AS REAL) / 22 FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'M' AND CAST(T2.start AS DATE) >= 2000 AND CAST(T2.END AS DATE) <= 2021 AND T2.party = 'Democrat'\n```"}]}, {"id": "train-4774", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of the total number of current female legislators and past female legislators. State which one has the highest value."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN current.gender_bio = 'F' THEN current.bioguide_id ELSE NULL END) AS REAL) * 100 / ( SELECT COUNT(CASE WHEN historical.gender_bio = 'F' THEN historical.bioguide_id ELSE NULL END) FROM historical ) FROM current\n```"}]}, {"id": "train-4775", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the YouTube ID of the channel 'RepWassermanSchultz.'"}, {"from": "gpt", "value": "```sql\nSELECT youtube_id FROM `social-media` WHERE youtube = 'RepWassermanSchultz'\n```"}]}, {"id": "train-4776", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the Facebook, Twitter and YouTube usernames of Adam Kinzinger?"}, {"from": "gpt", "value": "```sql\nSELECT T2.facebook FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.official_full_name = 'Adam Kinzinger'\n```"}]}, {"id": "train-4778", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the official full names of 10 legislators who have a YouTube account but no Instagram account."}, {"from": "gpt", "value": "```sql\nSELECT T2.official_full_name FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T1.facebook IS NOT NULL AND (T1.instagram IS NULL OR T1.instagram = '') LIMIT 10\n```"}]}, {"id": "train-4779", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the official full names of legislators representing Virginia."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state = 'VA' GROUP BY T1.official_full_name\n```"}]}, {"id": "train-4780", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which historical legislators are members of the National Greenbacker party? Write their first and last names."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.party = 'National Greenbacker'\n```"}]}, {"id": "train-4781", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which legislator has the YouTube channel 'RoskamIL06?' Write the official full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T2.youtube = 'RoskamIL06'\n```"}]}, {"id": "train-4782", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full names of 10 legislators who only have a Facebook account."}, {"from": "gpt", "value": "```sql\nSELECT T2.official_full_name FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE (T1.youtube IS NULL OR T1.youtube = '') AND (T1.instagram IS NULL OR T1.instagram = '') AND (T1.twitter IS NULL OR T1.twitter = '') AND T1.facebook IS NOT NULL AND T1.facebook != ''\n```"}]}, {"id": "train-4783", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the full names of junior ranked Republicans."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Republican' AND T2.state_rank = 'junior' GROUP BY T1.official_full_name\n```"}]}, {"id": "train-4784", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the contact URL of Claire McCaskill?"}, {"from": "gpt", "value": "```sql\nSELECT T2.contact_form FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Claire McCaskill' GROUP BY T2.contact_form\n```"}]}, {"id": "train-4785", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the Wikipedia IDs of historical legislators who are Readjuster Democrats."}, {"from": "gpt", "value": "```sql\nSELECT T2.wikipedia_id FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.party = 'Readjuster Democrat'\n```"}]}, {"id": "train-4786", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full names of Republican legislators who have a nickname."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Republican' AND T1.nickname_name IS NOT NULL GROUP BY T1.official_full_name\n```"}]}, {"id": "train-4788", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many historical legislators were born in 1973?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM historical WHERE CAST(birthday_bio AS date) = 1973\n```"}]}, {"id": "train-4789", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of males and females among historical legislators?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN gender_bio = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) FROM historical\n```"}]}, {"id": "train-4790", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the legislators who will end in 2009, how many are from the Republican party?"}, {"from": "gpt", "value": "```sql\nSELECT `END`, party FROM `current-terms` WHERE STRFTIME('%Y', `END`) = '2009' AND party = 'Republican'\n```"}]}, {"id": "train-4791", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the official full names and genders of legislators who have Collins as their last name."}, {"from": "gpt", "value": "```sql\nSELECT official_full_name, gender_bio FROM current WHERE last_name = 'Collins'\n```"}]}, {"id": "train-4792", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of senators were from class 1?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN class = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM `historical-terms` WHERE type = 'sen'\n```"}]}, {"id": "train-4793", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the current legislators' official full names who are from the Independent party."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Independent' GROUP BY T1.official_full_name\n```"}]}, {"id": "train-4794", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many years had Jr. John Conyers served in total?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CAST(T2.END - T2.start AS DATE)) AS sum FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'John Conyers, Jr.'\n```"}]}, {"id": "train-4795", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How old was Jr. F. James Sensenbrenner when he first started as a legislator?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(MIN(T2.start) - T1.birthday_bio AS DATE) AS AGE FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'F. James Sensenbrenner, Jr.'\n```"}]}, {"id": "train-4796", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full names, religions, and parties of legislators who have served in Maine."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name, T2.relation, T2.party FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state = 'ME' GROUP BY T1.official_full_name, T2.relation, T2.party\n```"}]}, {"id": "train-4797", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among legislators who have an Instagram account, list down their full names and nicknames who have a Thomas ID of less than 1000."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name, T1.nickname_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T2.instagram IS NOT NULL AND T1.thomas_id < 1000\n```"}]}, {"id": "train-4798", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the last serving date of Matt Salmon?"}, {"from": "gpt", "value": "```sql\nSELECT T1.END FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.official_full_name = 'Matt Salmon'\n```"}]}, {"id": "train-4799", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the legislators who have served in the U.S. House, provide the party and the state of the legislators who were born in 1738."}, {"from": "gpt", "value": "```sql\nSELECT T1.party, T1.state FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.house_history_id IS NOT NULL AND T2.birthday_bio LIKE '%1738%'\n```"}]}, {"id": "train-4800", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the IDs and full names of legislators from the Liberal Republican party."}, {"from": "gpt", "value": "```sql\nSELECT T2.bioguide_id, T2.first_name, T2.last_name FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.party = 'Liberal Republican'\n```"}]}, {"id": "train-4801", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the legislators who started a term on 2nd December 1793, how many of them were males?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.bioguide_id) FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'M' AND T2.start = '1793-12-02'\n```"}]}, {"id": "train-4802", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compare the number of legislators who started the term in 1875 and 2005."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN `current-terms`.start LIKE '2005%' THEN 1 ELSE 0 END) - ( SELECT SUM(CASE WHEN start LIKE '1875%' THEN 1 ELSE 0 END) FROM `historical-terms` ) FROM `current-terms`\n```"}]}, {"id": "train-4803", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full names, Twitter IDs, and YouTube IDs of legislators who have Richard as their first name."}, {"from": "gpt", "value": "```sql\nSELECT T2.official_full_name, T1.twitter_id, T1.youtube_id FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T2.first_name = 'Richard'\n```"}]}, {"id": "train-4804", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the start date, end date, and party of Pearl Peden Oldfield."}, {"from": "gpt", "value": "```sql\nSELECT T2.start, T2.`end`, T2.party FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Pearl' AND T1.middle_name = 'Peden' AND T1.last_name = 'Oldfield'\n```"}]}, {"id": "train-4805", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the birthday of Amy Klobuchar?"}, {"from": "gpt", "value": "```sql\nSELECT birthday_bio FROM current WHERE first_name = 'Amy' AND last_name = 'Klobuchar'\n```"}]}, {"id": "train-4806", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many legislators have not been registered in Federal Election Commission data?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current WHERE fec_id IS NULL OR fec_id = ''\n```"}]}, {"id": "train-4807", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of female legislators in the list."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current WHERE gender_bio = 'F'\n```"}]}, {"id": "train-4808", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name of legislators who have accounts on OpenSecrets.org."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current WHERE opensecrets_id IS NOT NULL AND opensecrets_id <> ''\n```"}]}, {"id": "train-4809", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the middle name of the legislator whose birthday was on 8/24/1956?"}, {"from": "gpt", "value": "```sql\nSELECT middle_name FROM current WHERE birthday_bio = '1956-08-24'\n```"}]}, {"id": "train-4810", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many legislators hold the title \"Majority Leader\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(bioguide) FROM `current-terms` WHERE title = 'Majority Leader'\n```"}]}, {"id": "train-4811", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of legislator whose birthday on 2/20/1942?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = '1942-02-20' GROUP BY T2.title\n```"}]}, {"id": "train-4812", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the gender of the legislator whose address at 317 Russell Senate Office Building Washington DC 20510?"}, {"from": "gpt", "value": "```sql\nSELECT T1.gender_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.address = '317 Russell Senate Office Building Washington DC 20510'\n```"}]}, {"id": "train-4813", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the first name of legislators who are senior Senator."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state_rank = 'senior' GROUP BY T1.first_name\n```"}]}, {"id": "train-4814", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among male legislators, state number of the legislators who are not the senator."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.state) FROM ( SELECT T2.state FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'M' AND (T2.class IS NULL OR T2.class = '') GROUP BY T2.state ) T3\n```"}]}, {"id": "train-4815", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of legislators who are Senator and were born in 1964."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.class IS NOT NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio LIKE '%1964%'\n```"}]}, {"id": "train-4816", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of legislators who are not Senator and were born before 1975."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.class IS NULL THEN T1.bioguide_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.bioguide_id) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE CAST(T1.birthday_bio AS DATE) <= 1975\n```"}]}, {"id": "train-4817", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the twitter name of the legislator whose birthday was on 5/27/1946?"}, {"from": "gpt", "value": "```sql\nSELECT T2.twitter FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.birthday_bio = '1946-05-27'\n```"}]}, {"id": "train-4818", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the opensecrets_id of the legislator whose YouTube name is Bluetkemeyer."}, {"from": "gpt", "value": "```sql\nSELECT T1.opensecrets_id FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T2.youtube = 'BLuetkemeyer'\n```"}]}, {"id": "train-4819", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the username of Facebook of Ralph Abraham."}, {"from": "gpt", "value": "```sql\nSELECT T2.facebook FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.first_name = 'Ralph' AND T1.last_name = 'Abraham'\n```"}]}, {"id": "train-4821", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the Instagram name of the legislator whose birthday was on 8/24/1952?"}, {"from": "gpt", "value": "```sql\nSELECT T1.instagram FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T2.birthday_bio = '1952-08-24'\n```"}]}, {"id": "train-4822", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State number of legislators who are not the senator among female legislators."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F' AND (T2.class IS NULL OR T2.class = '')\n```"}]}, {"id": "train-4823", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the religion of the legislator whose YouTube name is MaxineWaters."}, {"from": "gpt", "value": "```sql\nSELECT T2.religion_bio FROM `social-media` AS T1 INNER JOIN current AS T2 ON T1.bioguide = T2.bioguide_id WHERE T1.youtube = 'MaxineWaters'\n```"}]}, {"id": "train-4824", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many minority leaders have not been registered in Federal Election Commission data?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.title = 'Minority Leader' AND (T1.fec_id IS NULL OR T1.fec_id = '')\n```"}]}, {"id": "train-4825", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the legislators are male?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current WHERE gender_bio = 'M'\n```"}]}, {"id": "train-4826", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the facebook ID of the facebook account named \"RepWilson\"."}, {"from": "gpt", "value": "```sql\nSELECT facebook_id FROM `social-media` WHERE facebook = 'RepWilson'\n```"}]}, {"id": "train-4827", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of legislators with \"John\" as their first name?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current WHERE first_name = 'John'\n```"}]}, {"id": "train-4828", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the district numbers with an Anti-Administration party."}, {"from": "gpt", "value": "```sql\nSELECT district FROM `historical-terms` WHERE party = 'Anti-Administration' GROUP BY district\n```"}]}, {"id": "train-4829", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name of legislators whose born in 1960."}, {"from": "gpt", "value": "```sql\nSELECT official_full_name FROM current WHERE birthday_bio LIKE '1960%'\n```"}]}, {"id": "train-4830", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the google entity ID of Benjamin Hawkins?"}, {"from": "gpt", "value": "```sql\nSELECT google_entity_id_id FROM historical WHERE first_name = 'Benjamin' AND last_name = 'Hawkins'\n```"}]}, {"id": "train-4831", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the Pro-Administration senator that runs from March 4, 1789 to December 31, 1791?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Pro-Administration' AND T2.start = '1789-03-04' AND T2.end = '1791-12-31'\n```"}]}, {"id": "train-4832", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the first and last name of the representatives of the house in district 9?"}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T1.district = 9\n```"}]}, {"id": "train-4833", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name of the legislators with an independent party."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Independent' GROUP BY T1.official_full_name\n```"}]}, {"id": "train-4834", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the open secrets and thomas ID of the democrat senators of New Jersey."}, {"from": "gpt", "value": "```sql\nSELECT T1.opensecrets_id, T1.thomas_id FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'sen' AND T2.state = 'NJ' GROUP BY T1.opensecrets_id, T1.thomas_id\n```"}]}, {"id": "train-4835", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the google entity ID of the senators in New York."}, {"from": "gpt", "value": "```sql\nSELECT T1.google_entity_id_id FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'sen' AND T2.state = 'NY'\n```"}]}, {"id": "train-4836", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the religion of the legislator with RSS url of http://www.corker.senate.gov/public/index.cfm/rss/feed."}, {"from": "gpt", "value": "```sql\nSELECT T1.religion_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.rss_url = 'http://www.corker.senate.gov/public/index.cfm/rss/feed' GROUP BY T1.religion_bio\n```"}]}, {"id": "train-4837", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the party of the legislator named Susan M. Collins?"}, {"from": "gpt", "value": "```sql\nSELECT T2.party FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Susan M. Collins' GROUP BY T2.party\n```"}]}, {"id": "train-4838", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the district number of the representative of the house named Jonathan Grout."}, {"from": "gpt", "value": "```sql\nSELECT T2.district FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.last_name = 'Grout' AND T1.first_name = 'Jonathan' AND T2.type = 'rep'\n```"}]}, {"id": "train-4839", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the party and state of the legislator that has an open secrets ID of N00003689 and thomas ID of 186?"}, {"from": "gpt", "value": "```sql\nSELECT T2.party, T2.state FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.opensecrets_id = 'N00003689' AND T1.thomas_id = 186 GROUP BY T2.party, T2.state\n```"}]}, {"id": "train-4840", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the full name and birth date of the legislator with a contact form of http://www.brown.senate.gov/contact/."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name, T1.birthday_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.contact_form = 'http://www.brown.senate.gov/contact/'\n```"}]}, {"id": "train-4841", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the state and type of term of the legislator with the google entity ID of kg:/m/02pyzk."}, {"from": "gpt", "value": "```sql\nSELECT T2.state, T2.type FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.google_entity_id_id = 'kg:/m/02pyzk'\n```"}]}, {"id": "train-4842", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the type and end date of the term of the legislator named John Vining."}, {"from": "gpt", "value": "```sql\nSELECT T2.type, T2.end FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'John' AND T1.last_name = 'Vining'\n```"}]}, {"id": "train-4843", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the difference between the number of female senators and representatives born between 1930 to 1970."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.type = 'sen' THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.type = 'rep' THEN 1 ELSE 0 END) FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F' AND strftime('%Y', T1.birthday_bio) BETWEEN '1930' AND '1970'\n```"}]}, {"id": "train-4844", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the male legislators born between 1955 to 1965, what is the percentage of the legislators with an independent party?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.party = 'Independent' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.party) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'M' AND strftime('%Y', T1.birthday_bio) BETWEEN '1955' AND '1965'\n```"}]}, {"id": "train-4845", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the legislator with the ID of W000059?"}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM historical WHERE bioguide_id = 'W000059'\n```"}]}, {"id": "train-4846", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Does Thomas Carnes have an account on ballotpedia.org?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN ballotpedia_id IS NULL THEN 'doesn''t have' ELSE 'have' END AS HaveorNot FROM historical WHERE first_name = 'Thomas' AND last_name = 'Carnes'\n```"}]}, {"id": "train-4847", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many legislators were born in 1736?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(bioguide_id) FROM historical WHERE birthday_bio LIKE '1736%'\n```"}]}, {"id": "train-4848", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which legislators are woman?"}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM historical WHERE gender_bio = 'F'\n```"}]}, {"id": "train-4849", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many districts are in Idaho?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(district) FROM `current-terms` WHERE state = 'ID'\n```"}]}, {"id": "train-4850", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many legislators are not senator?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(bioguide) FROM `current-terms` WHERE class IS NULL\n```"}]}, {"id": "train-4851", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio between male and female legislators?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN gender_bio = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) FROM historical\n```"}]}, {"id": "train-4852", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of famous_legislatorss."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN wikipedia_id IS NOT NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(bioguide_id) FROM historical\n```"}]}, {"id": "train-4853", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which legislators do not have instagram account?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.instagram IS NULL\n```"}]}, {"id": "train-4854", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the representatives in 1789 along with the districts and state."}, {"from": "gpt", "value": "```sql\nSELECT T2.district, T2.state FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start LIKE '1789%'\n```"}]}, {"id": "train-4855", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State all the district that Benjamin Contee has served before."}, {"from": "gpt", "value": "```sql\nSELECT T2.district FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Benjamin' AND T1.last_name = 'Contee'\n```"}]}, {"id": "train-4858", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female legislators become representatives for California in 2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE STRFTIME('%Y', T2.start) = '2015' AND T2.state = 'CA' AND T1.gender_bio = 'F'\n```"}]}, {"id": "train-4859", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the Twitter ID of Emanuel Cleaver?"}, {"from": "gpt", "value": "```sql\nSELECT T1.twitter_id FROM `social-media` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.first_name = 'Emanuel' AND T2.last_name = 'Cleaver'\n```"}]}, {"id": "train-4860", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State all the Facebook ID for current legislators under the democrat party."}, {"from": "gpt", "value": "```sql\nSELECT T2.facebook_id FROM `current-terms` AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide = T2.bioguide WHERE T1.party = 'Democrat' GROUP BY T2.facebook_id\n```"}]}, {"id": "train-4862", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the Jewish current legislators that had served in Florida."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.religion_bio = 'Jewish' AND T2.state = 'FL' GROUP BY T1.first_name, T1.last_name\n```"}]}, {"id": "train-4863", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio between famous current legislators and famous historical legislators?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN wikipedia_id IS NOT NULL THEN bioguide_id ELSE 0 END) AS REAL) * 100 / ( SELECT COUNT(CASE WHEN wikipedia_id IS NOT NULL THEN bioguide_id ELSE 0 END) FROM historical ) FROM current\n```"}]}, {"id": "train-4864", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Based on the number of current legislators, calculate the percentage of legislators that served in 21st-Century."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN strftime('%Y', T2.start) BETWEEN '2000' AND '2017' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.bioguide_id) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide\n```"}]}, {"id": "train-4865", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Catholic legislators do not have an account on ballotpedia.org?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(bioguide_id) FROM historical WHERE religion_bio = 'Catholic' AND ballotpedia_id IS NULL\n```"}]}, {"id": "train-4866", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many class 1 senators belong to the Republican party?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(bioguide) FROM `current-terms` WHERE class = 1 AND party = 'Republican'\n```"}]}, {"id": "train-4868", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In California, how many representatives ended their term in 1995?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM `current-terms` WHERE state = 'CA' AND type = 'rep' AND end LIKE '1995%'\n```"}]}, {"id": "train-4869", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the oldest legislator?"}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM historical ORDER BY birthday_bio LIMIT 1\n```"}]}, {"id": "train-4870", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of the ids of the representatives belonging to the Democrat party in district 13 that ended their term on 1/3/2019?"}, {"from": "gpt", "value": "```sql\nSELECT bioguide FROM `current-terms` WHERE type = 'rep' AND party = 'Democrat' AND end = '2019-01-03' AND district = 13\n```"}]}, {"id": "train-4872", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the Independent senators that started their term in 2011 and onwards, what are the official full names of the senators that caucused with the Democrat?"}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.party = 'Independent' AND strftime('%Y', T2.start) >= '2011' AND T2.type = 'sen' AND T2.caucus = 'Democrat'\n```"}]}, {"id": "train-4873", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Jewish legislators do not have facebook?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.bioguide_id) FROM ( SELECT T1.bioguide_id FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.facebook IS NULL GROUP BY T1.bioguide_id ) T3\n```"}]}, {"id": "train-4874", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which party has the highest number of legislators who are Baptist?"}, {"from": "gpt", "value": "```sql\nSELECT T2.party FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.religion_bio = 'Baptist' GROUP BY T2.party ORDER BY COUNT(T2.party) DESC LIMIT 1\n```"}]}, {"id": "train-4875", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the official full names of all the legislators who have facebook, instagram, twitter and youtube accounts."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.facebook IS NOT NULL AND T2.instagram IS NOT NULL AND T2.twitter IS NOT NULL AND T2.youtube IS NOT NULL\n```"}]}, {"id": "train-4876", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many districts did John Conyers, Jr. serve in total?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.district) FROM ( SELECT T2.district FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'John Conyers, Jr.' GROUP BY T2.district ) T3\n```"}]}, {"id": "train-4877", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the Wikipedia page names of all the anti-administration senators?"}, {"from": "gpt", "value": "```sql\nSELECT T1.wikipedia_id FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'sen' AND T2.party = 'Anti-Administration'\n```"}]}, {"id": "train-4878", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the official full names of all the legislators that served 13 district for 26 consecutive years."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT CASE WHEN SUM(CAST(strftime('%Y', T2.end) AS int) - CAST(strftime('%Y', T2.start) AS int)) = 26 THEN T1.official_full_name END FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide GROUP BY T1.official_full_name, T2.district HAVING COUNT(T1.official_full_name) = 13\n```"}]}, {"id": "train-4879", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Federalist representatives are there whose first names are Benjamin?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.bioguide_id) FROM ( SELECT T1.bioguide_id FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.first_name = 'Benjamin' AND T2.party = 'Federalist' AND T2.type = 'rep' GROUP BY T1.bioguide_id ) AS T\n```"}]}, {"id": "train-4880", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female representatives served in the state of California for at least 10 years?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.result) FROM ( SELECT CASE WHEN SUM(CAST(strftime('%Y', T2.`end`) AS int) - CAST(strftime('%Y', T2.start) AS int)) > 10 THEN 1 ELSE 0 END AS result FROM current AS T1 INNER JOIN \"current-terms\" AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.gender_bio = 'F' AND T2.state = 'CA' AND T2.type = 'rep' ) AS T3\n```"}]}, {"id": "train-4881", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the party of the oldest legislator?"}, {"from": "gpt", "value": "```sql\nSELECT T1.party FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide ORDER BY T2.birthday_bio LIMIT 1\n```"}]}, {"id": "train-4882", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the Lutheran representative that served in the state of Ohio for 14 years before becoming a senator?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN SUM(CAST(strftime('%Y', T2.end) AS int) - CAST(strftime('%Y', T2.start) AS int)) = 14 THEN official_full_name END FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.religion_bio = 'Lutheran' AND T2.state = 'OH' AND T2.type = 'rep'\n```"}]}, {"id": "train-4883", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the current legislators born after the year 1960, how many of them are not google entities?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current WHERE strftime('%Y', birthday_bio) > '1960' AND google_entity_id_id IS NULL\n```"}]}, {"id": "train-4884", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the official full names of all the current legislators who have served in the U.S. House."}, {"from": "gpt", "value": "```sql\nSELECT official_full_name FROM current WHERE house_history_id IS NOT NULL\n```"}]}, {"id": "train-4885", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many current legislators have both accounts on both VoteView.com and maplight.org?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current WHERE icpsr_id IS NOT NULL AND maplight_id IS NOT NULL\n```"}]}, {"id": "train-4886", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the current female legislators, how many of them have attended in Senate roll call votes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(lis_id) FROM current WHERE gender_bio = 'F' AND lis_id IS NOT NULL\n```"}]}, {"id": "train-4887", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the religion of current legislator Sherrod Brown?"}, {"from": "gpt", "value": "```sql\nSELECT religion_bio FROM current WHERE official_full_name = 'Sherrod Brown'\n```"}]}, {"id": "train-4888", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the religion with the most occurrrence of the current legislators?"}, {"from": "gpt", "value": "```sql\nSELECT religion_bio FROM current GROUP BY religion_bio ORDER BY COUNT(religion_bio) DESC LIMIT 1\n```"}]}, {"id": "train-4889", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the current official Instagram handle of current legislator Bob Corker?"}, {"from": "gpt", "value": "```sql\nSELECT T2.instagram FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Bob Corker'\n```"}]}, {"id": "train-4890", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the current legislators who have accounts on both http://thomas.gov, how many of them have accounts on instagram?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.bioguide_id) FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.thomas_id IS NOT NULL AND T2.instagram IS NOT NULL\n```"}]}, {"id": "train-4891", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the username of the current official Facebook presence of all the current legislators that are famous or impact."}, {"from": "gpt", "value": "```sql\nSELECT T2.facebook FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.wikipedia_id IS NOT NULL GROUP BY T2.facebook\n```"}]}, {"id": "train-4892", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many terms have the oldest current legislator served?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.bioguide) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = ( SELECT MIN(birthday_bio) FROM current )\n```"}]}, {"id": "train-4893", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was current legislator Sherrod Brown's Washington, D.C. office phone number during his term starting on 2013/1/3?"}, {"from": "gpt", "value": "```sql\nSELECT T1.phone FROM `current-terms` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.official_full_name = 'Sherrod Brown' AND T1.start = '2013-01-03'\n```"}]}, {"id": "train-4894", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Current legislator Sherrod Brown has been in the Democrat party during how many terms that he has served?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Sherrod Brown' AND T2.party = 'Democrat'\n```"}]}, {"id": "train-4895", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full official names of all the current legislators who served the term that started on 2013/1/3."}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start = '2013-01-03'\n```"}]}, {"id": "train-4896", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the current legislators who served the term starting on 2013/1/3, how many of them are female?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.start = '2013-01-03' AND T1.gender_bio = 'F'\n```"}]}, {"id": "train-4897", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full official name of the current legislator that has served for the most number of terms?"}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide GROUP BY T1.official_full_name, T2.bioguide ORDER BY COUNT(T2.bioguide) DESC LIMIT 1\n```"}]}, {"id": "train-4898", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many terms has current legislator Sherrod Brown served as a representative for district no.13?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.official_full_name = 'Sherrod Brown' AND T2.district = 13\n```"}]}, {"id": "train-4899", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the official full name of the current legislator whose current official Facebook presence is \"senjoniernst\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.official_full_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.facebook = 'senjoniernst'\n```"}]}, {"id": "train-4900", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which current legislator has served for more terms, Sherrod Brown or Maria Cantwell?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN SUM(CASE WHEN T1.official_full_name = 'Maria Cantwell' THEN 1 ELSE 0 END) > SUM(CASE WHEN T1.official_full_name = 'Sherrod Brown' THEN 1 ELSE 0 END) THEN 'Maria Cantwell' ELSE 'Sherrod Brown' END FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide\n```"}]}, {"id": "train-4901", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the current legislators who have served for more than 4 terms, what is the percentage of them being female?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.bioguide) FROM ( SELECT T2.bioguide, T1.gender_bio FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide GROUP BY T2.bioguide HAVING COUNT(T2.bioguide) > 4 ) T3\n```"}]}, {"id": "train-4902", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of terms served for a current legislator that's famous or impact?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.bioguide) AS REAL) / COUNT(DISTINCT T1.bioguide_id) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.wikipedia_id IS NOT NULL\n```"}]}, {"id": "train-4903", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the legislators are female?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(gender_bio) FROM current WHERE gender_bio = 'F'\n```"}]}, {"id": "train-4904", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of senators New Jersey have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(type) FROM `historical-terms` WHERE state = 'NJ' AND type = 'rep'\n```"}]}, {"id": "train-4905", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the address of the legislator with the contact form of http://www.carper.senate.gov/contact/."}, {"from": "gpt", "value": "```sql\nSELECT address FROM `current-terms` WHERE contact_form = 'http://www.carper.senate.gov/contact/'\n```"}]}, {"id": "train-4908", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the MapLight ID of the representatives in Maine."}, {"from": "gpt", "value": "```sql\nSELECT T1.maplight_id FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'rep' AND T2.state = 'ME' GROUP BY T1.maplight_id\n```"}]}, {"id": "train-4909", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the type and start date of the term of the legislator born on November 26, 1727."}, {"from": "gpt", "value": "```sql\nSELECT T2.type, T2.start FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = '1727-11-26'\n```"}]}, {"id": "train-4911", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female representatives are there in Michigan?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.bioguide_id) FROM ( SELECT T1.bioguide_id FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'rep' AND T2.state = 'MI' AND T1.gender_bio = 'F' GROUP BY T1.bioguide_id ) T\n```"}]}, {"id": "train-4912", "db_id": "legislator", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the female legislators, what is the percentage of the senators in Maine?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.type = 'sen' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.type) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.state = 'ME' AND T1.gender_bio = 'F'\n```"}]}, {"id": "train-4913", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the Olympic games that John Aalberg has taken part in."}, {"from": "gpt", "value": "```sql\nSELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'John Aalberg'\n```"}]}, {"id": "train-4914", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the name of the Olympic game that John Aalberg took part in when he was 31?"}, {"from": "gpt", "value": "```sql\nSELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'John Aalberg' AND T2.age = 31\n```"}]}, {"id": "train-4915", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When John Aalberg took part in the 1994 Winter Olympic Game, how old was he?"}, {"from": "gpt", "value": "```sql\nSELECT T2.age FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'John Aalberg' AND T1.games_name = '1994 Winter'\n```"}]}, {"id": "train-4916", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Olympic competitors are from Finland?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.person_id) FROM person_region AS T1 INNER JOIN noc_region AS T2 ON T1.region_id = T2.id WHERE T2.region_name = 'Finland'\n```"}]}, {"id": "train-4917", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the Olympic competitors from Finland."}, {"from": "gpt", "value": "```sql\nSELECT T3.full_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Finland'\n```"}]}, {"id": "train-4918", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The Olympic competitor John Aalberg is from which region?"}, {"from": "gpt", "value": "```sql\nSELECT T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'John Aalberg'\n```"}]}, {"id": "train-4919", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the NOC code of the region where the tallest male Olympic competitor is from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.noc FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.gender = 'M' ORDER BY T3.height DESC LIMIT 1\n```"}]}, {"id": "train-4920", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the Olympic competitors from Finland, how many of them are female?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Finland' AND T3.gender = 'F'\n```"}]}, {"id": "train-4921", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city was the 1992 Summer Olympic Games held?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name = '1992 Summer'\n```"}]}, {"id": "train-4922", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the Olympic games that were held in London."}, {"from": "gpt", "value": "```sql\nSELECT T3.games_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'London'\n```"}]}, {"id": "train-4923", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year did London hold its earliest Olympic game?"}, {"from": "gpt", "value": "```sql\nSELECT T3.games_year FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'London' ORDER BY T3.games_year LIMIT 1\n```"}]}, {"id": "train-4924", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many times has London held the Olympic games?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.games_id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'London'\n```"}]}, {"id": "train-4925", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average height of the male Olympic competitors from Finland?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.height) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Finland' AND T3.gender = 'M'\n```"}]}, {"id": "train-4926", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the competitors of the 1994 Winter Olympic Game, what is the percentage of those from Finland?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T5.region_name = 'Finland' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T3.id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id INNER JOIN person_region AS T4 ON T3.id = T4.person_id INNER JOIN noc_region AS T5 ON T4.region_id = T5.id WHERE T1.games_name = '1994 Winter'\n```"}]}, {"id": "train-4927", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which sport does the event \"Shooting Women's Trap\" belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T2.event_name LIKE 'Shooting Women%s Trap'\n```"}]}, {"id": "train-4928", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city was the host of 1936 Winter Olympic Games?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name = '1936 Winter'\n```"}]}, {"id": "train-4929", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Olympic Games has London hosted?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'London'\n```"}]}, {"id": "train-4930", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of swimming related events."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Swimming'\n```"}]}, {"id": "train-4931", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For Peter Kohnke, show the name of his/her region."}, {"from": "gpt", "value": "```sql\nSELECT T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Peter Kohnke'\n```"}]}, {"id": "train-4932", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which game has Jessica Carolina Aguilera Aguilera participated in? Give the id of the game."}, {"from": "gpt", "value": "```sql\nSELECT T2.games_id FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T1.full_name = 'Jessica Carolina Aguilera Aguilera'\n```"}]}, {"id": "train-4933", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the name of the sport with the most events."}, {"from": "gpt", "value": "```sql\nSELECT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id GROUP BY T1.sport_name ORDER BY COUNT(T2.event_name) DESC LIMIT 1\n```"}]}, {"id": "train-4934", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the tallest athlete from Sweden."}, {"from": "gpt", "value": "```sql\nSELECT T3.full_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Sweden' ORDER BY T3.height DESC LIMIT 1\n```"}]}, {"id": "train-4935", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many athletes in the database are from Guatemala?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.person_id) FROM person_region AS T1 INNER JOIN noc_region AS T2 ON T1.region_id = T2.id WHERE T2.region_name = 'Guatemala'\n```"}]}, {"id": "train-4936", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who has participated in the most Olympic Games in the database?"}, {"from": "gpt", "value": "```sql\nSELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id GROUP BY T2.person_id ORDER BY COUNT(T2.person_id) DESC LIMIT 1\n```"}]}, {"id": "train-4937", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the name of the competitor id 90991."}, {"from": "gpt", "value": "```sql\nSELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T2.id = 90991\n```"}]}, {"id": "train-4938", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many competitor ids does Martina Kohlov have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T1.full_name = 'Martina Kohlov'\n```"}]}, {"id": "train-4939", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the bmi of the competitor id 147420."}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.weight AS REAL) / (T1.height * T1.height) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T2.id = 147420\n```"}]}, {"id": "train-4940", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of male athletes from Estonia?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.gender = 'M' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Estonia'\n```"}]}, {"id": "train-4941", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the youngest person who participated in the Olympics?"}, {"from": "gpt", "value": "```sql\nSELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T2.age LIMIT 1\n```"}]}, {"id": "train-4942", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 24 years old competitors competed in Men's Basketball?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM competitor_event AS T1 INNER JOIN games_competitor AS T2 ON T1.competitor_id = T2.id INNER JOIN event AS T3 ON T1.event_id = T3.id WHERE T3.event_name LIKE 'Basketball Men%s Basketball' AND T2.age = 24\n```"}]}, {"id": "train-4943", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the events under Art Competitions?"}, {"from": "gpt", "value": "```sql\nSELECT T2.event_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Art Competitions'\n```"}]}, {"id": "train-4944", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many gold medals does Henk Jan Zwolle have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T1.full_name = 'Henk Jan Zwolle' AND T4.medal_name = 'Gold'\n```"}]}, {"id": "train-4945", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the event where competitors received the most gold medals?"}, {"from": "gpt", "value": "```sql\nSELECT T2.event_name FROM competitor_event AS T1 INNER JOIN event AS T2 ON T1.event_id = T2.id INNER JOIN medal AS T3 ON T1.medal_id = T3.id WHERE T3.medal_name = 'Gold' GROUP BY T2.id ORDER BY COUNT(T1.event_id) DESC LIMIT 1\n```"}]}, {"id": "train-4946", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many athletes are from Australia?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Australia'\n```"}]}, {"id": "train-4947", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which cities hosted at least 3 Olympic games?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id GROUP BY T2.id HAVING COUNT(T1.games_id) >= 3\n```"}]}, {"id": "train-4948", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Summer games were held in Stockholm?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Stockholm' AND T3.season = 'Summer'\n```"}]}, {"id": "train-4949", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region do most of the athletes are from?"}, {"from": "gpt", "value": "```sql\nSELECT T2.region_name FROM person_region AS T1 INNER JOIN noc_region AS T2 ON T1.region_id = T2.id GROUP BY T2.region_name ORDER BY COUNT(T1.person_id) DESC LIMIT 1\n```"}]}, {"id": "train-4950", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where was the first Olympic game held?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id ORDER BY T3.games_year LIMIT 1\n```"}]}, {"id": "train-4951", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the game in which the oldest Olympian has ever participated?"}, {"from": "gpt", "value": "```sql\nSELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id ORDER BY T2.age LIMIT 1\n```"}]}, {"id": "train-4952", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many athletes competed in the 1992 Summer Olympics?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '1928 Summer'\n```"}]}, {"id": "train-4953", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Olympic events did Michael Phelps II join in total? Find the percentage of the events where he won a gold medal."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.event_id) , CAST(COUNT(CASE WHEN T4.id = '1' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T4.id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T1.full_name = 'Michael Fred Phelps, II'\n```"}]}, {"id": "train-4954", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the Winter and Summer Olympics of 1988, which game has the most number of competitors? Find the difference of the number of competitors between the two games."}, {"from": "gpt", "value": "```sql\nSELECT P1 , ( SELECT MAX(P2) - MIN(P2) FROM ( SELECT COUNT(T2.person_id) AS P2 FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name IN ('1988 Winter', '1988 Summer') GROUP BY T1.season ) ORDER BY P2 DESC LIMIT 1 ) FROM ( SELECT T1.season AS P1, COUNT(T2.person_id) AS P2 FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name IN ('1988 Winter', '1988 Summer') GROUP BY T1.season ) ORDER BY P2 DESC LIMIT 1\n```"}]}, {"id": "train-4955", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What age of the competitors is the most numerous?"}, {"from": "gpt", "value": "```sql\nSELECT age FROM games_competitor GROUP BY age ORDER BY COUNT(person_id) DESC LIMIT 1\n```"}]}, {"id": "train-4956", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which cities beginning with the letter M have the Olympic Games been held?"}, {"from": "gpt", "value": "```sql\nSELECT city_name FROM city WHERE city_name LIKE 'M%'\n```"}]}, {"id": "train-4957", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which cities were the 1976 winter and summer games held?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name IN ('1976 Summer', '1976 Winter')\n```"}]}, {"id": "train-4958", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the medal that Coleen Dufresne got?"}, {"from": "gpt", "value": "```sql\nSELECT T4.medal_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T1.full_name = 'Coleen Dufresne (-Stewner)'\n```"}]}, {"id": "train-4959", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the competitor who has won the most medals?"}, {"from": "gpt", "value": "```sql\nSELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T4.id != 4 GROUP BY T1.full_name ORDER BY COUNT(T4.id) DESC LIMIT 1\n```"}]}, {"id": "train-4960", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where is competitor Estelle Nze Minko from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Estelle Nze Minko'\n```"}]}, {"id": "train-4961", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of all the sports Chin Eei Hui has competed in?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id INNER JOIN competitor_event AS T3 ON T2.id = T3.event_id INNER JOIN games_competitor AS T4 ON T3.competitor_id = T4.id INNER JOIN person AS T5 ON T4.person_id = T5.id WHERE T5.full_name = 'Chin Eei Hui'\n```"}]}, {"id": "train-4962", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the oldest person who participated in the Olympic Games?"}, {"from": "gpt", "value": "```sql\nSELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T2.age DESC LIMIT 1\n```"}]}, {"id": "train-4963", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which Olympic Games have the largest number of women participation?"}, {"from": "gpt", "value": "```sql\nSELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.gender = 'F' GROUP BY T1.games_name ORDER BY COUNT(T2.person_id) DESC LIMIT 1\n```"}]}, {"id": "train-4964", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many males from Belgium have participated in an Olympic Games?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Belgium' AND T3.gender = 'M'\n```"}]}, {"id": "train-4965", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many persons participated in the Sapporo Olympics?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.person_id) FROM games_competitor AS T1 INNER JOIN games_city AS T2 ON T1.games_id = T2.games_id INNER JOIN city AS T3 ON T2.city_id = T3.id WHERE T3.city_name = 'Sapporo'\n```"}]}, {"id": "train-4966", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which Olympic Games has Morten Aleksander Djupvik participated?"}, {"from": "gpt", "value": "```sql\nSELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Morten Aleksander Djupvik'\n```"}]}, {"id": "train-4967", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many persons in total have participated in 12 meter Mixed Sailing competitions?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.competitor_id) FROM competitor_event AS T1 INNER JOIN event AS T2 ON T1.event_id = T2.id INNER JOIN sport AS T3 ON T2.sport_id = T3.id WHERE T2.event_name = 'Sailing Mixed 12 metres'\n```"}]}, {"id": "train-4968", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different events are there of Modern Pentathlon?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Modern Pentathlon'\n```"}]}, {"id": "train-4969", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of women who have participated in Equestrianism Mixed Three-Day Event, Individual."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.gender = 'F' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN event AS T4 ON T3.event_id = T4.id WHERE T4.event_name = 'Equestrianism Mixed Three-Day Event, Individual'\n```"}]}, {"id": "train-4970", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average age of the persons who participated in the 1992 Summer Games."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '1992 Summer'\n```"}]}, {"id": "train-4971", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out years that only have summer games."}, {"from": "gpt", "value": "```sql\nSELECT games_year FROM games WHERE season != 'Winter' GROUP BY games_year HAVING COUNT(season) = 1\n```"}]}, {"id": "train-4972", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Olympics games were held during the 90s?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(games_year) FROM games WHERE games_year BETWEEN '1990' AND '1999'\n```"}]}, {"id": "train-4973", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many athletes participated in the 2014 Winter Olympics?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '2014 Winter'\n```"}]}, {"id": "train-4974", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many athletes from region 151 have won a medal?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.person_id) FROM competitor_event AS T1 INNER JOIN games_competitor AS T2 ON T1.competitor_id = T2.id INNER JOIN person_region AS T3 ON T2.person_id = T3.person_id WHERE T3.region_id = 151 AND T1.medal_id != 4\n```"}]}, {"id": "train-4975", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many athlete from China participate in the 2016 Summer Olympics?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id INNER JOIN person_region AS T4 ON T3.id = T4.person_id INNER JOIN noc_region AS T5 ON T4.region_id = T5.id WHERE T1.games_name = '2016 Summer' AND T5.region_name = 'China'\n```"}]}, {"id": "train-4976", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many gold medals were given to the winners in the Ice Hockey Men's Ice Hockey event?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.competitor_id) FROM event AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.event_id WHERE T1.event_name LIKE 'Ice Hockey Men%s Ice Hockey' AND T2.medal_id = 1\n```"}]}, {"id": "train-4977", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region has the highest medal number?"}, {"from": "gpt", "value": "```sql\nSELECT T5.region_name FROM medal AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.medal_id INNER JOIN games_competitor AS T3 ON T2.competitor_id = T3.id INNER JOIN person_region AS T4 ON T3.person_id = T4.person_id INNER JOIN noc_region AS T5 ON T4.region_id = T5.id WHERE T1.id != 4 GROUP BY T5.region_name ORDER BY COUNT(T2.competitor_id) DESC LIMIT 1\n```"}]}, {"id": "train-4978", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out all the gold medalist winners in cycling sport."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T5.full_name FROM event AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.event_id INNER JOIN games_competitor AS T3 ON T2.competitor_id = T3.id INNER JOIN sport AS T4 ON T1.sport_id = T4.id INNER JOIN person AS T5 ON T3.person_id = T5.id WHERE T4.sport_name = 'Cycling' AND T2.medal_id = 1\n```"}]}, {"id": "train-4979", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out all the medals won by Lee Chong Wei."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.medal_name FROM medal AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.medal_id INNER JOIN games_competitor AS T3 ON T2.competitor_id = T3.id INNER JOIN person AS T4 ON T3.person_id = T4.id WHERE T4.full_name = 'Lee Chong Wei' AND T2.medal_id <> 4\n```"}]}, {"id": "train-4980", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of female athletes below 20s who participated in the 2002 Winter Olympic?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.gender = 'F' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '2002 Winter' AND T2.age < 20\n```"}]}, {"id": "train-4981", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio male to female athletes in the 2012 Summer Olympic?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.gender = 'M' THEN 1 ELSE NULL END) AS REAL) / COUNT(CASE WHEN T3.gender = 'F' THEN 1 ELSE NULL END) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '2012 Summer'\n```"}]}, {"id": "train-4982", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which summer Olympic have the highest and lowest number of participants?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Summer' GROUP BY T1.games_year ORDER BY COUNT(T2.person_id) DESC LIMIT 1 ) AS HIGHEST , ( SELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Summer' GROUP BY T1.games_year ORDER BY COUNT(T2.person_id) LIMIT 1 ) AS LOWEST\n```"}]}, {"id": "train-4983", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many athletes from Malaysia have won a medal?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.person_id) FROM medal AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.medal_id INNER JOIN games_competitor AS T3 ON T2.competitor_id = T3.id INNER JOIN person_region AS T4 ON T3.person_id = T4.person_id INNER JOIN noc_region AS T5 ON T4.region_id = T5.id WHERE T5.region_name = 'Malaysia' AND T1.id != 4\n```"}]}, {"id": "train-4984", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many athletes playing in Canoeing fall into overweight BMI category in the 2008 Summer games?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T5.id) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id INNER JOIN competitor_event AS T3 ON T2.id = T3.event_id INNER JOIN games_competitor AS T4 ON T3.competitor_id = T4.id INNER JOIN person AS T5 ON T4.person_id = T5.id INNER JOIN games AS T6 ON T4.games_id = T6.id WHERE T1.sport_name = 'Canoeing' AND T6.games_name = '2008 Summer' AND T5.weight * 10000.0 / (T5.height * T5.height) BETWEEN 25.0 AND 30\n```"}]}, {"id": "train-4985", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average height of male athletes playing basketball sport?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T5.height) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id INNER JOIN competitor_event AS T3 ON T2.id = T3.event_id INNER JOIN games_competitor AS T4 ON T3.competitor_id = T4.id INNER JOIN person AS T5 ON T4.person_id = T5.id WHERE T1.sport_name = 'Basketball' AND T5.gender = 'M'\n```"}]}, {"id": "train-4986", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female athletes are from the Philippines?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Philippines' AND T3.gender = 'F'\n```"}]}, {"id": "train-4987", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region is Yao Ming from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Yao Ming'\n```"}]}, {"id": "train-4988", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: At what age did Michael Fred Phelps, II join the Olympics?"}, {"from": "gpt", "value": "```sql\nSELECT T2.age FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T1.full_name = 'Michael Fred Phelps, II' ORDER BY T2.age LIMIT 1\n```"}]}, {"id": "train-4989", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many athletes are there in the region where Clara Hughes is from?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(person_id) FROM person_region WHERE region_id = ( SELECT T1.region_id FROM person_region AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.id WHERE T2.full_name = 'Clara Hughes' )\n```"}]}, {"id": "train-4990", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Men's 200 Metres Freestyle events did Ian James Thorpe compete in?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN event AS T4 ON T3.event_id = T4.id WHERE T1.full_name = 'Ian James Thorpe' AND T4.event_name LIKE 'Swimming Men%s 200 metres Freestyle'\n```"}]}, {"id": "train-4991", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times was Larysa Semenivna Latynina (Diriy-) declared as champion in Gymnastics Women's Individual All-Around?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM event AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.event_id INNER JOIN games_competitor AS T3 ON T2.competitor_id = T3.id INNER JOIN person AS T4 ON T3.person_id = T4.id WHERE T4.full_name = 'Larysa Semenivna Latynina (Diriy-)' AND T1.event_name LIKE 'Gymnastics Women%s Individual All-Around' AND T2.medal_id = 1\n```"}]}, {"id": "train-4992", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the cities where Carl Lewis Borack competed?"}, {"from": "gpt", "value": "```sql\nSELECT T4.city_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T1.full_name = 'Carl Lewis Borack'\n```"}]}, {"id": "train-4993", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Olympic games were held in London?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.games_id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'London'\n```"}]}, {"id": "train-4994", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city was the 1992 Summer Olympic held?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name = '1992 Summer'\n```"}]}, {"id": "train-4995", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many athletes over the age of 59 competed in the 2016 Summer Olympics?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '2016 Summer' AND T2.age > 59\n```"}]}, {"id": "train-4996", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the Olympic games held in Los Angeles, what is the name of the Olympic game that has the most number of competitors?"}, {"from": "gpt", "value": "```sql\nSELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T4.city_name = 'Los Angeles' GROUP BY T1.id ORDER BY COUNT(T2.person_id) DESC LIMIT 1\n```"}]}, {"id": "train-4997", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 10-year old athletes participated in the Gymnastics Men's Parallel Bars, Teams event?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM competitor_event AS T1 INNER JOIN games_competitor AS T2 ON T1.competitor_id = T2.id INNER JOIN event AS T3 ON T1.event_id = T3.id WHERE T3.event_name LIKE 'Gymnastics Men%s Parallel Bars, Teams' AND T2.age = 10\n```"}]}, {"id": "train-4998", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of the athletes from the United States of America who competed in the 2016 Summer Olympics?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person_region AS T3 ON T2.person_id = T3.person_id INNER JOIN noc_region AS T4 ON T3.region_id = T4.id WHERE T1.games_name = '2016 Summer' AND T4.region_name = 'USA'\n```"}]}, {"id": "train-4999", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region does the NOC code \"COL\" stand for?"}, {"from": "gpt", "value": "```sql\nSELECT region_name FROM noc_region WHERE noc = 'COL'\n```"}]}, {"id": "train-5000", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of sport id 19."}, {"from": "gpt", "value": "```sql\nSELECT sport_name FROM sport WHERE id = 19\n```"}]}, {"id": "train-5001", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the id of the event \"Shooting Mixed Skeet\"."}, {"from": "gpt", "value": "```sql\nSELECT id FROM event WHERE event_name = 'Shooting Mixed Skeet'\n```"}]}, {"id": "train-5002", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide hockey's sport id."}, {"from": "gpt", "value": "```sql\nSELECT id FROM sport WHERE sport_name = 'Hockey'\n```"}]}, {"id": "train-5003", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the weight of Dagfinn Sverre Aarskog."}, {"from": "gpt", "value": "```sql\nSELECT weight FROM person WHERE full_name = 'Dagfinn Sverre Aarskog'\n```"}]}, {"id": "train-5004", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the id of Rio de Janeiro?"}, {"from": "gpt", "value": "```sql\nSELECT id FROM city WHERE city_name = 'Rio de Janeiro'\n```"}]}, {"id": "train-5005", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people have won the gold medal of the event \"Rowing Women's Coxed Eights\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.competitor_id) FROM competitor_event AS T1 INNER JOIN event AS T2 ON T1.event_id = T2.id INNER JOIN medal AS T3 ON T1.medal_id = T3.id WHERE T2.event_name LIKE 'Rowing Women%s Coxed Eights' AND T3.medal_name = 'Gold'\n```"}]}, {"id": "train-5006", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many kinds of events belong to the sport of cycling?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Cycling'\n```"}]}, {"id": "train-5007", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is Vijay Singh Chauhan's region name?"}, {"from": "gpt", "value": "```sql\nSELECT T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Vijay Singh Chauhan'\n```"}]}, {"id": "train-5008", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Roma host the Olympic Games?"}, {"from": "gpt", "value": "```sql\nSELECT T3.games_year FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Roma'\n```"}]}, {"id": "train-5009", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 20 years old athletes were there in the 1984 Summer Olympic Games?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '1984 Summer' AND T2.age = 20\n```"}]}, {"id": "train-5010", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games has Prithipal Singh participated in?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.games_id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T1.full_name = 'Prithipal Singh'\n```"}]}, {"id": "train-5011", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of athletes in the 1984 Summer Olympic Games who were more than 50 years old."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '1984 Summer' AND T2.age > 50\n```"}]}, {"id": "train-5012", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many kinds of events does athletics have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Athletics'\n```"}]}, {"id": "train-5013", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the heaviest athlete from Russia?"}, {"from": "gpt", "value": "```sql\nSELECT T3.full_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Russia' ORDER BY T3.weight DESC LIMIT 1\n```"}]}, {"id": "train-5014", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the height of the tallest athlete from Portugal."}, {"from": "gpt", "value": "```sql\nSELECT T3.height FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Portugal' ORDER BY T3.height DESC LIMIT 1\n```"}]}, {"id": "train-5015", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the host city of the 1968 Winter Olympic Games."}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name = '1968 Winter'\n```"}]}, {"id": "train-5016", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region has the most athletes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.region_name FROM person_region AS T1 INNER JOIN noc_region AS T2 ON T1.region_id = T2.id GROUP BY T2.region_name ORDER BY COUNT(T1.person_id) DESC LIMIT 1\n```"}]}, {"id": "train-5017", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of athletes from Vanuatu who are taller than 175?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.height > 175 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Vanuatu'\n```"}]}, {"id": "train-5018", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average weight of male athletes from Tonga."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.weight) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Tonga' AND T3.gender = 'M'\n```"}]}, {"id": "train-5019", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where was the 1920 Summer held?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name = '1920 Summer'\n```"}]}, {"id": "train-5020", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 1900 to 1992, how many games did London host?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'London' AND T3.games_year BETWEEN 1900 AND 1992\n```"}]}, {"id": "train-5021", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Summer games are there that were held in Paris?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Paris' AND T3.season = 'Summer'\n```"}]}, {"id": "train-5022", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all game names that were held in Los Angeles."}, {"from": "gpt", "value": "```sql\nSELECT T3.games_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Los Angeles'\n```"}]}, {"id": "train-5023", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city hosted the most games?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id GROUP BY T2.city_name ORDER BY COUNT(T2.city_name) DESC LIMIT 1\n```"}]}, {"id": "train-5024", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the game name that was held in Beijing in 2008?"}, {"from": "gpt", "value": "```sql\nSELECT T3.games_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Beijing' AND T3.games_year = 2008\n```"}]}, {"id": "train-5025", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of champions at the age of over 30?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.age > 30 THEN 1 END) AS REAL) * 100 / COUNT(T2.person_id) FROM competitor_event AS T1 INNER JOIN games_competitor AS T2 ON T1.competitor_id = T2.id WHERE T1.medal_id = 1\n```"}]}, {"id": "train-5026", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: At which age did A Lamusi participate in 2012 Summer?"}, {"from": "gpt", "value": "```sql\nSELECT T2.age FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '2012 Summer' AND T3.full_name = 'A Lamusi'\n```"}]}, {"id": "train-5027", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many competitors were there who participated in 2000 Summer with age 31?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '2000 Summer' AND T2.age = 31\n```"}]}, {"id": "train-5028", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male competitors were there who participated in 1948 Summer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '1948 Summer' AND T3.gender = 'M'\n```"}]}, {"id": "train-5029", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all competitors' names who participated in 1936 Summer."}, {"from": "gpt", "value": "```sql\nSELECT T3.full_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '1936 Summer'\n```"}]}, {"id": "train-5030", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the youngest competitor that participated in 2014 Winter?"}, {"from": "gpt", "value": "```sql\nSELECT T3.full_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '2014 Winter' ORDER BY T2.age LIMIT 1\n```"}]}, {"id": "train-5031", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of competitors who participated in 1988 Winter?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '1988 Winter'\n```"}]}, {"id": "train-5032", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of female competitors whose heights are over 170 that participated in the game in 1988?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.gender = 'F' AND T3.height > 170 THEN 1 END) AS REAL) * 100 / COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_year = 1988\n```"}]}, {"id": "train-5033", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the sport name of \"Cross Country Skiing Men's 10/15 kilometres Pursuit\" event?"}, {"from": "gpt", "value": "```sql\nSELECT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T2.event_name LIKE 'Cross Country Skiing Men%s 10/15 kilometres Pursuit'\n```"}]}, {"id": "train-5034", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of people whose age greater than 24 and participate in winter season?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.age > 24 AND T1.season = 'Winter' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.games_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id\n```"}]}, {"id": "train-5035", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the region id of Christine Jacoba Aaftink?"}, {"from": "gpt", "value": "```sql\nSELECT T1.region_id FROM person_region AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.id WHERE T2.full_name = 'Christine Jacoba Aaftink'\n```"}]}, {"id": "train-5036", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the height of people who belong to region id 7."}, {"from": "gpt", "value": "```sql\nSELECT T2.height FROM person_region AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.id WHERE T1.region_id = 7\n```"}]}, {"id": "train-5037", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of the city that held game id 3."}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T1.games_id = 3\n```"}]}, {"id": "train-5038", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the id of the games held in London?"}, {"from": "gpt", "value": "```sql\nSELECT T1.games_id FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'London'\n```"}]}, {"id": "train-5039", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people who are below 30 and participated in the summer season?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Summer' AND T2.age < 30\n```"}]}, {"id": "train-5040", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the name of the game that the people participated in games id 13."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T2.games_id = 13\n```"}]}, {"id": "train-5041", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of the people who participated in the winter season?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Winter'\n```"}]}, {"id": "train-5042", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the people who are under 35 and participated in the summer season?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.age < 35 THEN 1 END) AS REAL) * 100 / COUNT(T2.games_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.season = 'Summer'\n```"}]}, {"id": "train-5043", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the event name of Basketball."}, {"from": "gpt", "value": "```sql\nSELECT T2.event_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Basketball'\n```"}]}, {"id": "train-5044", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of medal that competitor id 9 obtained?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.medal_name FROM medal AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.medal_id WHERE T2.competitor_id = 9\n```"}]}, {"id": "train-5045", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the id of event that achieve the gold medal."}, {"from": "gpt", "value": "```sql\nSELECT T2.event_id FROM medal AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.medal_id WHERE T1.medal_name = 'Gold'\n```"}]}, {"id": "train-5046", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the heaviest athlete?"}, {"from": "gpt", "value": "```sql\nSELECT full_name FROM person ORDER BY weight DESC LIMIT 1\n```"}]}, {"id": "train-5047", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city were the Olympic games held in 1992?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_year = 1992\n```"}]}, {"id": "train-5048", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region is the majority of the athletes from?"}, {"from": "gpt", "value": "```sql\nSELECT T2.region_name FROM person_region AS T1 INNER JOIN noc_region AS T2 ON T1.region_id = T2.id GROUP BY T2.region_name ORDER BY COUNT(T1.person_id) DESC LIMIT 1\n```"}]}, {"id": "train-5049", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the oldest competitor?"}, {"from": "gpt", "value": "```sql\nSELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T2.age DESC LIMIT 1\n```"}]}, {"id": "train-5050", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which sport did John Aalberg participate in?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.sport_name FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id INNER JOIN competitor_event AS T3 ON T2.id = T3.event_id INNER JOIN games_competitor AS T4 ON T3.competitor_id = T4.id INNER JOIN person AS T5 ON T4.person_id = T5.id WHERE T5.full_name = 'John Aalberg'\n```"}]}, {"id": "train-5051", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Belgian men have competed in an Olympic Games?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Belgium' AND T3.gender = 'M'\n```"}]}, {"id": "train-5052", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many athletes took part in the Olympic games held in Barcelona?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.person_id) FROM games_competitor AS T1 INNER JOIN games_city AS T2 ON T1.games_id = T2.games_id INNER JOIN city AS T3 ON T2.city_id = T3.id WHERE T3.city_name = 'Barcelona'\n```"}]}, {"id": "train-5053", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different football events are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.event_name) FROM sport AS T1 INNER JOIN event AS T2 ON T1.id = T2.sport_id WHERE T1.sport_name = 'Football'\n```"}]}, {"id": "train-5054", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What were the cities in which John Aalberg competed?"}, {"from": "gpt", "value": "```sql\nSELECT T4.city_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T1.full_name = 'John Aalberg'\n```"}]}, {"id": "train-5055", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Barcelona, how many Olympic games were held?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.games_id) FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'Barcelona'\n```"}]}, {"id": "train-5056", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many competitors over the age of 30 participated in the 1992 Winter Olympics?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '1992 Winter' AND T2.age > 30\n```"}]}, {"id": "train-5057", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the Olympic game with the most competitors held in Barcelona?"}, {"from": "gpt", "value": "```sql\nSELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN games_city AS T3 ON T2.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id WHERE T4.city_name = 'Barcelona' GROUP BY T1.id ORDER BY COUNT(T2.person_id) DESC LIMIT 1\n```"}]}, {"id": "train-5058", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of competitors from Argentina."}, {"from": "gpt", "value": "```sql\nSELECT T3.full_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Argentina'\n```"}]}, {"id": "train-5059", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of Argentina's athletes who participated in the Summer Olympics in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person_region AS T3 ON T2.person_id = T3.person_id INNER JOIN noc_region AS T4 ON T3.region_id = T4.id WHERE T1.games_name = '2012 Summer' AND T4.region_name = 'Argentina'\n```"}]}, {"id": "train-5060", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of bronze medals won by men's basketball players."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T4.medal_name = 'Bronze' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.person_id) FROM competitor_event AS T1 INNER JOIN games_competitor AS T2 ON T1.competitor_id = T2.id INNER JOIN event AS T3 ON T1.event_id = T3.id INNER JOIN medal AS T4 ON T1.medal_id = T4.id WHERE T3.event_name LIKE 'Basketball Men%s Basketball'\n```"}]}, {"id": "train-5061", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of the games that Georgios Abaris participated."}, {"from": "gpt", "value": "```sql\nSELECT T1.games_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Georgios Abaris'\n```"}]}, {"id": "train-5062", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of competitors from Greece."}, {"from": "gpt", "value": "```sql\nSELECT T3.full_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Greece'\n```"}]}, {"id": "train-5063", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average age of the competitors who participated in the 1924 Winter."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.age) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '1924 Winter'\n```"}]}, {"id": "train-5064", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the NOC code of the region of the competitors weighted 77 kg?"}, {"from": "gpt", "value": "```sql\nSELECT T1.noc FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.weight = 77\n```"}]}, {"id": "train-5065", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the games held in Paris."}, {"from": "gpt", "value": "```sql\nSELECT T3.games_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Paris'\n```"}]}, {"id": "train-5066", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the competitors' names who joined the 2000 Summer."}, {"from": "gpt", "value": "```sql\nSELECT T3.full_name FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_name = '2000 Summer'\n```"}]}, {"id": "train-5067", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city was the game held where the oldest competitor participated?"}, {"from": "gpt", "value": "```sql\nSELECT T4.city_name FROM games_competitor AS T1 INNER JOIN games AS T2 ON T1.games_id = T2.id INNER JOIN games_city AS T3 ON T1.games_id = T3.games_id INNER JOIN city AS T4 ON T3.city_id = T4.id ORDER BY T1.age DESC LIMIT 1\n```"}]}, {"id": "train-5068", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the youngest competitor?"}, {"from": "gpt", "value": "```sql\nSELECT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T2.age LIMIT 1\n```"}]}, {"id": "train-5069", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the games ID of games held in Tokyo."}, {"from": "gpt", "value": "```sql\nSELECT T1.games_id FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id WHERE T2.city_name = 'Tokyo'\n```"}]}, {"id": "train-5070", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the NOC code and region name of the heaviest competitor."}, {"from": "gpt", "value": "```sql\nSELECT T1.noc, T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id ORDER BY T3.weight DESC LIMIT 1\n```"}]}, {"id": "train-5071", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In what year and season did Sohail Abbas compete?"}, {"from": "gpt", "value": "```sql\nSELECT T1.games_year, T1.season FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.full_name = 'Sohail Abbas'\n```"}]}, {"id": "train-5072", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average weight of the competitors who won a silver medal?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.weight) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T4.medal_name = 'Silver'\n```"}]}, {"id": "train-5073", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city the 2004 Summer was held?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name = '2004 Summer'\n```"}]}, {"id": "train-5074", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the season of the game where a competitor who weighted 73 kg and 180 cm tall, participated?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.season FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.height = 180 AND T3.weight = 73\n```"}]}, {"id": "train-5075", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names of competitors who received a gold medal."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.full_name FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN medal AS T4 ON T3.medal_id = T4.id WHERE T4.medal_name = 'Gold'\n```"}]}, {"id": "train-5076", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compute the average height of competitors whose age ranges from 22 to 28."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.height) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T2.age BETWEEN 22 AND 28\n```"}]}, {"id": "train-5077", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female competitors were from Iran?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.person_id) FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Iran' AND T3.gender = 'F'\n```"}]}, {"id": "train-5078", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the age of the tallest competitor."}, {"from": "gpt", "value": "```sql\nSELECT T2.age FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id ORDER BY T1.height DESC LIMIT 1\n```"}]}, {"id": "train-5079", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the competitors with age ranges 24 and below, calculate the difference between the number of competitors who weighed greater than 70 kg and competitors who weighted less than 70 kg."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T1.weight > 70 THEN 1 ELSE NULL END) - COUNT(CASE WHEN T1.weight < 70 THEN 1 ELSE NULL END) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id WHERE T2.age < 24\n```"}]}, {"id": "train-5080", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the 2014 Winter game, what is the percentage of competitors who age 28 years old?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.age = 28 THEN 1 END) AS REAL) * 100 / COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id WHERE T1.games_name = '2014 Winter'\n```"}]}, {"id": "train-5081", "db_id": "olympics", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the males, list the region name of people with height greater than 87% of the average height of all people listed."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.region_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T3.gender = 'M' AND T3.height * 100 > ( SELECT AVG(height) FROM person WHERE gender = 'M' ) * 87\n```"}]}, {"id": "train-5082", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of households in Arecibo county?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.households) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO'\n```"}]}, {"id": "train-5083", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which residential area in Arecibo county has the highest average house value? Please give its zip_code."}, {"from": "gpt", "value": "```sql\nSELECT T1.zip_code FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO' ORDER BY T1.avg_house_value DESC LIMIT 1\n```"}]}, {"id": "train-5084", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the numbers of males in all the residential areas in Arecibo county."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.male_population) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO'\n```"}]}, {"id": "train-5085", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the residential areas in Delaware, how many of them implement daylight saving?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.zip_code) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'DELAWARE' AND T1.daylight_savings = 'Yes'\n```"}]}, {"id": "train-5086", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the residential areas in Arecibo county, what is the zip_code of the one with the highest white population?"}, {"from": "gpt", "value": "```sql\nSELECT T1.zip_code FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO' ORDER BY T1.white_population DESC LIMIT 1\n```"}]}, {"id": "train-5087", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which county is the residential area with the highest average income per household located?"}, {"from": "gpt", "value": "```sql\nSELECT T2.county FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO' GROUP BY T2.county ORDER BY T1.avg_income_per_household DESC LIMIT 1\n```"}]}, {"id": "train-5088", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the counties with at least one residential area that implements daylight saving."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.county FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T1.daylight_savings = 'Yes'\n```"}]}, {"id": "train-5089", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the zip_codes of all the residential areas in Huntingdon county with over 30 employees."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.zip_code FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'HUNTINGDON' AND T1.employees > 30\n```"}]}, {"id": "train-5090", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the Asian populations of all the residential areas with the bad alias \"URB San Joaquin\"."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.asian_population) FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T2.bad_alias = 'URB San Joaquin'\n```"}]}, {"id": "train-5091", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the residential areas with the bad alias \"Internal Revenue Service\", how many of them are in the Eastern time zone?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.zip_code) FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T2.bad_alias = 'Internal Revenue Service' AND T1.time_zone = 'Eastern'\n```"}]}, {"id": "train-5092", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the bad alias of the residential area with the highest average house value?"}, {"from": "gpt", "value": "```sql\nSELECT T2.bad_alias FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T1.avg_house_value = ( SELECT MAX(avg_house_value) FROM zip_data ) LIMIT 1\n```"}]}, {"id": "train-5093", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the bad alias of all the residential areas with a median female age of over 32."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.bad_alias FROM zip_data AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T1.female_median_age > 32\n```"}]}, {"id": "train-5094", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest gender ratio of the residential areas in Arecibo county?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.male_population AS REAL) / T1.female_population FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO' AND T1.female_population <> 0 ORDER BY 1 DESC LIMIT 1\n```"}]}, {"id": "train-5095", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average median female age of all the residential areas in the Arecibo county?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.female_median_age) / COUNT(T1.zip_code) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'ARECIBO'\n```"}]}, {"id": "train-5096", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the area code of the city with the female median age over 32 years old?"}, {"from": "gpt", "value": "```sql\nSELECT T1.area_code FROM area_code AS T1 INNER JOIN ZIP_Data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.female_median_age > 32 GROUP BY T1.area_code\n```"}]}, {"id": "train-5097", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the alias of the city called Hartford?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.alias FROM zip_data AS T1 INNER JOIN alias AS T2 ON T1.zip_code = T2.zip_code WHERE T1.city = 'Hartford'\n```"}]}, {"id": "train-5098", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many counties are there in Alabama?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Alabama'\n```"}]}, {"id": "train-5099", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many post offices are there in New York?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.zip_code) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.abbreviation = 'NY' AND T2.type = 'Post Office'\n```"}]}, {"id": "train-5100", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the precise locations of the cities with an area code of 787?"}, {"from": "gpt", "value": "```sql\nSELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = '787' GROUP BY T2.latitude, T2.longitude\n```"}]}, {"id": "train-5101", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In California, how many delivery receptacles are there in the community post office that has the highest number of delivery receptacles?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.abbreviation = 'CA' AND T2.type LIKE '%Community Post Office%' AND T1.name = 'California' AND T2.state = 'CA'\n```"}]}, {"id": "train-5102", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which county can you find the city with the highest number of females?"}, {"from": "gpt", "value": "```sql\nSELECT T4.county FROM zip_data AS T3 INNER JOIN country AS T4 ON T3.zip_code = T4.zip_code GROUP BY T4.county ORDER BY T3.female_population DESC LIMIT 1\n```"}]}, {"id": "train-5103", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the states whose postal point is not affiliated with any organization?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.name FROM zip_data AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.division IS NULL\n```"}]}, {"id": "train-5104", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in the most populated city of Allentown-Bethlehem-Easton, PA-NJ in 2020 against its population in 2010?"}, {"from": "gpt", "value": "```sql\nSELECT T1.population_2020 - T1.population_2010 AS result_data FROM zip_data AS T1 INNER JOIN CBSA AS T2 ON T1.CBSA = T2.CBSA WHERE T2.CBSA_name = 'Allentown-Bethlehem-Easton, PA-NJ' ORDER BY T1.population_2020 DESC LIMIT 1\n```"}]}, {"id": "train-5105", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the zip codes in the county of New Castle in Delaware."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.zip_code FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T2.county = 'NEW CASTLE' AND T1.name = 'Delaware'\n```"}]}, {"id": "train-5106", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many representatives are there in the state with the highest monthly benefit payments for retired workers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.cognress_rep_id) FROM zip_data AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation INNER JOIN congress AS T3 ON T2.abbreviation = T3.abbreviation ORDER BY T1.monthly_benefits_retired_workers DESC LIMIT 1\n```"}]}, {"id": "train-5107", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the state where Lisa Murkowski is the representative, how many cities have zero employees?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.city) FROM congress AS T1 INNER JOIN state AS T2 ON T1.abbreviation = T2.abbreviation INNER JOIN zip_data AS T3 ON T2.abbreviation = T3.state WHERE T1.first_name = 'Murkowski' AND T1.last_name = 'Lisa' AND T3.employees = 0\n```"}]}, {"id": "train-5108", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 3 states with the highest Asian population? List the full names of all the representatives in the said states."}, {"from": "gpt", "value": "```sql\nSELECT t.state, T1.first_name, T1.last_name 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\n```"}]}, {"id": "train-5109", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which state is Outagamie County in? Give the full name of the state."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.name FROM country AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.county = 'OUTAGAMIE'\n```"}]}, {"id": "train-5110", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What party does the area with the zip code 91701 belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T1.party FROM congress AS T1 INNER JOIN state AS T2 ON T1.abbreviation = T2.abbreviation INNER JOIN zip_data AS T3 ON T2.abbreviation = T3.state WHERE T3.zip_code = 91701 GROUP BY T1.party\n```"}]}, {"id": "train-5111", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many males are there in New Haven County's residential areas?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.male_population) FROM zip_data AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T2.county = 'NEW HAVEN'\n```"}]}, {"id": "train-5112", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the alias for the county at coordinate (18.090875, -66.867756)."}, {"from": "gpt", "value": "```sql\nSELECT T2.alias FROM zip_data AS T1 INNER JOIN alias AS T2 ON T1.zip_code = T2.zip_code WHERE T1.latitude = 18.090875 AND T1.longitude = -66.867756\n```"}]}, {"id": "train-5113", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the city with the most elders, what's its area code?"}, {"from": "gpt", "value": "```sql\nSELECT T2.area_code FROM zip_data AS T1 INNER JOIN area_code AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.area_code ORDER BY T1.over_65 DESC LIMIT 1\n```"}]}, {"id": "train-5114", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the county represented by Thompson Bennie G, how many bad aliases does it have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.bad_alias) FROM zip_congress AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T1.district = T3.cognress_rep_id WHERE T3.first_name = 'Thompson' AND T3.last_name = 'Bennie G'\n```"}]}, {"id": "train-5115", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the location coordinates of the city with area code 636."}, {"from": "gpt", "value": "```sql\nSELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 636\n```"}]}, {"id": "train-5116", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the zip code of the county represented by Buchanan Vernon."}, {"from": "gpt", "value": "```sql\nSELECT T2.zip_code FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.first_name = 'Buchanan' AND T1.last_name = 'Vernon'\n```"}]}, {"id": "train-5117", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which state is area code 878 in? Give the name of the state."}, {"from": "gpt", "value": "```sql\nSELECT T2.state FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 878\n```"}]}, {"id": "train-5118", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many counties are there in Virginia State?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Virginia'\n```"}]}, {"id": "train-5119", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name and the position of the cbsa officer from the area with the zip code 45503."}, {"from": "gpt", "value": "```sql\nSELECT T1.CBSA_name, T2.latitude, T2.longitude FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.zip_code = 45503 GROUP BY T1.CBSA_name, T2.latitude, T2.longitude\n```"}]}, {"id": "train-5120", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the name of the county which is represented by Hartzler Vicky."}, {"from": "gpt", "value": "```sql\nSELECT T1.county FROM country AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Hartzler' AND T3.last_name = 'Vicky' GROUP BY T1.county\n```"}]}, {"id": "train-5121", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average male median age of all the residential areas in Windham county."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.male_median_age) / COUNT(T2.median_age) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'WINDHAM'\n```"}]}, {"id": "train-5122", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the county where DeSantis Ron is from, what is the average female median age?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T4.female_median_age) / COUNT(T1.county) FROM country AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id INNER JOIN zip_data AS T4 ON T1.zip_code = T4.zip_code WHERE T3.first_name = 'DeSantis' AND T3.last_name = 'Ron'\n```"}]}, {"id": "train-5123", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the area code of Bishopville, SC?"}, {"from": "gpt", "value": "```sql\nSELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Bishopville' AND T2.state = 'SC'\n```"}]}, {"id": "train-5124", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the bad alias of Geneva, AL."}, {"from": "gpt", "value": "```sql\nSELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Geneva' AND T2.state = 'AL'\n```"}]}, {"id": "train-5125", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city and state has the bad alias of Lawrenceville?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city, T2.state FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.bad_alias = 'Lawrenceville' GROUP BY T2.city, T2.state\n```"}]}, {"id": "train-5126", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name both the alias and the bad alias of zip code 38015."}, {"from": "gpt", "value": "```sql\nSELECT T1.alias, T2.bad_alias FROM alias AS T1 INNER JOIN avoid AS T2 ON T1.zip_code = T2.zip_code WHERE T1.zip_code = 38015\n```"}]}, {"id": "train-5127", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the zip code of the district represented by Steven A King?"}, {"from": "gpt", "value": "```sql\nSELECT T2.zip_code FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.first_name = 'King' AND T1.last_name = 'Steven A'\n```"}]}, {"id": "train-5128", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the CBSA name and type in York, ME?"}, {"from": "gpt", "value": "```sql\nSELECT T1.CBSA_name, T1.CBSA_type FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.city = 'York' AND T2.state = 'ME'\n```"}]}, {"id": "train-5129", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List 10 cities with a median age over 40. Include their zip codes and area codes."}, {"from": "gpt", "value": "```sql\nSELECT T2.city, T2.zip_code, T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.median_age >= 40 LIMIT 10\n```"}]}, {"id": "train-5130", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the county that has the bad alias of Druid Hills."}, {"from": "gpt", "value": "```sql\nSELECT T2.county FROM avoid AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T1.bad_alias = 'Druid Hills'\n```"}]}, {"id": "train-5131", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the area code of Phillips county in Montana?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.area_code FROM area_code AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code INNER JOIN state AS T3 ON T2.state = T3.abbreviation WHERE T2.county = 'PHILLIPS' AND T3.name = 'Montana'\n```"}]}, {"id": "train-5132", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which district has the largest land area in Wisconsin? Write the full name of the congress representative and include the postal codes."}, {"from": "gpt", "value": "```sql\nSELECT T2.zip_code, T1.first_name, T1.last_name FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state = 'Wisconsin' ORDER BY T1.land_area DESC LIMIT 1\n```"}]}, {"id": "train-5133", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many states are in the central time zone? Write their full names."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.time_zone = 'Central' THEN 1 ELSE 0 END) AS count FROM zip_data AS T1 INNER JOIN state AS T2 ON T2.abbreviation = T1.state WHERE T1.time_zone = 'Central'\n```"}]}, {"id": "train-5134", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name 10 cities with their states that are under the Lexington-Fayette, KY office of the Canada Border Services Agency."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.city, T2.state FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Lexington-Fayette, KY' LIMIT 10\n```"}]}, {"id": "train-5135", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage ratio between Democrats and Republicans in Indiana? List the zip codes belonging to Democrats."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.party = 'Democrat' THEN 1 ELSE NULL END) AS REAL) / COUNT(CASE WHEN T2.party = 'Republican' THEN 1 ELSE NULL END)FROM zip_congress AS T1 INNER JOIN congress AS T2 ON T2.cognress_rep_id = T1.district\n```"}]}, {"id": "train-5136", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the ratio between the number of representatives in Alabama and the number of representatives in Illinois."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN state = 'Alabama' THEN cognress_rep_id ELSE NULL END) AS REAL) / COUNT(CASE WHEN state = 'Illinois' THEN cognress_rep_id ELSE NULL END) FROM congress\n```"}]}, {"id": "train-5137", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average of 2020's population in each zip code."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(population_2020) AS REAL) / COUNT(zip_code) FROM zip_data\n```"}]}, {"id": "train-5138", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the male population for all zip code which were under the Berlin, NH CBSA."}, {"from": "gpt", "value": "```sql\nSELECT T2.male_population FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Berlin, NH' GROUP BY T2.male_population\n```"}]}, {"id": "train-5139", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which CBSAs have more than 10 zip codes?"}, {"from": "gpt", "value": "```sql\nSELECT T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA GROUP BY T1.CBSA HAVING COUNT(T2.zip_code) > 10\n```"}]}, {"id": "train-5140", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the bad alias for zip codes in Puerto Rico."}, {"from": "gpt", "value": "```sql\nSELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.state = 'PR'\n```"}]}, {"id": "train-5141", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the longitude and latitude for the district represented by Grayson Alan?"}, {"from": "gpt", "value": "```sql\nSELECT T1.latitude, T1.longitude FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Grayson' AND T3.last_name = 'Alan'\n```"}]}, {"id": "train-5142", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the state for area code of 787?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.state FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 787\n```"}]}, {"id": "train-5143", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all representatives of districts which have more than 30 000 population in 2020."}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T1.population_2020 > 30000 GROUP BY T3.first_name, T3.last_name\n```"}]}, {"id": "train-5144", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which zip code in Massachusetts that have more than 1 area code?"}, {"from": "gpt", "value": "```sql\nSELECT T1.zip_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.state = 'MA' GROUP BY T1.zip_code HAVING COUNT(T1.area_code) > 1\n```"}]}, {"id": "train-5145", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the county for Arecibo City."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Arecibo'\n```"}]}, {"id": "train-5146", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many zip codes are under Barre, VT?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.zip_code) FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Barre, VT'\n```"}]}, {"id": "train-5147", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the zip code under Saint Croix county, which zip code has the biggest land area?"}, {"from": "gpt", "value": "```sql\nSELECT T1.zip_code FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'SAINT CROIX' ORDER BY T2.land_area DESC LIMIT 1\n```"}]}, {"id": "train-5148", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference between the 2020 population and the 2010 population for the districts represented by Griffin Tim."}, {"from": "gpt", "value": "```sql\nSELECT T1.population_2020 - T1.population_2010 FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Griffin' AND T3.last_name = 'Tim'\n```"}]}, {"id": "train-5149", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Based on the population in 2020, calculate the percentage for the population of Asian in the zip code where the CBSA was Atmore, AL."}, {"from": "gpt", "value": "```sql\nSELECT CAST(T2.asian_population AS REAL) * 100 / T2.population_2010 FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Atmore, AL'\n```"}]}, {"id": "train-5150", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cities with an area code 939, which city has the highest Asian population?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 939 ORDER BY T2.asian_population DESC LIMIT 1\n```"}]}, {"id": "train-5151", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the country and state of the city with elevation of 1039."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.name, T2.state FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state INNER JOIN zip_data AS T3 ON T2.zip_code = T3.zip_code WHERE T3.elevation = 1039\n```"}]}, {"id": "train-5152", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the alias and elevation of the city with zip code 1028."}, {"from": "gpt", "value": "```sql\nSELECT T1.alias, T2.elevation FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.zip_code = 1028\n```"}]}, {"id": "train-5153", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the area code of the city with the largest land area?"}, {"from": "gpt", "value": "```sql\nSELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.land_area = ( SELECT MAX(land_area) FROM zip_data )\n```"}]}, {"id": "train-5154", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the area code of the city with the white population ranging between 1700 to 2000."}, {"from": "gpt", "value": "```sql\nSELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.white_population BETWEEN 1700 AND 2000\n```"}]}, {"id": "train-5155", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the Asian population in the city with the alias Leeds?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.asian_population) FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'Leeds'\n```"}]}, {"id": "train-5156", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the area code and country of the city named Savoy."}, {"from": "gpt", "value": "```sql\nSELECT T1.area_code, T2.county FROM area_code AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code INNER JOIN zip_data AS T3 ON T1.zip_code = T3.zip_code WHERE T3.city = 'Savoy'\n```"}]}, {"id": "train-5157", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the alias of the cities with 0 population in 2010?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2010 = 0\n```"}]}, {"id": "train-5158", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cities with area code 608, how many cities implement daylight savings?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.city) FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 608 AND T2.daylight_savings = 'Yes'\n```"}]}, {"id": "train-5159", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the average elevation of the cities with alias Amherst."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.elevation) FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'Amherst'\n```"}]}, {"id": "train-5160", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the country and state of the city named Dalton?"}, {"from": "gpt", "value": "```sql\nSELECT T2.county FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state INNER JOIN zip_data AS T3 ON T2.zip_code = T3.zip_code WHERE T3.city = 'Dalton' GROUP BY T2.county\n```"}]}, {"id": "train-5161", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give at least five alias of cities with a postal point of post office."}, {"from": "gpt", "value": "```sql\nSELECT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.type = 'Post Office' LIMIT 5\n```"}]}, {"id": "train-5162", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T2.type = 'P.O. Box Only' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T2.type = 'Post Office' THEN 1 ELSE NULL END) AS DIFFERENCE FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 787\n```"}]}, {"id": "train-5163", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cities belonging to the country named Arroyo, calculate the percentage of increase in the population in these cities from 2010 to 2020."}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(T2.population_2020) - SUM(T2.population_2010)) AS REAL) * 100 / SUM(T2.population_2010) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Arroyo'\n```"}]}, {"id": "train-5164", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the postal points in Texas, provide the zip codes and cities of postal points which have total beneficiaries of above 10000."}, {"from": "gpt", "value": "```sql\nSELECT T2.zip_code, T2.city FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Texas' AND T2.total_beneficiaries > 10000\n```"}]}, {"id": "train-5165", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the postal points in the District of Columbia, how many of them have an area with above 20000 black population?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.zip_code) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'DISTRICT OF COLUMBIA' AND T2.black_population > 20000\n```"}]}, {"id": "train-5166", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the city where zip code 19019 is located and the alias of that city."}, {"from": "gpt", "value": "```sql\nSELECT T2.city, T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.zip_code = 19019\n```"}]}, {"id": "train-5167", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the bad alias of the postal point located in Camuy."}, {"from": "gpt", "value": "```sql\nSELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Camuy'\n```"}]}, {"id": "train-5168", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the zip code, city, and congress representative's full names of the area which has highest population in 2020."}, {"from": "gpt", "value": "```sql\nSELECT T1.zip_code, T1.city, T3.first_name, T3.last_name FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id GROUP BY T2.district ORDER BY T1.population_2020 DESC LIMIT 1\n```"}]}, {"id": "train-5169", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the daylight savings areas in the Midwest region, how many postal points are there in Illinois?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.zip_code) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Illinois' AND T2.daylight_savings = 'Yes' AND T2.region = 'Midwest'\n```"}]}, {"id": "train-5170", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the countries and the zip codes in the Virgin Islands."}, {"from": "gpt", "value": "```sql\nSELECT T2.county, T2.zip_code FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Virgin Islands'\n```"}]}, {"id": "train-5171", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the zip codes and the alias of Greeneville."}, {"from": "gpt", "value": "```sql\nSELECT T2.zip_code, T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Greeneville'\n```"}]}, {"id": "train-5172", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compare the numbers of postal points under Smith Adrian and Heck Joe."}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN COUNT(CASE WHEN T1.first_name = 'Smith' AND T1.last_name = 'Adrian' THEN T2.zip_code ELSE NULL END) > COUNT(CASE WHEN T1.first_name = 'Heck' AND T1.last_name = 'Joe' THEN T2.zip_code ELSE NULL END) THEN 'Smith Adrian>Heck Joe' ELSE 'Smith Adrian<=Heck Joe' END AS COMPARE FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district\n```"}]}, {"id": "train-5173", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the zip codes and CBSA officers of the postal point in Oxford."}, {"from": "gpt", "value": "```sql\nSELECT T2.zip_code, T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.city = 'Oxford'\n```"}]}, {"id": "train-5174", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the zip codes and their affiliated organization for the postal point under Kingsport-Bristol, TN-VA."}, {"from": "gpt", "value": "```sql\nSELECT T2.zip_code, T2.organization FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Kingsport-Bristol, TN-VA'\n```"}]}, {"id": "train-5175", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the zip codes and the congress representatives' names of the postal points which are affiliated with Readers Digest."}, {"from": "gpt", "value": "```sql\nSELECT T1.zip_code, T3.first_name, T3.last_name FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T1.organization = 'Readers Digest'\n```"}]}, {"id": "train-5176", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the postal points in California, calculate the percentage of them in post office types."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.type = 'Post Office' THEN T2.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(T2.zip_code) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'California'\n```"}]}, {"id": "train-5177", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the zip code for the Senate house?"}, {"from": "gpt", "value": "```sql\nSELECT T2.zip_code FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.House = 'House of Repsentatives' GROUP BY T2.zip_code\n```"}]}, {"id": "train-5178", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city has the most bad aliases?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T1.bad_alias ORDER BY COUNT(T1.zip_code) DESC LIMIT 1\n```"}]}, {"id": "train-5179", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the counties in Georgia."}, {"from": "gpt", "value": "```sql\nSELECT T2.county FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Georgia' GROUP BY T2.county\n```"}]}, {"id": "train-5180", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the locations of postal points with the area code \"410\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.latitude, T2.longitude FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 410\n```"}]}, {"id": "train-5181", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the CBSA of the city with the highest average house value?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.avg_house_value = ( SELECT MAX(avg_house_value) FROM zip_data ) LIMIT 1\n```"}]}, {"id": "train-5182", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the bad aliases of the postal points from East Setauket?"}, {"from": "gpt", "value": "```sql\nSELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'East Setauket'\n```"}]}, {"id": "train-5183", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the population of Wilcox County in 2010?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.population_2010) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'WILCOX'\n```"}]}, {"id": "train-5184", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the code of the area with the largest Asian population?"}, {"from": "gpt", "value": "```sql\nSELECT T1.zip_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.asian_population ORDER BY T2.asian_population DESC LIMIT 1\n```"}]}, {"id": "train-5185", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the cities with micro CBSA."}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_type = 'Micro'\n```"}]}, {"id": "train-5186", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the state with the most counties?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state GROUP BY T2.state ORDER BY COUNT(T2.county) DESC LIMIT 1\n```"}]}, {"id": "train-5187", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of households in the \"FL-10\" district?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.district = 'FL-10' THEN 1 ELSE 0 END) FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code\n```"}]}, {"id": "train-5188", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average household income in the city known as \"Danzig\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.avg_income_per_household FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.bad_alias = 'Danzig'\n```"}]}, {"id": "train-5189", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the states with an above-average female population?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.state FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T2.female_population > ( SELECT AVG(female_population) FROM zip_data )\n```"}]}, {"id": "train-5190", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of households are in \"Coroyell\" out of its state?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.county = 'CORYELL' THEN T2.households ELSE 0 END) AS REAL) * 100 / SUM(T2.households) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code\n```"}]}, {"id": "train-5191", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name and the position of the CBSA officer in the city of Cabo Rojo?"}, {"from": "gpt", "value": "```sql\nSELECT T1.CBSA_name, T1.CBSA_type FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.city = 'Cabo Rojo' GROUP BY T1.CBSA_name, T1.CBSA_type\n```"}]}, {"id": "train-5192", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the country name of the city Las Marias."}, {"from": "gpt", "value": "```sql\nSELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Las Marias'\n```"}]}, {"id": "train-5193", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities does congressman Pierluisi Pedro represent?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.city) FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Pierluisi' AND T3.last_name = 'Pedro'\n```"}]}, {"id": "train-5194", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names of bad aliases in the city of Aguadilla."}, {"from": "gpt", "value": "```sql\nSELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Aguadilla'\n```"}]}, {"id": "train-5195", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the name of the congressman represent in Guanica."}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T1.city = 'Guanica'\n```"}]}, {"id": "train-5196", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which state has the most bad aliases?"}, {"from": "gpt", "value": "```sql\nSELECT T2.state FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T2.state ORDER BY COUNT(T1.bad_alias) DESC LIMIT 1\n```"}]}, {"id": "train-5197", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in the number of bad alias between Aguada city and Aguadilla city?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T2.city = 'Aguada' THEN T1.bad_alias ELSE NULL END) - COUNT(CASE WHEN T2.city = 'Aguadilla' THEN T1.bad_alias ELSE NULL END) AS DIFFERENCE FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code\n```"}]}, {"id": "train-5198", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which state has greater than 50 CBSA officers of metro type?"}, {"from": "gpt", "value": "```sql\nSELECT T2.state FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_type = 'Metro' GROUP BY T2.state HAVING COUNT(T1.CBSA_type) > 50\n```"}]}, {"id": "train-5199", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the population of Arecibo in 2020."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.population_2020) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'ARECIBO'\n```"}]}, {"id": "train-5200", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the name of the country with a population greater than 10000 in 2010."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2010 > 10000\n```"}]}, {"id": "train-5201", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the country with the largest number of households in a residential area."}, {"from": "gpt", "value": "```sql\nSELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T1.county ORDER BY T2.households DESC LIMIT 1\n```"}]}, {"id": "train-5202", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of households in residential areas of countries over 10000."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.households > 10000 THEN T1.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(T1.zip_code) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code\n```"}]}, {"id": "train-5203", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the types of postal points in Saint Croix, what percentage of postal points is the post office?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.type = 'Post Office' THEN T1.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(T1.zip_code) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'SAINT CROIX'\n```"}]}, {"id": "train-5204", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the area code 787, list the country of the cities with a postal point type of unique postal office."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.county FROM area_code AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code INNER JOIN zip_data AS T3 ON T1.zip_code = T3.zip_code WHERE T1.area_code = '787' AND T3.type = 'Unique Post Office'\n```"}]}, {"id": "train-5205", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the elevation of the city with the alias East Longmeadow?"}, {"from": "gpt", "value": "```sql\nSELECT T2.elevation FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'East Longmeadow'\n```"}]}, {"id": "train-5206", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In cities that do not implement daylight savings, what is the total number of cities?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.area_code) FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.daylight_savings = 'No'\n```"}]}, {"id": "train-5207", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the country and area code of the city with zip code 1116."}, {"from": "gpt", "value": "```sql\nSELECT T2.county, T1.area_code FROM area_code AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T1.zip_code = 1116\n```"}]}, {"id": "train-5208", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cities with alias St Thomas, provide the type of postal point for each city."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.type FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'St Thomas'\n```"}]}, {"id": "train-5209", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the names of the cities belonging to Noble, Oklahoma."}, {"from": "gpt", "value": "```sql\nSELECT T3.city FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state INNER JOIN zip_data AS T3 ON T2.zip_code = T3.zip_code WHERE T1.name = 'Oklahoma' AND T2.county = 'NOBLE'\n```"}]}, {"id": "train-5210", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the listed cities, provide the area code of the city with the largest water area."}, {"from": "gpt", "value": "```sql\nSELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.water_area = ( SELECT MAX(water_area) FROM zip_data )\n```"}]}, {"id": "train-5211", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the alias of the city with the highest population in year 2020."}, {"from": "gpt", "value": "```sql\nSELECT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2020 = ( SELECT MAX(population_2020) FROM zip_data )\n```"}]}, {"id": "train-5212", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the elevation of the city belonging to Hampden, Massachusetts?"}, {"from": "gpt", "value": "```sql\nSELECT T3.elevation FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state INNER JOIN zip_data AS T3 ON T2.zip_code = T3.zip_code WHERE T1.name = 'Massachusetts' AND T2.county = 'HAMPDEN' GROUP BY T3.elevation\n```"}]}, {"id": "train-5213", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the area code of the city with the highest Hispanic population."}, {"from": "gpt", "value": "```sql\nSELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.hispanic_population = ( SELECT MAX(hispanic_population) FROM zip_data )\n```"}]}, {"id": "train-5214", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the alias of the cities with an Asian population of 7."}, {"from": "gpt", "value": "```sql\nSELECT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.asian_population = 7\n```"}]}, {"id": "train-5215", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average of the white population in the cities with area code 920?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.white_population) FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 920\n```"}]}, {"id": "train-5216", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cities with alias Ponce, what is the percentage of cities with a country level FIPS code of less than 20?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.county_fips < 20 THEN T2.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(T2.zip_code) FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'Ponce'\n```"}]}, {"id": "train-5217", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the country of the cities with a population greater than 97% of the average population of all countries in 2020."}, {"from": "gpt", "value": "```sql\nSELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2020 > 0.97 * ( SELECT AVG(population_2020) FROM zip_data )\n```"}]}, {"id": "train-5218", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the number of postal points in the district represented by Kirkpatrick Ann."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.zip_code) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.first_name = 'Kirkpatrick' AND T1.last_name = 'Ann'\n```"}]}, {"id": "train-5219", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the zip codes and coordinates of the postal points under Allentown-Bethlehem-Easton, PA-NJ."}, {"from": "gpt", "value": "```sql\nSELECT T2.zip_code, T2.latitude, T2.longitude FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Allentown-Bethlehem-Easton, PA-NJ'\n```"}]}, {"id": "train-5220", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the zip codes, cities, and locations of the postal points that have Shared Reshipper as a bad alias."}, {"from": "gpt", "value": "```sql\nSELECT T1.zip_code, T2.city, T2.latitude, T2.longitude FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.bad_alias = 'Shared Reshipper'\n```"}]}, {"id": "train-5221", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the congress representatives of the postal points in Garfield?"}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T1.city = 'Garfield'\n```"}]}, {"id": "train-5222", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the number of postal points under New York-Newark-Jersey City, NY-NJ-PA."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.zip_code) FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'New York-Newark-Jersey City, NY-NJ-PA'\n```"}]}, {"id": "train-5223", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many postal points are there under the congress representative in Puerto Rico?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.zip_code) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state = 'Puerto Rico'\n```"}]}, {"id": "train-5224", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the number of postal points and the countries in West Virginia."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.zip_code), COUNT(DISTINCT T2.county) FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'West Virginia'\n```"}]}, {"id": "train-5225", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the zip codes and area codes of the postal points with the community post office type at the elevation above 6000."}, {"from": "gpt", "value": "```sql\nSELECT T1.zip_code, T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.type = 'Community Post Office ' AND T2.elevation > 6000\n```"}]}, {"id": "train-5226", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many postal points are there under the congress representative from the House of Representatives in Mississippi?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.zip_code) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state = 'Mississippi'\n```"}]}, {"id": "train-5227", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the congress representatives' IDs of the postal points in East Springfield."}, {"from": "gpt", "value": "```sql\nSELECT T2.district FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code WHERE T1.city = 'East Springfield'\n```"}]}, {"id": "train-5228", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the CBSA officer of the post point in the area with the highest number of employees?"}, {"from": "gpt", "value": "```sql\nSELECT T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T2.employees = ( SELECT MAX(employees) FROM zip_data )\n```"}]}, {"id": "train-5229", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many postal points with unique post office types are there in Ohio?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.zip_code) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Ohio' AND T2.type = 'Unique Post Office'\n```"}]}, {"id": "train-5230", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of beneficiaries per postal point in Guam."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.total_beneficiaries) AS REAL) / COUNT(T2.zip_code) FROM state AS T1 INNER JOIN zip_data AS T2 ON T1.abbreviation = T2.state WHERE T1.name = 'Guam'\n```"}]}, {"id": "train-5231", "db_id": "address", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of congress representatives from the Democrat party. Among them, how many postal points are in the Hawaii state?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.party = 'Democrat' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*), SUM(CASE WHEN T1.state = 'Hawaii' THEN 1 ELSE 0 END) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district\n```"}]}, {"id": "train-5232", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the root beer brand that has the longest history?"}, {"from": "gpt", "value": "```sql\nSELECT BrandName FROM rootbeerbrand WHERE FirstBrewedYear = ( SELECT MIN(FirstBrewedYear) FROM rootbeerbrand )\n```"}]}, {"id": "train-5233", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many breweries are located in North America?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BrandID) FROM rootbeerbrand WHERE Country = 'United States'\n```"}]}, {"id": "train-5234", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the root beer brands that are advertised on facebook."}, {"from": "gpt", "value": "```sql\nSELECT BrandName FROM rootbeerbrand WHERE FacebookPage IS NOT NULL\n```"}]}, {"id": "train-5235", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the root beer brand with the lowest unit profit available to wholesalers?"}, {"from": "gpt", "value": "```sql\nSELECT BrandName FROM rootbeerbrand ORDER BY CurrentRetailPrice - WholesaleCost LIMIT 1\n```"}]}, {"id": "train-5236", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description of the root beer brand A&W?"}, {"from": "gpt", "value": "```sql\nSELECT Description FROM rootbeerbrand WHERE BrandName = 'A&W'\n```"}]}, {"id": "train-5237", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city is the brewery AJ Stephans Beverages located?"}, {"from": "gpt", "value": "```sql\nSELECT City FROM rootbeerbrand WHERE BreweryName = 'AJ Stephans Beverages'\n```"}]}, {"id": "train-5238", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many transactions had Frank-Paul Santangelo made in July, 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Frank-Paul' AND T1.Last = 'Santangelo' AND STRFTIME('%Y-%m', T2.TransactionDate) = '2014-07'\n```"}]}, {"id": "train-5239", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the transactions made in July, 2014, how many of them were made by a male customer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Gender = 'M' AND STRFTIME('%Y-%m', T2.TransactionDate) = '2014-07'\n```"}]}, {"id": "train-5240", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the users that permit the company to send regular emails to them, how many of them had made a transaction with a Visa card in July, 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.SubscribedToEmailList = 'TRUE' AND T2.CreditCardType = 'Visa' AND STRFTIME('%Y-%m', T2.TransactionDate) = '2014-07'\n```"}]}, {"id": "train-5241", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the customer that had made the most transactions in August, 2014?"}, {"from": "gpt", "value": "```sql\nSELECT T1.First, T1.Last FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y-%m', T2.TransactionDate) = '2014-08' GROUP BY T1.CustomerID ORDER BY COUNT(T2.CustomerID) DESC LIMIT 1\n```"}]}, {"id": "train-5242", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the brands of all the root beer that Frank-Paul Santangelo had purchased on 2014/7/7."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.BrandName FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T1.First = 'Frank-Paul' AND T1.Last = 'Santangelo' AND T2.TransactionDate = '2014-07-07'\n```"}]}, {"id": "train-5243", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the 4 root beers that Frank-Paul Santangelo purchased on 2014/7/7, how many of them were in cans?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID WHERE T1.First = 'Frank-Paul' AND T1.Last = 'Santangelo' AND T2.TransactionDate = '2014-07-07' AND T3.ContainerType = 'Can'\n```"}]}, {"id": "train-5244", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many root beers of the Bulldog were purchased in August, 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BrandID) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T2.TransactionDate LIKE '2014-08%' AND T3.BrandName = 'Bulldog'\n```"}]}, {"id": "train-5245", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of the customers who have purchased at least one root beer produced by AJ Stephans Beverages."}, {"from": "gpt", "value": "```sql\nSELECT T1.First, T1.Last FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T4.BreweryName = 'AJ Stephans Beverages'\n```"}]}, {"id": "train-5246", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the root beer brands that do not advertise on Twitter, how many of them have root beers sold in August, 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BrandID) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T2.TransactionDate LIKE '2014-08%' AND T3.Twitter IS NULL\n```"}]}, {"id": "train-5247", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of the credit card that Frank-Paul Santangelo used to purchase root beers on 2014/7/7?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.CreditCardNumber FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Frank-Paul' AND T1.Last = 'Santangelo' AND T2.TransactionDate = '2014-07-07'\n```"}]}, {"id": "train-5248", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the root beers purchased by Frank-Paul Santangelo, how many of them were non-sweetened?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T1.First = 'Frank-Paul' AND T1.Last = 'Santangelo' AND T4.ArtificialSweetener = 'FALSE' AND T4.Honey = 'FALSE'\n```"}]}, {"id": "train-5249", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the dates on which a male customer has purchased more than 3 root beers."}, {"from": "gpt", "value": "```sql\nSELECT T2.TransactionDate FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Gender = 'M' GROUP BY T2.TransactionDate HAVING COUNT(T2.CustomerID) > 3\n```"}]}, {"id": "train-5250", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of root beers of the brand A&W sold in a day in August, 2014?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.BrandID) AS REAL) / 31 FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T2.TransactionDate LIKE '2014-08%' AND T3.BrandName = 'A&W'\n```"}]}, {"id": "train-5251", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the root beers sold in 2014, what is the percentage of the root beers produced by the brewery AJ Stephans Beverages?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.BreweryName = 'AJ Stephans Beverages' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.BrandID) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T2.TransactionDate LIKE '2014%'\n```"}]}, {"id": "train-5252", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of reviews given by James House."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.CustomerID) FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'James' AND T1.Last = 'House'\n```"}]}, {"id": "train-5253", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the credit card number of Lisa Ling."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.CreditCardNumber FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Lisa' AND T1.Last = 'Ling'\n```"}]}, {"id": "train-5254", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the coordinate of Sac State American River Courtyard."}, {"from": "gpt", "value": "```sql\nSELECT T2.Latitude, T2.Longitude FROM location AS T1 INNER JOIN geolocation AS T2 ON T1.LocationID = T2.LocationID WHERE T1.LocationName = 'Sac State American River Courtyard'\n```"}]}, {"id": "train-5255", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of the location where transaction no.100885 happened."}, {"from": "gpt", "value": "```sql\nSELECT T2.LocationName FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.TransactionID = 100885\n```"}]}, {"id": "train-5256", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city does the customer who finished transaction no.103545 live in?"}, {"from": "gpt", "value": "```sql\nSELECT T1.City FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.TransactionID = 103545\n```"}]}, {"id": "train-5257", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the phone number of the customer who owns the credit card of number 6011179359005380?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.PhoneNumber FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.CreditCardNumber = 6011179359005382\n```"}]}, {"id": "train-5258", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which customer has the most reviews? State the full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.First, T1.Last FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID GROUP BY T1.CustomerID ORDER BY COUNT(T2.CustomerID) DESC LIMIT 1\n```"}]}, {"id": "train-5259", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the customer who leaves the review content of \"Tastes like Australia.\", when was his/her first purchase date?"}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstPurchaseDate FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Review = 'Tastes like Australia.'\n```"}]}, {"id": "train-5260", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Natalie Dorris buy her first root beer?"}, {"from": "gpt", "value": "```sql\nSELECT T2.TransactionDate FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Natalie' AND T1.Last = 'Dorris' ORDER BY T2.TransactionDate LIMIT 1\n```"}]}, {"id": "train-5261", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the root beer brand with the most 5 star ratings, what is the name of the brewery?"}, {"from": "gpt", "value": "```sql\nSELECT T1.BreweryName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.StarRating = 5 GROUP BY T1.BrandID ORDER BY COUNT(T2.StarRating) DESC LIMIT 1\n```"}]}, {"id": "train-5262", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the customer who gave a 3 star rating to Frostie brand on 2014/4/24, did the user permit the company to send regular emails to him/her?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T1.SubscribedToEmailList LIKE 'TRUE' THEN 'YES' ELSE 'NO' END AS result FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T2.StarRating = 3 AND T3.BrandName = 'Frostie' AND T2.ReviewDate = '2014-04-24'\n```"}]}, {"id": "train-5263", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the root beer brand which got the review with the content of \"The quintessential dessert root beer. No ice cream required.\", what is the current retail price of the root beer?"}, {"from": "gpt", "value": "```sql\nSELECT T1.CurrentRetailPrice - T1.WholesaleCost AS price FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.Review = 'The quintessential dessert root beer. No ice cream required.'\n```"}]}, {"id": "train-5264", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of 5 star ratings River City brand root beer get?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.StarRating = 5 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.StarRating) FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BrandName = 'River City'\n```"}]}, {"id": "train-5265", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of reviews of all the root beer brands from \"CA\" State?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(*) AS REAL) / COUNT(DISTINCT T1.BrandID) AS avgreview FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.State = 'CA'\n```"}]}, {"id": "train-5266", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female customers permit the company to send regular emails to them?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CustomerID) FROM customers WHERE Gender = 'F' AND SubscribedToEmailList = 'TRUE'\n```"}]}, {"id": "train-5267", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the brand of the beer with the shortest brewed history?"}, {"from": "gpt", "value": "```sql\nSELECT BrandName FROM rootbeerbrand ORDER BY FirstBrewedYear DESC LIMIT 1\n```"}]}, {"id": "train-5268", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the full names of the first top 10 customers?"}, {"from": "gpt", "value": "```sql\nSELECT First, Last FROM customers ORDER BY FirstPurchaseDate LIMIT 10\n```"}]}, {"id": "train-5269", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many breweries are there in Australia?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BreweryName) FROM rootbeerbrand WHERE Country = 'Australia'\n```"}]}, {"id": "train-5270", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are named Charles in Sacramento?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CustomerID) FROM customers WHERE First = 'Charles' AND City = 'Sacramento'\n```"}]}, {"id": "train-5271", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many transactions were paid through MasterCard in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(TransactionID) FROM `transaction` WHERE CreditCardType = 'MasterCard' AND TransactionDate LIKE '2014%'\n```"}]}, {"id": "train-5272", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which brand of root beer did Jayne Collins give the lowest rating?"}, {"from": "gpt", "value": "```sql\nSELECT T3.BrandName FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T1.First = 'Jayne' AND T1.Last = 'Collins' AND T2.StarRating = 1\n```"}]}, {"id": "train-5273", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sweet bottled root beers that do not contain cane sugar were purchased in 2015 through the selling company located in Sac State American River Courtyard?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BrandID) FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID INNER JOIN location AS T3 ON T1.LocationID = T3.LocationID WHERE T3.LocationName = 'Sac State American River Courtyard' AND T1.PurchaseDate LIKE '2015%' AND T2.Honey = 'TRUE' AND T2.CaneSugar = 'FALSE' AND T1.ContainerType = 'Bottle'\n```"}]}, {"id": "train-5274", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which brewery does the most purchased root beer in 2016 belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T2.BreweryName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T1.PurchaseDate BETWEEN '2016-01-01' AND '2016-12-31' GROUP BY T2.BrandID ORDER BY COUNT(T1.BrandID) DESC LIMIT 1\n```"}]}, {"id": "train-5275", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the full names of the customer who gave River City a 5-star?"}, {"from": "gpt", "value": "```sql\nSELECT T1.First, T1.Last FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T3.BrandName = 'River City' AND T2.StarRating = 5\n```"}]}, {"id": "train-5276", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many root beers did Tom Hanks purchase between 2015 to 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.RootBeerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Tom' AND T1.Last = 'Hanks' AND T2.TransactionDate BETWEEN '2015-01-01' AND '2016-12-31'\n```"}]}, {"id": "train-5277", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which brand of root beer was highly rated by customers?"}, {"from": "gpt", "value": "```sql\nSELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.StarRating = 5\n```"}]}, {"id": "train-5278", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Henry Weinhard's were bought by Nicholas Sparks?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T1.First = 'Nicholas' AND T1.Last = 'Sparks' AND T4.BrandName LIKE 'Henry Weinhard%s'\n```"}]}, {"id": "train-5279", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the root beer brands that do not advertise on Facebook and Twitter, which brand has the highest number of purchases?"}, {"from": "gpt", "value": "```sql\nSELECT T2.BreweryName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T2.FacebookPage IS NULL AND T2.Twitter IS NULL GROUP BY T2.BrandID ORDER BY COUNT(T1.BrandID) DESC LIMIT 1\n```"}]}, {"id": "train-5280", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between Sac State Union and Sac State American River Courtyard, which location sold the most Dog n Suds root beer?"}, {"from": "gpt", "value": "```sql\nSELECT T3.LocationName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID INNER JOIN location AS T3 ON T1.LocationID = T3.LocationID WHERE T2.BrandName = 'Dog n Suds' AND T3.LocationName IN ('Sac State American River Courtyard', 'Sac State Union') GROUP BY T1.LocationID ORDER BY COUNT(T1.BrandID) DESC LIMIT 1\n```"}]}, {"id": "train-5281", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many canned A&W were purchased in 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BrandID) FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T1.ContainerType = 'Can' AND T2.BrandName = 'A&W' AND T1.PurchaseDate LIKE '2016%'\n```"}]}, {"id": "train-5282", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the precise location of Sac State Union?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Latitude, T2.Longitude FROM location AS T1 INNER JOIN geolocation AS T2 ON T1.LocationID = T2.LocationID WHERE T1.LocationName = 'Sac State Union'\n```"}]}, {"id": "train-5283", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the brands of the root beers that received 5-star ratings from no less than 5 customers?"}, {"from": "gpt", "value": "```sql\nSELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.StarRating = 5 GROUP BY T2.BrandID HAVING COUNT(T2.StarRating) >= 5\n```"}]}, {"id": "train-5284", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the brands of root beer produced by Dr Pepper Snapple Group and calculate their percentage of purchases between 2014 to 2016."}, {"from": "gpt", "value": "```sql\nSELECT T1.BrandName , CAST(SUM(CASE WHEN T2.PurchaseDate >= '2014-01-01' AND T2.PurchaseDate <= '2016-12-31' THEN 1 ELSE 0 END) AS REAL) / COUNT(T2.BrandID) AS purchase FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BreweryName = 'Dr Pepper Snapple Group' GROUP BY T2.BrandID\n```"}]}, {"id": "train-5285", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which brand of root beer has the lowest unit profit available to wholesalers? Indicate the ID of the customer that has the highest number of purchases of the said brand."}, {"from": "gpt", "value": "```sql\nSELECT T3.BrandName, T2.CustomerID FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID GROUP BY T3.BrandID ORDER BY T3.CurrentRetailPrice - T3.WholesaleCost, COUNT(T1.BrandID) DESC LIMIT 1\n```"}]}, {"id": "train-5286", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name and phone number of male customers from Fair Oaks who are subscribed to the email list."}, {"from": "gpt", "value": "```sql\nSELECT First, Last, PhoneNumber FROM customers WHERE Gender = 'M' AND City = 'Fair Oaks' AND SubscribedToEmailList = 'TRUE'\n```"}]}, {"id": "train-5287", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the root beer purchased in 2014, what percentage were sold in cans?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN ContainerType = 'Can' THEN RootBeerID ELSE NULL END) AS REAL) * 100 / COUNT(RootBeerID) FROM rootbeer WHERE PurchaseDate LIKE '2014%'\n```"}]}, {"id": "train-5288", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the brands that brewed their first drink between 1996 and 2000 in the descending order of the date brewed."}, {"from": "gpt", "value": "```sql\nSELECT BrandName FROM rootbeerbrand WHERE FirstBrewedYear BETWEEN '1996' AND '2000' ORDER BY FirstBrewedYear DESC\n```"}]}, {"id": "train-5289", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the brand Id of the root beer which has the most number of customers who gave 1-star ratings."}, {"from": "gpt", "value": "```sql\nSELECT BrandID FROM rootbeerreview WHERE StarRating = 1 GROUP BY BrandID ORDER BY COUNT(BrandID) DESC LIMIT 1\n```"}]}, {"id": "train-5290", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the transactions, what percentage is done by using a visa card?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN CreditCardType = 'Visa' THEN TransactionID ELSE NULL END) AS REAL) * 100 / COUNT(TransactionID) FROM `transaction`\n```"}]}, {"id": "train-5291", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many brands of root beers are available in cans and contain corn syrup and artificial sweeteners?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BrandID) FROM rootbeerbrand WHERE CornSyrup = 'TRUE' AND ArtificialSweetener = 'TRUE' AND AvailableInCans = 'TRUE'\n```"}]}, {"id": "train-5292", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of sales done at Sac State American River Courtyard."}, {"from": "gpt", "value": "```sql\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```"}]}, {"id": "train-5293", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On average how many caffeinated root beers are sold a day?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.RootBeerID) AS REAL) / COUNT(DISTINCT T2.PurchaseDate) FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID INNER JOIN `transaction` AS T3 ON T2.RootBeerID = T3.RootBeerID WHERE T1.Caffeinated = 'TRUE'\n```"}]}, {"id": "train-5294", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the root beer with the most and least amount of profit per unit and list the container types in which these root beers are sold."}, {"from": "gpt", "value": "```sql\nSELECT * FROM ( SELECT T1.BrandName, T2.ContainerType FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID ORDER BY T1.CurrentRetailPrice - T1.WholesaleCost DESC LIMIT 1 ) UNION ALL SELECT * FROM ( SELECT T3.BrandName, T4.ContainerType FROM rootbeerbrand AS T3 INNER JOIN rootbeer AS T4 ON T3.BrandID = T4.BrandID ORDER BY T3.CurrentRetailPrice - T3.WholesaleCost ASC LIMIT 1 )\n```"}]}, {"id": "train-5295", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average cost of root beers purchased for more than 2 dollars and sold in bottles?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.PurchasePrice) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T1.ContainerType = 'Bottle' AND T2.PurchasePrice > 2\n```"}]}, {"id": "train-5296", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the root beers sold in bottles, how many are sold at the location 38.559615, -121.42243?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T4.BrandID) FROM `transaction` AS T1 INNER JOIN geolocation AS T2 ON T1.LocationID = T2.LocationID INNER JOIN location AS T3 ON T1.LocationID = T3.LocationID INNER JOIN rootbeer AS T4 ON T1.RootBeerID = T4.RootBeerID WHERE T2.Latitude = 38.559615 AND T2.Longitude = -121.42243 AND T4.ContainerType = 'Bottle'\n```"}]}, {"id": "train-5297", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers not subscribed to the mailing list, what percentage has given three or more stars in a review?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.StarRating > 3 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.CustomerID) FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.SubscribedToEmailList = 'FALSE'\n```"}]}, {"id": "train-5298", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which root beer got the most five stars in 2012? Give the brand name of this beer."}, {"from": "gpt", "value": "```sql\nSELECT T3.BrandName FROM rootbeer AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T2.StarRating = 5 AND strftime('%Y', T2.ReviewDate) = '2012' GROUP BY T1.BrandID ORDER BY COUNT(T2.BrandID) DESC LIMIT 1\n```"}]}, {"id": "train-5299", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the female customers, how many bought root beer that contains artificial sweetener?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T1.Gender = 'F' AND T4.ArtificialSweetener = 'TRUE'\n```"}]}, {"id": "train-5300", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference between the number of root beers sold that use cane sugar and corn syrup."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T3.CaneSugar = 'TRUE' THEN T1.BrandID ELSE NULL END) - COUNT(CASE WHEN T3.CornSyrup = 'TRUE' THEN T1.BrandID ELSE NULL END) AS DIFFERENCE FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID\n```"}]}, {"id": "train-5301", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which brewery brewed the most sold root beer in 2015?"}, {"from": "gpt", "value": "```sql\nSELECT T3.BreweryName FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T2.TransactionDate LIKE '2015%' GROUP BY T3.BrandID ORDER BY COUNT(T1.BrandID) DESC LIMIT 1\n```"}]}, {"id": "train-5302", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the male customers in Sacramento, what percentage bought Dominion root beer in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T4.BrandName = 'Dominion' THEN T1.CustomerID ELSE NULL END) AS REAL) * 100 / COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeer AS T3 ON T2.RootBeerID = T3.RootBeerID INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T1.City = 'Sacramento' AND T1.Gender = 'M' AND T2.TransactionDate LIKE '2014%'\n```"}]}, {"id": "train-5303", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in the average number of sales per day of root beer brands that contain honey and that don\u2019t contain honey."}, {"from": "gpt", "value": "```sql\nSELECT (CAST(SUM(CASE WHEN T1.Honey = 'TRUE' THEN 1 ELSE 0 END) AS REAL) / COUNT(DISTINCT T3.TransactionDate)) - (CAST(SUM(CASE WHEN T1.Honey <> 'TRUE' THEN 1 ELSE 0 END) AS REAL) / COUNT(DISTINCT T3.TransactionDate)) FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID INNER JOIN `transaction` AS T3 ON T2.RootBeerID = T3.RootBeerID\n```"}]}, {"id": "train-5304", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find and list the full name and email of the customers who used American Express cards in Sac State Union."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.First, T1.Last, T1.Email FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN location AS T3 ON T2.LocationID = T3.LocationID WHERE T3.LocationName = 'Sac State Union' AND T2.CreditCardType = 'American Express'\n```"}]}, {"id": "train-5305", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the reviews of September 2014. Which brand of beers obtained the highest star ratings?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.StarRating = 5 AND T2.ReviewDate BETWEEN '2014-09-01' AND '2014-09-30'\n```"}]}, {"id": "train-5306", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the precise location of all paying customers with American Express?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Latitude, T2.Longitude FROM `transaction` AS T1 INNER JOIN geolocation AS T2 ON T1.LocationID = T2.LocationID WHERE T1.CreditCardType = 'American Express'\n```"}]}, {"id": "train-5307", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Folsom customers prefer to pay with Visa?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.City = 'Folsom' AND T2.CreditCardType = 'Visa'\n```"}]}, {"id": "train-5308", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From which cities are the customers who gave 5 stars in their reviews in November 2012?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.City FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.StarRating = 5 AND T2.ReviewDate BETWEEN '2012-11-01' AND '2012-11-30'\n```"}]}, {"id": "train-5309", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What brands of beer has Peg Winchester consumed?"}, {"from": "gpt", "value": "```sql\nSELECT T3.BrandName FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T1.First = 'Peg' AND T1.Last = 'Winchester'\n```"}]}, {"id": "train-5310", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What brand of beer has been the worst rated most times?"}, {"from": "gpt", "value": "```sql\nSELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T2.BrandID = T1.BrandID WHERE T2.StarRating = 1 GROUP BY T1.BrandName ORDER BY COUNT(T1.BrandName) DESC LIMIT 1\n```"}]}, {"id": "train-5311", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What credit card is the most used in the purchase of non-alcoholic beer?"}, {"from": "gpt", "value": "```sql\nSELECT T2.CreditCardType FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID WHERE T3.Alcoholic = 'FALSE' GROUP BY T2.CreditCardType ORDER BY COUNT(T2.CreditCardType) DESC LIMIT 1\n```"}]}, {"id": "train-5312", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of all the customers who have ever given a 5-star review?"}, {"from": "gpt", "value": "```sql\nSELECT T1.First, T1.Last FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.StarRating = 5\n```"}]}, {"id": "train-5313", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: At what latitude is the Thomas Kemper brand beer consumed the most?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Latitude FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID INNER JOIN geolocation AS T3 ON T1.LocationID = T3.LocationID WHERE T2.BrandName = 'Thomas Kemper' GROUP BY T3.Latitude ORDER BY COUNT(T1.BrandID) DESC LIMIT 1\n```"}]}, {"id": "train-5314", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What star rating is the most common for beers containing corn syrup?"}, {"from": "gpt", "value": "```sql\nSELECT T2.StarRating FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.CornSyrup = 'TRUE' GROUP BY T2.StarRating ORDER BY COUNT(T2.StarRating) DESC LIMIT 1\n```"}]}, {"id": "train-5315", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the precise location of zip code 95819?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Latitude, T2.Longitude FROM location AS T1 INNER JOIN geolocation AS T2 ON T1.LocationID = T2.LocationID WHERE T1.ZipCode = 95819\n```"}]}, {"id": "train-5316", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What brands of beers are manufactured at coordinates 38,566,129, -121,426,432?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.BrandName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID INNER JOIN geolocation AS T3 ON T1.LocationID = T3.LocationID WHERE T3.Latitude = '38.566129' AND T3.Longitude = '-121.426432'\n```"}]}, {"id": "train-5317", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average unit profit for wholesalers of canned beers?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.CurrentRetailPrice - T2.WholesaleCost) FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T1.ContainerType = 'Can'\n```"}]}, {"id": "train-5318", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of customers who paid with a Discover Credit Card gave a 3-star rating?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.StarRating = 3 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.CustomerID) FROM rootbeerreview AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.CreditCardType = 'Discover'\n```"}]}, {"id": "train-5319", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the brand IDs of the beers whose star rating is more than 3."}, {"from": "gpt", "value": "```sql\nSELECT BrandID FROM rootbeerreview WHERE StarRating > 3\n```"}]}, {"id": "train-5320", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many brands of bottle root beer were purchased between 4/3/2015 and 10/26/2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BrandID) FROM rootbeer WHERE ContainerType = 'Bottle' AND PurchaseDate BETWEEN '2015-04-03' AND '2015-10-26'\n```"}]}, {"id": "train-5321", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the customer who gave a 5-star rating and commented \"The quintessential dessert root beer. No ice cream required\" on his review?"}, {"from": "gpt", "value": "```sql\nSELECT T1.First, T1.Last FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.StarRating = 5 AND T2.Review = 'The quintessential dessert root beer. No ice cream required.'\n```"}]}, {"id": "train-5322", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tally the email addresses and phone numbers of customers from Sacramento who gave a star rating of more than 3 in 2014."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Email, T1.PhoneNumber FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.StarRating > 3 AND T1.City = 'Sacramento' AND T2.ReviewDate BETWEEN '2014-01-01' AND '2014-12-31'\n```"}]}, {"id": "train-5323", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female mailing list subscribers from Sacramento gave a 4-star rating between 1/3/2016 and 10/26/2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CustomerID) FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.StarRating = 4 AND T1.City = 'Sacramento' AND T1.Gender = 'F' AND T1.SubscribedToEmailList = 'TRUE' AND T2.ReviewDate BETWEEN '2013-01-03' AND '2013-10-26'\n```"}]}, {"id": "train-5324", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give me the brewery and brand names of canned root beer that were purchased before 6/6/2015."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.BreweryName, T2.BrandName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T1.PurchaseDate < '2015-06-06' AND T1.ContainerType = 'Can'\n```"}]}, {"id": "train-5325", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the brand names of bottled root beer whose first brewing year is no later than 1930."}, {"from": "gpt", "value": "```sql\nSELECT T2.BrandName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T2.FirstBrewedYear < '1930-01-01' AND T1.ContainerType = 'Bottle' ORDER BY T2.FirstBrewedYear LIMIT 1\n```"}]}, {"id": "train-5326", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did Anna Himes use her Mastercard when paying between 12/25/2014 and 5/20/2016 ?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.CustomerID) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Anna' AND T1.Last = 'Himes' AND T2.CreditCardType = 'MasterCard' AND T2.TransactionDate BETWEEN '2014-12-25' AND '2016-05-20'\n```"}]}, {"id": "train-5327", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average star rating given by female customers to brand ID 10018 from 1/25/2015 to 3/10/2015?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.StarRating) FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.BrandID = 10018 AND T1.Gender = 'F' AND T2.ReviewDate BETWEEN '2013-01-25' AND '2015-03-10'\n```"}]}, {"id": "train-5328", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the brand name of the root beer that gained a 1-star rating from customer ID 331115 while saying, \"Yuk, more like licorice soda\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.CustomerID = 331115 AND T2.Review = 'Yuk, more like licorice soda.' AND T2.StarRating = 1\n```"}]}, {"id": "train-5329", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total purchases made by customers using their Visa credit cards in the Sac State American River Courtyard between 6/3/2014 and 11/27/2015."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.PurchasePrice) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.LocationName = 'Sac State American River Courtyard' AND T1.CreditCardType = 'Visa' AND T1.TransactionDate BETWEEN '2014-06-03' AND '2015-11-27'\n```"}]}, {"id": "train-5330", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many transactions were made in Sac State Union using the American Express credit card in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.LocationName = 'Sac State Union' AND T1.CreditCardType = 'American Express' AND T1.TransactionDate BETWEEN '2014-01-01' AND '2014-12-31'\n```"}]}, {"id": "train-5331", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the precise coordinate of Sac State Union?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Latitude, T2.Longitude FROM location AS T1 INNER JOIN geolocation AS T2 ON T1.LocationID = T2.LocationID WHERE T1.LocationName = 'Sac State Union'\n```"}]}, {"id": "train-5332", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What did the customer say in his or her review of Bulldog root beer on 7/26/2013?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Review FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.BrandName = 'Bulldog' AND T2.ReviewDate = '2013-07-26'\n```"}]}, {"id": "train-5333", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the brand names of root beer that gained a 5-star rating from a customer's review in 2013. Calculate the unit profit available to wholesalers for each brand."}, {"from": "gpt", "value": "```sql\nSELECT T1.BrandName, T1.CurrentRetailPrice - T1.WholesaleCost AS result FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.StarRating = 5 AND T2.ReviewDate BETWEEN '2013-01-01' AND '2013-12-31'\n```"}]}, {"id": "train-5334", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give me the full name of the first customer, and tell me how long ago he or she wrote his or her first review since making his or her first purchase."}, {"from": "gpt", "value": "```sql\nSELECT T1.First, T1.Last , strftime('%J', ReviewDate) - strftime('%J', FirstPurchaseDate) AS TIMEAGO FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID LIMIT 1\n```"}]}, {"id": "train-5335", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the credit card type used by Kenneth Walton?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.CreditCardType FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Kenneth' AND T1.Last = 'Walton'\n```"}]}, {"id": "train-5336", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the container type, brand name and star rating for root beer ID 10054?"}, {"from": "gpt", "value": "```sql\nSELECT T4.ContainerType, T3.BrandName, T1.StarRating FROM rootbeerreview AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID INNER JOIN rootbeer AS T4 ON T2.RootBeerID = T4.RootBeerID WHERE T2.RootBeerID = 100054\n```"}]}, {"id": "train-5337", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the root beers bought by Tim Ocel and Dawn Childress."}, {"from": "gpt", "value": "```sql\nSELECT T2.RootBeerID FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T2.CustomerID = T1.CustomerID WHERE (T1.First = 'Tim' AND T1.Last = 'Ocel') OR (T1.First = 'Dawn' AND T1.Last = 'Childress')\n```"}]}, {"id": "train-5338", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the root beer ID for the brand Bulldog, Bundaberg, Dad's, Dog n Suds and Virgil's."}, {"from": "gpt", "value": "```sql\nSELECT T1.RootBeerID FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T2.BrandID = T1.BrandID WHERE T2.BrandName IN ('Bulldog', 'Bundaberg', 'Dad''s', 'Dog n Suds', 'Virgil''s')\n```"}]}, {"id": "train-5339", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many bottles of beer have been bought by Jim Breech?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.ContainerType) FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T2.CustomerID = T1.CustomerID INNER JOIN rootbeer AS T3 ON T3.RootBeerID = T2.RootBeerID WHERE T3.ContainerType = 'Bottle' AND T1.First = 'Jim' AND T1.Last = 'Breech'\n```"}]}, {"id": "train-5340", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many transactions have been made to purchase a root beer brand from California?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.RootBeerID) FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID INNER JOIN `transaction` AS T3 ON T2.RootBeerID = T3.RootBeerID WHERE T1.State = 'CA'\n```"}]}, {"id": "train-5341", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average review given by a subscriber?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.StarRating) FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.SubscribedToEmailList = 'TRUE'\n```"}]}, {"id": "train-5342", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the amount difference between the bottles of root beer sold from Louisiana and Missouri?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT COUNT(T1.BrandID) FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T2.State = 'LA' AND T1.ContainerType = 'Bottle' ) - ( SELECT COUNT(T3.BrandID) FROM rootbeer AS T3 INNER JOIN rootbeerbrand AS T4 ON T3.BrandID = T4.BrandID WHERE T4.State = 'MO' AND T3.ContainerType = 'Bottle' ) AS DIFFERENCE\n```"}]}, {"id": "train-5343", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the transaction ratio being made at Sac State American River Courtyard and Sac State Union?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.LocationName = 'Sac State American River Courtyard' THEN T1.TransactionID ELSE NULL END) AS REAL) * 100 / COUNT(CASE WHEN T2.LocationName = 'Sac State Union' THEN T1.TransactionID ELSE NULL END) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID\n```"}]}, {"id": "train-5344", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the name of the top 10 spenders and what credit card type are they using."}, {"from": "gpt", "value": "```sql\nSELECT T1.First, T1.Last, T2.CreditCardType FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID GROUP BY T1.CustomerID ORDER BY SUM(T2.PurchasePrice) DESC LIMIT 10\n```"}]}, {"id": "train-5345", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out root beer brand that is not caffeinated and not containing cane sugar. What is the total amount sold for this products?"}, {"from": "gpt", "value": "```sql\nSELECT T1.BrandName, SUM(T3.PurchasePrice) FROM rootbeerbrand AS T1 INNER JOIN rootbeer AS T2 ON T1.BrandID = T2.BrandID INNER JOIN `transaction` AS T3 ON T2.RootBeerID = T3.RootBeerID WHERE T1.CaneSugar = 'FALSE' AND T1.Caffeinated = 'FALSE' GROUP BY T1.BrandName\n```"}]}, {"id": "train-5346", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of the root beer brand have the lowest purchase?"}, {"from": "gpt", "value": "```sql\nSELECT T2.BrandName FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID GROUP BY T2.BrandID ORDER BY COUNT(T1.BrandID) LIMIT 1\n```"}]}, {"id": "train-5347", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the best seller root beer brand and what is the average star rating for this root beer?"}, {"from": "gpt", "value": "```sql\nSELECT T1.BrandID, AVG(T1.StarRating) FROM rootbeerreview AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID GROUP BY T3.BrandID ORDER BY COUNT(T1.BrandID) DESC LIMIT 1\n```"}]}, {"id": "train-5348", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage difference of River City sale compare to Frostie?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(CASE WHEN T3.BrandName = 'River City' THEN T2.PurchasePrice ELSE 0 END) - SUM(CASE WHEN T3.BrandName = 'Frostie' THEN T2.PurchasePrice ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T3.BrandName = 'Frostie' THEN T2.PurchasePrice ELSE 0 END) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID INNER JOIN rootbeerbrand AS T3 ON T1.BrandID = T3.BrandID\n```"}]}, {"id": "train-5349", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please name all of the cities in California."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT City FROM customers WHERE State = 'CA'\n```"}]}, {"id": "train-5350", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of female customers who subscribed to the email list?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN Gender = 'F' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(SubscribedToEmailList) FROM customers WHERE SubscribedToEmailList = 'TRUE'\n```"}]}, {"id": "train-5351", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which type of card did Dick Ruthven use to pay for all of his transactions?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.CreditCardType FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.First = 'Dick' AND T1.Last = 'Ruthven'\n```"}]}, {"id": "train-5352", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many transactions were made at Sac State Union?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.LocationName = 'Sac State Union'\n```"}]}, {"id": "train-5353", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stars did Urijah Faber rate for Frostie?"}, {"from": "gpt", "value": "```sql\nSELECT T2.StarRating FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T1.First = 'Urijah' AND T1.Last = 'Faber' AND T3.BrandName = 'Frostie'\n```"}]}, {"id": "train-5354", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which brand has the lowest star rating with a \"Too spicy!\" review?"}, {"from": "gpt", "value": "```sql\nSELECT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T2.BrandID = T1.BrandID WHERE T2.StarRating = 1 AND T2.Review = 'Too Spicy!'\n```"}]}, {"id": "train-5355", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many purchases were made at Sac State American River Courtyard using Master Card?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TransactionID) FROM `transaction` AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T2.LocationName = 'Sac State American River Courtyard' AND T1.CreditCardType = 'MasterCard'\n```"}]}, {"id": "train-5356", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which brand in 2012 has the lowest star rating and contains cane sugar as well as honey?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.CaneSugar = 'TRUE' AND T1.Honey = 'TRUE' AND T2.StarRating = 1 AND T2.ReviewDate LIKE '2012%'\n```"}]}, {"id": "train-5357", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the precise location of the place where Tommy Kono made a purchase in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Latitude, T1.Longitude FROM geolocation AS T1 INNER JOIN `transaction` AS T2 ON T2.LocationID = T1.LocationID INNER JOIN customers AS T3 ON T3.CustomerID = T2.CustomerID WHERE T3.First = 'Tommy' AND T3.Last = 'Kono' AND T2.TransactionDate LIKE '2014%'\n```"}]}, {"id": "train-5358", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the email address of the customer who made a purchase in transaction 100016?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Email FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.TransactionID = '100016'\n```"}]}, {"id": "train-5359", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many transactions were made to purchase a bottle of beer using American Express?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.RootBeerID) FROM rootbeer AS T1 INNER JOIN `transaction` AS T2 ON T1.RootBeerID = T2.RootBeerID WHERE T1.ContainerType = 'Bottle' AND T2.CreditCardType = 'American Express'\n```"}]}, {"id": "train-5360", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which location sold more bottles of beer?"}, {"from": "gpt", "value": "```sql\nSELECT T2.LocationName FROM rootbeer AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.ContainerType = 'Bottle' GROUP BY T2.LocationID ORDER BY COUNT(T1.LocationID) DESC LIMIT 1\n```"}]}, {"id": "train-5361", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please name any three root beer brands that have the highest market evaluation and acceptance."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.BrandName FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T2.StarRating = 5 LIMIT 3\n```"}]}, {"id": "train-5362", "db_id": "beer_factory", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the precise location of the Sac State American River Courtyard?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Latitude, T2.Longitude FROM location AS T1 INNER JOIN geolocation AS T2 ON T1.LocationID = T2.LocationID WHERE T1.LocationName = 'Sac State American River Courtyard'\n```"}]}, {"id": "train-5363", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales ids are there for customer id 80?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(SalesID) FROM Sales WHERE CustomerID = 80\n```"}]}, {"id": "train-5364", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the total quantity for sales from id 1 to 10."}, {"from": "gpt", "value": "```sql\nSELECT SUM(Quantity) FROM Sales WHERE SalesID BETWEEN 1 AND 10\n```"}]}, {"id": "train-5365", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average quantity per sales from sales id 20 to 30."}, {"from": "gpt", "value": "```sql\nSELECT AVG(Quantity) FROM Sales WHERE SalesID BETWEEN 20 AND 30\n```"}]}, {"id": "train-5366", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the product id for products with the highest quantity."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT ProductID FROM Sales WHERE Quantity = ( SELECT MAX(Quantity) FROM Sales )\n```"}]}, {"id": "train-5367", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many product ids have the lowest price?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT ProductID) FROM Products WHERE Price = ( SELECT MAX(Price) FROM Products )\n```"}]}, {"id": "train-5368", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down product names of free gifts."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Products WHERE Price = 0\n```"}]}, {"id": "train-5369", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the product name for products from id 1 to 10."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Products WHERE ProductID BETWEEN 1 AND 10\n```"}]}, {"id": "train-5370", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the product with the lowest quantity?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID ORDER BY T1.Quantity LIMIT 1\n```"}]}, {"id": "train-5371", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customer ids have purchased Hex Nut 9?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CustomerID) FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Hex Nut 9'\n```"}]}, {"id": "train-5372", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total sales ids that were sales of Flat Washer 8."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.SalesID) FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Flat Washer 8'\n```"}]}, {"id": "train-5373", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all of the product names that were placed by sales person with id 10."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.SalesPersonID = 10\n```"}]}, {"id": "train-5374", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the first name of customers who placed order for product id 1."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T2.ProductID = 1\n```"}]}, {"id": "train-5375", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the last name of the customer who placed an order for sales id 178?"}, {"from": "gpt", "value": "```sql\nSELECT T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.SalesID = 178\n```"}]}, {"id": "train-5376", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down product ids that were purchased by customers called Abby."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.ProductID FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.FirstName = 'Abby'\n```"}]}, {"id": "train-5377", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down all of the product ids that were placed by Meander."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.ProductID FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID WHERE T1.FirstName = 'Meander'\n```"}]}, {"id": "train-5378", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the last name of sales person for sales id 100?"}, {"from": "gpt", "value": "```sql\nSELECT T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID WHERE T2.SalesID = 100\n```"}]}, {"id": "train-5379", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the first name of employee who handled sales for customer called Abigail?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.FirstName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID WHERE T1.FirstName = 'Abigail'\n```"}]}, {"id": "train-5380", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many free gifts have customer with id 11782 received?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.CustomerID = 11782 AND T1.Price = 0\n```"}]}, {"id": "train-5381", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of customers who dealt with sales person with id 5?"}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.SalesPersonID = 5\n```"}]}, {"id": "train-5383", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among customers with IDs from 1 to 100, what is the highest price of products they purchased?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Price FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.CustomerID BETWEEN 1 AND 100 ORDER BY T1.Price DESC LIMIT 1\n```"}]}, {"id": "train-5385", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Sum up the number sales ids handled by employees called Morningstar, Heather and Dean."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T2.FirstName = 'Morningstar', 1, 0)) + SUM(IIF(T2.FirstName = 'Heather', 1, 0)) + SUM(IIF(T2.FirstName = 'Dean', 1, 0)) AS num FROM Sales AS T1 INNER JOIN Employees AS T2 ON T1.SalesPersonID = T2.EmployeeID\n```"}]}, {"id": "train-5386", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Has Alex purchased product with id 498?"}, {"from": "gpt", "value": "```sql\nSELECT IIF(T1.ProductID = 498, 'YES', 'NO') FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.FirstName = 'Alex'\n```"}]}, {"id": "train-5387", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total price of products purchased by Adam."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.Price * T2.quantity) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Adam'\n```"}]}, {"id": "train-5388", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total price for products from id 400 to 500."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Price * T2.quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductID BETWEEN 400 AND 500\n```"}]}, {"id": "train-5389", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total quantity of products with name starting with alphabet \"c\"."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE SUBSTR(T1.Name, 1, 1) = 'C'\n```"}]}, {"id": "train-5390", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total quantity of products purchased by customer called Adrian."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Quantity) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.FirstName = 'Adam'\n```"}]}, {"id": "train-5391", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the product ID of the top five products, by descending order, in terms of price."}, {"from": "gpt", "value": "```sql\nSELECT ProductID FROM Products ORDER BY Price DESC LIMIT 5\n```"}]}, {"id": "train-5392", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products, how many of them are freebies?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ProductID) FROM Products WHERE Price = 0\n```"}]}, {"id": "train-5393", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the name of products whose sale quantity is more than 950."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Quantity > 950\n```"}]}, {"id": "train-5394", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of employee who sold 1000 units?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.FirstName, T2.MiddleInitial, T2.LastName FROM Sales AS T1 INNER JOIN Employees AS T2 ON T1.SalesPersonID = T2.EmployeeID WHERE T1.Quantity = 1000\n```"}]}, {"id": "train-5395", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tally the product name and quantity of the first ten sales."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name, T2.Quantity FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T2.SalesID BETWEEN 1 AND 10\n```"}]}, {"id": "train-5396", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total sales amount for Reflector?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Price * T2.quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Reflector'\n```"}]}, {"id": "train-5397", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the best selling colour for HL Mountain Frame, 42?"}, {"from": "gpt", "value": "```sql\nSELECT IIF(SUM(IIF(T1.Name = 'HL Mountain Frame - Silver, 42', T2.SalesID, 0)) - SUM(IIF(T1.Name = 'HL Mountain Frame - Black, 42', T2.SalesID, 0)) > 0, 'Silver', 'Black') FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID\n```"}]}, {"id": "train-5398", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in price between HL Mountain Frame - Black, 42 and LL Mountain Frame - Black, 42?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT Price FROM Products WHERE Name = 'HL Mountain Frame - Black, 42' ) - ( SELECT Price FROM Products WHERE Name = 'LL Mountain Frame - Black, 42' ) AS num\n```"}]}, {"id": "train-5399", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total number of sales closed by Michel E. DeFrance?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.SalesID) FROM Sales AS T1 INNER JOIN Employees AS T2 ON T1.SalesPersonID = T2.EmployeeID WHERE T2.FirstName = 'Michel' AND T2.MiddleInitial = 'e' AND T2.LastName = 'DeFrance'\n```"}]}, {"id": "train-5400", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of customers per sales person?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.CustomerID) AS REAL) / COUNT(T3.EmployeeID) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID\n```"}]}, {"id": "train-5401", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all customers handled by Innes E. del Castillo, how many have purchased Short-Sleeve Classic Jersey, L?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.CustomerID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID WHERE T3.FirstName = 'Innes' AND T3.LastName = 'del Castillo' AND T1.Name = 'Short-Sleeve Classic Jersey, L' AND T3.MiddleInitial = 'e'\n```"}]}, {"id": "train-5402", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the sales person who helped Elizabeth A. White to purchase Road-250 Black, 48."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.FirstName, T3.MiddleInitial, T3.LastName FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID INNER JOIN Customers AS T4 ON T2.CustomerID = T4.CustomerID WHERE T4.MiddleInitial = 'A' AND T4.LastName = 'White' AND T1.Name = 'Road-250 Black, 48' AND T4.FirstName = 'Elizabeth'\n```"}]}, {"id": "train-5403", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales people managed to sell Headlights - Weatherproof?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.SalesPersonID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Headlights - Weatherproof'\n```"}]}, {"id": "train-5404", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the revenue produced through sales of HL Road Frame - Red, 56."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Quantity * T1.Price) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'HL Road Frame - Red, 56'\n```"}]}, {"id": "train-5405", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales transactions were given by the customer named Joe L. Lopez?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.SalesID) FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.FirstName = 'Joe' AND T2.MiddleInitial = 'L' AND T2.LastName = 'Lopez'\n```"}]}, {"id": "train-5406", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the customers who received 'Touring Rim' as a free gift."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T3.Name = 'Touring Rim' AND T3.Price = 0\n```"}]}, {"id": "train-5407", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the number of customers handled by each of the sales people."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CustomerID) FROM Sales GROUP BY SalesPersonID\n```"}]}, {"id": "train-5408", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales people are handling all the customers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(EmployeeID) FROM Employees\n```"}]}, {"id": "train-5409", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the name of the sales person with employee ID 7."}, {"from": "gpt", "value": "```sql\nSELECT FirstName, MiddleInitial, LastName FROM Employees WHERE EmployeeID = 7\n```"}]}, {"id": "train-5410", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the most expensive and the least expensive products available, excluding free gifts."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Products WHERE Price IN (( SELECT MAX(Price) FROM Products ), ( SELECT MIN(Price) FROM Products ))\n```"}]}, {"id": "train-5411", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the customers who have purchased ML Bottom Bracket, identify the percentage of sales by Albert I. Ringer?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T3.FirstName = 'Albert' AND T3.MiddleInitial = 'I' AND T3.LastName = 'Ringer', 1, 0)) AS REAL) * 100 / COUNT(T2.CustomerID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID WHERE T1.Name = 'ML Bottom Bracket'\n```"}]}, {"id": "train-5412", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers have the first name Abigail?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CustomerID) FROM Customers WHERE FirstName = 'Abigail'\n```"}]}, {"id": "train-5413", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the quantity of Blade products sold."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Quantity FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Blade'\n```"}]}, {"id": "train-5414", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name of the employee who has sold the most quantity."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID ORDER BY T2.Quantity DESC LIMIT 1\n```"}]}, {"id": "train-5415", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name of the customer who purchased the most quantity of products."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID ORDER BY T2.Quantity DESC LIMIT 1\n```"}]}, {"id": "train-5416", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the product that is most sold by sale person id 20?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.SalesPersonID = 20 ORDER BY T2.Quantity DESC LIMIT 1\n```"}]}, {"id": "train-5417", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the first names of employees with trading quantity for more than 500."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.FirstName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID WHERE T2.Quantity > 500\n```"}]}, {"id": "train-5418", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the first names of customers who have purchased products from sale person id 1."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.SalesPersonID = 1\n```"}]}, {"id": "train-5419", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total trading quantity of Abraham sold to Aaron Alexander."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Quantity) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Employees AS T3 ON T2.SalesPersonID = T3.EmployeeID WHERE T2.SalesPersonID = 1 AND T1.FirstName = 'Aaron' AND T1.LastName = 'Alexander' AND T3.FirstName = 'Abraham'\n```"}]}, {"id": "train-5420", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full names of customers who have purchased products in quantity over 600."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.Quantity > 600\n```"}]}, {"id": "train-5421", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers whose first name is Cameron, who bought the product in the most quantity?"}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.FirstName = 'Cameron' ORDER BY T2.Quantity DESC LIMIT 1\n```"}]}, {"id": "train-5422", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide sales ID for products named Hex Nut with a price greater than 100."}, {"from": "gpt", "value": "```sql\nSELECT T2.SalesID FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE 'Hex Nut%' AND T1.Price > 100\n```"}]}, {"id": "train-5423", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify customer IDs who bought products priced from 1000 to 2000."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.CustomerID FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Price BETWEEN 1000 AND 2000\n```"}]}, {"id": "train-5424", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total quantity of products that are gifts."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Price = 0\n```"}]}, {"id": "train-5425", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the quantity percentage of the gift products in the total trading quantity."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.Price = 0, T2.Quantity, 0)) AS REAL) * 100 / SUM(T2.Quantity)FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID\n```"}]}, {"id": "train-5426", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of sold blades in the total number of transactions."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.Name = 'Blade', T2.Quantity, 0)) AS REAL) * 100 / SUM(T2.Quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID\n```"}]}, {"id": "train-5427", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the employees have the last name \"Ringer\" ?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(LastName) FROM Employees WHERE LastName = 'Ringer'\n```"}]}, {"id": "train-5428", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products with product ID lower than 15, how many of them costs 10 and below?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ProductID) FROM Products WHERE ProductID < 15 AND Price <= 10\n```"}]}, {"id": "train-5429", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the product's name brought by Aaron Alexander."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID WHERE T3.FirstName = 'Aaron' AND T3.LastName = 'Alexander'\n```"}]}, {"id": "train-5430", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the product ID and name of the product with the highest prices among the quantity ranges from 400 to 500."}, {"from": "gpt", "value": "```sql\nSELECT T1.ProductID, T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.quantity BETWEEN 400 AND 500 ORDER BY T1.Price DESC LIMIT 1\n```"}]}, {"id": "train-5431", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among customers named Kate, who has the highest quantity?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.FirstName = 'Kate' ORDER BY T1.Quantity DESC LIMIT 1\n```"}]}, {"id": "train-5432", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products that have price ranges from 100 to 150, what is the customer ID and sales ID of the product with a quantity lower than 25?"}, {"from": "gpt", "value": "```sql\nSELECT T2.CustomerID, T2.SalesID FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Price BETWEEN 100 AND 150 AND T2.Quantity < 25\n```"}]}, {"id": "train-5434", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In sales with a quantity of 60, how many of them have a price not greater than 500?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.quantity = 60 AND T1.Price <= 500\n```"}]}, {"id": "train-5435", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In customers with the first name of Erica, how many of them bought a quantity below 200?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ProductID) FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T2.FirstName = 'Erica' AND T1.Quantity < 200\n```"}]}, {"id": "train-5437", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the price and quantity of the product named Seat Tube?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Price, T1.Quantity FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Seat Tube'\n```"}]}, {"id": "train-5439", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the sales ID of the product with a quantity of 590 and named \"External Lock Washer 7\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.SalesID FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'External Lock Washer 7' AND T1.Quantity = 590\n```"}]}, {"id": "train-5440", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In sales ID between 30 and 40, who is the customer that bought a total quantity of 403?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Quantity = 403 AND T1.SalesID BETWEEN 30 AND 40\n```"}]}, {"id": "train-5441", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the customer's ID and last name of the customer that purchased a product with a quantity greater than 90% of the average quantity of all listed products."}, {"from": "gpt", "value": "```sql\nSELECT T2.CustomerID, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Quantity > ( SELECT AVG(Quantity) FROM Sales ) * 0.9\n```"}]}, {"id": "train-5442", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the sales ID ranges from 1 to 200, what is the percentage of the products with a price ranging from 200 to 300?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.Price BETWEEN 200 AND 300, 1, 0)) AS REAL) * 100 / COUNT(T2.Price) FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T1.SalesID BETWEEN 1 AND 200\n```"}]}, {"id": "train-5443", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the most expensive product?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Products WHERE Price = ( SELECT MAX(Price) FROM Products )\n```"}]}, {"id": "train-5444", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are named Madison?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CustomerID) FROM Customers WHERE FirstName = 'Madison'\n```"}]}, {"id": "train-5445", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many types of \"HL Touring Frames\" are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ProductID) FROM Products WHERE Name LIKE '%HL Touring Frame%'\n```"}]}, {"id": "train-5446", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers share the most common last name?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CustomerID) FROM Customers GROUP BY LastName ORDER BY COUNT(LastName) DESC LIMIT 1\n```"}]}, {"id": "train-5447", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many free or gift products are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ProductID) FROM Products WHERE Price = 0\n```"}]}, {"id": "train-5448", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the sales person who handled the highest number of sales?"}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T2.SalesPersonID = T1.EmployeeID GROUP BY T2.SalesPersonID, T1.FirstName, T1.MiddleInitial, T1.LastName ORDER BY COUNT(T2.SalesID) DESC LIMIT 1\n```"}]}, {"id": "train-5449", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the customer who purchased the highest amount of total price in a single purchase?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleInitial, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN Products AS T3 ON T1.ProductID = T3.ProductID GROUP BY T1.SalesID, T1.Quantity, T3.Price, FirstName, MiddleInitial, LastName ORDER BY T1.Quantity * T3.Price DESC LIMIT 1\n```"}]}, {"id": "train-5450", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"Mountain-500 Black 42\" were sold in total?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Quantity) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Mountain-500 Black, 42'\n```"}]}, {"id": "train-5451", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the total amount of sales handled by Heather McBadden?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Quantity * T3.Price) FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Heather' AND T1.LastName = 'McBadden'\n```"}]}, {"id": "train-5452", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"Mountain-100 Silver, 38\" were sold by Stearns MacFeather?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Quantity) FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Stearns' AND T1.LastName = 'MacFeather' AND T3.Name = 'Mountain-100 Silver, 38'\n```"}]}, {"id": "train-5453", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many type of products did Dalton M. Coleman purchase?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ProductID) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.FirstName = 'Dalton' AND T1.MiddleInitial = 'M' AND T1.LastName = 'Coleman'\n```"}]}, {"id": "train-5454", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the full names of the top 3 employees who handled the highest number of sales?"}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID GROUP BY T2.SalesPersonID, T1.FirstName, T1.MiddleInitial, T1.LastName ORDER BY COUNT(T2.SalesID) DESC LIMIT 3\n```"}]}, {"id": "train-5455", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the \"Mountain-500 Black\" product types, which type was purchased the most?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE 'Mountain-500 Black%' GROUP BY T2.Quantity, T1.Name ORDER BY SUM(T2.Quantity) DESC LIMIT 1\n```"}]}, {"id": "train-5456", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees sold \"ML Road Frame-W - Yellow, 40\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.SalesPersonID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'ML Road Frame-W - Yellow, 40'\n```"}]}, {"id": "train-5457", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many chainring bolts were sold under sales ID 551971?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Quantity FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Chainring Bolts' AND T1.SalesID = 551971\n```"}]}, {"id": "train-5458", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees sold over 20,000 quantities of \"Touring-2000 Blue, 50\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT SUM(Quantity) FROM Sales WHERE ProductID IN ( SELECT ProductID FROM Products WHERE Name = 'Touring-2000 Blue, 50' ) GROUP BY Quantity, SalesPersonID HAVING SUM(Quantity) > 20000 )\n```"}]}, {"id": "train-5459", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total cost of all the \"Road-650, Red, 60\" products that Abraham E. Bennet sold?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Quantity * T3.Price) FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Abraham' AND T1.MiddleInitial = 'e' AND T1.LastName = 'Bennet' AND T3.Name = 'Road-650 Red, 60'\n```"}]}, {"id": "train-5460", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product has the highest total amount of quantity sold? Calculate its overall total price."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, SUM(T2.Quantity * T1.Price) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID GROUP BY T1.ProductID, T1.Name ORDER BY SUM(T2.Quantity) DESC LIMIT 1\n```"}]}, {"id": "train-5461", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the first name of all the customers whose last name is Chen."}, {"from": "gpt", "value": "```sql\nSELECT FirstName, LastName FROM Customers WHERE LastName = 'Chen'\n```"}]}, {"id": "train-5462", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employee names, what is the most common middle initial?"}, {"from": "gpt", "value": "```sql\nSELECT MiddleInitial FROM Employees GROUP BY MiddleInitial ORDER BY COUNT(MiddleInitial) DESC LIMIT 1\n```"}]}, {"id": "train-5463", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average price of products that cost between 100 and 200?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(Price) FROM Products WHERE Price BETWEEN 100 AND 200\n```"}]}, {"id": "train-5464", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find and list the full name of customers who bought products above-average quantity."}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleInitial, T2.LastName FROM Sales AS T1 INNER JOIN Customers AS T2 ON T1.CustomerID = T2.CustomerID GROUP BY T1.Quantity HAVING T1.Quantity > ( SELECT AVG(Quantity) FROM Sales )\n```"}]}, {"id": "train-5465", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name of the customer who bought the most amount of products."}, {"from": "gpt", "value": "```sql\nSELECT T3.FirstName, T3.MiddleInitial, T3.LastName FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID ORDER BY T2.Quantity * T1.Price DESC LIMIT 1\n```"}]}, {"id": "train-5466", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the employees who sold Blade, who has the most amount of sales?"}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.MiddleInitial, T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID ORDER BY T2.Quantity * T3.Price DESC LIMIT 1\n```"}]}, {"id": "train-5467", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name of customers who spend more than 50,000 in descending order the amount spend."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.FirstName, T3.MiddleInitial, T3.LastName FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Customers AS T3 ON T2.CustomerID = T3.CustomerID WHERE T2.Quantity * T1.Price > 50000\n```"}]}, {"id": "train-5468", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the product that sold the most quantity."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID ORDER BY T1.Quantity DESC LIMIT 1\n```"}]}, {"id": "train-5469", "db_id": "sales", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find and list the products that sold below the average quantity."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Name FROM Sales AS T1 INNER JOIN Products AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Quantity < ( SELECT AVG(Quantity) FROM Sales )\n```"}]}, {"id": "train-5470", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many dishes do not have correct data for the year in which it appeared first?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Dish WHERE first_appeared < 1851 OR first_appeared > 2012\n```"}]}, {"id": "train-5471", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which dish lasted longer, Anchovies or Fresh lobsters in every style?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN SUM(CASE WHEN name = 'Anchovies' THEN last_appeared - first_appeared ELSE 0 END) - SUM(CASE WHEN name = 'Fresh lobsters in every style' THEN last_appeared - first_appeared ELSE 0 END) > 0 THEN 'Anchovies' ELSE 'Fresh lobsters in every style' END FROM Dish WHERE name IN ('Fresh lobsters in every style', 'Anchovies')\n```"}]}, {"id": "train-5472", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the dishes that were once free, what is the name of the dish that had appeared on most menus?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM Dish WHERE lowest_price = 0 ORDER BY menus_appeared DESC LIMIT 1\n```"}]}, {"id": "train-5473", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many menus with the name \"Waldorf Astoria\" have 4 pages?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Menu WHERE name = 'Waldorf Astoria' AND page_count = 4\n```"}]}, {"id": "train-5475", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the prices of the dish \"Clear green turtle\" on every menu page it appeared on."}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Clear green turtle'\n```"}]}, {"id": "train-5476", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the menu pages with the appearance of the dish \"Clear green turtle\", how many of them have the dish at a stable price?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.name = 'Clear green turtle' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.highest_price IS NULL\n```"}]}, {"id": "train-5477", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest price of the dish \"Clear green turtle\" on a menu page?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Clear green turtle' ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-5478", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of all the menus in which the dish \"Clear green turtle\" had appeared."}, {"from": "gpt", "value": "```sql\nSELECT T1.menu_id FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Clear green turtle'\n```"}]}, {"id": "train-5479", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the menus in which the dish \"Clear green turtle\" had appeared, how many of them used the dollar as their currency?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.currency = 'Dollars' THEN 1 ELSE 0 END) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T4.name = 'Clear green turtle'\n```"}]}, {"id": "train-5480", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the menus in which the dish \"Clear green turtle\" had appeared, how many of them did not support taking out or booking in advance?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T4.name = 'Clear green turtle' THEN 1 ELSE 0 END) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T3.call_number IS NULL\n```"}]}, {"id": "train-5481", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the dishes that appeared on the menu \"Zentral Theater Terrace\"."}, {"from": "gpt", "value": "```sql\nSELECT T4.name FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T3.name = 'Zentral Theater Terrace'\n```"}]}, {"id": "train-5482", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which dish has the highest price on the menu \"Zentral Theater Terrace\"? Please give its name."}, {"from": "gpt", "value": "```sql\nSELECT T4.name FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T3.name = 'Zentral Theater Terrace' ORDER BY T1.price DESC LIMIT 1\n```"}]}, {"id": "train-5483", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many dishes are there on the menu \"Zentral Theater Terrace\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.name = 'Zentral Theater Terrace' THEN 1 ELSE 0 END) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id\n```"}]}, {"id": "train-5484", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many dishes are there in total in the menus with the name \"Waldorf Astoria\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.name = 'Waldorf Astoria' THEN 1 ELSE 0 END) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id\n```"}]}, {"id": "train-5485", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the menus that are DIYs of the restaurant and have the dish \"Clear green turtle\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.menu_id FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T4.name = 'Clear green turtle' AND T3.sponsor IS NULL\n```"}]}, {"id": "train-5486", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average page number of the menus that have the dish \"Clear green turtle\"?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.page_number) FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Clear green turtle'\n```"}]}, {"id": "train-5487", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average price of the dishes on the menu \"Zentral Theater Terrace\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.price) / COUNT(T1.price) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id WHERE T3.name = 'Zentral Theater Terrace'\n```"}]}, {"id": "train-5488", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many menu items were created on 28th March 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM MenuItem WHERE created_at LIKE '2011-03-28%'\n```"}]}, {"id": "train-5489", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many dishes are included in the menu page ID 144?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM MenuItem WHERE menu_page_id = 144\n```"}]}, {"id": "train-5490", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many menus were used in Dutcher House?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Menu WHERE location = 'Dutcher House'\n```"}]}, {"id": "train-5491", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many dishes appeared on a menu more than once?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Dish WHERE times_appeared > menus_appeared\n```"}]}, {"id": "train-5492", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many menus were created for steamship?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Menu WHERE venue = 'STEAMSHIP'\n```"}]}, {"id": "train-5493", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many pages were there on the menu created on 17th November 1898?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.date = '1898-11-17' THEN 1 ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id\n```"}]}, {"id": "train-5494", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the dishes that were on the menu page ID 174."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T1.menu_page_id = 174\n```"}]}, {"id": "train-5495", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names and menu page IDs of the dishes that first appeared in 1861."}, {"from": "gpt", "value": "```sql\nSELECT T2.name, T1.dish_id FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T2.first_appeared = 1861\n```"}]}, {"id": "train-5496", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the dishes on menu page ID 7610, list the names and highest prices of the dishes in menu items that were created on 23rd May 2011."}, {"from": "gpt", "value": "```sql\nSELECT T1.name, T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.created_at LIKE '2011-05-23%' ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-5497", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the dishes included on page number 30 with the least in full height."}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T1.page_number = 30 ORDER BY T1.full_height DESC, T1.full_height ASC LIMIT 1\n```"}]}, {"id": "train-5498", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the page IDs and name of the menu which had the highest page count."}, {"from": "gpt", "value": "```sql\nSELECT T1.page_number, T2.name FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id ORDER BY T2.page_count DESC LIMIT 1\n```"}]}, {"id": "train-5499", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On the menu with the most dishes, how many dishes were there on its second page?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.dish_id) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id WHERE T2.page_number = 2 GROUP BY T3.name ORDER BY T3.dish_count DESC LIMIT 1\n```"}]}, {"id": "train-5500", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the numbers of the menu item which includes Fresh lobsters in every style and location where that dish was used on a menu."}, {"from": "gpt", "value": "```sql\nSELECT T2.menu_id, T1.xpos, T1.ypos FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T4.name = 'Fresh lobsters in every style'\n```"}]}, {"id": "train-5501", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the dishes that appeared at the left upper corner of the CHAS.BRADLEY'S OYSTER & DINING ROOM\"s sponsored menu."}, {"from": "gpt", "value": "```sql\nSELECT T4.name FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T3.sponsor = 'CHAS.BRADLEY''S OYSTER & DINING ROOM' AND T1.xpos < 0.25 AND T1.ypos < 0.25\n```"}]}, {"id": "train-5502", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the sponsor and event of the menu which includes Cerealine with Milk."}, {"from": "gpt", "value": "```sql\nSELECT T3.name, T3.event FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T4.name = 'Cerealine with Milk'\n```"}]}, {"id": "train-5503", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of Bluefish dishes are located at the center of the menu page?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.xpos BETWEEN 0.25 AND 0.75 AND T2.ypos BETWEEN 0.25 AND 0.75 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.id) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name LIKE '%BLuefish%'\n```"}]}, {"id": "train-5504", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the sponsor of menu with ID 12463?"}, {"from": "gpt", "value": "```sql\nSELECT sponsor FROM Menu WHERE id = 12463\n```"}]}, {"id": "train-5505", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the event sponsored by the Republican House?"}, {"from": "gpt", "value": "```sql\nSELECT event FROM Menu WHERE sponsor = 'REPUBLICAN HOUSE'\n```"}]}, {"id": "train-5506", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where is the place that menu with ID 12472 was created for?"}, {"from": "gpt", "value": "```sql\nSELECT location FROM Menu WHERE id = 12472\n```"}]}, {"id": "train-5508", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the occasion for menu with ID 12463?"}, {"from": "gpt", "value": "```sql\nSELECT occasion FROM Menu WHERE id = 12463\n```"}]}, {"id": "train-5509", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the locations of menu sponsored by Norddeutscher Lloyd Bremen."}, {"from": "gpt", "value": "```sql\nSELECT location FROM Menu WHERE sponsor = 'Norddeutscher Lloyd Bremen'\n```"}]}, {"id": "train-5511", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the image IDs for menu located at Manhattan Hotel."}, {"from": "gpt", "value": "```sql\nSELECT T1.image_id FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.location = 'Manhattan Hotel'\n```"}]}, {"id": "train-5512", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the full height and width for menu called \"El Fuerte Del Palmar\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.full_height, T1.full_width FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.name = 'El Fuerte Del Palmar'\n```"}]}, {"id": "train-5513", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is \"c02c9a3b-6881-7080-e040-e00a180631aa\" the uuid for menu called \"The Biltmore\"?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T2.uuid = 'c02c9a3b-6881-7080-e040-e00a180631aa' THEN 'yes' ELSE 'no' END AS yn FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.name = 'The Biltmore' AND T2.uuid = 'c02c9a3b-6881-7080-e040-e00a180631aa'\n```"}]}, {"id": "train-5514", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of menu with the longest full height."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id ORDER BY T1.full_height DESC LIMIT 1\n```"}]}, {"id": "train-5515", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the page count for menu with page ID of 130?"}, {"from": "gpt", "value": "```sql\nSELECT T1.page_count FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.id = 130\n```"}]}, {"id": "train-5517", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the page numbers for menu with dishes on the right upper corner."}, {"from": "gpt", "value": "```sql\nSELECT T2.page_number FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id INNER JOIN MenuItem AS T3 ON T2.id = T3.menu_page_id WHERE T3.xpos > 0.75 AND T3.ypos < 0.25\n```"}]}, {"id": "train-5518", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the name of dishes from menu created in April."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE SUBSTR(T1.created_at, 7, 1) = '4'\n```"}]}, {"id": "train-5519", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down name of dishes from menu with menu page ID 1389."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T1.menu_page_id = 1389\n```"}]}, {"id": "train-5520", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest price of dishes with menu item ID 1 to 5?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.id BETWEEN 1 AND 5 ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-5521", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the name of dishes that were positioned on the left upper corner."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.xpos < 0.25 AND T2.ypos < 0.25\n```"}]}, {"id": "train-5522", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total dish count for menu with uuid of \"510d47e4-2958-a3d9-e040-e00a18064a99\" & \"510d47e4-295a-a3d9-e040-e00a18064a99\"."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.uuid = '510d47e4-2958-a3d9-e040-e00a18064a99' THEN T1.dish_count ELSE 0 END) - SUM(CASE WHEN T2.uuid = '510d47e4-295a-a3d9-e040-e00a18064a99' THEN T1.dish_count ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id\n```"}]}, {"id": "train-5523", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total price of items for menu with ID 12882."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.price) FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id WHERE T1.menu_id = 12882\n```"}]}, {"id": "train-5524", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the top five dishes, by descending order, in terms of highest price."}, {"from": "gpt", "value": "```sql\nSELECT name FROM Dish ORDER BY highest_price DESC LIMIT 5\n```"}]}, {"id": "train-5525", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the dishes, how many of them are for free?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Dish WHERE lowest_price = 0\n```"}]}, {"id": "train-5526", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What dishes made their first and last appearances in 1855 and 1900, respectively?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM Dish WHERE first_appeared = 1855 AND last_appeared = 1900\n```"}]}, {"id": "train-5527", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the top ten menus with the highest dish count."}, {"from": "gpt", "value": "```sql\nSELECT name FROM Menu GROUP BY name ORDER BY dish_count DESC LIMIT 10\n```"}]}, {"id": "train-5528", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many dishes appear in the right upper corner of the menu page?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T1.dish_id = T2.id WHERE T1.xpos > 0.75 AND T1.ypos < 0.25\n```"}]}, {"id": "train-5529", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long has the \"Clear Green Turtle\" dish appeared on the menu, and tell me when its latest update was?"}, {"from": "gpt", "value": "```sql\nSELECT T1.last_appeared - T1.first_appeared, T2.updated_at FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Clear green turtle'\n```"}]}, {"id": "train-5530", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tally the dishes that have appeared on the menu for more than 100 years."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.last_appeared - T1.first_appeared > 100\n```"}]}, {"id": "train-5531", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many dishes have appeared on the menu in less than 5 years?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.last_appeared - T1.first_appeared < 5\n```"}]}, {"id": "train-5532", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give me the name and menu price of dishes that were free."}, {"from": "gpt", "value": "```sql\nSELECT T2.name, T1.price FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T2.lowest_price = 0\n```"}]}, {"id": "train-5534", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the dishes, how many of them were created between 2011-03-31 at 20:24:46 UTC and 2011-04-15 at 23:09:51 UTC."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.created_at BETWEEN '2011-03-31 20:24:46 UTC' AND '2011-04-15 23:09:51 UTC' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id\n```"}]}, {"id": "train-5536", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the image ID, full height, and full width of the menu that were used in the \"100TH ANNIVERSARY OF BIRTH OF DANIEL WEBSTER\" event."}, {"from": "gpt", "value": "```sql\nSELECT T1.image_id, T1.full_height, T1.full_width FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.event = '100TH ANNIVERSARY OF BIRTH OF DANIEL WEBSTER'\n```"}]}, {"id": "train-5537", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Under what events was the menu page's full width less than 2000 mm?"}, {"from": "gpt", "value": "```sql\nSELECT T1.event FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.full_width = 2000\n```"}]}, {"id": "train-5538", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the dishes that cost 180,000."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.price = 180000\n```"}]}, {"id": "train-5539", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the position coordinate on the page menu of the \"Small Hominy\" dish and how long did it appear?"}, {"from": "gpt", "value": "```sql\nSELECT T2.xpos, T2.ypos, T1.last_appeared - T1.first_appeared FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Small Hominy'\n```"}]}, {"id": "train-5540", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the image area of the page menu for the dish named \"Baked Stuffed Mullet & Sauce Pomard\". Please include the page number and image ID."}, {"from": "gpt", "value": "```sql\nSELECT T1.full_height * T1.full_width, T1.page_number, T1.image_id FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Baked Stuffed Mullet & Sauce Pomard'\n```"}]}, {"id": "train-5541", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many dishes appeared more than once on a menu?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Dish WHERE times_appeared > Dish.menus_appeared\n```"}]}, {"id": "train-5542", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many menus sponsored by Krogs Fiske Restaurant were created in April 2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Menu WHERE date LIKE '2015-04%' AND sponsor = 'Krogs Fiskerestaurant'\n```"}]}, {"id": "train-5543", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which dish has the longest history?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM Dish ORDER BY last_appeared - Dish.first_appeared DESC LIMIT 1\n```"}]}, {"id": "train-5544", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On 1887-07-21, what was the event that lead to the creation of menu id 21380?"}, {"from": "gpt", "value": "```sql\nSELECT event FROM Menu WHERE date = '1887-07-21' AND id = 21380\n```"}]}, {"id": "train-5545", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many pages are there in the \"Emil Kuehn\" menu?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.name = 'Emil Kuehn' THEN 1 ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id\n```"}]}, {"id": "train-5546", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many menus include puree of split peas aux croutons?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.name = 'Puree of split peas aux croutons' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id\n```"}]}, {"id": "train-5547", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the dishes with a stable price that were created in April of 2011?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE SUBSTR(T2.created_at, 1, 4) = '2011' AND SUBSTR(T2.created_at, 7, 1) = '4' AND T1.highest_price IS NULL\n```"}]}, {"id": "train-5548", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the menu with the highest number of pages?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id GROUP BY T2.menu_id ORDER BY COUNT(T2.page_number) DESC LIMIT 1\n```"}]}, {"id": "train-5549", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the menu page ids of all the menu that includes mashed potatoes."}, {"from": "gpt", "value": "```sql\nSELECT T2.menu_page_id FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Mashed potatoes'\n```"}]}, {"id": "train-5550", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the menus sponsored by Pacific Mail Steamship Company, how many menus have no more than 2 pages?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.sponsor = 'PACIFIC MAIL STEAMSHIP COMPANY' GROUP BY T2.menu_id HAVING COUNT(T2.page_number) <= 2\n```"}]}, {"id": "train-5551", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the menus that include milk, what is the menu page id of the menu that has the highest price?"}, {"from": "gpt", "value": "```sql\nSELECT T1.menu_page_id FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T2.name = 'Milk' ORDER BY T1.price DESC LIMIT 1\n```"}]}, {"id": "train-5552", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the menu id of the menu sponsored by Occidental and Oriental Steamship Company with the highest number of pages?"}, {"from": "gpt", "value": "```sql\nSELECT T2.menu_id FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.sponsor = 'OCCIDENTAL & ORIENTAL STEAMSHIP COMPANY' GROUP BY T2.menu_id ORDER BY COUNT(T2.page_number) DESC LIMIT 1\n```"}]}, {"id": "train-5554", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the dishes shown in the lower right corner of menu page 48706?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM MenuItem AS T1 INNER JOIN Dish AS T2 ON T2.id = T1.dish_id WHERE T1.xpos > 0.75 AND T1.ypos > 0.75 AND T1.menu_page_id = 48706\n```"}]}, {"id": "train-5556", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the menus that include baked apples with cream, who is the sponsor of the menu with the highest price?"}, {"from": "gpt", "value": "```sql\nSELECT T4.sponsor FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id INNER JOIN Menu AS T4 ON T4.id = T1.menu_id WHERE T3.name = 'Baked apples with cream' AND T3.id = 107 ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-5557", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of dishes per menu in the Souper de Luxe menus? Identify what is the name of the dish that appeared the most in all of its menus."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*), T1.dish_id FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T3.name = 'Souper de Luxe' GROUP BY T3.id ORDER BY COUNT(T1.dish_id) DESC LIMIT 1\n```"}]}, {"id": "train-5558", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of all the menus that are DIYs of the restaurant."}, {"from": "gpt", "value": "```sql\nSELECT id FROM Menu WHERE sponsor IS NULL\n```"}]}, {"id": "train-5559", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many menus were created for lunch?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Menu WHERE event = 'LUNCH'\n```"}]}, {"id": "train-5560", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the menus with over 10 pages, how many of them have over 20 dishes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Menu WHERE page_count > 10 AND dish_count > 20\n```"}]}, {"id": "train-5561", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of the menu with the most number of dishes?"}, {"from": "gpt", "value": "```sql\nSELECT id FROM Menu ORDER BY dish_count DESC LIMIT 1\n```"}]}, {"id": "train-5562", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many dishes are there on the menu \"Zentral Theater Terrace\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Menu WHERE name = 'Zentral Theater Terrace'\n```"}]}, {"id": "train-5563", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the menus that did not support taking out or booking in advance, how many of them were created before 1950?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Menu WHERE call_number IS NULL AND strftime('%Y', date) < '1950'\n```"}]}, {"id": "train-5564", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the image ID of page 1 of the menu \"Zentral Theater Terrace\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.image_id FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.name = 'Zentral Theater Terrace' AND T2.page_number = 1\n```"}]}, {"id": "train-5565", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which menu does the menu page image ID5189412 belong? Please give its name."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.image_id = 5189412\n```"}]}, {"id": "train-5566", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which menu page has a bigger width, page 1 of \"Zentral Theater Terrace\" or page 1 of \"Young's Hotel\"?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN SUM(CASE WHEN T1.name = 'Zentral Theater Terrace' THEN T2.full_width ELSE 0 END) - SUM(CASE WHEN T1.name = 'Young''s Hotel' THEN T2.full_width ELSE 0 END) > 0 THEN 'Zentral Theater Terrace' ELSE 'Young''s Hotel' END FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id\n```"}]}, {"id": "train-5567", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which menu page of \"Ritz Carlton\" has the biggest height?"}, {"from": "gpt", "value": "```sql\nSELECT T1.page_number FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.name = 'Ritz Carlton' ORDER BY T1.full_height DESC LIMIT 1\n```"}]}, {"id": "train-5568", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the menu pages of \"Ritz Carlton\", how many of them have a width of over 1000?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.name = 'Ritz Carlton' THEN 1 ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.full_width > 1000\n```"}]}, {"id": "train-5569", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many dishes are there on page 1 of menu ID12882?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.page_number = 1 THEN 1 ELSE 0 END) FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id WHERE T1.menu_id = 12882\n```"}]}, {"id": "train-5570", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the dishes on page 1 of menu ID12882."}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T1.menu_id = 12882 AND T1.page_number = 1\n```"}]}, {"id": "train-5571", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the page numbers of all the menu pages on which the dish \"Chicken gumbo\" had appeared."}, {"from": "gpt", "value": "```sql\nSELECT T1.page_number FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Chicken gumbo'\n```"}]}, {"id": "train-5572", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the menu pages on which the dish \"Chicken gumbo\" had appeared, what is the menu ID of the one with the biggest width?"}, {"from": "gpt", "value": "```sql\nSELECT T1.id FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Chicken gumbo' ORDER BY T1.full_width DESC LIMIT 1\n```"}]}, {"id": "train-5573", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many times had the dish \"Chicken gumbo\" appeared on a menu page?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.name = 'Chicken gumbo' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id\n```"}]}, {"id": "train-5574", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the menu pages on which the dish \"Paysanne Soup\" had appeared, how many of them had a stable price for the dish?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.name = 'Paysanne Soup' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.highest_price IS NULL\n```"}]}, {"id": "train-5575", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest price of the dish \"Chicken gumbo\" on a menu page?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Chicken gumbo' ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-5576", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much space does page 1 of the menu \"Zentral Theater Terrace\" cover?"}, {"from": "gpt", "value": "```sql\nSELECT T2.full_height * T2.full_width FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.name = 'Zentral Theater Terrace' AND T2.page_number = 1\n```"}]}, {"id": "train-5577", "db_id": "menu", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of dishes per menu page of menu ID12882?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(dish_id) AS REAL) / COUNT(T3.page_count) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id WHERE T2.menu_id = 12882\n```"}]}, {"id": "train-5578", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments were ordered by S K L Enterprises Inc in 2017?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ship_id) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'S K L Enterprises Inc' AND STRFTIME('%Y', T2.ship_date) = '2017'\n```"}]}, {"id": "train-5579", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of pounds being transported for S K L Enterprises Inc?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.weight) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'S K L Enterprises Inc'\n```"}]}, {"id": "train-5580", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the shipments done by Sue Newell, how many of them are for S K L Enterprises Inc?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T1.cust_name = 'S K L Enterprises Inc' AND T3.first_name = 'Sue' AND T3.last_name = 'Newell'\n```"}]}, {"id": "train-5581", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments were ordered by a customer in Florida?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.cust_id) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.state = 'FL'\n```"}]}, {"id": "train-5582", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of all the shipments made by a retailer customer."}, {"from": "gpt", "value": "```sql\nSELECT T2.ship_id FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_type = 'retailer'\n```"}]}, {"id": "train-5583", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers having at least one shipment in 2017, how many of them have an annual revenue of over 30000000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(COUNTCUSID) FROM ( SELECT COUNT(T1.cust_id) AS COUNTCUSID FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE STRFTIME('%Y', T2.ship_date) = '2017' AND T1.annual_revenue > 30000000 GROUP BY T1.cust_id HAVING COUNT(T2.ship_id) >= 1 ) T3\n```"}]}, {"id": "train-5584", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments in 2017 were done by Sue Newell?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE STRFTIME('%Y', T1.ship_date) = '2017' AND T2.first_name = 'Sue' AND T2.last_name = 'Newell'\n```"}]}, {"id": "train-5585", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the driver that has done the most shipments in 2017?"}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE STRFTIME('%Y', T1.ship_date) = '2017' GROUP BY T2.first_name, T2.last_name ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-5586", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the shipments in 2017, how many of them have the destination in New Jersey?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE STRFTIME('%Y', T1.ship_date) = '2017' AND T2.state = 'New Jersey'\n```"}]}, {"id": "train-5587", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the maximum weight being transported to New York during a single shipment?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.weight) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'New York'\n```"}]}, {"id": "train-5588", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much more pounds in total were transported to New York than to Chicago?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.city_name = 'New York' THEN T1.weight ELSE 0 END) - SUM(CASE WHEN T2.city_name = 'Chicago' THEN T1.weight ELSE 0 END) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id\n```"}]}, {"id": "train-5589", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the destination cities of all the shipments ordered by S K L Enterprises Inc."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.city_name FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T1.cust_name = 'S K L Enterprises Inc'\n```"}]}, {"id": "train-5590", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average weight of the goods being transported on a single shipment ordered by S K L Enterprises Inc?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.weight) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'S K L Enterprises Inc'\n```"}]}, {"id": "train-5591", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the shipments to Florida, what is the percentage of the shipment to Jacksonville?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.city_name = 'Jacksonville' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'Florida'\n```"}]}, {"id": "train-5592", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the headquarter of the truck which completed shipment no.1045."}, {"from": "gpt", "value": "```sql\nSELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = 1045\n```"}]}, {"id": "train-5593", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments were delivered by the oldest truck model?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id GROUP BY T1.model_year ORDER BY T1.model_year ASC LIMIT 1\n```"}]}, {"id": "train-5594", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the customer of shipment no.1275? Give the customer's name."}, {"from": "gpt", "value": "```sql\nSELECT T1.cust_name FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T2.ship_id = '1275'\n```"}]}, {"id": "train-5595", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where was the destination city of shipment no.1701?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1701'\n```"}]}, {"id": "train-5596", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the driver of shipment no.1021."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1021'\n```"}]}, {"id": "train-5597", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the name of the driver who received the shipment on 2017/11/5."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_date = '2017-11-05'\n```"}]}, {"id": "train-5598", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the population of the city which was the destination of shipment no.1398."}, {"from": "gpt", "value": "```sql\nSELECT T2.population FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1398'\n```"}]}, {"id": "train-5599", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ship date of the first shipment to customers in South Carolina."}, {"from": "gpt", "value": "```sql\nSELECT MIN(T1.ship_date) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'SC'\n```"}]}, {"id": "train-5600", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the shipment received by Leszek Kieltyka on 2017/9/25, what was its weight?"}, {"from": "gpt", "value": "```sql\nSELECT T1.weight FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Leszek' AND T2.last_name = 'Kieltyka' AND T1.ship_date = '2017-09-25'\n```"}]}, {"id": "train-5601", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the area of the destination city of shipment No.1346?"}, {"from": "gpt", "value": "```sql\nSELECT T2.area FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1346'\n```"}]}, {"id": "train-5602", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the weight of the shipment to U-haul Center Of N Syracuse on 2016/9/21."}, {"from": "gpt", "value": "```sql\nSELECT T1.weight FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.cust_name = 'U-haul Center Of N Syracuse' AND T1.ship_date = '2016-09-21'\n```"}]}, {"id": "train-5603", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the driver of truck no.3 on 2016/9/19? Tell the full name."}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T1.truck_id = '3' AND T2.ship_date = '2016-09-19'\n```"}]}, {"id": "train-5604", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the population density of the city as the destination of shipment no.1369."}, {"from": "gpt", "value": "```sql\nSELECT T2.area / T2.population FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1369'\n```"}]}, {"id": "train-5605", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of shipments done by the Kenworth trucks?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.ship_id) AS REAL) / COUNT(DISTINCT T1.truck_id) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Kenworth'\n```"}]}, {"id": "train-5606", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many pounds did Sue Newell transport during her first shipment?"}, {"from": "gpt", "value": "```sql\nSELECT T1.weight FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Sue' AND T2.last_name = 'Newell' ORDER BY T1.ship_date ASC LIMIT 1\n```"}]}, {"id": "train-5607", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To whom did the company transport its heaviest shipment?"}, {"from": "gpt", "value": "```sql\nSELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id ORDER BY T1.weight DESC LIMIT 1\n```"}]}, {"id": "train-5608", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the driver who transported the first shipment of the company?"}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id ORDER BY T1.ship_date ASC LIMIT 1\n```"}]}, {"id": "train-5609", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In total, how many shipments were transported to Olympic Camper Sales Inc?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ship_id) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'Olympic Camper Sales Inc'\n```"}]}, {"id": "train-5610", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the shipments bound for New York City were shipped to Harry's Hot Rod Auto and Truck Accessories?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.city_name = 'New York' AND T1.cust_name = 'Harry''s Hot Rod Auto & Truck Accessories'\n```"}]}, {"id": "train-5611", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the top 5 heaviest shipments, how many shipments were transported via Mack?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ship_id) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Mack' ORDER BY T2.weight DESC LIMIT 1\n```"}]}, {"id": "train-5612", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the driver who delivered the most shipments to the least populated city?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM driver AS T1 INNER JOIN shipment AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id GROUP BY T1.first_name, T1.last_name, T3.population HAVING T3.population = MAX(T3.population) ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-5613", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments with weight of no more than 1,000 pounds were shipped by the oldest truck?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.weight < 1000 ORDER BY T1.model_year ASC LIMIT 1\n```"}]}, {"id": "train-5614", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the annual revenue of the customer with the most number of shipments?"}, {"from": "gpt", "value": "```sql\nSELECT T2.annual_revenue FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_id ORDER BY COUNT(T1.cust_id) DESC LIMIT 1\n```"}]}, {"id": "train-5615", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the shipments for Downey, how many shipments were shipped to California in 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Downey' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state = 'CA'\n```"}]}, {"id": "train-5616", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments did Holger Nohr transport to North Las Vegas overall?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM driver AS T1 INNER JOIN shipment AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T1.first_name = 'Holger' AND T1.last_name = 'Nohr' AND T3.city_name = 'North Las Vegas'\n```"}]}, {"id": "train-5617", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments were shipped to the most densely populated city?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.area / T2.population DESC LIMIT 1\n```"}]}, {"id": "train-5618", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Determine the percentage of manufacturers who are from Texas among all of Lorenzo's customers."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN cust_type = 'manufacturer' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer WHERE state = 'TX'\n```"}]}, {"id": "train-5619", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the total weight of shipments transported to San Mateo, California, in 2016."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.weight) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'San Mateo' AND STRFTIME('%Y', T1.ship_date) = '2016'\n```"}]}, {"id": "train-5620", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the total weight of shipments transported in 2016 by the newest Peterbilt."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Peterbilt' AND STRFTIME('%Y', T2.ship_date) = '2016' ORDER BY T1.model_year DESC LIMIT 1\n```"}]}, {"id": "train-5621", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the maximum weight of the shipment carried to Boston? Name the customer of that shipment."}, {"from": "gpt", "value": "```sql\nSELECT T1.weight, T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T1.city_id WHERE T3.city_name = 'Boston' ORDER BY T1.weight DESC LIMIT 1\n```"}]}, {"id": "train-5622", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where was shipment no. 1002 headed?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1002'\n```"}]}, {"id": "train-5623", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average shipment weight carried by the oldest Mack?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Mack'\n```"}]}, {"id": "train-5624", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the full name of the driver who delivered a shipment to the city of New York in February 2016."}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.city_name = 'New York' AND T1.ship_date LIKE '2016-02%'\n```"}]}, {"id": "train-5625", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the customer who sent the shipment to Oak Park."}, {"from": "gpt", "value": "```sql\nSELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T1.city_id WHERE T3.city_name = 'Oak Park'\n```"}]}, {"id": "train-5626", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Determine the number of shipments delivered by Andrea Simons to Huntsville in 2016."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T3.first_name = 'Andrea' AND T3.last_name = 'Simons' AND T2.city_name = 'Huntsville' AND STRFTIME('%Y', T1.ship_date) = '2016'\n```"}]}, {"id": "train-5627", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments does each driver deliver per month on average?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(*) AS REAL) / (12 * COUNT(T2.driver_id)) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id\n```"}]}, {"id": "train-5628", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all shipments placed by Sunguard Window Tinting & Truck Accessories in 2017, identify the percentage of shipments whose weight exceeded 10,000 pounds."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.weight >= 10000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.cust_name = 'Sunguard Window Tinting & Truck Accessories' AND STRFTIME('%Y', T1.ship_date) = '2017'\n```"}]}, {"id": "train-5629", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all shipments delivered by Sue Newel, identify the percentage of shipments that were placed by Autoware Inc."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.cust_name = 'Autoware Inc' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) AS per FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.first_name = 'Sue' AND T2.last_name = 'Newell'\n```"}]}, {"id": "train-5630", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities which belong to New Jersey have transported weight greater than 20000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT T2.city_id AS CITYID FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'New Jersey' GROUP BY T2.city_id HAVING SUM(T1.weight) > 20000 )\n```"}]}, {"id": "train-5631", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities whose polulation is larger than 50000 pounds have shipment in 2017?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM city AS T1 INNER JOIN shipment AS T2 ON T1.city_id = T2.city_id WHERE T1.population > 50000 AND STRFTIME('%Y', T2.ship_date) = '2017'\n```"}]}, {"id": "train-5632", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the weight of shipments transported by Peterbilt."}, {"from": "gpt", "value": "```sql\nSELECT T2.weight FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE make = 'Peterbilt'\n```"}]}, {"id": "train-5633", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the model year of the truck used in shipment id 1003?"}, {"from": "gpt", "value": "```sql\nSELECT T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1003'\n```"}]}, {"id": "train-5634", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the brand of truck used in shipment id 1011?"}, {"from": "gpt", "value": "```sql\nSELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1011'\n```"}]}, {"id": "train-5635", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the first name of the driver who transported shipment id 1028?"}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = 1028\n```"}]}, {"id": "train-5636", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the state of driver who transported the shipment id 1055."}, {"from": "gpt", "value": "```sql\nSELECT T2.state FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1055'\n```"}]}, {"id": "train-5637", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the address of drivers who transported the shipment with weight greater than 50000 pounds."}, {"from": "gpt", "value": "```sql\nSELECT T2.address FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id GROUP BY T2.driver_id HAVING SUM(T1.weight) > 50000\n```"}]}, {"id": "train-5638", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name of driver who transported the items on 3/2/2016."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_date = '2016-03-02'\n```"}]}, {"id": "train-5639", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average annual revenue of customers who have shipment weight of less than 65000 pounds?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.annual_revenue) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T2.weight < 65000\n```"}]}, {"id": "train-5640", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of wholesaler customers who have shipment weight of not greater than 70000 pounds?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.weight < 70000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_type = 'wholesaler'\n```"}]}, {"id": "train-5641", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the last name of driver who transported shipment id 1088?"}, {"from": "gpt", "value": "```sql\nSELECT T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1088'\n```"}]}, {"id": "train-5642", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the phone of drivers who transported shipment weight of greater than 20000 pounds."}, {"from": "gpt", "value": "```sql\nSELECT T2.phone FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id GROUP BY T2.driver_id HAVING SUM(T1.weight) > 20000\n```"}]}, {"id": "train-5643", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the brand and model of truck used in shipment id 1055?"}, {"from": "gpt", "value": "```sql\nSELECT T1.make, T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1055'\n```"}]}, {"id": "train-5644", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many trucks were manufactured in year 2009?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(truck_id) FROM truck WHERE model_year = 2009\n```"}]}, {"id": "train-5645", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are manufacturer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM customer WHERE cust_type = 'manufacturer'\n```"}]}, {"id": "train-5646", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers who live in California that are retailers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM customer WHERE cust_type = 'retailer' AND state = 'CA'\n```"}]}, {"id": "train-5647", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities are in Connecticut?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM city WHERE state = 'Connecticut'\n```"}]}, {"id": "train-5648", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most populated city in California?"}, {"from": "gpt", "value": "```sql\nSELECT city_name FROM city WHERE state = 'California' AND population = ( SELECT MAX(population) FROM city WHERE state = 'California' )\n```"}]}, {"id": "train-5649", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the annual revenue of Klett & Sons Repair?"}, {"from": "gpt", "value": "```sql\nSELECT annual_revenue FROM customer WHERE cust_name = 'Klett & Sons Repair'\n```"}]}, {"id": "train-5650", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the driver that transported the lightest weight of shipment? Provide the full name of the driver."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id ORDER BY T1.weight ASC LIMIT 1\n```"}]}, {"id": "train-5651", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments were shipped to customers living in California in year 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) AS per FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE STRFTIME('%Y', T2.ship_date) = '2016' AND T1.state = 'CA'\n```"}]}, {"id": "train-5652", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the brand of the truck that is used to ship by Zachery Hicks?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T3.first_name = 'Zachery' AND T3.last_name = 'Hicks'\n```"}]}, {"id": "train-5653", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the name of the customers that received a shipment in February 2017."}, {"from": "gpt", "value": "```sql\nSELECT T1.cust_name FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T2.ship_date LIKE '2017-02%'\n```"}]}, {"id": "train-5654", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the brand of the truck and the name of the driver that transported goods in Klett & Sons Repair."}, {"from": "gpt", "value": "```sql\nSELECT T3.make, T4.first_name, T4.last_name FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN truck AS T3 ON T3.truck_id = T2.truck_id INNER JOIN driver AS T4 ON T4.driver_id = T2.driver_id WHERE T1.cust_name = 'Klett & Sons Repair'\n```"}]}, {"id": "train-5655", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the shipment ID of the heaviest shipment that Zachery Hicks transported?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ship_id FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Zachery' AND T2.last_name = 'Hicks' ORDER BY T1.weight DESC LIMIT 1\n```"}]}, {"id": "train-5656", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments did Zachery Hicks transport goods to New York in the year 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM city AS T1 INNER JOIN shipment AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T3.first_name = 'Zachery' AND T3.last_name = 'Hicks' AND T1.city_name = 'New York' AND STRFTIME('%Y', T2.ship_date) = '2016'\n```"}]}, {"id": "train-5657", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which headquarter's truck has the highest shipments in year 2016?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T2.make = 'Peterbilt' THEN 'Texas (TX)' WHEN T2.make = 'Mack' THEN 'North Carolina (NC)' WHEN T2.make = 'Kenworth' THEN 'Washington (WA)' END AS \"result\" FROM shipment AS T1 INNER JOIN truck AS T2 ON T1.truck_id = T2.truck_id WHERE CAST(T1.ship_date AS DATE) = 2016 GROUP BY T2.make ORDER BY COUNT(T1.ship_id) DESC LIMIT 1\n```"}]}, {"id": "train-5658", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments were shipped to the least populated city in California?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state = 'California' ORDER BY T3.population ASC LIMIT 1\n```"}]}, {"id": "train-5659", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city did the heaviest shipment transported?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T1.weight DESC LIMIT 1\n```"}]}, {"id": "train-5660", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the cities where Zachery Hicks transported goods."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.city_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T1.city_id = T3.city_id WHERE T2.first_name = 'Zachery' AND T2.last_name = 'Hicks'\n```"}]}, {"id": "train-5661", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of shipments that Zachery Hicks shipped in year 2017."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.first_name = 'Zachery' AND T2.last_name = 'Hicks' THEN T1.ship_id ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE STRFTIME('%Y', T1.ship_date) = '2017'\n```"}]}, {"id": "train-5662", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of the weight of goods being transported by Zachery Hicks to California in year 2016."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.first_name = 'Zachery' AND T2.last_name = 'Hicks' THEN T1.weight ELSE 0 END) AS REAL) * 100 / SUM(T1.weight) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE STRFTIME('%Y', T1.ship_date) = '2016'\n```"}]}, {"id": "train-5663", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments were shipped by the driver named Zachary Hicks?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.driver_id = 23\n```"}]}, {"id": "train-5664", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ship ID of shipments shipped to the city with the largest area?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ship_id FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.area DESC LIMIT 1\n```"}]}, {"id": "train-5665", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the drivers who shipped the shipments to the least populated city."}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id ORDER BY T2.population ASC LIMIT 1\n```"}]}, {"id": "train-5666", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the shipments shipped to Cicero, Illinois, how many shipments weighed between 9,000 to 15,000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'Cicero' AND T2.state = 'Illinois' AND T1.weight BETWEEN 9000 AND 15000\n```"}]}, {"id": "train-5667", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What model year of truck delivered the ship ID 1233?"}, {"from": "gpt", "value": "```sql\nSELECT T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1233'\n```"}]}, {"id": "train-5668", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the address of the driver that delivers the shipment for the customer lives at 7052 Carroll Road, San Diego, California?"}, {"from": "gpt", "value": "```sql\nSELECT T3.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.address = '7052 Carroll Road' AND T2.city = 'San Diego' AND T2.state = 'CA'\n```"}]}, {"id": "train-5669", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the shipments delivered by Maria Craft, how many shipments were delivered in 2017?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Maria' AND T2.last_name = 'Craft' AND STRFTIME('%Y', T1.ship_date) = '2017'\n```"}]}, {"id": "train-5670", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the truck's model year used to ship the ship ID 1245?"}, {"from": "gpt", "value": "```sql\nSELECT T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1245'\n```"}]}, {"id": "train-5671", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where does the driver of ship ID 1127 live?"}, {"from": "gpt", "value": "```sql\nSELECT T2.address FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1127'\n```"}]}, {"id": "train-5672", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the annual revenue of the customer of ship ID 1047."}, {"from": "gpt", "value": "```sql\nSELECT T2.annual_revenue FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1047'\n```"}]}, {"id": "train-5673", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the weight of the shipment delivered by Andrea Simons on March 7, 2016?"}, {"from": "gpt", "value": "```sql\nSELECT T1.weight FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Andrea' AND T2.last_name = 'Simons' AND T1.ship_date = '2016-03-07'\n```"}]}, {"id": "train-5674", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the destination city of the shipment shipped by January 16, 2017."}, {"from": "gpt", "value": "```sql\nSELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_date = '2017-01-16'\n```"}]}, {"id": "train-5675", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments were delivered to a customer from New York?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'NY'\n```"}]}, {"id": "train-5676", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the customer of ship ID 1147?"}, {"from": "gpt", "value": "```sql\nSELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1147'\n```"}]}, {"id": "train-5677", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ship ID of shipments shipped to the most populated city."}, {"from": "gpt", "value": "```sql\nSELECT T1.ship_id FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.population DESC LIMIT 1\n```"}]}, {"id": "train-5678", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the driver's name of the shipment shipped on February 22, 2016."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_date = '2016-02-22'\n```"}]}, {"id": "train-5679", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the weight of the customer's shipment with annual revenue of 39448581."}, {"from": "gpt", "value": "```sql\nSELECT T1.weight FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.annual_revenue = 39448581\n```"}]}, {"id": "train-5680", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the customer's address for the shipment with ship ID 1117?"}, {"from": "gpt", "value": "```sql\nSELECT T2.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1117'\n```"}]}, {"id": "train-5681", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the shipments to a customer from Texas, what percentage of the shipments shipped in 2017?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN STRFTIME('%Y', T1.ship_date) = '2017' THEN 1 ELSE 0 END) AS REAL ) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'TX'\n```"}]}, {"id": "train-5682", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference between the number of shipments shipped by the truck with the model year 2005 and model year 2006."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.model_year = '2005' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.model_year = '2006' THEN 1 ELSE 0 END) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id\n```"}]}, {"id": "train-5683", "db_id": "shipping", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the driver's name of the shipment with a weight greater than 95% of the average weight of all shipments."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.weight * 100 > ( SELECT 95 * AVG(weight) FROM shipment )\n```"}]}, {"id": "train-5684", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the longest Catalan language Wikipedia page title and state the number of different words in this page."}, {"from": "gpt", "value": "```sql\nSELECT title, words FROM pages WHERE title = ( SELECT MAX(LENGTH(title)) FROM pages )\n```"}]}, {"id": "train-5685", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the Catalan language wikipedia page title with less than 10 number of different words in these pages."}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE words < 10\n```"}]}, {"id": "train-5686", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the page number for Catalan language wikipedia pages containing the word 'Art' in the page title."}, {"from": "gpt", "value": "```sql\nSELECT page FROM pages WHERE title LIKE 'Art%' OR title LIKE '%Art%' OR title LIKE '%Art'\n```"}]}, {"id": "train-5687", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of Catalan language wikipedia page with revision page id '16203226'?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE revision = 16203226\n```"}]}, {"id": "train-5688", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the titles for all Catalan language wikipedia page from revision page id 106600 to 106700."}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE revision BETWEEN 106600 AND 106700\n```"}]}, {"id": "train-5689", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Catalan language wikipedia pages have between 1000 to 2000 number of different words?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(pid) FROM pages WHERE words BETWEEN 1000 AND 2000\n```"}]}, {"id": "train-5690", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the page id of wikipedia about Catalan language which have the appearance of the word 'decimal'?"}, {"from": "gpt", "value": "```sql\nSELECT T2.pid FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'decimal'\n```"}]}, {"id": "train-5691", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which word has the most occurrences within the same page of wikipedia about Catalan language?"}, {"from": "gpt", "value": "```sql\nSELECT T1.word FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T2.occurrences = ( SELECT MAX(occurrences) FROM pages_words )\n```"}]}, {"id": "train-5692", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the first words of the biwords pair where the second word is 'antic'."}, {"from": "gpt", "value": "```sql\nSELECT T1.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T2.w2nd = ( SELECT wid FROM words WHERE word = 'antic' )\n```"}]}, {"id": "train-5693", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show all the title of pages and number of occurences for each page where the word 'quipu' appears."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T2.occurrences FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid INNER JOIN words AS T3 ON T2.wid = T3.wid WHERE T3.word = 'quipu'\n```"}]}, {"id": "train-5694", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of the word occurrences in which \u2018system\u2019 appeared as the first word in the pair."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.occurrences) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T2.w1st = ( SELECT wid FROM words WHERE word = 'sistema' )\n```"}]}, {"id": "train-5695", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total pages of Wikipedia in Catalan language?"}, {"from": "gpt", "value": "```sql\nSELECT pages FROM langs WHERE lang = 'ca'\n```"}]}, {"id": "train-5696", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the Catalan language, which biwords pair appeared the most in this language/page?"}, {"from": "gpt", "value": "```sql\nSELECT w1st, w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords )\n```"}]}, {"id": "train-5697", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the word id of the catalan language that was repeated no more than 10 times in the said language?"}, {"from": "gpt", "value": "```sql\nSELECT wid FROM langs_words WHERE occurrences <= 10\n```"}]}, {"id": "train-5698", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the Catalan language Wikipedia page that has the highest number of different words?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE words = ( SELECT MAX(words) FROM pages )\n```"}]}, {"id": "train-5699", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the wikipedia page id of Arqueozoologia?"}, {"from": "gpt", "value": "```sql\nSELECT page FROM pages WHERE title = 'Arqueozoologia'\n```"}]}, {"id": "train-5700", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Abadia, what is the word id of the of the Catalan language that appeared the highest amount of times? Indicate the how many times did they said word id appeared."}, {"from": "gpt", "value": "```sql\nSELECT T2.wid, T2.occurrences FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Abadia' ORDER BY T2.occurrences DESC LIMIT 1\n```"}]}, {"id": "train-5701", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the titles of the top 5 Catalan language Wikipedia page with the least number of different words? Indicate each title's word id that has appeared the most in the said pages."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid ORDER BY T1.words LIMIT 5\n```"}]}, {"id": "train-5702", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did the word pair \"i\" and \"a\" appeared in the Cataln language/page?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(occurrences) FROM biwords WHERE w1st = 86 AND w2nd = 109\n```"}]}, {"id": "train-5703", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the word pairs that occured only twice?"}, {"from": "gpt", "value": "```sql\nSELECT T1.word, T3.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T2.occurrences = 2\n```"}]}, {"id": "train-5705", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total word of title \"Adam\" and \"Acampada\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(words) FROM pages WHERE title IN ('Adam', 'Acampada')\n```"}]}, {"id": "train-5707", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of corpus with most words?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE words = ( SELECT MAX(words) FROM pages )\n```"}]}, {"id": "train-5708", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average words of the 10 fewest words title?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN words >= 10 THEN words ELSE 0 END) AS REAL) / SUM(CASE WHEN words >= 10 THEN 1 ELSE 0 END) FROM pages\n```"}]}, {"id": "train-5709", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the title with single digit word count, list down 5 revision page ID of these titles."}, {"from": "gpt", "value": "```sql\nSELECT revision FROM pages WHERE words < 10 LIMIT 5\n```"}]}, {"id": "train-5710", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the page id of titles start with alphabet \"b\"."}, {"from": "gpt", "value": "```sql\nSELECT pid FROM pages WHERE title LIKE 'b%'\n```"}]}, {"id": "train-5711", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of corpus where word \"desena\" appear?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid INNER JOIN words AS T3 ON T2.wid = T3.wid WHERE T3.word = 'desena'\n```"}]}, {"id": "train-5712", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the word id for title \"Sometent\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.wid FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Sometent'\n```"}]}, {"id": "train-5713", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is word id \"88\" the word id for title \"Animals\"?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN COUNT(T1.pid) > 0 THEN 'YES' ELSE 'NO' END AS YORN FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T2.wid = 88 AND T1.title = 'Animals'\n```"}]}, {"id": "train-5715", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State one biword pair with occurence of 4."}, {"from": "gpt", "value": "```sql\nSELECT T1.word, T3.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T2.occurrences = 4 LIMIT 1\n```"}]}, {"id": "train-5716", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the total occurence of words that paired with \"nombre\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.occurrences) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st OR T1.wid = T2.w2nd WHERE T2.w1st IN (( SELECT wid FROM words WHERE word = 'nombre' ) OR T2.w2nd IN ( SELECT wid FROM words WHERE word = 'nombre' ))\n```"}]}, {"id": "train-5717", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the words that were paired with \"John\", list down 10 of them."}, {"from": "gpt", "value": "```sql\nSELECT w2nd FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'john' ) LIMIT 10\n```"}]}, {"id": "train-5718", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the revision page id of titles where \"fresc\" appears."}, {"from": "gpt", "value": "```sql\nSELECT T3.revision FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'fresc'\n```"}]}, {"id": "train-5719", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the words with word id from 1 to 10 and write down a paired word for each of them."}, {"from": "gpt", "value": "```sql\nSELECT T1.word AS W1, T3.word AS W2 FROM words AS T1 LEFT JOIN biwords AS T2 ON T1.wid = T2.w1st LEFT JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T1.wid <= 10 GROUP BY T1.wid\n```"}]}, {"id": "train-5720", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For corpus title \"Atomium\", pick 3 words appear in the title and calculate the total occurence of these words."}, {"from": "gpt", "value": "```sql\nSELECT T1.word, T1.occurrences FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T2.pid = ( SELECT pid FROM pages WHERE title = 'Atomium' ) LIMIT 3\n```"}]}, {"id": "train-5721", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate which is the word that is repeated the most times."}, {"from": "gpt", "value": "```sql\nSELECT word FROM words WHERE occurrences = ( SELECT MAX(occurrences) FROM words )\n```"}]}, {"id": "train-5722", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the page id of Wikipedia about Catalan language of all the pages that have a numeric value in their title."}, {"from": "gpt", "value": "```sql\nSELECT pid, title FROM pages WHERE title LIKE '%0%' OR '%1%' OR '%2%' OR '%3%' OR '%4%' OR '%5%' OR '%6%' OR '%7%' OR '%8%' OR '%9%'\n```"}]}, {"id": "train-5723", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the page that has the fewest words?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE title = ( SELECT MIN(words) FROM pages )\n```"}]}, {"id": "train-5724", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the pair of words that is repeated the most times? Identify them by their ID."}, {"from": "gpt", "value": "```sql\nSELECT w1st, w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords )\n```"}]}, {"id": "train-5725", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many total occurrences are there in the three-letter words?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(occurrences) FROM words WHERE LENGTH(word) = 3\n```"}]}, {"id": "train-5726", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of different words that appear on all pages whose title begins with A."}, {"from": "gpt", "value": "```sql\nSELECT AVG(words) FROM pages WHERE title LIKE 'A%'\n```"}]}, {"id": "train-5727", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of repetitions in the pairs of words in which the first word id is number 34."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN w1st = 34 THEN 1 ELSE 0 END) AS REAL) / COUNT(w1st) FROM biwords\n```"}]}, {"id": "train-5728", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of pages that have 1500 different words."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN words = 1500 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(page) FROM pages WHERE words > 300 LIMIT 3\n```"}]}, {"id": "train-5729", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of times that the same word appears in a pair."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN w1st = w2nd THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(w1st) FROM biwords\n```"}]}, {"id": "train-5730", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the title of all the pages in which the word comunitat appears."}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'comunitat'\n```"}]}, {"id": "train-5731", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate on how many different pages the word ripoll appears."}, {"from": "gpt", "value": "```sql\nSELECT T3.page FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'ripoll'\n```"}]}, {"id": "train-5732", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many words are repeated on the Llista de conflictes armats page?"}, {"from": "gpt", "value": "```sql\nSELECT occurrences FROM pages_words WHERE pid = ( SELECT pid FROM pages WHERE title = 'Llista de conflictes armats' )\n```"}]}, {"id": "train-5733", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate if there is any pair formed by the words fukunaga and d'egees."}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN COUNT(T1.wid) > 0 THEN 'yes' ELSE 'no' END FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st OR T1.wid = T2.w2nd WHERE T2.w1st = ( SELECT wid FROM words WHERE T1.word = 'fukunaga' ) AND T2.w2nd = ( SELECT wid FROM words WHERE word LIKE 'd%egees' )\n```"}]}, {"id": "train-5734", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average of repetitions in the pages that have a total of 100 different words."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.occurrences) AS REAL) / COUNT(T1.page) FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.words = 100\n```"}]}, {"id": "train-5735", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Wikipedia page number does the Catalan language's name, Acampada, appear on?"}, {"from": "gpt", "value": "```sql\nSELECT page FROM pages WHERE title = 'Acampada'\n```"}]}, {"id": "train-5736", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three Wikipedia pages with more than 300 words."}, {"from": "gpt", "value": "```sql\nSELECT page FROM pages WHERE words > 300 LIMIT 3\n```"}]}, {"id": "train-5737", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did the word number 8 appear?"}, {"from": "gpt", "value": "```sql\nSELECT occurrences FROM words WHERE wid = 8\n```"}]}, {"id": "train-5738", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top three most frequently occurring words and their ids."}, {"from": "gpt", "value": "```sql\nSELECT word, wid FROM words ORDER BY occurrences DESC LIMIT 3\n```"}]}, {"id": "train-5739", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How frequently did the words 1 and 25 appear together?"}, {"from": "gpt", "value": "```sql\nSELECT occurrences FROM biwords WHERE w1st = 1 AND w2nd = 25\n```"}]}, {"id": "train-5740", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What number of words are there on revision page 27457362?"}, {"from": "gpt", "value": "```sql\nSELECT words FROM pages WHERE revision = 27457362\n```"}]}, {"id": "train-5741", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of words in the Catalan language that have a repetition of more than 16,000 times?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN occurrences > 16000 THEN lid ELSE NULL END) AS REAL) * 100 / COUNT(lid) FROM langs_words\n```"}]}, {"id": "train-5742", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Wikipedia page number has the highest number of words in the Catalan language?"}, {"from": "gpt", "value": "```sql\nSELECT page FROM pages WHERE words = ( SELECT MAX(words) FROM pages )\n```"}]}, {"id": "train-5743", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What proportion of a pair of words in the Catalan language have been repeated less than 80 times?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN occurrences < 80 THEN lid ELSE NULL END) AS REAL) * 100 / COUNT(lid) FROM biwords\n```"}]}, {"id": "train-5744", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Catalan-language Wikipedia pages are there overall?"}, {"from": "gpt", "value": "```sql\nSELECT pages FROM langs WHERE lang = 'ca'\n```"}]}, {"id": "train-5745", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three Wikipedia pages that are written in Catalan, together with their titles and revision page numbers."}, {"from": "gpt", "value": "```sql\nSELECT title, revision FROM pages WHERE lid = 1 LIMIT 3\n```"}]}, {"id": "train-5746", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the language of the pair of words numbered 1 and 616?"}, {"from": "gpt", "value": "```sql\nSELECT T2.lang FROM biwords AS T1 INNER JOIN langs AS T2 ON T1.lid = T2.lid WHERE T1.w1st = 1 AND T1.w2nd = 616\n```"}]}, {"id": "train-5747", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times does the Catalan word \"nombre\" repeat itself?"}, {"from": "gpt", "value": "```sql\nSELECT T1.occurrences FROM langs_words AS T1 INNER JOIN words AS T2 ON T1.wid = T2.wid WHERE T2.word = 'nombre'\n```"}]}, {"id": "train-5748", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the second word in the pair of words number 1 and 8968?"}, {"from": "gpt", "value": "```sql\nSELECT word FROM words WHERE wid = 8968\n```"}]}, {"id": "train-5749", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which word has the most repetitions in the Catalan language?"}, {"from": "gpt", "value": "```sql\nSELECT T2.word FROM langs_words AS T1 INNER JOIN words AS T2 ON T1.wid = T2.wid WHERE T1.occurrences = ( SELECT MAX(occurrences) FROM langs_words )\n```"}]}, {"id": "train-5750", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times on page number 44 does the word \"votives\" appear?"}, {"from": "gpt", "value": "```sql\nSELECT T2.occurrences FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'votives' AND T2.pid = 44\n```"}]}, {"id": "train-5751", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times on page number 16 does the second word in the pair of words 1 and 109 appear?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.occurrences) FROM pages_words AS T1 INNER JOIN biwords AS T2 ON T2.w2nd = T1.wid WHERE T2.w2nd = 109 AND T2.w1st = 1 AND T1.pid = 16\n```"}]}, {"id": "train-5752", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the words that have been repeated under 180 times in the Catalan language?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.occurrences < 180 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.lid) FROM langs AS T1 INNER JOIN langs_words AS T2 ON T1.lid = T2.lid WHERE T1.lang = 'ca'\n```"}]}, {"id": "train-5753", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of Catalan-language Wikipedia pages have more than 10,000 words?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.words > 10000 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T2.page) FROM langs AS T1 INNER JOIN pages AS T2 ON T1.lid = T2.lid WHERE T1.lang = 'ca'\n```"}]}, {"id": "train-5754", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times the word \"desena\" occurs?"}, {"from": "gpt", "value": "```sql\nSELECT occurrences FROM words WHERE word = 'desena'\n```"}]}, {"id": "train-5755", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many words has the appearance times greater than 10?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(w1st) AS countwords FROM biwords WHERE occurrences > 10\n```"}]}, {"id": "train-5756", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the total pages of Wikipedia in Catalan language."}, {"from": "gpt", "value": "```sql\nSELECT pages FROM langs\n```"}]}, {"id": "train-5757", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many words have repetitions greater than 2000 and lower than 5000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(wid) FROM langs_words WHERE occurrences BETWEEN '2000' AND '5000'\n```"}]}, {"id": "train-5758", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the title of Catalan language Wikipedia page that has wikipedia revision page id as 106601."}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE revision = 106601\n```"}]}, {"id": "train-5759", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the Wikipedia page title that has revision page id of 28040864."}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE revision = 28040864\n```"}]}, {"id": "train-5760", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times that the word pair of \"barcelona\" and \"precolombina\" occur?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(occurrences) FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'barcelona' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'precolombina' )\n```"}]}, {"id": "train-5761", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the locale of the language of the page titled \"Anys 90\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.locale FROM langs AS T1 INNER JOIN pages AS T2 ON T1.lid = T2.lid WHERE T2.title = 'Anys 90'\n```"}]}, {"id": "train-5762", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which word that has 71303 appearance in the Catalan language?"}, {"from": "gpt", "value": "```sql\nSELECT T1.word FROM words AS T1 INNER JOIN langs_words AS T2 ON T1.wid = T2.wid WHERE T2.occurrences = 71303\n```"}]}, {"id": "train-5763", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the locale of the language of the page titled \"Abril\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.locale FROM langs AS T1 INNER JOIN pages AS T2 ON T1.lid = T2.lid WHERE T2.title = 'Abril'\n```"}]}, {"id": "train-5765", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the total pages of the words that has repeated times of 2593."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.pages) FROM langs AS T1 INNER JOIN langs_words AS T2 ON T1.lid = T2.lid WHERE T2.occurrences = 2593\n```"}]}, {"id": "train-5766", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the title of the word have id less than 20."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T2.wid < 20\n```"}]}, {"id": "train-5767", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many word that has number of different words equal to 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.wid) FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.words = 3\n```"}]}, {"id": "train-5768", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many word appeared 8 times? State the language id of the page."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.wid), T1.lid FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T2.occurrences = 8\n```"}]}, {"id": "train-5769", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average percentage of word appearance in the page that have revision page id smaller than 106680."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.words) AS REAL) * 100 / SUM(T2.occurrences) FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.revision < 106680\n```"}]}, {"id": "train-5770", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the total pages of the words that has repeated times more than 3000."}, {"from": "gpt", "value": "```sql\nSELECT T1.pages FROM langs AS T1 INNER JOIN langs_words AS T2 ON T1.lid = T2.lid WHERE T2.occurrences > 3000 GROUP BY T1.pages\n```"}]}, {"id": "train-5772", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many pages of Wikipedia are there in total on the Catalan language?"}, {"from": "gpt", "value": "```sql\nSELECT pages FROM langs WHERE lang = 'ca'\n```"}]}, {"id": "train-5773", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of the Wikipedia pages on the Catalan language with more than 4000 words."}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE lid = 1 AND words > 4000\n```"}]}, {"id": "train-5774", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many words are there on the page titled \"Asclepi\"?"}, {"from": "gpt", "value": "```sql\nSELECT words FROM pages WHERE title = 'Asclepi'\n```"}]}, {"id": "train-5775", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of these pages have more words, the page titled \"Afluent\" or \"Asclepi\"?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN ( SELECT words FROM pages WHERE title = 'Asclepi' ) > ( SELECT words FROM pages WHERE title = 'Afluent' ) THEN 'Asclepi' ELSE 'Afluent' END\n```"}]}, {"id": "train-5776", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the occurrence of the word \"nombre\"?"}, {"from": "gpt", "value": "```sql\nSELECT occurrences FROM words WHERE word = 'nombre'\n```"}]}, {"id": "train-5777", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the Catalan words with an occurrence of over 200000."}, {"from": "gpt", "value": "```sql\nSELECT word FROM words WHERE occurrences > 200000\n```"}]}, {"id": "train-5778", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the locale of the language of the page titled \"Asclepi\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.locale FROM pages AS T1 INNER JOIN langs AS T2 ON T1.lid = T2.lid WHERE T1.title = 'Asclepi'\n```"}]}, {"id": "train-5779", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did the word \"grec\" occur on the page titled \"\u00c0bac\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.occurrences FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T3.title = '\u00c0bac' AND T1.word = 'grec'\n```"}]}, {"id": "train-5780", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the title of the pages on which the word \"grec\" occurred for over 20 times."}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'grec' AND T2.occurrences > 20\n```"}]}, {"id": "train-5781", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many words are there on the page that the word \"grec\" has occurred for 52 times?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.words) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'grec' AND T2.occurrences = 52\n```"}]}, {"id": "train-5782", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the occurrence of the biwords pair whose first word is \"\u00e0bac\" and second word is \"xin\u00e8s\"?"}, {"from": "gpt", "value": "```sql\nSELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = '\u00e0bac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'xin\u00e8s' )\n```"}]}, {"id": "train-5783", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which biwords pair has a higher occurrence, \"\u00e0bac-xin\u00e8s\" or \"\u00e0bac-grec\"?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN ( SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = '\u00e0bac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'xin\u00e8s' ) ) > ( SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = '\u00e0bac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'grec' ) ) THEN '\u00e0bac-xin\u00e8s' ELSE '\u00e0bac-grec' END AS CALUS FROM words LIMIT 1\n```"}]}, {"id": "train-5784", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more times does the first word in the biwords pair \"\u00e0bac-xin\u00e8s\" occur than the biwords pair itself?"}, {"from": "gpt", "value": "```sql\nSELECT occurrences - ( SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = '\u00e0bac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'xin\u00e8s' ) ) AS CALUS FROM words WHERE word = '\u00e0bac'\n```"}]}, {"id": "train-5785", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the biwords pairs with \"\u00e0bac\" as its first word."}, {"from": "gpt", "value": "```sql\nSELECT T1.word AS W1, T3.word AS W2 FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T1.word = '\u00e0bac'\n```"}]}, {"id": "train-5786", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total occurrence of the biwords pairs with \"\u00e0bac\" as its first word?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.w1st) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T1.word = '\u00e0bac'\n```"}]}, {"id": "train-5787", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Wikipedia pages are there on the language of the biwords pair \"\u00e0bac-xin\u00e8s\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.pages) FROM langs AS T1 INNER JOIN biwords AS T2 ON T1.lid = T2.lid WHERE T2.w1st = ( SELECT wid FROM words WHERE word = '\u00e0bac' ) AND T2.w2nd = ( SELECT wid FROM words WHERE word = 'xin\u00e8s' )\n```"}]}, {"id": "train-5788", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much higher in percentage does the word \"grec\" occur on the page titled \"\u00c0bac\" than on the page titled \"Astronomia\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(CASE WHEN T3.title = '\u00c0bac' THEN T2.occurrences END) - SUM(CASE WHEN T3.title = 'Astronomia' THEN T2.occurrences END)) AS REAL) * 100 / SUM(CASE WHEN T3.title = 'Astronomia' THEN T2.occurrences END) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'grec'\n```"}]}, {"id": "train-5789", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many pages does the Catalan language have in Wikipedia?"}, {"from": "gpt", "value": "```sql\nSELECT pages FROM langs WHERE lang = 'ca'\n```"}]}, {"id": "train-5790", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which word has the most repetitions in the Catalan language? Give the ID of the word."}, {"from": "gpt", "value": "```sql\nSELECT wid FROM langs_words WHERE occurrences = ( SELECT MAX(occurrences) FROM langs_words )\n```"}]}, {"id": "train-5791", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the word ID for the second word for the biwords pair with most repetitions?"}, {"from": "gpt", "value": "```sql\nSELECT w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords )\n```"}]}, {"id": "train-5792", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many occurrences does the word \"panajot\" have?"}, {"from": "gpt", "value": "```sql\nSELECT occurrences FROM words WHERE word = 'panajot'\n```"}]}, {"id": "train-5793", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which word has the time of occurrences as 340691?"}, {"from": "gpt", "value": "```sql\nSELECT word FROM words WHERE occurrences = 340691\n```"}]}, {"id": "train-5794", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the word ID for \"periodograma\"."}, {"from": "gpt", "value": "```sql\nSELECT wid FROM words WHERE word = 'periodograma'\n```"}]}, {"id": "train-5795", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the biwords pair that appears \"116430\" times, what is the second word of the pair?"}, {"from": "gpt", "value": "```sql\nSELECT T1.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w2nd WHERE T2.occurrences = 116430\n```"}]}, {"id": "train-5796", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times does the word \"riu\" appears in the biwords pair?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.wid) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T1.word = 'riu'\n```"}]}, {"id": "train-5797", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which word has the most appearances in the Wikipedia page with the title of \"Agricultura\"? Give the word ID."}, {"from": "gpt", "value": "```sql\nSELECT T2.wid FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Agricultura' ORDER BY T2.occurrences DESC LIMIT 1\n```"}]}, {"id": "train-5798", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many appearances does the word ID No. 2823 have in the Wikipedia page \"Astre\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.occurrences) FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Astre' AND T2.wid = 2823\n```"}]}, {"id": "train-5799", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which Wikipedia page does the word ID No. 174 have the most appearances? Give the title."}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE pid = ( SELECT pid FROM pages_words WHERE wid = 174 ORDER BY occurrences DESC LIMIT 1 )\n```"}]}, {"id": "train-5800", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times does the word \"her\u00f2dot\" appear in the Wikipedia page?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.occurrences) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'her\u00f2dot'\n```"}]}, {"id": "train-5801", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which word has the most appearances in the Wikipedia page revision ID No. 28278070? Give the word ID."}, {"from": "gpt", "value": "```sql\nSELECT pid FROM pages_words WHERE pid = ( SELECT pid FROM pages WHERE revision = 28278070 ) ORDER BY occurrences DESC LIMIT 1\n```"}]}, {"id": "train-5802", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times does the biwords \"que gregorio\" appear in the language?"}, {"from": "gpt", "value": "```sql\nSELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'que' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'gregorio' )\n```"}]}, {"id": "train-5803", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many biword pairs contain the word \"base\" as the second word?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(w1st) FROM biwords WHERE w2nd = ( SELECT wid FROM words WHERE word = 'base' )\n```"}]}, {"id": "train-5804", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times of repetition does the word \"exemple\" show in the Catalan language?"}, {"from": "gpt", "value": "```sql\nSELECT T2.occurrences FROM words AS T1 INNER JOIN langs_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'exemple' AND T2.lid = 1\n```"}]}, {"id": "train-5805", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which word that has 274499 repetitions in the Catalan language?"}, {"from": "gpt", "value": "```sql\nSELECT T1.word FROM words AS T1 INNER JOIN langs_words AS T2 ON T1.wid = T2.wid WHERE T2.occurrences = 274499 AND T2.lid = 1\n```"}]}, {"id": "train-5806", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times greater is the appearances of the biword pair \"a base\" than \"a decimal\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(occurrences AS REAL) / ( SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'a' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'decimal' ) ) FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'a' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'base' )\n```"}]}, {"id": "train-5807", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the word \"grec\", what is the percentage of the appearances in the \"Art\" Wikipedia page have among all the appearances?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.title = 'Art' THEN T2.occurrences ELSE 0 END) AS REAL) * 100 / SUM(T2.occurrences) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'grec'\n```"}]}, {"id": "train-5808", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Wikipedia pages with over 4000 different words are there on the Catalan language?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(lid) FROM pages WHERE lid = 1 AND words > 4000\n```"}]}, {"id": "train-5809", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the Wikipedia pages on the Catalan language with 10 different words."}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE lid = 1 AND words = 10 LIMIT 10\n```"}]}, {"id": "train-5810", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the word that occurs the most in the Catalan language?"}, {"from": "gpt", "value": "```sql\nSELECT word FROM words WHERE occurrences = ( SELECT MAX(occurrences) FROM words )\n```"}]}, {"id": "train-5811", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of the top 3 Wikipedia pages with the most different words on the Catalan language."}, {"from": "gpt", "value": "```sql\nSELECT title FROM pages WHERE lid = 1 ORDER BY words DESC LIMIT 3\n```"}]}, {"id": "train-5812", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the revision ID for the page on Catalan titled \"Arqueologia\"?"}, {"from": "gpt", "value": "```sql\nSELECT revision FROM pages WHERE lid = 1 AND title = 'Arqueologia'\n```"}]}, {"id": "train-5813", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the wikipedia pages on Catalan with more than 300 different words, how many of them have a revision ID of over 28330000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(lid) FROM pages WHERE lid = 1 AND words > 300 AND revision > 28330000\n```"}]}, {"id": "train-5814", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the page IDs of all the Wikipedia pages that have the word \"nombre\" appeared on it."}, {"from": "gpt", "value": "```sql\nSELECT T2.pid FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'nombre'\n```"}]}, {"id": "train-5815", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Wikipedia pages on Catalan are there with the word \"nombre\" appearing for more than 5 times?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.pid) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'nombre' AND T2.occurrences > 5\n```"}]}, {"id": "train-5816", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many biwords pairs are there whose second word is \"grec\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.w1st) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w2nd WHERE T1.word = 'grec'\n```"}]}, {"id": "train-5817", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the page on which the word \"grec\" has an occurrence of 52 times."}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'grec' AND T2.occurrences = 52\n```"}]}, {"id": "train-5818", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the biwords pairs with \"\u00e0bac\" as its first word, how many of them have an occurrence of over 10?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.w2nd) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T1.word = '\u00e0bac' AND T2.occurrences > 10\n```"}]}, {"id": "train-5819", "db_id": "language_corpus", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average occurrence of the word \"grec\" on each Wikipedia page that has this word?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.occurrences) AS REAL) / COUNT(T1.wid) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'grec'\n```"}]}, {"id": "train-5820", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights were there on 2018/8/1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1'\n```"}]}, {"id": "train-5821", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the flights on 2018/8/1, how many of them departed from an airport in New York?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND ORIGIN = 'JFK'\n```"}]}, {"id": "train-5822", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the destination cities of all the flights that were cancelled on 2018/8/1."}, {"from": "gpt", "value": "```sql\nSELECT DEST FROM Airlines WHERE FL_DATE = '2018/8/1' AND CANCELLED = 1 GROUP BY DEST\n```"}]}, {"id": "train-5823", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the dates of the flights that were cancelled due to the most serious reason."}, {"from": "gpt", "value": "```sql\nSELECT FL_DATE FROM Airlines WHERE CANCELLATION_CODE = 'A' GROUP BY FL_DATE\n```"}]}, {"id": "train-5824", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the departure airports of the flights on 2018/8/1 that were delayed."}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T2.DEP_DELAY > 0 GROUP BY T1.Description\n```"}]}, {"id": "train-5825", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the flights on 2018/8/1, how many of them were scheduled to depart from John F. Kennedy International in New York?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Code) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T1.Description = 'New York, NY: John F. Kennedy International'\n```"}]}, {"id": "train-5826", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the flight on 2018/8/1 that was delayed for the longest time, which was the destination airport of this flight?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/1' ORDER BY T2.DEP_DELAY DESC LIMIT 1\n```"}]}, {"id": "train-5827", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the flights departing from John F. Kennedy International, how many of them arrived earlier than scheduled?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.ARR_DELAY < 0 THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'New York, NY: John F. Kennedy International'\n```"}]}, {"id": "train-5828", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the flights scheduled to depart from John F. Kennedy International on 2018/8/1, when was the earliest one scheduled to depart?"}, {"from": "gpt", "value": "```sql\nSELECT T2.DEP_TIME FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T1.Description = 'New York, NY: John F. Kennedy International' AND T2.DEP_TIME IS NOT NULL ORDER BY T2.DEP_TIME ASC LIMIT 1\n```"}]}, {"id": "train-5829", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights on 2018/8/1 were operated by American Airlines Inc.?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1' AND T3.Description = 'American Airlines Inc.: AA'\n```"}]}, {"id": "train-5830", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the flight numbers of all the flights operated by American Airlines Inc. that were scheduled to depart from John F. Kennedy International."}, {"from": "gpt", "value": "```sql\nSELECT T2.OP_CARRIER_FL_NUM FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA' AND T1.Description = 'New York, NY: John F. Kennedy International' AND T2.FL_DATE = '2018/8/1'\n```"}]}, {"id": "train-5831", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights operated by American Airlines Inc. on 2018/8/1 were faster than scheduled?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1' AND T3.Description = 'American Airlines Inc.: AA'\n```"}]}, {"id": "train-5832", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the flight number of the flight operated by American Airlines Inc. that had the longest delay in departure?"}, {"from": "gpt", "value": "```sql\nSELECT T1.OP_CARRIER_FL_NUM FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T2.Code = T1.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T1.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA' ORDER BY T1.DEP_TIME DESC LIMIT 1\n```"}]}, {"id": "train-5833", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the flights operated by American Airlines Inc., how many of them were scheduled to land in New York?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.DEST = 'JFK' THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA'\n```"}]}, {"id": "train-5834", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the flights operated by American Airlines Inc. on 2018/8/1, how many of them were cancelled?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.CANCELLED = 1 THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1' AND T3.Description = 'American Airlines Inc.: AA'\n```"}]}, {"id": "train-5835", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which airline operated more flights on 2018/8/1, American Airlines Inc. or Endeavor Air Inc.?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN COUNT(CASE WHEN T3.Description = 'American Airlines Inc.: AA' THEN 1 ELSE NULL END) > COUNT(CASE WHEN T3.Description = 'Endeavor Air Inc.: 9E' THEN 1 ELSE NULL END) THEN 'American Airlines Inc.: AA' ELSE 'Endeavor Air Inc.: 9E' END AS RESULT FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1'\n```"}]}, {"id": "train-5836", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average departure delay time of flights operated by American Airlines Inc.?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.DEP_DELAY) FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T2.Code = T1.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T1.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA'\n```"}]}, {"id": "train-5837", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights on average does American Airlines Inc. operate every day in August, 2018?"}, {"from": "gpt", "value": "```sql\nSELECT CAST( SUM(CASE WHEN T2.FL_DATE LIKE '2018/8%' THEN 1 ELSE 0 END) AS REAL) / 31 FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA'\n```"}]}, {"id": "train-5838", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of air carriers in the database?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Code) FROM `Air Carriers`\n```"}]}, {"id": "train-5839", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of planes that took off from Los Angeles International airport on 2018/8/27."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.FL_DATE = '2018/8/27' THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'Los Angeles, CA: Los Angeles International'\n```"}]}, {"id": "train-5840", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of airplanes that landed on Oakland Airport on 2018/8/7."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Description LIKE '%Oakland%' THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/7'\n```"}]}, {"id": "train-5841", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights of Alaska Airlines were delayed on 2018/8/2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/2' AND T2.Description = 'Alaska Airlines Inc.: AS' AND T1.DEP_DELAY > 0\n```"}]}, {"id": "train-5842", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of fights landed earlier on Miami Airport on 2018/8/12."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/12' AND T2.DEST = 'MIA' AND T2.ARR_DELAY < 0\n```"}]}, {"id": "train-5843", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights from American Airlines were cancelled due to a type A cancellation code?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.CANCELLATION_CODE = 'A' AND T2.Description = 'American Airlines Inc.: AA' AND T1.CANCELLED = 1\n```"}]}, {"id": "train-5844", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights of Endeavor Air Inc. were faster than scheduled on 2018/8/31?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME THEN 1 ELSE 0 END) AS count FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/31' AND T2.Description = 'Endeavor Air Inc.: 9E'\n```"}]}, {"id": "train-5845", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many planes of Spirit Air Lines took off on 2018/8/7?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Code) FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/7' AND T2.Description = 'Spirit Air Lines: NK'\n```"}]}, {"id": "train-5846", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the flight with the tail number 'N702SK', which air carrier does it belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.TAIL_NUM = 'N702SK' GROUP BY T2.Description\n```"}]}, {"id": "train-5847", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of the airport which landed the most number of flights on 2018/8/15."}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/15' ORDER BY T2.DEST DESC LIMIT 1\n```"}]}, {"id": "train-5848", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the flight from ATL to PHL on 2018/8/1 that scheduled local departure time as \"2040\", which air carrier does this flight belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/1' AND T1.ORIGIN = 'ATL' AND T1.DEST = 'PHL' AND T1.CRS_DEP_TIME = '2040' GROUP BY T2.Description\n```"}]}, {"id": "train-5849", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of flights that landed at Lake Charles Regional Airport on 2018/8/15."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Code) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/15' AND T1.Description = 'Lake Charles, LA: Lake Charles Regional'\n```"}]}, {"id": "train-5850", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights were there from San Diego International airport to Los Angeles International airport in the August of 2018?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(FL_DATE) FROM Airlines WHERE FL_DATE LIKE '2018/8%' AND ORIGIN = ( SELECT T2.ORIGIN FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'San Diego, CA: San Diego International' ) AND DEST = ( SELECT T4.DEST FROM Airports AS T3 INNER JOIN Airlines AS T4 ON T3.Code = T4.DEST WHERE T3.Description = 'Los Angeles, CA: Los Angeles International' )\n```"}]}, {"id": "train-5851", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of flights from Los Angeles International airport that were cancelled due to a type C cancellation code?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.CANCELLATION_CODE = 'C' THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/15' AND T2.CANCELLATION_CODE IS NOT NULL AND T1.Description = 'Los Angeles, CA: Los Angeles International'\n```"}]}, {"id": "train-5852", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of flights which landed at Pittsburgh were faster than scheduled?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.ACTUAL_ELAPSED_TIME < T1.CRS_ELAPSED_TIME THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T2.Code = T1.DEST WHERE T2.Description LIKE '%Pittsburgh%' AND T1.CRS_ELAPSED_TIME IS NOT NULL AND T1.ACTUAL_ELAPSED_TIME IS NOT NULL\n```"}]}, {"id": "train-5853", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description of the airline code 19049?"}, {"from": "gpt", "value": "```sql\nSELECT Description FROM `Air Carriers` WHERE Code = 19049\n```"}]}, {"id": "train-5854", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights departed on time on 8/1/2018?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND DEP_DELAY <= 0\n```"}]}, {"id": "train-5855", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the codes of the airport found in Ankara, Turkey?"}, {"from": "gpt", "value": "```sql\nSELECT Code FROM Airports WHERE Description LIKE '%Ankara, Turkey%'\n```"}]}, {"id": "train-5856", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long was the longest minute delay caused by a weather problem in airport id 12264?"}, {"from": "gpt", "value": "```sql\nSELECT WEATHER_DELAY FROM Airlines WHERE ORIGIN_AIRPORT_ID = 12264 ORDER BY WEATHER_DELAY DESC LIMIT 1\n```"}]}, {"id": "train-5857", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the IATA code of the Anita Bay Airport in Anita Bay, Alaska?"}, {"from": "gpt", "value": "```sql\nSELECT Code FROM Airports WHERE Description = 'Anita Bay, AK: Anita Bay Airport'\n```"}]}, {"id": "train-5858", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the origin airport id that recorded the longest delay due to a late aircraft?"}, {"from": "gpt", "value": "```sql\nSELECT ORIGIN_AIRPORT_ID FROM Airlines ORDER BY LATE_AIRCRAFT_DELAY DESC LIMIT 1\n```"}]}, {"id": "train-5859", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights depart to Hartsfield-Jackson Atlanta International from Chicago O'Hare International?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(FL_DATE) FROM Airlines WHERE ORIGIN = ( SELECT T2.ORIGIN FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'Chicago, IL: Chicago O''Hare International' ) AND DEST = ( SELECT T4.DEST FROM Airports AS T3 INNER JOIN Airlines AS T4 ON T3.Code = T4.DEST WHERE T3.Description = 'Atlanta, GA: Hartsfield-Jackson Atlanta International' )\n```"}]}, {"id": "train-5860", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many planes does Southwest Airlines Co. have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.TAIL_NUM) FROM ( SELECT T1.TAIL_NUM FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T2.Description = 'Southwest Airlines Co.: WN' GROUP BY T1.TAIL_NUM ) T3\n```"}]}, {"id": "train-5861", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On August 2018, which day had the highest number of cancelled flights due to the most serious reasons in Dallas/Fort Worth International?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FL_DATE FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE LIKE '2018/8%' AND T1.Description = 'Dallas/Fort Worth, TX: Dallas/Fort Worth International' AND T2.ORIGIN = 'DFW' AND T2.CANCELLED = 1 AND T2.CANCELLATION_CODE = 'A' GROUP BY T2.FL_DATE ORDER BY COUNT(T2.FL_DATE) DESC LIMIT 1\n```"}]}, {"id": "train-5862", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the tail numbers of all the aircraft that arrived on time at Meadows Field airport in August of 2018?"}, {"from": "gpt", "value": "```sql\nSELECT 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\n```"}]}, {"id": "train-5863", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the airports whose destination is Logan International, what is the airline id of the carrier operator with the highest delay in minutes due to security?"}, {"from": "gpt", "value": "```sql\nSELECT T2.OP_CARRIER_AIRLINE_ID FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T1.Description = 'Boston, MA: Logan International' AND T2.DEST = 'BOS' ORDER BY T2.SECURITY_DELAY DESC LIMIT 1\n```"}]}, {"id": "train-5864", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the top 5 airlines with the highest number of aircraft?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code GROUP BY T2.Description ORDER BY T1.TAIL_NUM DESC LIMIT 5\n```"}]}, {"id": "train-5865", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the airline with the highest number of non-cancelled flights?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.CANCELLED = 0 GROUP BY T2.Description ORDER BY COUNT(T1.CANCELLED) DESC LIMIT 1\n```"}]}, {"id": "train-5866", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the airline to which tail number N202NN belongs to."}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.TAIL_NUM = 'N202NN' GROUP BY T2.Description\n```"}]}, {"id": "train-5867", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the airline that flew the most flights to Chicago Midway International?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T1.Description = 'Chicago, IL: Chicago Midway International' AND T2.DEST = 'MDW' GROUP BY T3.Description ORDER BY COUNT(T3.Description) DESC LIMIT 1\n```"}]}, {"id": "train-5868", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the tail number of a Compass Airline's plane that flew the most number of flights from LAX to ABQ?"}, {"from": "gpt", "value": "```sql\nSELECT T2.OP_CARRIER_AIRLINE_ID FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Compass Airlines: CP' AND T2.ORIGIN = 'LAX' AND T2.DEST = 'ABQ' GROUP BY T2.OP_CARRIER_AIRLINE_ID ORDER BY COUNT(T2.OP_CARRIER_AIRLINE_ID) DESC LIMIT 1\n```"}]}, {"id": "train-5869", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which airport did Republic Airline fly the most from?"}, {"from": "gpt", "value": "```sql\nSELECT T2.DEST FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Republic Airline: YX' GROUP BY T2.DEST ORDER BY COUNT(T2.DEST) DESC LIMIT 1\n```"}]}, {"id": "train-5870", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which airline does the aircraft with the fastest flight belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T1.OP_CARRIER_AIRLINE_ID FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T1.ORIGIN = T2.Code WHERE T1.ACTUAL_ELAPSED_TIME IS NOT NULL AND T1.CRS_ELAPSED_TIME IS NOT NULL ORDER BY T1.ACTUAL_ELAPSED_TIME - T1.CRS_ELAPSED_TIME ASC LIMIT 1\n```"}]}, {"id": "train-5871", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many hours in total did all of the Delta Air Lines aircraft were delayed due to a late aircraft in August of 2018? Identify the plane number of the aircraft with the highest delayed hours."}, {"from": "gpt", "value": "```sql\nSELECT T1.TAIL_NUM, SUM(CAST(T1.LATE_AIRCRAFT_DELAY AS REAL) / 60) AS delay FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T2.Code = T1.OP_CARRIER_AIRLINE_ID WHERE T1.FL_DATE LIKE '2018/8/%' AND T2.Description = 'Delta Air Lines Inc.: DL' ORDER BY delay DESC LIMIT 1\n```"}]}, {"id": "train-5872", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three airports with their codes."}, {"from": "gpt", "value": "```sql\nSELECT Code, Description FROM Airports LIMIT 3\n```"}]}, {"id": "train-5873", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the code of Mississippi Valley Airlines?"}, {"from": "gpt", "value": "```sql\nSELECT Code FROM `Air Carriers` WHERE Description LIKE 'Mississippi Valley Airlines%'\n```"}]}, {"id": "train-5874", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the scheduled local departure time and the actual departure time of the flight from Philadelphia to Harrisburg with the plane's tail number N627AE on the 13th of August 2018?"}, {"from": "gpt", "value": "```sql\nSELECT CRS_DEP_TIME, DEP_TIME FROM Airlines WHERE ORIGIN = 'PHL' AND DEST = 'MDT' AND TAIL_NUM = 'N627AE' AND FL_DATE = '2018/8/13'\n```"}]}, {"id": "train-5875", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights on the 1st of August 2018 were coming from Allentown, Pennsylvania?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND ORIGIN = 'ABE'\n```"}]}, {"id": "train-5876", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the only flight destination for flights from Albany?"}, {"from": "gpt", "value": "```sql\nSELECT DEST FROM Airlines WHERE ORIGIN = 'ABY' GROUP BY DEST\n```"}]}, {"id": "train-5877", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights from Dallas to Santa Ana departed on time?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airlines WHERE DEST = 'SNA' AND ORIGIN = 'DFW' AND DEP_DELAY = 0\n```"}]}, {"id": "train-5878", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights from Charlotte Douglas International Airport to Austin - Bergstrom International Airport experienced serious reasons that cause flight cancellation?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T1.ORIGIN = T2.Code WHERE T1.ORIGIN = 'CLT' AND T1.DEST = 'AUS' AND T2.Description = 'Charlotte, NC: Charlotte Douglas International' AND T1.CANCELLATION_CODE = 'A'\n```"}]}, {"id": "train-5879", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which flight carrier operator has the most cancelled flights?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID ORDER BY T2.CANCELLED DESC LIMIT 1\n```"}]}, {"id": "train-5880", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the actual departure time of JetBlue Airways with the plane's tail number N903JB to Fort Lauderdale-Hollywood International Airport on the 20th of August 2018?"}, {"from": "gpt", "value": "```sql\nSELECT T1.DEP_TIME FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code INNER JOIN Airports AS T3 ON T1.DEST = T3.Code WHERE T1.FL_DATE = '2018/8/20' AND T1.TAIL_NUM = 'N903JB' AND T2.Description LIKE '%JetBlue Airways%' AND T3.Description LIKE '%Fort Lauderdale-Hollywood%'\n```"}]}, {"id": "train-5881", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which flight carrier operator flies from Atlantic City to Fort Lauderdale?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.ORIGIN = 'ACY' AND T1.DEST = 'FLL' GROUP BY T2.Description\n```"}]}, {"id": "train-5882", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the airport description of the airport code A11?"}, {"from": "gpt", "value": "```sql\nSELECT Description FROM Airports WHERE Code = 'A11'\n```"}]}, {"id": "train-5883", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of flights that have Oklahoma as their origin?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) AS num FROM Airlines WHERE Origin = 'OKC'\n```"}]}, {"id": "train-5884", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many airports have a code starting with the letter C?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airports WHERE Code LIKE 'C%'\n```"}]}, {"id": "train-5885", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the destinations of flight number 1596."}, {"from": "gpt", "value": "```sql\nSELECT DEST FROM Airlines WHERE OP_CARRIER_FL_NUM = 1596\n```"}]}, {"id": "train-5886", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the description of the airports that have code that ends with number 3?"}, {"from": "gpt", "value": "```sql\nSELECT Description FROM Airports WHERE Code LIKE '%3'\n```"}]}, {"id": "train-5887", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the code of the airport described as Driftwood Bay, AK: Driftwood Bay Airport."}, {"from": "gpt", "value": "```sql\nSELECT Code FROM Airports WHERE Description = 'Driftwood Bay, AK: Driftwood Bay Airport'\n```"}]}, {"id": "train-5888", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cancelled flights are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Airlines WHERE CANCELLED = 1\n```"}]}, {"id": "train-5889", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the tail number of flights that flew on August 17, 2018."}, {"from": "gpt", "value": "```sql\nSELECT TAIL_NUM FROM Airlines WHERE FL_DATE = '2018/8/17' GROUP BY TAIL_NUM\n```"}]}, {"id": "train-5890", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the origin of the flight that has the shortest actual elapsed time."}, {"from": "gpt", "value": "```sql\nSELECT ORIGIN FROM Airlines ORDER BY ACTUAL_ELAPSED_TIME ASC LIMIT 1\n```"}]}, {"id": "train-5892", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the air carrier description and code of the flight with the shortest arrival time."}, {"from": "gpt", "value": "```sql\nSELECT T1.Description, T1.Code FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID ORDER BY T2.ARR_TIME ASC LIMIT 1\n```"}]}, {"id": "train-5893", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many flights of air carrier called JetBlue Airways: B6 have 0 new arrival delay?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description LIKE '%JetBlue Airways: B6%' AND T2.ARR_DELAY_NEW = 0\n```"}]}, {"id": "train-5894", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the air carrier description of all flights arriving at Miami."}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.DEST = 'MIA'\n```"}]}, {"id": "train-5895", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the air carrier's description of the cancelled flights?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.CANCELLED = 1 GROUP BY T1.Description\n```"}]}, {"id": "train-5898", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the air carrier's description of the flights with 0 departure delay."}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.DEP_DELAY = 0 GROUP BY T1.Description\n```"}]}, {"id": "train-5899", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the air carrier description of the flight with the highest actual elapsed time."}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID ORDER BY T2.ACTUAL_ELAPSED_TIME DESC LIMIT 1\n```"}]}, {"id": "train-5901", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From August 10 to August 20, 2018, how many cancelled flights of air carrier named Spirit Air Lines: NK are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Spirit Air Lines: NK' AND T2.CANCELLED = 0 AND T2.FL_DATE BETWEEN '2018/8/10' AND '2018/8/20'\n```"}]}, {"id": "train-5902", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of flights that flew on August 2, 2018 with air carrier described as Horizon Air?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description LIKE '%Horizon Air%' AND T2.FL_DATE = '2018/8/2'\n```"}]}, {"id": "train-5905", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the flights with air carrier named Republic Airline, how many of the flights have departure delay of 30 minutes and above?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description LIKE '%Republic Airline%' AND T2.DEP_DELAY > 30\n```"}]}, {"id": "train-5906", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the air carriers of the flights that flew on August 25, 2018 that have departure delay of -5?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.FL_DATE = '2018/8/25' GROUP BY T1.Description\n```"}]}, {"id": "train-5907", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the air carrier description of the flight with a tail number N922US from Phoenix."}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T2.Code = T1.OP_CARRIER_AIRLINE_ID WHERE T1.TAIL_NUM = 'N922US' AND T1.ORIGIN = 'PHX' GROUP BY T2.Description\n```"}]}, {"id": "train-5908", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the air carrier description of the flights that have an earlier arrival and departure."}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.ARR_DELAY < 0 AND T2.DEP_DELAY < 0 GROUP BY T1.Description\n```"}]}, {"id": "train-5909", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the flights with air carrier \"Southwest Airlines Co.: WN\", provide the tail number of flights with an actual elapsed time lower than the 80% of the average actual elapsed time of listed flights."}, {"from": "gpt", "value": "```sql\nSELECT T2.TAIL_NUM FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Southwest Airlines Co.: WN' AND T2.ACTUAL_ELAPSED_TIME < ( SELECT AVG(ACTUAL_ELAPSED_TIME) * 0.8 FROM Airlines )\n```"}]}, {"id": "train-5910", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the air carrier's description with arrival time lower than the 40% of the average arrival time of flights that flew to Phoenix."}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T2.DEST = 'PHX' AND T2.ARR_TIME < ( SELECT AVG(ARR_TIME) * 0.4 FROM Airlines ) GROUP BY T1.Description\n```"}]}, {"id": "train-5911", "db_id": "airline", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the flights of the air carrier described as American Airlines, what is the percentage of the flights with earlier departure?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.DEP_DELAY < 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description LIKE '%American Airlines%'\n```"}]}, {"id": "train-5912", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the books published by publisher ID 1929, how many of them have over 500 pages?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book WHERE publisher_id = 1929 AND num_pages > 500\n```"}]}, {"id": "train-5913", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the publication date of the book with the most pages?"}, {"from": "gpt", "value": "```sql\nSELECT publication_date FROM book ORDER BY num_pages DESC LIMIT 1\n```"}]}, {"id": "train-5914", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the publisher of the book \"The Illuminati\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Illuminati'\n```"}]}, {"id": "train-5915", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books were published by publisher \"Thomas Nelson\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Thomas Nelson'\n```"}]}, {"id": "train-5916", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the publisher that has published the most number of books?"}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_name ORDER BY COUNT(T1.book_id) DESC LIMIT 1\n```"}]}, {"id": "train-5917", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the title of the oldest book published by publisher \"Thomas Nelson\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Thomas Nelson' ORDER BY T1.publication_date ASC LIMIT 1\n```"}]}, {"id": "train-5918", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the books published by publisher \"Thomas Nelson\", how many of them have over 300 pages?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Thomas Nelson' AND T1.num_pages > 300\n```"}]}, {"id": "train-5919", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the publisher of the book with the most pages?"}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id ORDER BY T1.num_pages DESC LIMIT 1\n```"}]}, {"id": "train-5920", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books are in English?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'English'\n```"}]}, {"id": "train-5921", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the books in British English."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'British English'\n```"}]}, {"id": "train-5922", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the cheapest order price of the book \"The Little House\"?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(T2.price) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'The Little House'\n```"}]}, {"id": "train-5923", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the books that Lucas Wyldbore has ordered."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Lucas' AND T4.last_name = 'Wyldbore'\n```"}]}, {"id": "train-5924", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the books ordered by Lucas Wyldbore, how many of them are over 300 pages?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Lucas' AND T4.last_name = 'Wyldbore' AND T1.num_pages > 300\n```"}]}, {"id": "train-5925", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total price of all the books ordered by Lucas Wyldbore?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.price) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Lucas' AND T3.last_name = 'Wyldbore'\n```"}]}, {"id": "train-5926", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much money on average does Lucas Wyldbore spend on book orders?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.price) / COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Lucas' AND T3.last_name = 'Wyldbore'\n```"}]}, {"id": "train-5927", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the books ordered by Lucas Wyldbore, what is the percentage of those books over $13?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.price > 13 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Lucas' AND T3.last_name = 'Wyldbore'\n```"}]}, {"id": "train-5928", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city does the address id 547 belong to?"}, {"from": "gpt", "value": "```sql\nSELECT city FROM address WHERE address_id = 547\n```"}]}, {"id": "train-5929", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders has Cordy Dumbarton made?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Cordy' AND T1.last_name = 'Dumbarton'\n```"}]}, {"id": "train-5930", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the title of the earliest published Japanese book."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'Japanese' ORDER BY T1.publication_date ASC LIMIT 1\n```"}]}, {"id": "train-5931", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the publisher which published the most books, show its name."}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_name ORDER BY COUNT(T2.publisher_id) DESC LIMIT 1\n```"}]}, {"id": "train-5932", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books were published by Kensington?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.book_id) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Kensington'\n```"}]}, {"id": "train-5933", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which language was book id 1405 written in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T1.book_id = 1405\n```"}]}, {"id": "train-5934", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which customer has made the most orders? Show his/her full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-5935", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the book title of the bestseller."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id GROUP BY T1.title ORDER BY COUNT(T1.title) DESC LIMIT 1\n```"}]}, {"id": "train-5936", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books did David Foster Wallace write?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.title) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'David Foster Wallace'\n```"}]}, {"id": "train-5937", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders does the book \"O Xar\u00e1\" have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'O Xar\u00e1'\n```"}]}, {"id": "train-5938", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country does Malina Johnson live in?"}, {"from": "gpt", "value": "```sql\nSELECT T4.country_name FROM customer AS T1 INNER JOIN customer_address AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id INNER JOIN country AS T4 ON T4.country_id = T3.country_id WHERE T1.first_name = 'Malina' AND T1.last_name = 'Johnson' AND T2.status_id = 2\n```"}]}, {"id": "train-5939", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of Ukrainian addresses in the database."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id WHERE T1.country_name = 'Ukraine'\n```"}]}, {"id": "train-5940", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country does \u017dirovnica city belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T1.country_name FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id WHERE T2.city = '\u017dirovnica'\n```"}]}, {"id": "train-5941", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of the International shipping orders on 2022/11/10."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.method_name = 'International' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipping_method AS T1 INNER JOIN cust_order AS T2 ON T1.method_id = T2.shipping_method_id WHERE T2.order_date LIKE '2022-11-10%'\n```"}]}, {"id": "train-5942", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of pages of David Coward's books?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.num_pages) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'David Coward'\n```"}]}, {"id": "train-5943", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the cost of the slowest and least expensive shipping method?"}, {"from": "gpt", "value": "```sql\nSELECT method_name FROM shipping_method ORDER BY cost ASC LIMIT 1\n```"}]}, {"id": "train-5944", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the first book that was published in 1900?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM book WHERE STRFTIME('%Y', publication_date) = '1900' ORDER BY publication_date LIMIT 1\n```"}]}, {"id": "train-5945", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the customer who owns the \"aalleburtonkc@yellowbook.com\" e-mail address?"}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM customer WHERE email = 'aalleburtonkc@yellowbook.com'\n```"}]}, {"id": "train-5946", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders in 2022 have Iran as their destinations?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id INNER JOIN cust_order AS T3 ON T3.dest_address_id = T2.address_id WHERE T1.country_name = 'Iran' AND STRFTIME('%Y', T3.order_date) = '2022'\n```"}]}, {"id": "train-5947", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among Daisey Lamball's orders, how many were shipped via International shipping?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id INNER JOIN shipping_method AS T3 ON T3.method_id = T2.shipping_method_id WHERE T1.first_name = 'Daisey' AND T1.last_name = 'Lamball' AND T3.method_name = 'International'\n```"}]}, {"id": "train-5948", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the customer who ordered the most books of all time?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-5949", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders did Antonia Poltun return?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T1.status_value = 'Returned' AND T4.first_name = 'Antonia' AND T4.last_name = 'Poltun'\n```"}]}, {"id": "train-5950", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which shipping method is preferred by customers the most?"}, {"from": "gpt", "value": "```sql\nSELECT T2.method_name FROM cust_order AS T1 INNER JOIN shipping_method AS T2 ON T1.shipping_method_id = T2.method_id GROUP BY T2.method_name ORDER BY COUNT(T2.method_id) DESC LIMIT 1\n```"}]}, {"id": "train-5951", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were delivered in 2021?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Delivered' AND STRFTIME('%Y', T2.status_date) = '2021'\n```"}]}, {"id": "train-5952", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the first book written by J.K Rowling?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'J.K. Rowling' ORDER BY T1.publication_date ASC LIMIT 1\n```"}]}, {"id": "train-5953", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books did A.R. Braunmuller write?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM author AS T1 INNER JOIN book_author AS T2 ON T1.author_id = T2.author_id WHERE T1.author_name = 'A.R. Braunmuller'\n```"}]}, {"id": "train-5954", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the publisher who published Agatha Christie's first book?"}, {"from": "gpt", "value": "```sql\nSELECT T4.publisher_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T3.author_name = 'Agatha Christie' ORDER BY T1.publication_date ASC LIMIT 1\n```"}]}, {"id": "train-5955", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the names of the books written by Danielle Steel."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Danielle Steel'\n```"}]}, {"id": "train-5956", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books by William Shakespeare were published by Penguin Classics?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T3.author_name = 'William Shakespeare' AND T4.publisher_name = 'Penguin Classics'\n```"}]}, {"id": "train-5957", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the publisher that published the most books?"}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_name ORDER BY COUNT(T2.publisher_id) DESC LIMIT 1\n```"}]}, {"id": "train-5958", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total shipping cost of all the orders made by Page Holsey? Indicate how many of the said orders were ordered in 2022."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.cost) FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id INNER JOIN shipping_method AS T3 ON T3.method_id = T2.shipping_method_id WHERE T1.first_name = 'Page' AND T1.last_name = 'Holsey' AND STRFTIME('%Y', T2.order_date) = '2022'\n```"}]}, {"id": "train-5959", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the publisher with publisher ID 22?"}, {"from": "gpt", "value": "```sql\nSELECT publisher_name FROM publisher WHERE publisher_id = 22\n```"}]}, {"id": "train-5960", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the books authored by Al Gore have less than 400 pages?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Al Gore' AND T1.num_pages < 400\n```"}]}, {"id": "train-5961", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the author's and publisher's name of the book published on July 10, 1997."}, {"from": "gpt", "value": "```sql\nSELECT T3.author_name, T4.publisher_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T1.publication_date = '1997-07-10'\n```"}]}, {"id": "train-5962", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the language of the book with ISBN 23755004321?"}, {"from": "gpt", "value": "```sql\nSELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T1.isbn13 = 23755004321\n```"}]}, {"id": "train-5963", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the most expensive book?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-5964", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total price of books ordered by customer named Lucas Wyldbore."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.price) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Lucas' AND T3.last_name = 'Wyldbore'\n```"}]}, {"id": "train-5965", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ISBN of the book published in Spanish."}, {"from": "gpt", "value": "```sql\nSELECT T1.isbn13 FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'Spanish'\n```"}]}, {"id": "train-5966", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the books that cost less than 1 dollar, how many were published by Berkley Trade?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM publisher AS T1 INNER JOIN book AS T2 ON T1.publisher_id = T2.publisher_id INNER JOIN order_line AS T3 ON T3.book_id = T2.book_id WHERE T1.publisher_name = 'Berkley' AND T3.price < 1\n```"}]}, {"id": "train-5967", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the title of the books purchased by the customer named Zia Roizin."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Zia' AND T4.last_name = 'Roizin'\n```"}]}, {"id": "train-5968", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who authored the book with greatest number of pages?"}, {"from": "gpt", "value": "```sql\nSELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id ORDER BY T1.num_pages DESC LIMIT 1\n```"}]}, {"id": "train-5969", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the email of customers that bought the book titled Switch on the Night."}, {"from": "gpt", "value": "```sql\nSELECT T4.email FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T1.title = 'Switch on the Night'\n```"}]}, {"id": "train-5970", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the author's name of the books published by Abrams."}, {"from": "gpt", "value": "```sql\nSELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T4.publisher_name = 'Abrams'\n```"}]}, {"id": "train-5971", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the publisher name of the book titled The Illuminati?"}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Illuminati'\n```"}]}, {"id": "train-5972", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In books authored by Abraham Lincoln, what is the percentage of the books published in 1992?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN STRFTIME('%Y', T1.publication_date) = '1992' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Abraham Lincoln'\n```"}]}, {"id": "train-5973", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the books published in 2004, list the name of the publisher of books with number of pages greater than 70% of the average number of pages of all books."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE STRFTIME('%Y', T1.publication_date) = '2004' AND T1.num_pages * 100 > ( SELECT AVG(num_pages) FROM book ) * 70\n```"}]}, {"id": "train-5974", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the contact email of Moss Zarb."}, {"from": "gpt", "value": "```sql\nSELECT email FROM customer WHERE first_name = 'Moss' AND last_name = 'Zarb'\n```"}]}, {"id": "train-5975", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the streets in Dallas."}, {"from": "gpt", "value": "```sql\nSELECT street_name FROM address WHERE city = 'Dallas'\n```"}]}, {"id": "train-5976", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which books were released by Orson Scott Card in 2001?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Orson Scott Card' AND STRFTIME('%Y', T1.publication_date) = '2001'\n```"}]}, {"id": "train-5977", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the number of books written by Orson Scott Card."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Orson Scott Card'\n```"}]}, {"id": "train-5978", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the authors and titles of the books which have more than 3000 pages."}, {"from": "gpt", "value": "```sql\nSELECT T3.author_name, T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T1.num_pages > 3000\n```"}]}, {"id": "train-5979", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who wrote \"The Prophet\"?"}, {"from": "gpt", "value": "```sql\nSELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T1.title = 'The Prophet'\n```"}]}, {"id": "train-5980", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books were published by Ace Hardcover?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Ace Hardcover'\n```"}]}, {"id": "train-5981", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which publisher published Barry Eisler's book?"}, {"from": "gpt", "value": "```sql\nSELECT T4.publisher_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T3.author_name = 'Barry Eisler'\n```"}]}, {"id": "train-5982", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books were published in Japanese?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.book_id) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id WHERE T1.language_name = 'Japanese'\n```"}]}, {"id": "train-5983", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Sum the total price of the orders for The Prophet book."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.price) FROM order_line AS T1 INNER JOIN book AS T2 ON T1.book_id = T2.book_id WHERE T2.title = 'The Prophet'\n```"}]}, {"id": "train-5984", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of orders by Daisey Lamball in 2021."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM cust_order AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Daisey' AND T2.last_name = 'Lamball' AND STRFTIME('%Y', T1.order_date) = '2021'\n```"}]}, {"id": "train-5985", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are from Australia?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM customer_address AS T1 INNER JOIN address AS T2 ON T2.address_id = T1.address_id INNER JOIN country AS T3 ON T3.country_id = T2.country_id WHERE T3.country_name = 'Australia'\n```"}]}, {"id": "train-5986", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were delivered in December 2019?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Delivered' AND STRFTIME('%Y', T2.status_date) = '2019'\n```"}]}, {"id": "train-5987", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the customers' names who ordered the Fantasmas."}, {"from": "gpt", "value": "```sql\nSELECT T4.first_name, T4.last_name FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T1.title = 'Fantasmas'\n```"}]}, {"id": "train-5988", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of orders in 2020 used international shipping?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.method_name = 'International' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM cust_order AS T1 INNER JOIN shipping_method AS T2 ON T1.shipping_method_id = T2.method_id WHERE STRFTIME('%Y', T1.order_date) = '2020'\n```"}]}, {"id": "train-5989", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the authors named \"George\"."}, {"from": "gpt", "value": "```sql\nSELECT author_name FROM author WHERE author_name LIKE 'George%'\n```"}]}, {"id": "train-5990", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year has the most customer orders?"}, {"from": "gpt", "value": "```sql\nSELECT strftime('%Y', order_date) FROM cust_order GROUP BY strftime('%Y', order_date) ORDER BY COUNT(strftime('%Y', order_date)) DESC LIMIT 1\n```"}]}, {"id": "train-5991", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average price for the order line?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(price) FROM order_line\n```"}]}, {"id": "train-5992", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of the books that were published in 1995."}, {"from": "gpt", "value": "```sql\nSELECT title FROM book WHERE STRFTIME('%Y', publication_date) = '1995'\n```"}]}, {"id": "train-5993", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common domain for the email address among all the customers?"}, {"from": "gpt", "value": "```sql\nSELECT SUBSTR(email, INSTR(email, '@') + 1, LENGTH(email) - INSTR(email, '@')) AS ym FROM customer GROUP BY SUBSTR(email, INSTR(email, '@') + 1, LENGTH(email) - INSTR(email, '@')) ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-5994", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many publishers have the word \"book\" in their name?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM publisher WHERE publisher_name LIKE '%book%'\n```"}]}, {"id": "train-5995", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which language is the rarest among all the books?"}, {"from": "gpt", "value": "```sql\nSELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id GROUP BY T2.language_name ORDER BY COUNT(T2.language_name) ASC LIMIT 1\n```"}]}, {"id": "train-5996", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the order dates for the customer named \"Adrian Kunzelmann\"."}, {"from": "gpt", "value": "```sql\nSELECT T3.order_date FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Adrian' AND T4.last_name = 'Kunzelmann'\n```"}]}, {"id": "train-5997", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many addresses are from the Philippines?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.country_id) FROM address AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE T2.country_name = 'Philippines'\n```"}]}, {"id": "train-5998", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the author who wrote the most books?"}, {"from": "gpt", "value": "```sql\nSELECT T1.author_name FROM author AS T1 INNER JOIN book_author AS T2 ON T1.author_id = T2.author_id GROUP BY T1.author_name ORDER BY COUNT(T2.author_id) DESC LIMIT 1\n```"}]}, {"id": "train-5999", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the books published by \"Harper Collins\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Harper Collins'\n```"}]}, {"id": "train-6000", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were returned in the year 2020?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Returned' AND STRFTIME('%Y', T2.status_date) = '2020'\n```"}]}, {"id": "train-6001", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the second-least common method of shipping?"}, {"from": "gpt", "value": "```sql\nSELECT T2.method_name FROM cust_order AS T1 INNER JOIN shipping_method AS T2 ON T1.shipping_method_id = T2.method_id GROUP BY T2.method_name ORDER BY COUNT(T2.method_id) ASC LIMIT 1, 1\n```"}]}, {"id": "train-6002", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the customer addresses are inactive?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM customer_address AS T1 INNER JOIN address_status AS T2 ON T1.status_id = T2.status_id WHERE T2.address_status = 'Inactive'\n```"}]}, {"id": "train-6003", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the book with the most orders?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM order_line AS T1 INNER JOIN book AS T2 ON T1.book_id = T2.book_id GROUP BY T2.title ORDER BY COUNT(T1.book_id) DESC LIMIT 1\n```"}]}, {"id": "train-6004", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the address that received the most orders?"}, {"from": "gpt", "value": "```sql\nSELECT T2.street_name, T2.city FROM cust_order AS T1 INNER JOIN address AS T2 ON T1.dest_address_id = T2.address_id GROUP BY T2.street_number, T2.street_name, T2.city ORDER BY COUNT(T1.dest_address_id) DESC LIMIT 1\n```"}]}, {"id": "train-6005", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much time does it take to update the status of order \"2398\"?"}, {"from": "gpt", "value": "```sql\nSELECT strftime('%J', T2.status_date) - strftime('%J', T1.order_date) FROM cust_order AS T1 INNER JOIN order_history AS T2 ON T1.order_id = T2.order_id WHERE T1.order_id = 2398\n```"}]}, {"id": "train-6006", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which customer has the most addresses?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN customer_address AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ORDER BY COUNT(T2.customer_id) DESC LIMIT 1\n```"}]}, {"id": "train-6007", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of the total prices of all orders are shipped internationally?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.method_name = 'International' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM cust_order AS T1 INNER JOIN order_line AS T2 ON T1.order_id = T2.order_id INNER JOIN shipping_method AS T3 ON T3.method_id = T1.shipping_method_id\n```"}]}, {"id": "train-6008", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the authors who wrote fewer pages than the average."}, {"from": "gpt", "value": "```sql\nSELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T1.num_pages < ( SELECT AVG(num_pages) FROM book )\n```"}]}, {"id": "train-6009", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Other than zero, what is the lowest price paid by a customer for an order?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(price) FROM order_line WHERE price <> 0\n```"}]}, {"id": "train-6010", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers have an address that is located in the city of Villeneuve-la-Garenne?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(address_id) FROM address WHERE city = 'Villeneuve-la-Garenne'\n```"}]}, {"id": "train-6011", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many authors are named Adam?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM author WHERE author_name LIKE 'Adam%'\n```"}]}, {"id": "train-6012", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers use a Yahoo! Mail e-mail address?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM customer WHERE email LIKE '%@yahoo.com'\n```"}]}, {"id": "train-6013", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the city addresses of the customers located in the United States of America?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.city FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id WHERE T1.country_name = 'United States of America'\n```"}]}, {"id": "train-6014", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders did Marcelia Goering place in 2021 that uses the Priority Shipping method?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id INNER JOIN shipping_method AS T3 ON T3.method_id = T2.shipping_method_id WHERE T1.first_name = 'Marcelia' AND T1.last_name = 'Goering' AND STRFTIME('%Y', T2.order_date) = '2021' AND T3.method_name = 'Priority'\n```"}]}, {"id": "train-6015", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which books have the most expensive price?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM order_line AS T1 INNER JOIN book AS T2 ON T1.book_id = T2.book_id ORDER BY T1.price DESC LIMIT 1\n```"}]}, {"id": "train-6016", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers ordered the book titled \"Anleitung zum Zickigsein\""}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'Anleitung zum Zickigsein'\n```"}]}, {"id": "train-6017", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most expensive price paid by a customer for the book \"Bite Me If You Can (Argeneau #6)\"?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.price) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'Bite Me If You Can (Argeneau #6)'\n```"}]}, {"id": "train-6018", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers ordered the oldest book?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id GROUP BY T1.publication_date ORDER BY T1.publication_date ASC LIMIT 1\n```"}]}, {"id": "train-6019", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the titles of the Spanish books published by Alfaguara."}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM book_language AS T1 INNER JOIN book AS T2 ON T2.language_id = T1.language_id INNER JOIN publisher AS T3 ON T3.publisher_id = T2.publisher_id WHERE T1.language_name = 'Spanish' AND T3.publisher_name = 'Alfaguara' GROUP BY T2.title\n```"}]}, {"id": "train-6020", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers ordered Stephen King's first book?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.publication_date) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN order_line AS T4 ON T4.book_id = T1.book_id WHERE T3.author_name = 'Stephen King' ORDER BY T1.publication_date ASC LIMIT 1\n```"}]}, {"id": "train-6021", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the languages of the first two published books?"}, {"from": "gpt", "value": "```sql\nSELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id ORDER BY T1.publication_date ASC LIMIT 2\n```"}]}, {"id": "train-6022", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who published the book \"The Secret Garden\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Secret Garden'\n```"}]}, {"id": "train-6023", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the books that were published by Scholastic, how many were written by J.K Rowling?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id INNER JOIN book_author AS T3 ON T3.book_id = T1.book_id INNER JOIN author AS T4 ON T4.author_id = T3.author_id WHERE T2.publisher_name = 'Scholastic' AND T4.author_name = 'J.K. Rowling'\n```"}]}, {"id": "train-6024", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of all the publishers who have published at least 30 books?"}, {"from": "gpt", "value": "```sql\nSELECT 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\n```"}]}, {"id": "train-6025", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the last number of each street."}, {"from": "gpt", "value": "```sql\nSELECT street_number FROM address\n```"}]}, {"id": "train-6026", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the complete address of customers located in Lazaro Cardenas."}, {"from": "gpt", "value": "```sql\nSELECT street_number, street_name, city, country_id FROM address WHERE city = 'Lazaro Cardenas'\n```"}]}, {"id": "train-6027", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the ISBN13 of all the books that have less than 140 pages and more than 135."}, {"from": "gpt", "value": "```sql\nSELECT isbn13 FROM book WHERE num_pages < 140 AND num_pages > 135\n```"}]}, {"id": "train-6028", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the title of the six books with the greatest potential value as collectibles."}, {"from": "gpt", "value": "```sql\nSELECT title FROM book ORDER BY publication_date ASC LIMIT 6\n```"}]}, {"id": "train-6029", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books were ordered in the last month of the year 2020?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM cust_order WHERE order_date LIKE '2020-12%'\n```"}]}, {"id": "train-6030", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the full name of all customers whose last name begins with the letter K."}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM customer WHERE last_name LIKE 'K%'\n```"}]}, {"id": "train-6031", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which cities are the customers of Costa Rica located?"}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM address AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE T2.country_name = 'Costa Rica'\n```"}]}, {"id": "train-6032", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which customer addresses are no longer active?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.street_name FROM address AS T1 INNER JOIN customer_address AS T2 ON T1.address_id = T2.address_id INNER JOIN address_status AS T3 ON T3.status_id = T2.status_id WHERE T3.address_status = 'Inactive'\n```"}]}, {"id": "train-6033", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the customers who live in Baiyin city?"}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name FROM address AS T1 INNER JOIN customer_address AS T2 ON T1.address_id = T2.address_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T1.city = 'Baiyin'\n```"}]}, {"id": "train-6034", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the email of the customers who place their orders with priority method?"}, {"from": "gpt", "value": "```sql\nSELECT T1.email FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id INNER JOIN shipping_method AS T3 ON T3.method_id = T2.shipping_method_id WHERE T3.method_name = 'Priority'\n```"}]}, {"id": "train-6035", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On what date did the customers who live at number 460 of their respective streets place their orders?"}, {"from": "gpt", "value": "```sql\nSELECT T1.order_date FROM cust_order AS T1 INNER JOIN address AS T2 ON T1.dest_address_id = T2.address_id WHERE T2.street_number = 460\n```"}]}, {"id": "train-6036", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify by their id all the orders that have been cancelled."}, {"from": "gpt", "value": "```sql\nSELECT T2.order_id FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Cancelled'\n```"}]}, {"id": "train-6037", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the status of the orders placed on 04/10/2022?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.status_value FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id WHERE T3.order_date LIKE '2022-04-10%'\n```"}]}, {"id": "train-6038", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest price at which a customer bought the book 'The Prophet'?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.price) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'The Prophet'\n```"}]}, {"id": "train-6039", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On what dates were books ordered at a price of 16.54?"}, {"from": "gpt", "value": "```sql\nSELECT T1.order_date FROM cust_order AS T1 INNER JOIN order_line AS T2 ON T1.order_id = T2.order_id WHERE T2.price = 16.54\n```"}]}, {"id": "train-6040", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the titles of all the books that Peter H. Smith wrote."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Peter H. Smith'\n```"}]}, {"id": "train-6041", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books under 300 pages has HarperCollins Publishers published?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'HarperCollins Publishers' AND T1.num_pages < 300\n```"}]}, {"id": "train-6042", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books have been published in Japanese?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id WHERE T1.language_name = 'Japanese'\n```"}]}, {"id": "train-6043", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of pages in the books written by Jennifer Crusie?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.num_pages) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Jennifer Crusie'\n```"}]}, {"id": "train-6044", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of the orders placed by Kaleena were shipped by the international method?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.method_name = 'International' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id INNER JOIN shipping_method AS T3 ON T3.method_id = T2.shipping_method_id WHERE T1.first_name = 'Kaleena'\n```"}]}, {"id": "train-6045", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the full name of the customers who have ordered the book The Sorrows of Young Werther."}, {"from": "gpt", "value": "```sql\nSELECT T4.first_name, T4.last_name FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T1.title = 'The Sorrows of Young Werther'\n```"}]}, {"id": "train-6046", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List every book that Ursola Purdy has ordered."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Ursola' AND T4.last_name = 'Purdy'\n```"}]}, {"id": "train-6047", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the author of the book with the biggest page count?"}, {"from": "gpt", "value": "```sql\nSELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id ORDER BY T1.num_pages DESC LIMIT 1\n```"}]}, {"id": "train-6048", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books written by Akira Watanabe are available on Gravity?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM author AS T1 INNER JOIN book_author AS T2 ON T1.author_id = T2.author_id WHERE T1.author_name = 'Akira Watanabe'\n```"}]}, {"id": "train-6049", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the full address of Ursola Purdy."}, {"from": "gpt", "value": "```sql\nSELECT T3.street_number, T3.street_name, T3.city FROM customer AS T1 INNER JOIN customer_address AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id INNER JOIN country AS T4 ON T4.country_id = T3.country_id WHERE T1.first_name = 'Ursola' AND T1.last_name = 'Purdy'\n```"}]}, {"id": "train-6050", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the author of the book The Mystery in the Rocky Mountains?"}, {"from": "gpt", "value": "```sql\nSELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T1.title = 'The Mystery in the Rocky Mountains'\n```"}]}, {"id": "train-6051", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the publisher of the book Girls' Night In."}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'Girls'' Night In'\n```"}]}, {"id": "train-6052", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the publisher of the oldest book."}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id ORDER BY T1.publication_date ASC LIMIT 1\n```"}]}, {"id": "train-6053", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the cost difference between Priority and Express shipping methods."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN method_name = 'Priority' THEN cost ELSE 0 END) - SUM(CASE WHEN method_name = 'Express' THEN cost ELSE 0 END) FROM shipping_method\n```"}]}, {"id": "train-6054", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders have been cancelled in 2022?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Cancelled' AND STRFTIME('%Y', T2.status_date) = '2022'\n```"}]}, {"id": "train-6055", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the books published by BBC Audiobooks."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'BBC Audiobooks'\n```"}]}, {"id": "train-6056", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books were published in 2017?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book WHERE STRFTIME('%Y', publication_date) = '2017'\n```"}]}, {"id": "train-6057", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the International Standard Book Number of the book The Mystery in the Rocky Mountains."}, {"from": "gpt", "value": "```sql\nSELECT isbn13 FROM book WHERE title = 'The Mystery in the Rocky Mountains'\n```"}]}, {"id": "train-6058", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all orders updated in 2022, identify the percentage that has been returned."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.status_value = 'Returned' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE STRFTIME('%Y', T2.status_date) = '2022'\n```"}]}, {"id": "train-6059", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all addresses provided by customers, identify the percentage that are not in use anymore."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.address_status = 'Inactive' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer_address AS T1 INNER JOIN address_status AS T2 ON T2.status_id = T1.status_id\n```"}]}, {"id": "train-6060", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many pages does 'Seaward' have?"}, {"from": "gpt", "value": "```sql\nSELECT num_pages FROM book WHERE title = 'Seaward'\n```"}]}, {"id": "train-6061", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the author of First Things First?"}, {"from": "gpt", "value": "```sql\nSELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T1.title = 'First Things First'\n```"}]}, {"id": "train-6062", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all books authored by Tom Clancy."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Tom Clancy'\n```"}]}, {"id": "train-6063", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which book by Hirohiko Araki was published on 6/6/2006?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Hirohiko Araki' AND T1.publication_date = '2006-06-06'\n```"}]}, {"id": "train-6064", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the publisher of Hitchhiker's Guide To The Galaxy: The Filming of the Douglas Adams classic?"}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'Hitchhiker''s Guide To The Galaxy: The Filming of the Douglas Adams classic'\n```"}]}, {"id": "train-6065", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all books published by ADV Manga."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'ADV Manga'\n```"}]}, {"id": "train-6066", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the full name of the customers whose address is at 55 Dorton Pass, Huangqiao."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN customer_address AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id WHERE T3.street_number = 55 AND T3.street_name = 'Dorton Pass' AND T3.city = 'Huangqiao'\n```"}]}, {"id": "train-6067", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is 9 Green Ridge Point, Arendal located at?"}, {"from": "gpt", "value": "```sql\nSELECT T2.country_name FROM address AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE T1.street_number = 9 AND T1.street_name = 'Green Ridge Point' AND T1.city = 'Arendal'\n```"}]}, {"id": "train-6068", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List 10 addresses located in Poland."}, {"from": "gpt", "value": "```sql\nSELECT T1.street_number, T1.street_name, T1.city FROM address AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE T2.country_name = 'Poland' LIMIT 10\n```"}]}, {"id": "train-6069", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the shipping method ordered by Nicolette Sadler at 6/29/2020 7:40:07 PM?"}, {"from": "gpt", "value": "```sql\nSELECT T3.method_name FROM cust_order AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN shipping_method AS T3 ON T3.method_id = T1.shipping_method_id WHERE T2.first_name = 'Nicolette' AND T2.last_name = 'Sadler' AND T1.order_date = '2020-06-29 19:40:07'\n```"}]}, {"id": "train-6070", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all books written in Arabic."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'Arabic'\n```"}]}, {"id": "train-6071", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which language is 'El plan infinito' written in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'El plan infinito'\n```"}]}, {"id": "train-6072", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of books written by Hirohiko make up the number of books published by Viz Media?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.author_name = 'Hirohiko Araki' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM author AS T1 INNER JOIN book_author AS T2 ON T2.author_id = T1.author_id INNER JOIN book AS T3 ON T3.book_id = T2.book_id INNER JOIN publisher AS T4 ON T4.publisher_id = T3.publisher_id WHERE T4.publisher_name = 'VIZ Media'\n```"}]}, {"id": "train-6073", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of book pages written by Zilpha Keatley Snyder?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.num_pages) FROM book_author AS T1 INNER JOIN author AS T2 ON T1.author_id = T2.author_id INNER JOIN book AS T3 ON T3.book_id = T1.book_id WHERE T2.author_name = 'Zilpha Keatley Snyder'\n```"}]}, {"id": "train-6074", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of customer with email ckupis4@tamu.edu?"}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM customer WHERE email = 'ckupis4@tamu.edu'\n```"}]}, {"id": "train-6075", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which book has the most number of pages?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM book ORDER BY num_pages DESC LIMIT 1\n```"}]}, {"id": "train-6076", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books were written by author A.J. Ayer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book_author AS T1 INNER JOIN author AS T2 ON T1.author_id = T2.author_id WHERE T2.author_name = 'A.J. Ayer'\n```"}]}, {"id": "train-6077", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the title of books written by author A.J.Ayer."}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM book_author AS T1 INNER JOIN author AS T2 ON T1.author_id = T2.author_id INNER JOIN book AS T3 ON T3.book_id = T1.book_id WHERE T2.author_name = 'A.J. Ayer'\n```"}]}, {"id": "train-6078", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The book name \"The Season: A Candid Look at Broadway\" was published by which publisher?"}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Season: A Candid Look at Broadway'\n```"}]}, {"id": "train-6079", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average of English books among all books published by Carole Marsh Mysteries?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.language_name = 'English' THEN 1 ELSE 0 END) AS REAL) / COUNT(*) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id INNER JOIN publisher AS T3 ON T3.publisher_id = T2.publisher_id WHERE T3.publisher_name = 'Carole Marsh Mysteries'\n```"}]}, {"id": "train-6080", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the title of the book with the most number of pages that was published from 1990 to 2000 by publisher Free Press."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Free Press' AND STRFTIME('%Y', T1.publication_date) BETWEEN '1990' AND '2000' ORDER BY T1.num_pages DESC LIMIT 1\n```"}]}, {"id": "train-6081", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the order price of the book \"The Servant Leader\" in 2003?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'The Servant Leader' AND STRFTIME('%Y', T1.publication_date) = '2003'\n```"}]}, {"id": "train-6082", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the current address of customer Kandy?"}, {"from": "gpt", "value": "```sql\nSELECT T3.street_number, T3.street_name, T3.city FROM customer AS T1 INNER JOIN customer_address AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id INNER JOIN address_status AS T4 ON T4.status_id = T2.status_id WHERE T1.first_name = 'Kandy'\n```"}]}, {"id": "train-6083", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books were ordered by customer Kandy Adamec?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Kandy' AND T3.last_name = 'Adamec'\n```"}]}, {"id": "train-6084", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders got returned in 2022?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Returned' AND STRFTIME('%Y', T2.status_date) = '2022'\n```"}]}, {"id": "train-6086", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the publisher who published the most books."}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_name ORDER BY COUNT(T2.publisher_id) DESC LIMIT 1\n```"}]}, {"id": "train-6087", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the first book that was written by A.J. Ayer?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'A.J. Ayer' ORDER BY T1.publication_date ASC LIMIT 1\n```"}]}, {"id": "train-6088", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of books that cost greater than $10 and were ordered by customer Ruthanne Vatini?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.price > 10 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Ruthanne' AND T3.last_name = 'Vatini'\n```"}]}, {"id": "train-6089", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the title of books published by AK Press."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'AK Press'\n```"}]}, {"id": "train-6090", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who ordered the book with the cheapest price?"}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id ORDER BY T1.price ASC LIMIT 1\n```"}]}, {"id": "train-6091", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the ISBN of the books purchased by the customer with an email of fsier3e@ihg.com."}, {"from": "gpt", "value": "```sql\nSELECT T1.isbn13 FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.email = 'fsier3e@ihg.com'\n```"}]}, {"id": "train-6092", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the author's name of the books that cost 19 dollars and above."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN order_line AS T4 ON T4.book_id = T1.book_id WHERE T4.price > 19\n```"}]}, {"id": "train-6093", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the publisher name of the book with ISBN 76092025986."}, {"from": "gpt", "value": "```sql\nSELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.isbn13 = 76092025986\n```"}]}, {"id": "train-6094", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the books published by Birlinn in 2008, how many books have pages around 600 to 700?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Birlinn' AND STRFTIME('%Y', T1.publication_date) = '2008' AND T1.num_pages BETWEEN 600 AND 700\n```"}]}, {"id": "train-6095", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the price of the book with ISBN 9780763628321?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.isbn13 = 9780763628321\n```"}]}, {"id": "train-6096", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of pages of the book in the order ID 1167?"}, {"from": "gpt", "value": "```sql\nSELECT T1.num_pages FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.order_id = 1167\n```"}]}, {"id": "train-6097", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the title of the books published in British-English."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'British English'\n```"}]}, {"id": "train-6098", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many books were published by Brava in 2006?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Brava' AND STRFTIME('%Y', T1.publication_date) = '2006'\n```"}]}, {"id": "train-6099", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ISBN and price of the book with book ID 7160."}, {"from": "gpt", "value": "```sql\nSELECT T1.isbn13, T2.price FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.book_id = 6503\n```"}]}, {"id": "train-6100", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the book in the order ID 931?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.order_id = 931\n```"}]}, {"id": "train-6101", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the language of the book titled Zorro?"}, {"from": "gpt", "value": "```sql\nSELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'Zorro'\n```"}]}, {"id": "train-6102", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the email of the customers that purchased books with a price range of 3 to 5 dollars."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.email FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T1.price BETWEEN 3 AND 5\n```"}]}, {"id": "train-6103", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ISBN of the books that cost 7.5 dollars."}, {"from": "gpt", "value": "```sql\nSELECT T1.isbn13 FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.price = 7.5\n```"}]}, {"id": "train-6104", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the publisher's name of the books authored by Alan Lee."}, {"from": "gpt", "value": "```sql\nSELECT T4.publisher_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T3.author_name = 'Alan Lee' GROUP BY T4.publisher_name\n```"}]}, {"id": "train-6105", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the sum of the number of pages of the books ordered by Mick Sever?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.num_pages) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Mick' AND T4.last_name = 'Sever'\n```"}]}, {"id": "train-6106", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the author's name of the book most recently published."}, {"from": "gpt", "value": "```sql\nSELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id ORDER BY T1.publication_date DESC LIMIT 1\n```"}]}, {"id": "train-6107", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In books published by Ace Book, what is the percentage of English books published?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.language_name = 'English' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id INNER JOIN publisher AS T3 ON T3.publisher_id = T2.publisher_id WHERE T3.publisher_name = 'Ace Book'\n```"}]}, {"id": "train-6108", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the books purchased by less than 1 dollar, what is the difference between the number of books with less than 500 pages and books with greater than 500 pages?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.num_pages < 500 THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.num_pages > 500 THEN 1 ELSE 0 END) AS dif FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.price < 1\n```"}]}, {"id": "train-6109", "db_id": "books", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the language and title of the ordered books with price less than 20% of the average price of all ordered books?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.language_name, T2.title FROM order_line AS T1 INNER JOIN book AS T2 ON T1.book_id = T2.book_id INNER JOIN book_language AS T3 ON T3.language_id = T2.language_id WHERE T1.price * 100 < ( SELECT AVG(price) FROM order_line ) * 20\n```"}]}, {"id": "train-6110", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of all the sanitarians under the supervision of Darlisha Jacobs."}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM employee WHERE title = 'Sanitarian' AND supervisor = ( SELECT employee_id FROM employee WHERE first_name = 'Darlisha' AND last_name = 'Jacobs' )\n```"}]}, {"id": "train-6111", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of the sanitarians who did at least one inspection in May, 2010."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first_name, T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE strftime('%Y-%m', T2.inspection_date) = '2010-05' AND T1.title = 'Sanitarian'\n```"}]}, {"id": "train-6112", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many inspections were sanitarian Joshua Rosa responsible for in 2010?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.inspection_id) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE strftime('%Y', T2.inspection_date) = '2010' AND T1.first_name = 'Joshua' AND T1.last_name = 'Rosa'\n```"}]}, {"id": "train-6113", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the assumed name of all the facilities inspected by Joshua Rosa."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.dba_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T1.first_name = 'Joshua' AND T1.last_name = 'Rosa'\n```"}]}, {"id": "train-6114", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the facilities that have undergone at least one inspection in 2010, how many of them are restaurants or cafeterias?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.license_no) FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T1.inspection_date) = '2010' AND T2.facility_type = 'Restaurant'\n```"}]}, {"id": "train-6115", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the location coordinates of all the facilities that had an inspection on 2010/5/11."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.latitude, T2.longitude FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE T1.inspection_date = '2010-05-11'\n```"}]}, {"id": "train-6116", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the facilities that have undergone at least one inspection in 2010, how many of them are in ward no.42?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.license_no) FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T1.inspection_date) = '2010' AND T2.ward = 42\n```"}]}, {"id": "train-6117", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of all the sanitarians who have inspected the facility Burbank."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first_name, T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T3.dba_name = 'Burbank' AND T1.title = 'Sanitarian'\n```"}]}, {"id": "train-6118", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the assumed name of all the facilities that failed an inspection in 2010."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.dba_name FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE T1.results = 'Fail' AND strftime('%Y', T1.inspection_date) = '2010'\n```"}]}, {"id": "train-6119", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the sanitarian who inspected Amundsen High School on 2010/5/11?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T2.inspection_date = '2010-05-11' AND T3.dba_name = 'AMUNDSEN HIGH SCHOOL' AND T1.title = 'Sanitarian'\n```"}]}, {"id": "train-6120", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the inspections done by sanitarian Joshua Rosa, how many of them have the result of \"pass\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.inspection_id) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.results = 'Pass' AND T1.first_name = 'Joshua' AND T1.last_name = 'Rosa'\n```"}]}, {"id": "train-6121", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: After Azha Restaurant Inc. passed the inspection on 2010/1/21, when was the follow-up inspection done?"}, {"from": "gpt", "value": "```sql\nSELECT T1.followup_to FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE T2.dba_name = 'Azha Restaurant Inc.' AND T1.results = 'Pass' AND T1.inspection_date = '2010-01-21'\n```"}]}, {"id": "train-6122", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the facilities that had undergone at least one inspection in 2010, how many of them have the most serious food safety issues?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.license_no) FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T1.inspection_date) = '2010' AND T2.risk_level = 3\n```"}]}, {"id": "train-6123", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of inspections carried out in the year 2010 by a sanitarian whose salary is over 70000?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.inspection_date LIKE '2010%' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.salary > 70000 THEN 1 ELSE 0 END) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id\n```"}]}, {"id": "train-6124", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the point level of \"Refrigeration and metal stem thermometers provided and conspicuous\"?"}, {"from": "gpt", "value": "```sql\nSELECT point_level FROM inspection_point WHERE Description = 'Refrigeration and metal stem thermometers provided and conspicuous '\n```"}]}, {"id": "train-6125", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which employee was responsible for inspection no.48224? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_id = 48224\n```"}]}, {"id": "train-6126", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many inspections did All Style Buffet Restaurant have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.facility_type = 'Restaurant' AND T1.dba_name = 'All Style Buffet'\n```"}]}, {"id": "train-6127", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Wing Hung Chop Suey Restaurant have its first inspection?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(T2.inspection_date) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.aka_name = 'WING HUNG CHOP SUEY RESTAURANT'\n```"}]}, {"id": "train-6128", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restaurants were inspected on 2015/5/8?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_date = '2015-05-08' AND T1.facility_type = 'Restaurant'\n```"}]}, {"id": "train-6129", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"food maintenance\" related violations did inspection no.1454071 have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.point_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspection_id = '1454071' AND T1.category = 'Food Maintenance'\n```"}]}, {"id": "train-6130", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of violations did Royal Thai Cuisine has during the 2015/5/8 inspection."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.point_id) 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 T2.inspection_date = '2015-05-08' AND T1.dba_name = 'ROYAL THAI CUISINE'\n```"}]}, {"id": "train-6131", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the grocery store located at \"3635 W DIVERSEY AVE\", how many inspections did it have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.address = '3635 W DIVERSEY AVE ' AND T1.facility_type = 'Grocery Store'\n```"}]}, {"id": "train-6132", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is responsible for most of the inspections? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T2.employee_id, T2.first_name, T2.last_name, COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id GROUP BY T2.employee_id, T2.first_name, T2.last_name ORDER BY COUNT(T1.inspection_id) DESC LIMIT 1 ) AS T\n```"}]}, {"id": "train-6133", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many inspections done by Lisa Tillman ended up with the result of \"Out of Business\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T2.first_name = 'Lisa' AND T2.last_name = 'Tillman' AND T1.results = 'Out of Business'\n```"}]}, {"id": "train-6134", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the sanitarian who lives on 5000 N Wolcott Ave, how many establishments did he/she inspect in the May of 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T2.address = '5000 N Wolcott Ave' AND T2.title = 'Sanitarian' AND strftime('%Y-%m', T1.inspection_date) = '2011-05'\n```"}]}, {"id": "train-6135", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the phone number of the sanitarian who was responsible for inspection no.634597."}, {"from": "gpt", "value": "```sql\nSELECT T2.phone FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_id = 634597 AND T2.title = 'Sanitarian'\n```"}]}, {"id": "train-6136", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the salary of the employee who did the most inspections."}, {"from": "gpt", "value": "```sql\nSELECT T1.salary FROM employee AS T1 INNER JOIN ( SELECT T.employee_id, COUNT(T.inspection_id) FROM inspection AS T GROUP BY T.employee_id ORDER BY COUNT(T.inspection_id) DESC LIMIT 1 ) AS T2 ON T1.employee_id = T2.employee_id\n```"}]}, {"id": "train-6137", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of inspections did risk level 3 taverns have?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.inspection_id) AS REAL) / COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = 3 AND T1.facility_type = 'TAVERN'\n```"}]}, {"id": "train-6138", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the inspection pass rate of Pockets Restaurant."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.results = 'Pass' THEN T2.inspection_id ELSE NULL END) AS REAL) * 100 / COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'POCKETS' AND T1.facility_type = 'Restaurant'\n```"}]}, {"id": "train-6139", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sanitarian employees in Chicago are from the zip code 60617?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(employee_id) FROM employee WHERE zip = '60617'\n```"}]}, {"id": "train-6140", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the assumed name of the business located at 2903 W Irving Park Rd?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT dba_name FROM establishment WHERE address = '2903 W IRVING PARK RD '\n```"}]}, {"id": "train-6141", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the employee with the lowest salary?"}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM employee ORDER BY salary ASC LIMIT 1\n```"}]}, {"id": "train-6142", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many establishments that are doing business as Homemade Pizza have a risk level of 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(license_no) FROM establishment WHERE risk_level = 2 AND dba_name = 'HOMEMADE PIZZA'\n```"}]}, {"id": "train-6143", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many inspections with critical food safety problems are under inspection point id 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(inspection_id) FROM violation WHERE point_id = 3 AND fine = 500\n```"}]}, {"id": "train-6144", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees are under Gregory Cardenas?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.employee_id) FROM employee AS T1 WHERE T1.supervisor = ( SELECT employee_id FROM employee WHERE first_name = 'Gregory' AND last_name = 'Cardenas' )\n```"}]}, {"id": "train-6145", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Renaldi's Pizza had its first inspection?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(T2.inspection_date) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'RENALDI''S PIZZA'\n```"}]}, {"id": "train-6146", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the employee who was responsible for the most inspection in March 2016?"}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name FROM ( SELECT T1.employee_id, COUNT(T1.inspection_id) FROM inspection AS T1 WHERE strftime('%Y-%m', T1.inspection_date) = '2016-03' GROUP BY T1.employee_id ORDER BY COUNT(T1.inspection_id) DESC LIMIT 1 ) AS T2 INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id\n```"}]}, {"id": "train-6147", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the businesses that passed with conditions in May 2012?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.dba_name FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y-%m', T1.inspection_date) = '2012-05' AND T1.results = 'Pass w/ Conditions'\n```"}]}, {"id": "train-6148", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Out of all the short form complaint inspections done by David Hodges, how many businesses passed?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.license_no) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'David' AND T1.last_name = 'Hodges' AND T1.employee_id = 153225 AND T2.inspection_type = 'Short Form Complaint' AND T2.results = 'Pass'\n```"}]}, {"id": "train-6149", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses from ward 42 have at least 5 failed inspection results between 1/1/2010 to 12/31/2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_date BETWEEN '2010-01-01' AND '2015-12-31' AND T1.ward = 42 AND T1.license_no IN ( SELECT license_no FROM ( SELECT license_no FROM inspection WHERE results = 'Fail' GROUP BY license_no HAVING COUNT(results) >= 5 ) )\n```"}]}, {"id": "train-6150", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the salary of the employee who has the highest number of inspections done of all time?"}, {"from": "gpt", "value": "```sql\nSELECT T1.salary FROM employee AS T1 INNER JOIN ( SELECT employee_id, COUNT(inspection_id) FROM inspection GROUP BY employee_id ORDER BY COUNT(inspection_id) DESC LIMIT 1 ) AS T2 ON T1.employee_id = T2.employee_id\n```"}]}, {"id": "train-6151", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the assumed name of the business that has the highest total fine in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT 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\n```"}]}, {"id": "train-6152", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the precise location of the establishment with the highest number of failed inspections?"}, {"from": "gpt", "value": "```sql\nSELECT T1.latitude, T1.longitude FROM establishment AS T1 INNER JOIN ( SELECT license_no FROM inspection WHERE results = 'Fail' GROUP BY license_no ORDER BY COUNT(results) DESC LIMIT 1 ) AS T2 ON T1.license_no = T2.license_no\n```"}]}, {"id": "train-6153", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the comments of the inspector during the inspection of Taqueria La Fiesta on 1/25/2010?"}, {"from": "gpt", "value": "```sql\nSELECT T3.inspector_comment 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 T2.inspection_date = '2010-01-25' AND T1.dba_name = 'TAQUERIA LA FIESTA'\n```"}]}, {"id": "train-6154", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the total fine given to Ron of Japan Inc in its inspection done on February 2014?"}, {"from": "gpt", "value": "```sql\nSELECT 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-%m', T2.inspection_date) = '2014-02' AND T1.dba_name = 'RON OF JAPAN INC'\n```"}]}, {"id": "train-6155", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full names of the employees who were responsible for inspecting Taqueria La Paz."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.first_name, T3.last_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id WHERE T1.dba_name = 'TAQUERIA LA PAZ'\n```"}]}, {"id": "train-6156", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the employee who gave the highest amount of fine of all time?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, SUM(T3.fine) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id GROUP BY T1.first_name, T1.last_name ORDER BY SUM(T3.fine) DESC LIMIT 1 ) t\n```"}]}, {"id": "train-6157", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of inspections done by the top 5 employees with the highest salary? List the names of the said employees."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(DISTINCT T2.inspection_id) AS REAL) / 5, T1.first_name, T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.title = 'Sanitarian' ORDER BY T1.salary DESC LIMIT 5\n```"}]}, {"id": "train-6158", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which business had the highest number of inspections done? Calculate the percentage of passed and failed inspections of the said business."}, {"from": "gpt", "value": "```sql\nSELECT T2.dba_name , CAST(SUM(CASE WHEN T1.results = 'Pass' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.inspection_id) AS percentagePassed , CAST(SUM(CASE WHEN T1.results = 'Fail' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.inspection_id) FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no GROUP BY T2.dba_name ORDER BY COUNT(T1.license_no) DESC LIMIT 1\n```"}]}, {"id": "train-6159", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the employee's last name at 7211 S Hermitage Ave, Chicago, IL?"}, {"from": "gpt", "value": "```sql\nSELECT last_name FROM employee WHERE address = '7211 S Hermitage Ave' AND city = 'Chicago' AND state = 'IL'\n```"}]}, {"id": "train-6160", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the establishment's name and employee involved in the inspection ID 44256 on May 5, 2010?"}, {"from": "gpt", "value": "```sql\nSELECT T1.dba_name, T3.first_name, T3.last_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id WHERE T2.inspection_date = '2010-05-05' AND T2.inspection_id = 44256\n```"}]}, {"id": "train-6161", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the address of the schools that passed the inspection in March 2010."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.address FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y-%m', T2.inspection_date) = '2010-03' AND T2.results = 'Pass' AND T1.facility_type = 'School'\n```"}]}, {"id": "train-6162", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the employee's full name involved in the canvass inspection type on March 09, 2010?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first_name, T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_date = '2010-03-09' AND T2.inspection_type = 'Canvass'\n```"}]}, {"id": "train-6163", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the inspection ID of the establishment named \"PIZZA RUSTICA, INC.\""}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.inspection_id FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'PIZZA RUSTICA, INC'\n```"}]}, {"id": "train-6165", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of employees involved in an inspection with the Display of Inspection Report Summary category."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first_name, T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id INNER JOIN inspection_point AS T4 ON T3.point_id = T4.point_id WHERE T4.category = 'Display of Inspection Report Summary'\n```"}]}, {"id": "train-6166", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the employee involved in inspection ID 60332?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 60332\n```"}]}, {"id": "train-6167", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the restaurants with the lowest risk level failed the complaint inspection type?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = '1' AND T2.inspection_type = 'Complaint' AND T1.facility_type = 'Restaurant' AND T2.results = 'Fail'\n```"}]}, {"id": "train-6168", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the fine paid and the complete address of the establishment with inspection ID 48216."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.fine, T1.state, T1.city, T1.address 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 T2.inspection_id = 48216\n```"}]}, {"id": "train-6169", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the inspection ID of the inspection with critical point level, $500 fine, and inspector comment \"CDI ON 5-17-10\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.inspection_id FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.fine = 500 AND T1.point_level = 'Critical' AND T2.inspector_comment = 'CDI ON 5-17-10'\n```"}]}, {"id": "train-6170", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the inspection description and inspector's comments in the inspection ID 164795?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Description, T2.inspector_comment FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspection_id = 44247\n```"}]}, {"id": "train-6171", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the inspector's comments and clean operating requirement code for inspection ID 54216 and point ID 34?"}, {"from": "gpt", "value": "```sql\nSELECT T2.inspector_comment, T1.code FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspection_id = 54216 AND T2.point_id = 34\n```"}]}, {"id": "train-6172", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the establishments that failed in the inspection, what is the percentage of establishments with the highest risk level?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.risk_level = 3 THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.risk_level) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.results = 'Fail'\n```"}]}, {"id": "train-6173", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.fine = 100 THEN 1 ELSE 0 END) - SUM(CASE WHEN T3.fine = 500 THEN 1 ELSE 0 END) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T1.salary BETWEEN 75000 AND 80000\n```"}]}, {"id": "train-6174", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many inspections were done in January 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(inspection_id) FROM inspection WHERE strftime('%Y-%m', inspection_date) = '2011-01'\n```"}]}, {"id": "train-6175", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many inspections failed in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(inspection_id) FROM inspection WHERE strftime('%Y', inspection_date) = '2014' AND results = 'Fail'\n```"}]}, {"id": "train-6176", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of inspections with the fine for a minor food safety problem."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN fine = 100 THEN inspection_id END) AS REAL) * 100 / COUNT(inspection_id) FROM violation\n```"}]}, {"id": "train-6177", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the point IDs and fines of the inspections done on 7th August 2010."}, {"from": "gpt", "value": "```sql\nSELECT T2.point_id, T2.fine FROM inspection AS T1 INNER JOIN violation AS T2 ON T1.inspection_id = T2.inspection_id WHERE T1.inspection_date = '2010-08-07'\n```"}]}, {"id": "train-6178", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many inspections were done under the personnel category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.inspection_id) FROM violation AS T1 INNER JOIN inspection_point AS T2 ON T1.point_id = T2.point_id WHERE T2.category = 'Personnel'\n```"}]}, {"id": "train-6179", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names and inspection results of the facilities located in Burnham."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.dba_name, T2.results FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.city = 'BURNHAM'\n```"}]}, {"id": "train-6180", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compare the number of inspections under toxic items and no-smoking regulations."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T2.category = 'Toxic Items' THEN T1.inspection_id END) AS Tox_nums , COUNT(CASE WHEN T2.category = 'No Smoking Regulations' THEN T1.inspection_id END) AS NosmoNums FROM violation AS T1 INNER JOIN inspection_point AS T2 ON T1.point_id = T2.point_id\n```"}]}, {"id": "train-6181", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which facilities were inspected by Sarah Lindsey on 20th November 2012?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id WHERE T2.inspection_date = '2012-11-20' AND T3.first_name = 'Sarah' AND T3.last_name = 'Lindsey'\n```"}]}, {"id": "train-6182", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the categories and fines for the inspections done by Lisa Tillman in January 2014."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.category, T3.fine FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T1.inspection_id = T3.inspection_id INNER JOIN inspection_point AS T4 ON T3.point_id = T4.point_id WHERE T2.first_name = 'Lisa' AND T2.last_name = 'Tillman' AND strftime('%Y-%m', T1.inspection_date) = '2014-01'\n```"}]}, {"id": "train-6183", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many inspections were done under the display of inspection report summary category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.inspection_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.category = 'Display of Inspection Report Summary'\n```"}]}, {"id": "train-6184", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the types and results of the inspections done on Riverwalk caf\u00e9."}, {"from": "gpt", "value": "```sql\nSELECT T2.inspection_type, T2.results FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.facility_type = 'RIVERWALK CAFE'\n```"}]}, {"id": "train-6185", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who inspected Jean Samocki and what was the result?"}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name, T2.results FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id WHERE T1.dba_name = 'JEAN SAMOCKI'\n```"}]}, {"id": "train-6186", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much did Hacienda Los Torres from ward 36 fine for failing an inspection?"}, {"from": "gpt", "value": "```sql\nSELECT 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 T1.dba_name = 'HACIENDA LOS TORRES' AND T1.ward = 36 AND T2.results = 'Fail'\n```"}]}, {"id": "train-6187", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total amount of fine under the food equipment and utensil category."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.fine) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.category = 'Food Equipment and Utensil'\n```"}]}, {"id": "train-6188", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names and locations of the facilities that failed inspections on 29th July 2013."}, {"from": "gpt", "value": "```sql\nSELECT T2.dba_name, T2.longitude, T2.latitude FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE T1.inspection_date = '2013-07-29' AND T1.results = 'Fail'\n```"}]}, {"id": "train-6189", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of inspections with verified quality. Among them, how many businesses were from Chicago?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.results LIKE '%Pass%' THEN T2.inspection_id END) AS REAL) * 100 / COUNT(T2.inspection_id), COUNT(DISTINCT T2.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.city = 'CHICAGO'\n```"}]}, {"id": "train-6190", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average inspections per year done by Jessica Anthony from 2010 to 2017."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.first_name = 'Jessica' AND T1.last_name = 'Anthony' THEN T2.inspection_id ELSE 0 END) AS REAL) / 8 FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE strftime('%Y', T2.inspection_date) BETWEEN '2010' AND '2017'\n```"}]}, {"id": "train-6191", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the first name of employee who did inspection ID 48225?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 48225\n```"}]}, {"id": "train-6192", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the address of employee who did inspection ID 52238?"}, {"from": "gpt", "value": "```sql\nSELECT T1.address FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52238\n```"}]}, {"id": "train-6193", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the last name of employee who did inspection ID 52238?"}, {"from": "gpt", "value": "```sql\nSELECT T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52238\n```"}]}, {"id": "train-6194", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the inspection result for inspection done by Thomas Langley?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.results FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'Thomas' AND T1.last_name = 'Langley'\n```"}]}, {"id": "train-6195", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the address of employees who did inspection dated 11/5/2010."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.address FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_date = '2010-11-05'\n```"}]}, {"id": "train-6196", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the phone numbers of employees who did Canvass inspection."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.phone FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_type = 'Canvass'\n```"}]}, {"id": "train-6197", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the job title of employee who did inspection ID 52269?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52269\n```"}]}, {"id": "train-6198", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the inspection results for Xando Coffee & Bar / Cosi Sandwich Bar?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.results FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'XANDO COFFEE & BAR / COSI SANDWICH BAR'\n```"}]}, {"id": "train-6199", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What type of inspection was done at John Schaller?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.inspection_type FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'JOHN SCHALLER'\n```"}]}, {"id": "train-6200", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the dba name of restaurants that were inspected due to license."}, {"from": "gpt", "value": "```sql\nSELECT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_type = 'License'\n```"}]}, {"id": "train-6201", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many inspections done in 2010 had serious food safety issue?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.inspection_id) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T2.inspection_date) = '2010' AND T1.risk_level = 3\n```"}]}, {"id": "train-6202", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of dbas with verified quality."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.results LIKE '%Pass%'\n```"}]}, {"id": "train-6203", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total salary for employees who did inspection from ID 52270 to 52272."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.salary) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_id BETWEEN 52270 AND 52272\n```"}]}, {"id": "train-6204", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average salary for employees who did inspection on License Re-Inspection."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.salary) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_type = 'License Re-Inspection'\n```"}]}, {"id": "train-6205", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Did license number 1222441 pass the inspection and what is the zip code number of it?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.results, T1.zip FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.license_no = 1222441\n```"}]}, {"id": "train-6206", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did restaurant John Schaller has its first inspection in 2010?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(T2.inspection_date) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.dba_name = 'JOHN SCHALLER' AND strftime('%Y', T2.inspection_date) = '2010'\n```"}]}, {"id": "train-6207", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the employee that inspected establishments with license 1334073?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first_name, T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.license_no = 1334073\n```"}]}, {"id": "train-6208", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which establishments did Joshua Rosa inspect?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.dba_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T1.first_name = 'Joshua' AND T1.last_name = 'Rosa'\n```"}]}, {"id": "train-6209", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees have salary greater than 70000 but fail the inspection?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.employee_id) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.results = 'Fail' AND T1.salary > 70000\n```"}]}, {"id": "train-6210", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the food businesses that passed the inspection in 2010."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T2.inspection_date) = '2010' AND T2.results = 'Pass' AND T1.facility_type = 'Liquor'\n```"}]}, {"id": "train-6211", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the establishment that Joshua Rosa inspected?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.dba_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T1.first_name = 'Joshua' AND T1.last_name = 'Rosa'\n```"}]}, {"id": "train-6212", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many taverns failed in July 2010?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y-%m', T2.inspection_date) = '2010-07' AND T2.results = 'Fail' AND T1.facility_type = 'Restaurant'\n```"}]}, {"id": "train-6213", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the risk level of the establishment that Bob Benson inspected?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.risk_level FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T1.first_name = 'Bob' AND T1.last_name = 'Benson'\n```"}]}, {"id": "train-6214", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which establishments did Bob Benson inspect in 2010 and what was the results?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.dba_name, T2.results FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T1.first_name = 'Bob' AND T1.last_name = 'Benson' AND strftime('%Y', T2.inspection_date) = '2010'\n```"}]}, {"id": "train-6215", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the employee that inspected the establishment with license number 1576687?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.license_no = 1576687\n```"}]}, {"id": "train-6216", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many inspection points with serious point level that have no fine?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.point_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.point_level = 'Serious ' AND T2.fine = 0\n```"}]}, {"id": "train-6217", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of restaurants that paid a fine of 250 among all establishments?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.fine = 250 THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.license_no) 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 T1.facility_type = 'Restaurant'\n```"}]}, {"id": "train-6218", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of establishments with a risk level of 1 among all of the establishments that passed the inspection?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.risk_level = 1 THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.results = 'Pass'\n```"}]}, {"id": "train-6219", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where does the employee named \"Standard Murray\" live?"}, {"from": "gpt", "value": "```sql\nSELECT address, city, state FROM employee WHERE first_name = 'Standard' AND last_name = 'Murray'\n```"}]}, {"id": "train-6220", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the facility type of the establishment named \"Kinetic Playground\"?"}, {"from": "gpt", "value": "```sql\nSELECT facility_type FROM establishment WHERE dba_name = 'Kinetic Playground'\n```"}]}, {"id": "train-6221", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much salary does Jessica Anthony receive?"}, {"from": "gpt", "value": "```sql\nSELECT salary FROM employee WHERE first_name = 'Jessica' AND last_name = 'Anthony'\n```"}]}, {"id": "train-6222", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the restaurant's name at \"41.9532864854\" latitude and \"-87.7673790701422\" longitude?"}, {"from": "gpt", "value": "```sql\nSELECT dba_name FROM establishment WHERE latitude = 41.9532864854 AND longitude = -87.7673790701422 AND facility_type = 'Restaurant'\n```"}]}, {"id": "train-6223", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the list of employees, what is the total number of supervisors?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(employee_id) FROM employee WHERE title = 'Supervisor'\n```"}]}, {"id": "train-6224", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where in Chicago does the restaurant named \"Old Timers Rest & Lounge\" located?"}, {"from": "gpt", "value": "```sql\nSELECT address FROM establishment WHERE city = 'CHICAGO' AND dba_name = 'OLD TIMERS REST & LOUNGE' AND facility_type = 'Restaurant'\n```"}]}, {"id": "train-6225", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees are living in Hoffman Estates, IL?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(employee_id) FROM employee WHERE state = 'IL' AND city = 'Hoffman Estates'\n```"}]}, {"id": "train-6226", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of establishments with the highest risk level?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(license_no) FROM establishment WHERE risk_level = 3\n```"}]}, {"id": "train-6227", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the employee that receives 82700 as their salary?"}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM employee WHERE salary = 82700\n```"}]}, {"id": "train-6228", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the last name of the employee involved in the inspection ID 52256."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.last_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52256\n```"}]}, {"id": "train-6229", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of taverns that paid a $100 fine upon inspection."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.dba_name 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 T1.facility_type = 'Tavern' AND T3.fine = 100\n```"}]}, {"id": "train-6230", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List point level of inspections with no fine."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.point_level FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.fine = 0\n```"}]}, {"id": "train-6231", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the facility type and license number of establishments with the lowest risk level but failed the inspection."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.facility_type, T1.license_no FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = 1 AND T2.results = 'Fail'\n```"}]}, {"id": "train-6232", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the result of the February 24, 2010 inspection involving the employee named \"Arnold Holder\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.results FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_date = '2010-02-24' AND T1.first_name = 'Arnold' AND T1.last_name = 'Holder'\n```"}]}, {"id": "train-6233", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restaurants failed the inspection in April 2010?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.license_no) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y-%m', T2.inspection_date) = '2010-04' AND T1.facility_type = 'Restaurant' AND T2.results = 'Fail'\n```"}]}, {"id": "train-6234", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all inspection IDs where the employee named \"Rosemary Kennedy\" was involved."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.inspection_id FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'Rosemary' AND T1.last_name = 'Kennedy'\n```"}]}, {"id": "train-6235", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What type of inspection was done on July 07, 2010, involving the employee named \"Lisa Tillman\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.inspection_type FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'Lisa' AND T1.last_name = 'Tillman' AND T2.inspection_date = '2010-07-07'\n```"}]}, {"id": "train-6236", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the inspection ID of the inspection with the comment \"MUST CLEAN AND BETTER ORGANIZE HALLWAY AREA\" and sanitary operating requirement code of 7-38-030, 015, 010 (A), 005 (A)."}, {"from": "gpt", "value": "```sql\nSELECT T2.inspection_id FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T2.inspector_comment = 'MUST CLEAN AND BETTER ORGANIZE HALLWAY AREA' AND T1.code = '7-38-030, 015, 010 (A), 005 (A)'\n```"}]}, {"id": "train-6237", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the names of the establishments with the highest risk level and failed the inspection."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.dba_name FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T1.risk_level = 3 AND T2.results = 'Fail'\n```"}]}, {"id": "train-6238", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the inspection ID where the employee named \"David Hodges\" is currently employed in the \"Kamayan Express\" establishment?"}, {"from": "gpt", "value": "```sql\nSELECT T2.inspection_id FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no INNER JOIN employee AS T3 ON T2.employee_id = T3.employee_id WHERE T3.first_name = 'David' AND T3.last_name = 'Hodges' AND T1.dba_name = 'KAMAYAN EXPRESS'\n```"}]}, {"id": "train-6239", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the salary range of the employee involved in the inspection ID 58424."}, {"from": "gpt", "value": "```sql\nSELECT T1.salary, T3.salary FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN employee AS T3 WHERE T2.inspection_id = 58424 ORDER BY T1.salary, T3.salary DESC LIMIT 1\n```"}]}, {"id": "train-6240", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT T2.inspection_id FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.category = 'Personnel' AND T2.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.'\n```"}]}, {"id": "train-6241", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many grocery stores paid $250 fine upon their inspection?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.license_no) 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 T1.facility_type = 'Grocery Store' AND T3.fine = 250\n```"}]}, {"id": "train-6242", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the category of the inspection of the establishment named \"J & J FOOD\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.category 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 INNER JOIN inspection_point AS T4 ON T3.point_id = T4.point_id WHERE T1.dba_name = 'J & J FOOD'\n```"}]}, {"id": "train-6243", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the taverns that failed the inspection in January 2010."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.dba_name 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-%m', T2.inspection_date) = '2010-01' AND T2.results = 'Fail' AND T1.facility_type = 'TAVERN'\n```"}]}, {"id": "train-6244", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the inspections with serious point levels have no fines?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.inspection_id) FROM inspection_point AS T1 INNER JOIN violation AS T2 ON T1.point_id = T2.point_id WHERE T1.point_level = 'Serious ' AND T2.fine = 0\n```"}]}, {"id": "train-6245", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the establishment's name with an inspection category of No Smoking Regulations?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.dba_name 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 INNER JOIN inspection_point AS T4 ON T3.point_id = T4.point_id WHERE T4.category = 'No Smoking Regulations'\n```"}]}, {"id": "train-6246", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in the number of restaurants that passed and failed the canvass inspection type?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T2.results = 'Pass' THEN T1.license_no END) - COUNT(CASE WHEN T2.results = 'Fail' THEN T1.license_no END) AS diff FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.inspection_type = 'Canvass' AND T1.facility_type = 'Restaurant'\n```"}]}, {"id": "train-6247", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the establishments that failed the inspection in February 2010, list the names of the employees with a salary greater than 70% of the average salary of all employees."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.employee_id FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.results = 'Fail' AND strftime('%Y-%m', T2.inspection_date) = '2010-02' AND T1.salary > 0.7 * ( SELECT AVG(salary) FROM employee )\n```"}]}, {"id": "train-6248", "db_id": "food_inspection_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the establishments that paid a 500 fine, what is the percentage of restaurants?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.facility_type = 'Restaurant' THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.facility_type) 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 T3.fine = 500\n```"}]}, {"id": "train-6249", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the coin that has the highest market capitalization for all transactions in 2018."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date LIKE '2018%' AND T2.market_cap = ( SELECT MAX(market_cap) FROM historical WHERE STRFTIME('%Y', date) = '2018' )\n```"}]}, {"id": "train-6250", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total value of Argentum coined traded in the past 24 hours on 2016/10/11."}, {"from": "gpt", "value": "```sql\nSELECT T2.volume_24h FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Argentum' AND T2.date = '2016-10-11'\n```"}]}, {"id": "train-6251", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the price for Zetacoin on 13/11/1 and the next 7 consecutive days. What is the average price for these 7 days?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Zetacoin' AND T2.date BETWEEN '2013-11-01' AND '2013-11-07' UNION ALL SELECT AVG(T2.PRICE) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Zetacoin' AND T2.date BETWEEN '2013-11-01' AND '2013-11-07'\n```"}]}, {"id": "train-6252", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all transactions for WRAP in August 2016, list the time to achieve highest price and the time to achieve the lowest price."}, {"from": "gpt", "value": "```sql\nSELECT T2.time_high, T2.time_low, T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'WARP' AND STRFTIME('%Y-%m', T2.date) = '2016-08'\n```"}]}, {"id": "train-6253", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the transaction date whereby DigixDAO was transacted at the hightest price."}, {"from": "gpt", "value": "```sql\nSELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'DigixDAO' ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-6254", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the coin with the highest percentage price changed in 24 hours. State the transaction date and price."}, {"from": "gpt", "value": "```sql\nSELECT T1.name, T2.DATE, T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.percent_change_24h = ( SELECT MAX(percent_change_24h) FROM historical )\n```"}]}, {"id": "train-6255", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average monthly circulating supply for Frozen in 2014."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.circulating_supply) AS REAL) / 12 FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Frozen' AND STRFTIME('%Y', T2.date) = '2014'\n```"}]}, {"id": "train-6256", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the inactive coins and state the last date of its transaction?"}, {"from": "gpt", "value": "```sql\nSELECT T1.NAME, MAX(T2.DATE) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.ID = T2.coin_id WHERE T1.status = 'inactive' ORDER BY T2.DATE DESC LIMIT 1\n```"}]}, {"id": "train-6257", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the price of 1 Bitcoin in 2016?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.price) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bitcoin' AND STRFTIME('%Y', T2.date) = '2016'\n```"}]}, {"id": "train-6258", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the transaction date and the price when Bitcoin was bottomed?"}, {"from": "gpt", "value": "```sql\nSELECT T2.date, T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bitcoin' ORDER BY T2.price LIMIT 1\n```"}]}, {"id": "train-6259", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all coins with average price more than $1000. State the current status of the coin."}, {"from": "gpt", "value": "```sql\nSELECT T1.status FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id GROUP BY T1.name HAVING AVG(T2.price) > 1000\n```"}]}, {"id": "train-6260", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the coin and date of transactions with the greatest decline in percent change in 1 hour."}, {"from": "gpt", "value": "```sql\nSELECT T1.name, T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.percent_change_1h = ( SELECT MIN(percent_change_1h) FROM historical )\n```"}]}, {"id": "train-6261", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the coin under the token category that gives the highest max profit."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.category = 'token' ORDER BY T2.high - T2.low DESC LIMIT 1\n```"}]}, {"id": "train-6262", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the coin that have higher than average percentage price changed from the previous 24 hours for transaction on 2013/6/22."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2020-06-22' GROUP BY T1.name HAVING AVG(T2.percent_change_24h) > T2.PRICE\n```"}]}, {"id": "train-6263", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which crytocurrency was ranked the first by CoinMarketCap on 2013/4/28?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T2.cmc_rank = 1\n```"}]}, {"id": "train-6264", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much dollars was a Bitcoin worth on 2013/4/28 according to the coin market?"}, {"from": "gpt", "value": "```sql\nSELECT T2.market_cap FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'\n```"}]}, {"id": "train-6265", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which crytocurrency was not opened on 2013/5/3?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-05-03' AND T2.open IS NULL\n```"}]}, {"id": "train-6266", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the price of Bitcoin when it closed at the end of the day on 2013/4/29?"}, {"from": "gpt", "value": "```sql\nSELECT T2.close FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T1.name = 'Bitcoin'\n```"}]}, {"id": "train-6267", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Bitcoin reach its highest price on 2013/4/29?"}, {"from": "gpt", "value": "```sql\nSELECT T2.time_high FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T1.name = 'Bitcoin'\n```"}]}, {"id": "train-6268", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the max profit a user can make on Bitcoin on 2013/4/28?"}, {"from": "gpt", "value": "```sql\nSELECT T2.high - T2.low FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'\n```"}]}, {"id": "train-6269", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the number of Bitcoins verifiably burned until 2013/4/28?"}, {"from": "gpt", "value": "```sql\nSELECT T2.max_supply - T2.total_supply FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'\n```"}]}, {"id": "train-6270", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which crytocurrency was traded in the highest value on 2016/1/8?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2016-01-08' AND T2.volume_24h = ( SELECT MAX(volume_24h) FROM historical WHERE date = '2016-01-08' )\n```"}]}, {"id": "train-6271", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the crytocurrencies that have a total amount of existence of over 10000000 on 2013/4/28."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T2.total_supply > 10000000\n```"}]}, {"id": "train-6272", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Had Bitcoin's price increased or decreased on 2013/5/5 compared with the price 7 days before?"}, {"from": "gpt", "value": "```sql\nSELECT (CASE WHEN T2.percent_change_7d > 0 THEN 'INCREASED' ELSE 'DECREASED' END) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-05-05' AND T1.name = 'Bitcoin'\n```"}]}, {"id": "train-6273", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name IN ('Bitcoin', 'Litecoin') ORDER BY T2.circulating_supply DESC LIMIT 1\n```"}]}, {"id": "train-6274", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much was a Bitcoin on 2013/4/28?"}, {"from": "gpt", "value": "```sql\nSELECT T2.price FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-28' AND T1.name = 'Bitcoin'\n```"}]}, {"id": "train-6275", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the average price of a Bitcoin in the year 2013?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.price) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE STRFTIME('%Y', T2.date) = '2013' AND T1.name = 'Bitcoin'\n```"}]}, {"id": "train-6276", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the percentage of the Bitcoins verifiably burned until 2018/4/28?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(T2.max_supply) - SUM(T2.total_supply)) AS REAL) / SUM(T2.total_supply) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date < '2018-04-28' AND T1.name = 'Bitcoin'\n```"}]}, {"id": "train-6277", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of coins that has been disappeared."}, {"from": "gpt", "value": "```sql\nSELECT name FROM coins WHERE status = 'extinct'\n```"}]}, {"id": "train-6278", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the descripition of BitBar?"}, {"from": "gpt", "value": "```sql\nSELECT description FROM coins WHERE name = 'BitBar'\n```"}]}, {"id": "train-6279", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many coins were added in May 2013? Please list the names of coins."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) num FROM coins WHERE STRFTIME('%Y-%m', date_added) = '2013-05' UNION ALL SELECT name FROM coins WHERE STRFTIME('%Y-%m', date_added) = '2013-05'\n```"}]}, {"id": "train-6280", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names and symbols of the coins that were added on June 14, 2013."}, {"from": "gpt", "value": "```sql\nSELECT name, symbol FROM coins WHERE date_added LIKE '2013-06-14%'\n```"}]}, {"id": "train-6281", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of coins that cannot be traded in 2014."}, {"from": "gpt", "value": "```sql\nSELECT name FROM coins WHERE date_added LIKE '2014%' AND status = 'untracked'\n```"}]}, {"id": "train-6282", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the coins that have three tags."}, {"from": "gpt", "value": "```sql\nSELECT name FROM coins WHERE LENGTH(tag_names) - LENGTH(replace(tag_names, ',', '')) = 2\n```"}]}, {"id": "train-6283", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the coin with the highest price?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.price = ( SELECT MAX(price) FROM historical )\n```"}]}, {"id": "train-6284", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please name the coin that ranked first among the coins traded on April 29, 2013."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2013-04-29' AND T2.cmc_rank = 1\n```"}]}, {"id": "train-6285", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When is the best time to purchase Bitcoin?"}, {"from": "gpt", "value": "```sql\nSELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bitcoin' ORDER BY T2.low LIMIT 1\n```"}]}, {"id": "train-6286", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the coin that creates the most total value in the past 24 hours?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.volume_24h = ( SELECT MAX(volume_24h) FROM historical )\n```"}]}, {"id": "train-6287", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the coins that were not opened on May 2013."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE STRFTIME('%Y-%m', T2.date) = '2013-05' AND T2.open IS NULL\n```"}]}, {"id": "train-6288", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When is the highest closed price of CHNCoin?"}, {"from": "gpt", "value": "```sql\nSELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'CHNCoin' ORDER BY T2.close DESC LIMIT 1\n```"}]}, {"id": "train-6289", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Peercoin rank fifth?"}, {"from": "gpt", "value": "```sql\nSELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Peercoin' AND T2.cmc_rank = 5\n```"}]}, {"id": "train-6290", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When is Devcoin most valuable in the market?"}, {"from": "gpt", "value": "```sql\nSELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Devcoin' ORDER BY T2.market_cap DESC LIMIT 1\n```"}]}, {"id": "train-6291", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the top five coins traded on January 1, 2014."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2014-01-01' AND T2.cmc_rank <= 5\n```"}]}, {"id": "train-6292", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was Lebowskis not opened?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Lebowskis' AND (T2.open IS NULL OR T2.open = 0)\n```"}]}, {"id": "train-6293", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When is the highest price of Terracoin?"}, {"from": "gpt", "value": "```sql\nSELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Terracoin' ORDER BY T2.price DESC LIMIT 1\n```"}]}, {"id": "train-6294", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times was Bytecoin traded in June 2013?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.coin_id) FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Bytecoin' AND STRFTIME('%Y-%m', T2.date) = '2013-06'\n```"}]}, {"id": "train-6295", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the coins above the average price on April 28, 2013."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2018-04-28' AND T2.price > ( SELECT AVG(price) FROM historical WHERE date = '2018-04-28' )\n```"}]}, {"id": "train-6296", "db_id": "coinmarketcap", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the percentage of coins that is higher than the price 1 hour ago in May 29,2013? List the names of these coins."}, {"from": "gpt", "value": "```sql\nSELECT T1.NAME FROM coins AS T1 INNER JOIN historical AS T2 ON T1.ID = T2.coin_id WHERE T2.DATE = '2013-05-29' AND T2.percent_change_1h > 0\n```"}]}, {"id": "train-6324", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the products whose supplier is in Japan."}, {"from": "gpt", "value": "```sql\nSELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Japan'\n```"}]}, {"id": "train-6332", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name of the youngest employee."}, {"from": "gpt", "value": "```sql\nSELECT FirstName, LastName FROM Employees WHERE BirthDate = ( SELECT MAX(BirthDate) FROM Employees )\n```"}]}, {"id": "train-6334", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of orders that were handled by Michael Suyama."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Michael' AND T1.LastName = 'Suyama'\n```"}]}, {"id": "train-6343", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many kinds of products are there in the the category of \"dairy products\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.CategoryName = 'Dairy Products'\n```"}]}, {"id": "train-6344", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which category does \"tofu\" belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T2.CategoryName FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.ProductName = 'Tofu'\n```"}]}, {"id": "train-6348", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the contact name of the supplier for the product \"Gudbrandsdalsost\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.ContactName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Gudbrandsdalsost'\n```"}]}, {"id": "train-6349", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the country name of the supplier for \"Scottish Longbreads\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Scottish Longbreads'\n```"}]}, {"id": "train-6355", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are there in the country with the highest number of customers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CustomerID) FROM Customers GROUP BY Country ORDER BY COUNT(CustomerID) DESC LIMIT 1\n```"}]}, {"id": "train-6359", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many suppliers are there in the United States of America?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(SupplierID) FROM Suppliers WHERE Country = 'USA'\n```"}]}, {"id": "train-6371", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the supplier that supplies the most products to the company?"}, {"from": "gpt", "value": "```sql\nSELECT T1.SupplierID FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID GROUP BY T1.SupplierID ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-6379", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the employee who handled the highest amount of orders?"}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID GROUP BY T1.FirstName, T1.LastName ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-6411", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the contact person of the Pavlova supplier company?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ContactName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Pavlova'\n```"}]}, {"id": "train-6429", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the products that belong to the beverage category?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ProductName FROM Categories AS T1 INNER JOIN Products AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.CategoryName = 'Beverages'\n```"}]}, {"id": "train-6434", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the person to contact to get Camembert Pierrot?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ContactName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Camembert Pierrot'\n```"}]}, {"id": "train-6461", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the customer ids who placed order with Michael Suyama."}, {"from": "gpt", "value": "```sql\nSELECT T2.CustomerID FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Michael' AND T1.LastName = 'Suyama'\n```"}]}, {"id": "train-6463", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders have Margaret Peacock placed?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.EmployeeID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Margaret' AND T1.LastName = 'Peacock'\n```"}]}, {"id": "train-6469", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total products that are supplied by Japan suppliers."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.SupplierID) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Japan'\n```"}]}, {"id": "train-6470", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the contact name for product Teatime Chocolate Biscuits?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ContactName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName = 'Teatime Chocolate Biscuits'\n```"}]}, {"id": "train-6495", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are there in Berlin, Germany?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(City) FROM Customers WHERE Country = 'Germany' AND City = 'Berlin'\n```"}]}, {"id": "train-6502", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of orders were placed by customers in Madrid city in 1996?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.City = 'Madrid' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.City) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = 1996\n```"}]}, {"id": "train-6506", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1996, how many orders were from customers in the UK?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.CustomerID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = '1996' AND T1.Country = 'UK'\n```"}]}, {"id": "train-6508", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate the number of orders from customers by country in 1996."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.CustomerID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y', T2.OrderDate) = '1996' GROUP BY T1.Country\n```"}]}, {"id": "train-6514", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country are the majority of the suppliers located?"}, {"from": "gpt", "value": "```sql\nSELECT Country FROM Suppliers GROUP BY Country ORDER BY COUNT(SupplierID) DESC LIMIT 1\n```"}]}, {"id": "train-6516", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In August of 1996, how many orders were placed by the customer with the highest amount of orders?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(OrderID) FROM Orders WHERE OrderDate LIKE '1996-08%' GROUP BY CustomerID ORDER BY COUNT(OrderID) DESC LIMIT 1\n```"}]}, {"id": "train-6534", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the ID and description of the condiments category?"}, {"from": "gpt", "value": "```sql\nSELECT CategoryID, Description FROM Categories WHERE CategoryName = 'Condiments'\n```"}]}, {"id": "train-6549", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What were the products supplied by the company in Spain?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Spain'\n```"}]}, {"id": "train-6552", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were made by the customers in Ireland."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.OrderID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Country = 'Ireland'\n```"}]}, {"id": "train-6574", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the full name of the employee who processed the sales order with ID 10274."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10274\n```"}]}, {"id": "train-6580", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many suppliers does Northwind have in USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(SupplierID) FROM Suppliers WHERE Country = 'USA'\n```"}]}, {"id": "train-6583", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many companies do ship Northwind's orders?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ShipperID) FROM Shippers\n```"}]}, {"id": "train-6585", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate category name of soft drinks, coffees, teas, beers, and ales in description list."}, {"from": "gpt", "value": "```sql\nSELECT CategoryName FROM Categories WHERE Description = 'Soft drinks, coffees, teas, beers, and ales'\n```"}]}, {"id": "train-6608", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all product names under Confections."}, {"from": "gpt", "value": "```sql\nSELECT T1.ProductName FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.CategoryName = 'Confections'\n```"}]}, {"id": "train-6613", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the products where the suppliers come from Finland."}, {"from": "gpt", "value": "```sql\nSELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Finland'\n```"}]}, {"id": "train-6614", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The product 'Mozzarella di Giovanni' belongs in which category? Include the category's description as well."}, {"from": "gpt", "value": "```sql\nSELECT T2.CategoryName, T2.Description FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.ProductName = 'Mozzarella di Giovanni'\n```"}]}, {"id": "train-6622", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many suppliers are from UK?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(SupplierID) FROM Suppliers WHERE Country = 'UK'\n```"}]}, {"id": "train-6637", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of product with the ID of 77?"}, {"from": "gpt", "value": "```sql\nSELECT ProductName FROM Products WHERE ProductID = 77\n```"}]}, {"id": "train-6644", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were handled by Michael Suyama. State the order ID."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.OrderID) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Michael' AND T1.LastName = 'Suyama'\n```"}]}, {"id": "train-6653", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are located in London?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CustomerID) FROM Customers WHERE City = 'London'\n```"}]}, {"id": "train-6656", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the first name of employee who took care the order id 10250."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10250\n```"}]}, {"id": "train-6666", "db_id": "retail_world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name of employee who handled the order id 10280."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10280\n```"}]}, {"id": "train-6670", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many kinds of items are returned in order no.5?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_linenumber) FROM lineitem WHERE l_orderkey = 5 AND l_returnflag = 'R'\n```"}]}, {"id": "train-6671", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the latest date the items of order no.1 were shipped?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(l_shipdate) FROM lineitem WHERE l_orderkey = 1\n```"}]}, {"id": "train-6672", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which order has a higher priority, order no. 4 or order no. 36?"}, {"from": "gpt", "value": "```sql\nSELECT l_orderkey FROM lineitem WHERE l_orderkey IN (4, 36) ORDER BY l_shipdate DESC LIMIT 1\n```"}]}, {"id": "train-6673", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the comment of the order with the highest total price?"}, {"from": "gpt", "value": "```sql\nSELECT o_comment FROM orders WHERE o_totalprice = ( SELECT MAX(o_totalprice) FROM orders )\n```"}]}, {"id": "train-6674", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the phone number of Customer#000000001?"}, {"from": "gpt", "value": "```sql\nSELECT c_phone FROM customer WHERE c_name = 'Customer#000000001'\n```"}]}, {"id": "train-6675", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders in total have the customers in the household segment made?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'HOUSEHOLD'\n```"}]}, {"id": "train-6676", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the orders made by a customer in the household segment, what is the highest total price?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.o_totalprice) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'HOUSEHOLD'\n```"}]}, {"id": "train-6677", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the order comments of all the orders made by customers in the household segment."}, {"from": "gpt", "value": "```sql\nSELECT T1.o_comment FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'HOUSEHOLD'\n```"}]}, {"id": "train-6678", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the name of the customer who has made the single order with the highest total price."}, {"from": "gpt", "value": "```sql\nSELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey ORDER BY T1.o_totalprice DESC LIMIT 1\n```"}]}, {"id": "train-6679", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the order keys of all the orders made by a customer whose account is in debt."}, {"from": "gpt", "value": "```sql\nSELECT T1.o_orderkey FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_acctbal < 0\n```"}]}, {"id": "train-6680", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the orders made by customers in the household segment, how many of them are urgent?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.o_orderpriority) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'HOUSEHOLD' AND T1.o_orderpriority = '1-URGENT'\n```"}]}, {"id": "train-6681", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are in Brazil?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'BRAZIL'\n```"}]}, {"id": "train-6682", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the phone numbers of all the customers in the household segment and are in Brazil."}, {"from": "gpt", "value": "```sql\nSELECT T1.c_phone FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'BRAZIL'\n```"}]}, {"id": "train-6683", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the customers in Germany, how many of them have an account balance of over 1000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'GERMANY' AND T1.c_acctbal > 1000\n```"}]}, {"id": "train-6684", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders in total are made by customers in Germany?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.c_custkey) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN orders AS T3 ON T2.c_custkey = T3.o_custkey WHERE T1.n_name = 'GERMANY'\n```"}]}, {"id": "train-6685", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total price of all the orders made by customers in Germany?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.o_totalprice) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN orders AS T3 ON T2.c_custkey = T3.o_custkey WHERE T1.n_name = 'GERMANY'\n```"}]}, {"id": "train-6686", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the orders made by customers in Germany, which one of them has the highest priority in delivery? Please give its order key."}, {"from": "gpt", "value": "```sql\nSELECT T3.o_orderkey FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN orders AS T3 ON T2.c_custkey = T3.o_custkey WHERE T1.n_name = 'GERMANY' ORDER BY T3.o_orderdate LIMIT 1\n```"}]}, {"id": "train-6687", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average price of the orders made by a customer in Germany?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.o_totalprice) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN orders AS T3 ON T2.c_custkey = T3.o_custkey WHERE T1.n_name = 'GERMANY'\n```"}]}, {"id": "train-6688", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the customers, what is the percentage of the customer's nation being Germany?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.n_name = 'GERMANY', 1, 0)) AS REAL) * 100 / COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey\n```"}]}, {"id": "train-6689", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries are there in the No.2 region?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(n_nationkey) FROM nation WHERE n_regionkey = 2\n```"}]}, {"id": "train-6690", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country does supplier No.34 come from?"}, {"from": "gpt", "value": "```sql\nSELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_suppkey = 34\n```"}]}, {"id": "train-6691", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region does \"Supplier#000000129\" belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T3.r_name FROM nation AS T1 INNER JOIN supplier AS T2 ON T1.n_nationkey = T2.s_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.s_name = 'Supplier#000000129'\n```"}]}, {"id": "train-6692", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the nationality of \"Customer#000000055\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.n_name FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_name = 'Customer#000000055'\n```"}]}, {"id": "train-6693", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give customer No.106936's region name."}, {"from": "gpt", "value": "```sql\nSELECT T3.r_name FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_custkey = 106936\n```"}]}, {"id": "train-6694", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of Moroccan customers whose account is in debt."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_name) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'MOROCCO' AND T1.c_acctbal < 0\n```"}]}, {"id": "train-6695", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the order with the total price of 231499.38, what was the discounted price for supplier No. 9397?"}, {"from": "gpt", "value": "```sql\nSELECT T1.l_extendedprice * (1 - T1.l_discount) AS DISCOUNTERPRICE FROM lineitem AS T1 INNER JOIN orders AS T2 ON T2.o_orderkey = T1.l_orderkey WHERE T1.l_suppkey = 9397 AND T2.o_totalprice = 231499.38\n```"}]}, {"id": "train-6696", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the order with the total price of 218195.43, which supplier handled the returned item? Give the supplier id."}, {"from": "gpt", "value": "```sql\nSELECT T2.l_suppkey FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_totalprice = 218195.43 AND T2.l_returnflag = 'R'\n```"}]}, {"id": "train-6698", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Customer No.129301 made an order on 1996/7/27, what was the delivery time for the first part of that order?"}, {"from": "gpt", "value": "```sql\nSELECT JULIANDAY(T2.l_receiptdate) - JULIANDAY(T2.l_commitdate) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_custkey = '129301' AND T1.o_orderdate = '1996-07-27'\n```"}]}, {"id": "train-6699", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the customer who made an order with Clerk#000000803 on 1997/12/10."}, {"from": "gpt", "value": "```sql\nSELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_orderdate = '1997-12-10' AND T1.o_clerk = 'Clerk#000000803'\n```"}]}, {"id": "train-6700", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculates the profit processed by Supplier No. 7414 on order No. 817154."}, {"from": "gpt", "value": "```sql\nSELECT T1.l_extendedprice * (1 - T1.l_discount) - T2.ps_supplycost * T1.l_quantity FROM lineitem AS T1 INNER JOIN partsupp AS T2 ON T1.l_suppkey = T2.ps_suppkey WHERE T1.l_suppkey = 7414 AND T1.l_orderkey = 817154\n```"}]}, {"id": "train-6701", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the most number of suppliers whose account is in debt?"}, {"from": "gpt", "value": "```sql\nSELECT T.n_name FROM ( SELECT T2.n_name, SUM(T1.s_acctbal) AS num FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 GROUP BY T2.n_name ) AS T ORDER BY T.num LIMIT 1\n```"}]}, {"id": "train-6702", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the European countries among the given countries?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.r_name = 'EUROPE', 1, 0)) AS REAL) * 100 / COUNT(T1.n_name) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey\n```"}]}, {"id": "train-6703", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the percentage of Japanese suppliers whose account is in debt."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.n_name = 'JAPAN', 1, 0)) AS REAL) * 100 / COUNT(T1.s_name) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0\n```"}]}, {"id": "train-6704", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the customer with the highest amount of debt?"}, {"from": "gpt", "value": "```sql\nSELECT c_name FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer )\n```"}]}, {"id": "train-6705", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were shipped in 1998?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1998'\n```"}]}, {"id": "train-6706", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are in debt?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(c_custkey) FROM customer WHERE c_acctbal < 0\n```"}]}, {"id": "train-6707", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many items that were shipped via air were returned in 1994?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_linenumber) FROM lineitem WHERE l_returnflag = 'R' AND l_shipmode = 'AIR' AND STRFTIME('%Y', l_shipdate) = '1994'\n```"}]}, {"id": "train-6708", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are in the automobile market segment?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(c_custkey) FROM customer WHERE c_mktsegment = 'AUTOMOBILE'\n```"}]}, {"id": "train-6709", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 2 order keys of the item with the highest amount of extended price?"}, {"from": "gpt", "value": "```sql\nSELECT l_orderkey FROM lineitem ORDER BY l_extendedprice DESC LIMIT 2\n```"}]}, {"id": "train-6710", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the order with the highest amount of total price shipped?"}, {"from": "gpt", "value": "```sql\nSELECT T2.l_shipdate FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 1\n```"}]}, {"id": "train-6711", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which country do most of the customers come from?"}, {"from": "gpt", "value": "```sql\nSELECT T.n_name FROM ( SELECT T2.n_name, COUNT(T1.c_custkey) AS num FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey GROUP BY T2.n_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-6712", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many urgent orders were shipped the next day?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.o_orderkey) FROM lineitem AS T1 INNER JOIN orders AS T2 ON T2.o_orderkey = T1.l_orderkey WHERE JULIANDAY(T1.l_shipdate) - JULIANDAY(T2.o_orderdate) = 1 AND T2.o_orderpriority = '1-URGENT'\n```"}]}, {"id": "train-6713", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many in debt customers in the household market segment are from Russia?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal < 0 AND T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'RUSSIA'\n```"}]}, {"id": "train-6714", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many suppliers are from Japan?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'JAPAN'\n```"}]}, {"id": "train-6715", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders shipped via ship have a medium priority?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'SHIP' AND T1.o_orderpriority = '3-MEDIUM'\n```"}]}, {"id": "train-6716", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers from the United States, which market segment has the highest number of customers?"}, {"from": "gpt", "value": "```sql\nSELECT T.c_mktsegment FROM ( SELECT T1.c_mktsegment, COUNT(T1.c_custkey) AS num FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'UNITED STATES' GROUP BY T1.c_mktsegment ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-6717", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the countries in the region of Asia?"}, {"from": "gpt", "value": "```sql\nSELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'ASIA'\n```"}]}, {"id": "train-6718", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the parts manufactured by manufacturer 3 that have a supply cost of 1,000?"}, {"from": "gpt", "value": "```sql\nSELECT T2.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T1.ps_supplycost = 1000 AND T2.p_mfgr = 'Manufacturer#3'\n```"}]}, {"id": "train-6719", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries are there in the region whose comment description is \"asymptotes sublate after the r.\""}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_comment = 'asymptotes sublate after the r'\n```"}]}, {"id": "train-6721", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the profit for smoke turquoise purple blue salmon that was delivered in person on 5/7/1996?"}, {"from": "gpt", "value": "```sql\nSELECT T1.l_extendedprice * (1 - T1.l_discount) - T2.ps_supplycost * T1.l_quantity AS num FROM lineitem AS T1 INNER JOIN partsupp AS T2 ON T1.l_suppkey = T2.ps_suppkey INNER JOIN part AS T3 ON T2.ps_partkey = T3.p_partkey WHERE T1.l_receiptdate = '1996-05-07' AND T1.l_shipinstruct = 'DELIVER IN PERSON' AND T3.p_name = 'smoke turquoise purple blue salmon'\n```"}]}, {"id": "train-6722", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average price before discount of the top 10 orders with the highest total price?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.l_extendedprice) / 10 FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 10\n```"}]}, {"id": "train-6723", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the names of the top 3 customers with the highest number of orders of all time and calculate for the average total price per order of each customers."}, {"from": "gpt", "value": "```sql\nSELECT T.c_name, T.res FROM ( SELECT T2.c_name, SUM(T1.o_totalprice) / COUNT(T1.o_orderkey) AS res , COUNT(T1.o_orderkey) AS num FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey GROUP BY T1.o_custkey ) AS T ORDER BY T.num DESC LIMIT 3\n```"}]}, {"id": "train-6724", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many items were shipped on 4th December, 1993?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_linenumber) FROM lineitem WHERE l_shipdate = '1993-12-04'\n```"}]}, {"id": "train-6725", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the order date of items with the highest total price?"}, {"from": "gpt", "value": "```sql\nSELECT o_orderdate FROM orders WHERE o_totalprice = ( SELECT MAX(o_totalprice) FROM orders )\n```"}]}, {"id": "train-6726", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of customers' accounts in debt."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(c_acctbal < 0, 1, 0)) AS REAL) * 100 / COUNT(c_custkey) FROM customer\n```"}]}, {"id": "train-6727", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many part supplies were nearly out of stock?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ps_suppkey) FROM partsupp WHERE ps_availqty < 10\n```"}]}, {"id": "train-6728", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of manufactured parts by Manufacturer#3."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(p_mfgr = 'Manufacturer#3', 1, 0)) AS REAL) * 100 / COUNT(p_partkey) FROM part\n```"}]}, {"id": "train-6729", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List any five parts name in Medium Plated Brass."}, {"from": "gpt", "value": "```sql\nSELECT p_name FROM part WHERE p_type = 'MEDIUM PLATED BRASS' LIMIT 5\n```"}]}, {"id": "train-6730", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the orders shipped in November, 1998 by air, how many orders were urgent?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'AIR' AND T1.o_orderpriority = '1-URGENT' AND SUBSTR(T2.l_shipdate, 1, 7) = '1998-11'\n```"}]}, {"id": "train-6731", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are there in India?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'INDIA'\n```"}]}, {"id": "train-6732", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers from Morocco, how many customers were in debt?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal < 0 AND T2.n_name = 'MOROCCO'\n```"}]}, {"id": "train-6733", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the nation keys and names in Africa."}, {"from": "gpt", "value": "```sql\nSELECT T1.n_name, T1.n_nationkey FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'AFRICA'\n```"}]}, {"id": "train-6734", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total price of orders by Customer#000000013."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.o_totalprice) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_name = 'Customer#000000013'\n```"}]}, {"id": "train-6736", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total profit made by chocolate floral blue coral cyan."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.l_extendedprice * (1 - T3.l_discount) - T2.ps_supplycost * T3.l_quantity) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN lineitem AS T3 ON T2.ps_partkey = T3.l_partkey AND T2.ps_suppkey = T3.l_suppkey WHERE T1.p_name = 'chocolate floral blue coral cyan'\n```"}]}, {"id": "train-6737", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of suppliers in Germany."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.n_name = 'GERMANY', 1, 0)) AS REAL) * 100 / COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0\n```"}]}, {"id": "train-6738", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the suppliers' names which supplied smoke red pale saddle plum."}, {"from": "gpt", "value": "```sql\nSELECT T3.s_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_name = 'smoke red pale saddle plum'\n```"}]}, {"id": "train-6739", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the suppliers from Middle East region, how many suppliers were in debt?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.s_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey INNER JOIN supplier AS T3 ON T2.n_nationkey = T3.s_nationkey WHERE T3.s_acctbal < 0 AND T1.r_name = 'MIDDLE EAST'\n```"}]}, {"id": "train-6740", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the parts shipped by rail on 1st December, 1995, list part names with 10% discount."}, {"from": "gpt", "value": "```sql\nSELECT T2.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey INNER JOIN lineitem AS T3 ON T1.ps_partkey = T3.l_partkey WHERE T3.l_discount = 0.1 AND T3.l_shipdate = '1995-12-01' AND T3.l_shipmode = 'RAIL'\n```"}]}, {"id": "train-6741", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the parts supplied by Supplier#000000018, provide parts names which had supply costs above 900."}, {"from": "gpt", "value": "```sql\nSELECT T2.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey INNER JOIN supplier AS T3 ON T1.ps_suppkey = T3.s_suppkey WHERE T1.ps_supplycost > 900 AND T3.s_name = 'Supplier#000000018'\n```"}]}, {"id": "train-6742", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders were shipped in 1994?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1994'\n```"}]}, {"id": "train-6743", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the line items have been shipped by rail with a quantity less than 30?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_linenumber) FROM lineitem WHERE l_quantity < 30 AND l_shipmode = 'RAIL'\n```"}]}, {"id": "train-6744", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers in the furniture market segment, how many of them have a nation key of 1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(c_custkey) FROM customer WHERE c_mktsegment = 'FURNITURE' AND c_nationkey = 1\n```"}]}, {"id": "train-6745", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the phone number of the customer with the highest account balance."}, {"from": "gpt", "value": "```sql\nSELECT c_phone FROM customer ORDER BY c_acctbal DESC LIMIT 1\n```"}]}, {"id": "train-6746", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the order priority of the order with the highest total price?"}, {"from": "gpt", "value": "```sql\nSELECT o_orderpriority FROM orders WHERE o_totalprice = ( SELECT MAX(o_totalprice) FROM orders )\n```"}]}, {"id": "train-6747", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of orders made by customers in United States?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey INNER JOIN nation AS T3 ON T2.c_nationkey = T3.n_nationkey WHERE T3.n_name = 'UNITED STATES'\n```"}]}, {"id": "train-6748", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers from Brazil, how many customers are in automobile market segment?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'AUTOMOBILE' AND T2.n_name = 'BRAZIL'\n```"}]}, {"id": "train-6750", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the countries that are located in Asia."}, {"from": "gpt", "value": "```sql\nSELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'ASIA'\n```"}]}, {"id": "train-6751", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the countries that belong in the region with comment description \"furiously express accounts wake sly\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_comment = 'furiously express accounts wake sly'\n```"}]}, {"id": "train-6752", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of suppliers from Germany?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T2.n_name = 'GERMANY'\n```"}]}, {"id": "train-6753", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers in Asia, how many customers are in debt?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.n_name) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_acctbal < 0 AND T3.r_name = 'ASIA'\n```"}]}, {"id": "train-6754", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the phone number of the customer with the highest total price in an order."}, {"from": "gpt", "value": "```sql\nSELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey ORDER BY T1.o_totalprice DESC LIMIT 1\n```"}]}, {"id": "train-6755", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products that have a retail price greater than 1,000, how many products were shipped via ship?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ps_suppkey) FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_retailprice > 1000 AND T2.l_shipmode = 'SHIP'\n```"}]}, {"id": "train-6756", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name and marketing segment of the customer with the total order price of 199180.63?"}, {"from": "gpt", "value": "```sql\nSELECT T2.c_name, T2.c_mktsegment FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice = 199180.63\n```"}]}, {"id": "train-6757", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the nation and region of the customer with the address of wH55UnX7 VI?"}, {"from": "gpt", "value": "```sql\nSELECT T1.n_name, T3.r_name FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_address = 'wH55UnX7 VI'\n```"}]}, {"id": "train-6758", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the customers in Brazil, how many of them have an account balance of less than 1000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'BRAZIL' AND T1.c_acctbal < 1000\n```"}]}, {"id": "train-6760", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers with an account balance lower than 4000, what is the percentage of the customers in the US?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.n_name = 'United States', 1, 0)) AS REAL) * 100 / COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal < 4000\n```"}]}, {"id": "train-6761", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name and phone number of the customers who have more than 9000 account balance."}, {"from": "gpt", "value": "```sql\nSELECT c_name, c_phone FROM customer WHERE c_acctbal > 9000\n```"}]}, {"id": "train-6762", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of items shipped each day in April of 1994?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(l_linenumber) FROM lineitem WHERE l_shipdate BETWEEN '1994-01-01' AND '1994-01-30'\n```"}]}, {"id": "train-6763", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the order key of the orders with a total price between 200000 and 300000."}, {"from": "gpt", "value": "```sql\nSELECT o_orderkey FROM orders WHERE o_totalprice BETWEEN 200000 AND 300000\n```"}]}, {"id": "train-6764", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find and list the part key of the parts which has an above-average retail price."}, {"from": "gpt", "value": "```sql\nSELECT p_partkey FROM part WHERE p_retailprice > ( SELECT AVG(p_retailprice) FROM part )\n```"}]}, {"id": "train-6765", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of part supply that costs more than 500."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(ps_supplycost > 500, 1, 0)) AS REAL) * 100 / COUNT(ps_suppkey) FROM partsupp\n```"}]}, {"id": "train-6766", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the supply key of the top ten suppliers with the most account balance, and list the supply key along with the account balance in descending order of account balance."}, {"from": "gpt", "value": "```sql\nSELECT s_suppkey, s_acctbal FROM supplier ORDER BY s_acctbal DESC LIMIT 10\n```"}]}, {"id": "train-6767", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers who are not in debt ordered an urgent order?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.c_custkey) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_acctbal > 0 AND T1.o_orderpriority = '1-URGENT'\n```"}]}, {"id": "train-6768", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name and phone number of customers in India who have an above-average account balance."}, {"from": "gpt", "value": "```sql\nSELECT T1.c_name, T1.c_phone FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal > ( SELECT AVG(c_acctbal) FROM customer ) ORDER BY T1.c_name\n```"}]}, {"id": "train-6769", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the parts supply by Supplier#000000654, list the top five parts with the most supply cost in descending order of supply cost."}, {"from": "gpt", "value": "```sql\nSELECT T2.ps_partkey FROM supplier AS T1 INNER JOIN partsupp AS T2 ON T1.s_suppkey = T2.ps_suppkey WHERE T1.s_name = 'Supplier#000000654' ORDER BY T2.ps_supplycost DESC LIMIT 5\n```"}]}, {"id": "train-6770", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of customers from France is in the automobile segment?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.c_mktsegment = 'AUTOMOBILE', 1, 0)) AS REAL) * 100 / COUNT(T1.c_name) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'FRANCE'\n```"}]}, {"id": "train-6771", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the part which is most profitable."}, {"from": "gpt", "value": "```sql\nSELECT T.p_name FROM ( SELECT T3.p_name , T2.l_extendedprice * (1 - T2.l_discount) - T1.ps_supplycost * T2.l_quantity AS num FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-6772", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the countries with the below-average number of customers in ascending order of customer numbers."}, {"from": "gpt", "value": "```sql\nSELECT T2.n_name FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey GROUP BY T2.n_name HAVING COUNT(T1.c_name) > ( SELECT COUNT(customer.c_name) / COUNT(DISTINCT nation.n_name) FROM customer INNER JOIN nation ON customer.c_nationkey = nation.n_nationkey ) ORDER BY COUNT(T1.c_name)\n```"}]}, {"id": "train-6773", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of customers from the African region is in the household segment?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.r_name = 'AFRICA', 1, 0)) AS REAL) * 100 / COUNT(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey INNER JOIN customer AS T3 ON T1.n_nationkey = T3.c_nationkey WHERE T3.c_mktsegment = 'HOUSEHOLD'\n```"}]}, {"id": "train-6774", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of the top ten items with the most quantity available in the descending order of availability."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey ORDER BY T2.ps_availqty DESC LIMIT 10\n```"}]}, {"id": "train-6775", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference in the average retail price of parts shipped via ship and air."}, {"from": "gpt", "value": "```sql\nSELECT (CAST(SUM(IIF(T3.l_shipmode = 'SHIP', T1.p_retailprice, 0)) AS REAL) / SUM(IIF(T3.l_shipmode = 'SHIP', 1, 0))) - (CAST(SUM(IIF(T3.l_shipmode = 'AIR', T1.p_retailprice, 0)) AS REAL) / SUM(IIF(T3.l_shipmode = 'AIR', 1, 0))) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN lineitem AS T3 ON T2.ps_suppkey = T3.l_suppkey\n```"}]}, {"id": "train-6776", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average discount for the parts made by Manufacturer#5?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.l_discount) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN lineitem AS T3 ON T2.ps_suppkey = T3.l_suppkey WHERE T1.p_mfgr = 'Manufacturer#5'\n```"}]}, {"id": "train-6777", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the parts shipped by rail, how many are of medium priority?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.l_partkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'RAIL' AND T1.o_orderpriority = '3-MEDIUM'\n```"}]}, {"id": "train-6778", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the suppliers in the European region, what percentage have a below-average account balance?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T3.s_acctbal < ( SELECT AVG(supplier.s_acctbal) FROM supplier ), 1, 0)) AS REAL) * 100 / COUNT(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey INNER JOIN supplier AS T3 ON T1.n_nationkey = T3.s_nationkey WHERE T2.r_name = 'EUROPE'\n```"}]}, {"id": "train-6779", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference in the average number of low-priority orders shipped by truck in each month of 1995 and 1996."}, {"from": "gpt", "value": "```sql\nSELECT (CAST(SUM(IIF(STRFTIME('%Y', T2.l_shipdate) = 1995, 1, 0)) AS REAL) / 12) - (CAST(SUM(IIF(STRFTIME('%Y', T2.l_shipdate) = 1996, 1, 0)) AS REAL) / 12) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderpriority = '5-LOW' AND T2.l_shipmode = 'TRUCK'\n```"}]}, {"id": "train-6780", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List by their id all customers who have a debit balance in their accounts."}, {"from": "gpt", "value": "```sql\nSELECT c_custkey FROM customer WHERE c_acctbal < 0\n```"}]}, {"id": "train-6781", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List by order number the 3 items with the lowest price after applying the discount."}, {"from": "gpt", "value": "```sql\nSELECT l_orderkey FROM lineitem ORDER BY l_extendedprice * (1 - l_discount) LIMIT 3\n```"}]}, {"id": "train-6782", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders of more than 10 items have been returned?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_linenumber) FROM lineitem WHERE l_quantity > 10 AND l_returnflag = 'R'\n```"}]}, {"id": "train-6783", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total price charged for orders shipped by air without shipping instructions?"}, {"from": "gpt", "value": "```sql\nSELECT l_extendedprice * (1 - l_discount) * (1 + l_tax) AS totalprice FROM lineitem WHERE l_shipmode = 'AIR' AND l_shipinstruct = 'NONE'\n```"}]}, {"id": "train-6784", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the orders with a lower delivery priority, how many have an urgent priority order?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(o_orderkey) FROM orders WHERE o_orderpriority = '1-URGENT' GROUP BY o_orderdate ORDER BY o_orderdate DESC LIMIT 1\n```"}]}, {"id": "train-6785", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many suppliers from Egypt have a debit balance?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 AND T2.n_name = 'EGYPT'\n```"}]}, {"id": "train-6786", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many items shipped by REG AIR were ordered on March 22, 1995?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'REG AIR' AND T1.o_orderdate = '1995-03-22'\n```"}]}, {"id": "train-6787", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many European suppliers are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey INNER JOIN supplier AS T3 ON T1.n_nationkey = T3.s_nationkey WHERE T2.r_name = 'EUROPE'\n```"}]}, {"id": "train-6788", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which segment belongs the customer that made the most orders in April 1994?"}, {"from": "gpt", "value": "```sql\nSELECT T.c_mktsegment FROM ( SELECT T2.c_mktsegment, COUNT(T1.o_orderkey) AS num FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_orderdate LIKE '1994-04-%' GROUP BY T1.o_custkey ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-6789", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Lists all parts supplied by Supplier#000000034."}, {"from": "gpt", "value": "```sql\nSELECT T3.p_name FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T2.s_name = 'Supplier#000000034'\n```"}]}, {"id": "train-6790", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the cost prices of large burnished copper?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ps_supplycost FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T1.p_type = 'LARGE BURNISHED COPPER'\n```"}]}, {"id": "train-6791", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many clients from Mozambique required orders with a low priority order?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey INNER JOIN orders AS T3 ON T1.c_custkey = T3.o_custkey WHERE T2.n_name = 'MOZAMBIQUE' AND T3.o_orderpriority = '5-LOW'\n```"}]}, {"id": "train-6792", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the name of the product that is close to being sold out and that has the lowest cost price."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_availqty < 10 ORDER BY T2.ps_supplycost LIMIT 1\n```"}]}, {"id": "train-6793", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different clerks have served the customer with the address uFTe2u518et8Q8UC?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.o_clerk) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_address = 'uFTe2u518et8Q8UC'\n```"}]}, {"id": "train-6794", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the name of the parts without discount."}, {"from": "gpt", "value": "```sql\nSELECT T3.p_name FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T2.l_discount = 0.0000\n```"}]}, {"id": "train-6795", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many suppliers from Germany have left a comment with 'carefully regular packages'?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T2.n_name = 'GERMANY' AND T1.s_comment LIKE '%carefully regular packages%'\n```"}]}, {"id": "train-6796", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products shipped on 19/11/1994 were ordered on 21/09/1994?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.l_partkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderdate = '1994-09-21' AND T2.l_shipdate = '1994-11-19'\n```"}]}, {"id": "train-6797", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average profit of prom brushed steel products."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.l_extendedprice * (1 - T2.l_discount) - T1.ps_supplycost * T2.l_quantity) / COUNT(T1.ps_partkey) FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_type = 'PROMO BRUSHED STEEL'\n```"}]}, {"id": "train-6798", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of customers engaged in the household segment are from Iran?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.n_name = 'IRAN', 1, 0)) AS REAL) * 100 / COUNT(T2.n_name) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'HOUSEHOLD'\n```"}]}, {"id": "train-6799", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please state the segment, the name, the address, and the phone number of customer number 3."}, {"from": "gpt", "value": "```sql\nSELECT c_mktsegment, c_name, c_address, c_phone FROM customer WHERE c_custkey = 3\n```"}]}, {"id": "train-6800", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three line item numbers that have 10% off."}, {"from": "gpt", "value": "```sql\nSELECT l_linenumber FROM lineitem WHERE l_discount = 0.1 LIMIT 3\n```"}]}, {"id": "train-6801", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the line items that have a quantity greater than 40 have been shipped by air?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_linenumber) FROM lineitem WHERE l_quantity > 40 AND l_shipmode = 'AIR'\n```"}]}, {"id": "train-6802", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which ship mode has more \"deliver in person\" instructions, rail or mail?"}, {"from": "gpt", "value": "```sql\nSELECT IIF(SUM(IIF(l_shipmode = 'RAIL', 1, 0)) - SUM(IIF(l_shipmode = 'MAIL', 1, 0)), 'RAIL', 'MAIL') AS result FROM lineitem WHERE l_shipinstruct = 'DELIVER IN PERSON'\n```"}]}, {"id": "train-6803", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total price and the order priority of order number 33?"}, {"from": "gpt", "value": "```sql\nSELECT o_totalprice, o_orderpriority FROM orders WHERE o_orderkey = 33\n```"}]}, {"id": "train-6804", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many orders in 1998 had a total price under 950?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(o_orderkey) AS countorders FROM orders WHERE STRFTIME('%Y', o_orderdate) = '1998' AND o_totalprice < 950\n```"}]}, {"id": "train-6805", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three customers with debt."}, {"from": "gpt", "value": "```sql\nSELECT c_name FROM customer WHERE c_acctbal < 0 LIMIT 3\n```"}]}, {"id": "train-6806", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the discounted price of line item number 1?"}, {"from": "gpt", "value": "```sql\nSELECT l_extendedprice * (1 - l_discount) FROM lineitem WHERE l_linenumber = 1\n```"}]}, {"id": "train-6807", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference between the number of returned items and not returned items with the full price of under 16947.7?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(l_returnflag = 'A', 1, 0)) - SUM(IIF(l_returnflag = 'N', 1, 0)) AS diff FROM lineitem WHERE l_extendedprice < 16947.7\n```"}]}, {"id": "train-6809", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please name any three parts that have an available quantity of more than 9998."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_availqty > 9998 LIMIT 3\n```"}]}, {"id": "train-6810", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any two parts that come with the wrap bag container and have a supply cost of under 10."}, {"from": "gpt", "value": "```sql\nSELECT T1.p_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T2.ps_supplycost < 10 AND T1.p_container = 'WRAP BAG' LIMIT 2\n```"}]}, {"id": "train-6811", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the nationality of supplier number 1?"}, {"from": "gpt", "value": "```sql\nSELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_suppkey = 1\n```"}]}, {"id": "train-6813", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which region has the lowest number of countries?"}, {"from": "gpt", "value": "```sql\nSELECT T.r_name FROM ( SELECT T1.r_name, COUNT(T2.n_name) AS num FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey GROUP BY T1.r_name ) AS T ORDER BY T.num LIMIT 1\n```"}]}, {"id": "train-6814", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers from the furniture segments come from Iraq?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'FURNITURE' AND T2.n_name = 'IRAQ'\n```"}]}, {"id": "train-6815", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the customer number 93697 with the total order price of 191918.92?"}, {"from": "gpt", "value": "```sql\nSELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice = 191918.92 AND T1.o_custkey = 93697\n```"}]}, {"id": "train-6816", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which nation and region does the Customer#000000008 come from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.n_name, T3.r_name FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_name = 'Customer#000000008'\n```"}]}, {"id": "train-6817", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the delivery time and the clerk of order number 6?"}, {"from": "gpt", "value": "```sql\nSELECT JULIANDAY(T2.l_receiptdate) - JULIANDAY(T2.l_commitdate), T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderkey = 6\n```"}]}, {"id": "train-6818", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Japanese suppliers have their accounts in debt?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 AND T2.n_name = 'JAPAN'\n```"}]}, {"id": "train-6819", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which customer is the most in debt?"}, {"from": "gpt", "value": "```sql\nSELECT c_name FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer )\n```"}]}, {"id": "train-6820", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the dates of the urgent orders."}, {"from": "gpt", "value": "```sql\nSELECT o_orderdate FROM orders WHERE o_orderpriority = '1-URGENT'\n```"}]}, {"id": "train-6821", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the items are instructed to be delivered in person?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_linenumber) FROM lineitem WHERE l_shipinstruct = 'DELIVER IN PERSON'\n```"}]}, {"id": "train-6822", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the largest supplier's account balance?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(s_acctbal) FROM supplier\n```"}]}, {"id": "train-6823", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many part supplies are close to being out of stock?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ps_suppkey) FROM partsupp WHERE ps_availqty < 10\n```"}]}, {"id": "train-6824", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the nations in Europe."}, {"from": "gpt", "value": "```sql\nSELECT T2.n_name FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey WHERE T1.r_name = 'EUROPE'\n```"}]}, {"id": "train-6825", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the supply cost for the part \"violet olive rose ivory sandy\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ps_supplycost FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T1.p_name = 'violet olive rose ivory sandy'\n```"}]}, {"id": "train-6827", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total price of all orders from the customer with the phone number \"627-220-3983\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.o_totalprice) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_phone = '627-220-3983'\n```"}]}, {"id": "train-6828", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the shipping methods for the orders on 12/31/1994?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.l_shipmode FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderdate = '1994-12-31'\n```"}]}, {"id": "train-6829", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the account balance of the supplier with the most parts?"}, {"from": "gpt", "value": "```sql\nSELECT T.s_acctbal FROM ( SELECT T1.s_acctbal, COUNT(T2.ps_suppkey) AS num FROM supplier AS T1 INNER JOIN partsupp AS T2 ON T1.s_suppkey = T2.ps_suppkey GROUP BY T1.s_suppkey ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-6830", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which nation does the supplier with the account balance of \"4393.04\" belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal = 4393.04\n```"}]}, {"id": "train-6831", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the region with the most customers?"}, {"from": "gpt", "value": "```sql\nSELECT T.r_name FROM ( SELECT T3.r_name, COUNT(T2.c_custkey) AS num FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey GROUP BY T3.r_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-6832", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the phone number of the customer who placed orders with a total price of more than $300,000."}, {"from": "gpt", "value": "```sql\nSELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice > 300000\n```"}]}, {"id": "train-6833", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the clerks of orders with line items shipped by mail?"}, {"from": "gpt", "value": "```sql\nSELECT T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'MAIL'\n```"}]}, {"id": "train-6834", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 5 nations of suppliers with the lowest account balance?"}, {"from": "gpt", "value": "```sql\nSELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey ORDER BY T1.s_acctbal LIMIT 1\n```"}]}, {"id": "train-6835", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the addresses for the suppliers of the biggest parts."}, {"from": "gpt", "value": "```sql\nSELECT T2.s_address FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey ORDER BY T3.p_size DESC LIMIT 1\n```"}]}, {"id": "train-6836", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which part and supplier have the most profit?"}, {"from": "gpt", "value": "```sql\nSELECT T3.p_name, T4.s_name FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey INNER JOIN supplier AS T4 ON T1.ps_suppkey = T4.s_suppkey ORDER BY T2.l_extendedprice * (1 - T2.l_discount) - T1.ps_supplycost * T2.l_quantity DESC LIMIT 1\n```"}]}, {"id": "train-6837", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What proportion of suppliers are from Asia?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.r_name = 'ASIA', 1, 0)) AS REAL) * 100 / COUNT(T1.r_regionkey) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey INNER JOIN supplier AS T3 ON T2.n_nationkey = T3.s_nationkey\n```"}]}, {"id": "train-6838", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate the total price of order key 32."}, {"from": "gpt", "value": "```sql\nSELECT o_totalprice FROM orders WHERE o_orderkey = 32\n```"}]}, {"id": "train-6839", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many order keys are not applied for the discount?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_orderkey) FROM lineitem WHERE l_discount = 0\n```"}]}, {"id": "train-6842", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which line item with the highest quantity is shipped by air?"}, {"from": "gpt", "value": "```sql\nSELECT l_linenumber FROM lineitem WHERE l_shipmode = 'AIR' ORDER BY l_quantity DESC LIMIT 1\n```"}]}, {"id": "train-6843", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of customers whose accounts are in debt."}, {"from": "gpt", "value": "```sql\nSELECT c_name FROM customer WHERE c_acctbal < 0\n```"}]}, {"id": "train-6844", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers belong to the household segment in Germany?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.c_name) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'GERMANY'\n```"}]}, {"id": "train-6845", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the phone numbers of customers whose order priority is urgent."}, {"from": "gpt", "value": "```sql\nSELECT T2.c_phone FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_orderpriority = '1-URGENT'\n```"}]}, {"id": "train-6846", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name of customer whose order is applied with the highest discount."}, {"from": "gpt", "value": "```sql\nSELECT T3.c_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN customer AS T3 ON T1.o_custkey = T3.c_custkey ORDER BY T2.l_discount DESC LIMIT 1\n```"}]}, {"id": "train-6847", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the 5 orders with the highest total price, indicating the delivery date."}, {"from": "gpt", "value": "```sql\nSELECT T1.o_orderkey, T2.l_shipdate FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 5\n```"}]}, {"id": "train-6848", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the comments describing orders from customers in the furniture segment."}, {"from": "gpt", "value": "```sql\nSELECT T1.o_comment FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'FURNITURE'\n```"}]}, {"id": "train-6849", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate the names of the customers whose order with a total price over $300000."}, {"from": "gpt", "value": "```sql\nSELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T1.o_totalprice > 300000\n```"}]}, {"id": "train-6850", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name customers in India with account balances over $5000."}, {"from": "gpt", "value": "```sql\nSELECT T1.c_name FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal > 5000 AND T2.n_name = 'INDIA'\n```"}]}, {"id": "train-6851", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the phone numbers of suppliers from Japan."}, {"from": "gpt", "value": "```sql\nSELECT T1.s_phone FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T2.n_name = 'JAPAN'\n```"}]}, {"id": "train-6852", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the providers in Argentina, which supplier has an account that is in debt?"}, {"from": "gpt", "value": "```sql\nSELECT T1.s_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 AND T2.n_name = 'ARGENTINA'\n```"}]}, {"id": "train-6853", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries belong to the Algeria region?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.r_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey WHERE T2.n_name = 'ALGERIA'\n```"}]}, {"id": "train-6855", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of countries that belong to the American region."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.r_name = 'America', 1, 0)) AS REAL) * 100 / COUNT(T2.n_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey\n```"}]}, {"id": "train-6856", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate percentage of household segment in Indonesia."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.c_mktsegment = 'HOUSEHOLD', 1, 0)) AS REAL) * 100 / COUNT(T1.c_mktsegment) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'INDONESIA'\n```"}]}, {"id": "train-6857", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the products under the type \"promo brushed steel\"."}, {"from": "gpt", "value": "```sql\nSELECT p_name FROM part WHERE p_type = 'PROMO BRUSHED STEEL'\n```"}]}, {"id": "train-6858", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the comment of the product \"burlywood plum powder puff mint\"?"}, {"from": "gpt", "value": "```sql\nSELECT p_comment FROM part WHERE p_name = 'burlywood plum powder puff mint'\n```"}]}, {"id": "train-6859", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many parts have a retail price of over 1900?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(p_partkey) FROM part WHERE p_retailprice > 1900\n```"}]}, {"id": "train-6860", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products under the type \"promo brushed steel\", how many of them are manufactured by Manufacturer#5?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(p_partkey) FROM part WHERE p_type = 'PROMO BRUSHED STEEL' AND p_mfgr = 'Manufacturer#5'\n```"}]}, {"id": "train-6861", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the brands that contain a part under the type \"promo brushed steel\"."}, {"from": "gpt", "value": "```sql\nSELECT p_brand FROM part WHERE p_type = 'PROMO BRUSHED STEEL'\n```"}]}, {"id": "train-6862", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the product with the highest retail price?"}, {"from": "gpt", "value": "```sql\nSELECT p_name FROM part WHERE p_retailprice = ( SELECT MAX(p_retailprice) FROM part )\n```"}]}, {"id": "train-6863", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which part has a bigger size, \"pink powder drab lawn cyan\" or \"cornflower sky burlywood green beige\"?"}, {"from": "gpt", "value": "```sql\nSELECT T.p_name FROM ( SELECT p_name, p_size FROM part WHERE p_name IN ('pink powder drab lawn cyan', 'cornflower sky burlywood green beige') ) AS T ORDER BY p_size DESC LIMIT 1\n```"}]}, {"id": "train-6864", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many parts have a jumbo case container?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(p_partkey) FROM part WHERE p_container = 'JUMBO CASE'\n```"}]}, {"id": "train-6865", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the size of the smallest part in a jumbo case container?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(p_size) FROM part WHERE p_container = 'JUMBO CASE'\n```"}]}, {"id": "train-6866", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many suppliers have their accounts in debt?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(s_suppkey) FROM supplier WHERE s_acctbal < 0\n```"}]}, {"id": "train-6867", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the top 3 suppliers with the most amount of money in their accounts."}, {"from": "gpt", "value": "```sql\nSELECT s_name FROM supplier ORDER BY s_acctbal DESC LIMIT 3\n```"}]}, {"id": "train-6869", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the suppliers for the part \"hot spring dodger dim light\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.s_name FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_name = 'hot spring dodger dim light'\n```"}]}, {"id": "train-6870", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the lowest supply cost for the part \"hot spring dodger dim light\"?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(T1.ps_supplycost) FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T2.p_name = 'hot spring dodger dim light'\n```"}]}, {"id": "train-6871", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the supplier that provides the part \"hot spring dodger dim light\" with the lowest supply cost?"}, {"from": "gpt", "value": "```sql\nSELECT T2.s_name FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_name = 'hot spring dodger dim light' ORDER BY T1.ps_supplycost LIMIT 1\n```"}]}, {"id": "train-6872", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total quantity available by all suppliers for the part \"hot spring dodger dim light\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.ps_availqty) FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T2.p_name = 'hot spring dodger dim light'\n```"}]}, {"id": "train-6873", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which supplier can provide the most number of \"hot spring dodger dim light\"? Please give the supplier's phone number."}, {"from": "gpt", "value": "```sql\nSELECT T3.s_phone FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_name = 'hot spring dodger dim light' ORDER BY T2.ps_availqty DESC LIMIT 1\n```"}]}, {"id": "train-6874", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the suppliers for the part with the highest retail price."}, {"from": "gpt", "value": "```sql\nSELECT T3.s_phone FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_name = 'hot spring dodger dim light' ORDER BY T1.p_size DESC LIMIT 1\n```"}]}, {"id": "train-6875", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many suppliers for the part \"hot spring dodger dim light\" are in Vietnam?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.s_name) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey INNER JOIN nation AS T4 ON T3.s_nationkey = T4.n_nationkey WHERE T1.p_name = 'hot spring dodger dim light' AND T4.n_name = 'VIETNAM'\n```"}]}, {"id": "train-6876", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the suppliers providing parts under the type \"promo brushed steel\", how many of them are in debt?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.s_name) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T3.s_acctbal < 0 AND T1.p_type = 'PROMO BRUSHED STEEL'\n```"}]}, {"id": "train-6877", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the suppliers for parts under Brand#55."}, {"from": "gpt", "value": "```sql\nSELECT T3.s_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_brand = 'Brand#55'\n```"}]}, {"id": "train-6878", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the parts under the type \"promo brushed steel\", how many of them have a total available quantity from all suppliers of under 5000?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(num) FROM ( SELECT COUNT(T3.s_name) AS num FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_type = 'PROMO BRUSHED STEEL' GROUP BY T2.ps_partkey HAVING SUM(T2.ps_availqty) < 5000 ) T\n```"}]}, {"id": "train-6879", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The part \"hot spring dodger dim light\" is ordered in how many orders?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.p_partkey) FROM part AS T1 INNER JOIN lineitem AS T2 ON T1.p_partkey = T2.l_partkey WHERE T1.p_name = 'hot spring dodger dim light'\n```"}]}, {"id": "train-6880", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total quantity of the part \"hot spring dodger dim light\" ordered in all orders?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.p_partkey) FROM part AS T1 INNER JOIN lineitem AS T2 ON T1.p_partkey = T2.l_partkey WHERE T1.p_name = 'hot spring dodger dim light'\n```"}]}, {"id": "train-6881", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the order keys of all the orders that have more than 2 parts with a jumbo case container."}, {"from": "gpt", "value": "```sql\nSELECT T.l_orderkey FROM ( SELECT T2.l_orderkey, COUNT(T2.l_partkey) AS num FROM part AS T1 INNER JOIN lineitem AS T2 ON T1.p_partkey = T2.l_partkey WHERE T1.p_container = 'JUMBO CASE' GROUP BY T2.l_orderkey ) AS T WHERE T.num > 2\n```"}]}, {"id": "train-6882", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the suppliers in debt, how many of them are in Europe?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey INNER JOIN supplier AS T3 ON T1.n_nationkey = T3.s_nationkey WHERE T2.r_name = 'EUROPE' AND T3.s_acctbal < 0\n```"}]}, {"id": "train-6883", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the suppliers providing the part \"hot spring dodger dim light\", how many of them are in Europe?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.r_regionkey) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey INNER JOIN supplier AS T3 ON T2.n_nationkey = T3.s_nationkey WHERE T1.r_name = 'EUROPE'\n```"}]}, {"id": "train-6884", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the phone numbers of all the suppliers for the parts ordered in order no.1."}, {"from": "gpt", "value": "```sql\nSELECT T2.s_phone FROM lineitem AS T1 INNER JOIN supplier AS T2 ON T1.l_suppkey = T2.s_suppkey WHERE T1.l_orderkey = 1\n```"}]}, {"id": "train-6885", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the suppliers for the parts ordered in order no.4, how many of them are in debt?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.l_linenumber) FROM lineitem AS T1 INNER JOIN supplier AS T2 ON T1.l_suppkey = T2.s_suppkey WHERE T1.l_orderkey = 4 AND T2.s_acctbal < 0\n```"}]}, {"id": "train-6886", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the parts that are returned, how many of them are provided by a supplier in debt?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.l_partkey) FROM lineitem AS T1 INNER JOIN supplier AS T2 ON T1.l_suppkey = T2.s_suppkey WHERE T1.l_returnflag = 'R' AND T2.s_acctbal < 0\n```"}]}, {"id": "train-6887", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On which date was the part \"burnished seashell gainsboro navajo chocolate\" in order no.1 shipped?"}, {"from": "gpt", "value": "```sql\nSELECT T1.l_shipdate FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T1.l_orderkey = 1 AND T2.p_name = 'burnished seashell gainsboro navajo chocolate'\n```"}]}, {"id": "train-6888", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the quantity of the part \"burnished seashell gainsboro navajo chocolate\" ordered in order no.1?"}, {"from": "gpt", "value": "```sql\nSELECT T1.l_quantity FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T1.l_orderkey = 1 AND T2.p_name = 'burnished seashell gainsboro navajo chocolate'\n```"}]}, {"id": "train-6889", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which part is ordered in a bigger amount in order no.1, \"burnished seashell gainsboro navajo chocolate\" or \"salmon white grey tan navy\"?"}, {"from": "gpt", "value": "```sql\nSELECT T.p_name FROM ( SELECT T2.p_name, SUM(T1.l_quantity) AS num FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name IN ('salmon white grey tan navy', 'burnished seashell gainsboro navajo chocolate') GROUP BY T1.l_partkey ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-6890", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the biggest discount among all orders for the part \"burnished seashell gainsboro navajo chocolate\"?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.l_discount) FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name = 'burnished seashell gainsboro navajo chocolate'\n```"}]}, {"id": "train-6891", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the modes of shipping for the part \"burnished seashell gainsboro navajo chocolate\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.l_shipmode FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name = 'burnished seashell gainsboro navajo chocolate'\n```"}]}, {"id": "train-6892", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average supply cost for the part \"hot spring dodger dim light\"?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.ps_supplycost) FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_name = 'hot spring dodger dim light'\n```"}]}, {"id": "train-6893", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much higher in percentage is the highest supply cost of the part \"hot spring dodger dim light\" than the lowest supply cost?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((MAX(T1.ps_supplycost) - MIN(T1.ps_supplycost)) AS REAL) * 100 / MIN(T1.ps_supplycost) FROM partsupp AS T1 INNER JOIN supplier AS T2 ON T1.ps_suppkey = T2.s_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_name = 'hot spring dodger dim light'\n```"}]}, {"id": "train-6894", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the profit for part no.98768 in order no.1?"}, {"from": "gpt", "value": "```sql\nSELECT T1.l_extendedprice * (1 - T1.l_discount) - T2.ps_supplycost * T1.l_quantity FROM lineitem AS T1 INNER JOIN partsupp AS T2 ON T1.l_suppkey = T2.ps_suppkey WHERE T1.l_orderkey = 1 AND T1.l_partkey = 98768\n```"}]}, {"id": "train-6895", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the discounted price of the part \"burnished seashell gainsboro navajo chocolate\" in order no.1?"}, {"from": "gpt", "value": "```sql\nSELECT T1.l_extendedprice * (1 - T1.l_discount) FROM lineitem AS T1 INNER JOIN part AS T2 ON T1.l_partkey = T2.p_partkey WHERE T2.p_name = 'burnished seashell gainsboro navajo chocolate' AND T1.l_orderkey = 1\n```"}]}, {"id": "train-6896", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which market segment does the customer with the highest amount of debt belongs to?"}, {"from": "gpt", "value": "```sql\nSELECT c_mktsegment FROM customer WHERE c_acctbal = ( SELECT MIN(c_acctbal) FROM customer )\n```"}]}, {"id": "train-6897", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1997, how many orders were shipped via mail?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1997' AND l_shipmode = 'MAIL'\n```"}]}, {"id": "train-6898", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are in the furniture segment?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(c_custkey) FROM customer WHERE c_mktsegment = 'FURNITURE'\n```"}]}, {"id": "train-6899", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the items shipped in 1994 via truck, how many items were returned?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1994' AND l_returnflag = 'R' AND l_shipmode = 'TRUCK'\n```"}]}, {"id": "train-6900", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers in the machinery segment are in debt?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(c_custkey) FROM customer WHERE c_acctbal < 0 AND c_mktsegment = 'MACHINERY'\n```"}]}, {"id": "train-6901", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many urgent orders did Clerk#000000001 handle in 1997?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(o_orderkey) FROM orders WHERE STRFTIME('%Y', o_orderdate) = '1997' AND o_clerk = 'Clerk#000000001' AND o_orderpriority = '1-URGENT'\n```"}]}, {"id": "train-6902", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the customer whose order was delivered the longest?"}, {"from": "gpt", "value": "```sql\nSELECT T3.c_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN customer AS T3 ON T1.o_custkey = T3.c_custkey ORDER BY (JULIANDAY(T2.l_receiptdate) - JULIANDAY(T2.l_commitdate)) DESC LIMIT 1\n```"}]}, {"id": "train-6903", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the total price of all the orders shipped to customers in Argentina?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.o_totalprice) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey INNER JOIN orders AS T3 ON T1.c_custkey = T3.o_custkey WHERE T2.n_name = 'ARGENTINA'\n```"}]}, {"id": "train-6904", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers in the building segments have orders with a total price of no less than 50,000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.c_name) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'BUILDING' AND T1.o_totalprice > 50000\n```"}]}, {"id": "train-6905", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the least number of suppliers?"}, {"from": "gpt", "value": "```sql\nSELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey GROUP BY T1.s_nationkey ORDER BY COUNT(T1.s_name) LIMIT 1\n```"}]}, {"id": "train-6906", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the part supply cost for the medium metallic grey dodger linen?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ps_supplycost FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey WHERE T1.p_name = 'medium metallic grey dodger linen'\n```"}]}, {"id": "train-6907", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 2 countries with the highest number of indebted suppliers?"}, {"from": "gpt", "value": "```sql\nSELECT T.n_name FROM ( SELECT T2.n_name, SUM(T1.s_acctbal) AS num FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0 GROUP BY T1.s_nationkey ) AS T ORDER BY T.num LIMIT 2\n```"}]}, {"id": "train-6909", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the country of the supplier with the highest debt?"}, {"from": "gpt", "value": "```sql\nSELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey ORDER BY T1.s_suppkey DESC LIMIT 1\n```"}]}, {"id": "train-6910", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the clerk in charge of handling the item with the highest amount of extended price?"}, {"from": "gpt", "value": "```sql\nSELECT T1.o_clerk FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T2.l_extendedprice DESC LIMIT 1\n```"}]}, {"id": "train-6911", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the total quantities of the items ordered by customer 101660 on 10/5/1995?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.l_quantity) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_orderdate = '1995-10-05' AND T1.o_custkey = 101660\n```"}]}, {"id": "train-6912", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total amount of tax charged for the order placed by customer 88931 on 7/13/994?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.l_extendedprice * (1 - T2.l_discount) * (1 + T2.l_tax)) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_custkey = 88931 AND T1.o_orderdate = '1994-07-13'\n```"}]}, {"id": "train-6913", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the parts that were ordered by customer 110942?"}, {"from": "gpt", "value": "```sql\nSELECT T3.p_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN part AS T3 ON T2.l_partkey = T3.p_partkey WHERE T1.o_custkey = 110942\n```"}]}, {"id": "train-6914", "db_id": "retails", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the discounted price of every item that customer 111511 ordered in order 53159? List the names of the parts of every item."}, {"from": "gpt", "value": "```sql\nSELECT T2.l_extendedprice * (1 - T2.l_discount), T3.p_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN part AS T3 ON T2.l_partkey = T3.p_partkey WHERE T1.o_custkey = 111511 AND T1.o_orderkey = 53159\n```"}]}, {"id": "train-6915", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the height of David Bornhammar in inches?"}, {"from": "gpt", "value": "```sql\nSELECT T2.height_in_inch FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.PlayerName = 'David Bornhammar'\n```"}]}, {"id": "train-6916", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the players with a height of over 6'2\" inches."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch > '6''2\"'\n```"}]}, {"id": "train-6917", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players with a height of over 6'2\" inches, how many of them were born in Sweden?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch > '6''2\"' AND T1.nation = 'Sweden'\n```"}]}, {"id": "train-6918", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the tallest player?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id ORDER BY T2.height_in_cm DESC LIMIT 1\n```"}]}, {"id": "train-6919", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much does David Bornhammar weigh in kilograms?"}, {"from": "gpt", "value": "```sql\nSELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.PlayerName = 'David Bornhammar'\n```"}]}, {"id": "train-6920", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players weigh more than 90 kg?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90\n```"}]}, {"id": "train-6921", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players that weigh more than 90 kg, how many of them have a position of defense?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.position_info = 'D'\n```"}]}, {"id": "train-6922", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players that weigh more than 90 kg, what is the name of the player that has the most attendance in the player's first 7 years of NHL career?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.sum_7yr_GP = ( SELECT MAX(T1.sum_7yr_GP) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 )\n```"}]}, {"id": "train-6923", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the weight of the player with the longest time on ice in the player\u2019s first 7 years of NHL career in kilograms?"}, {"from": "gpt", "value": "```sql\nSELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.sum_7yr_TOI = ( SELECT MAX(t.sum_7yr_TOI) FROM PlayerInfo t )\n```"}]}, {"id": "train-6924", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much taller is David Bornhammar than Pauli Levokari in centimeters?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT T2.height_in_cm FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.PlayerName = 'David Bornhammar' ) - ( SELECT T2.height_in_cm FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.PlayerName = 'Pauli Levokari' )\n```"}]}, {"id": "train-6925", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the players that are right-shooted, how many of them weigh over 90 kg?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.shoots = 'R'\n```"}]}, {"id": "train-6926", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the players that are over 90 kg and are right-shooted."}, {"from": "gpt", "value": "```sql\nSELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_kg > 90 AND T1.shoots = 'R'\n```"}]}, {"id": "train-6927", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the BMI of David Bornhammar?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(T2.weight_in_kg AS REAL) / (CAST(T3.height_in_cm AS REAL) / 100 * (CAST(T3.height_in_cm AS REAL) / 100)) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id INNER JOIN height_info AS T3 ON T1.height = T3.height_id WHERE T1.PlayerName = 'David Bornhammar'\n```"}]}, {"id": "train-6928", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average height in centimeters of all the players in the position of defense?"}, {"from": "gpt", "value": "```sql\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```"}]}, {"id": "train-6929", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the weight in pounds of the heaviest player?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.weight_in_lbs) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id\n```"}]}, {"id": "train-6930", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many right-shooted players have a height of 5'7''?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch = '5''7\"' AND T1.shoots = 'R'\n```"}]}, {"id": "train-6931", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players whose total NHL games played in their first 7 years of NHL career is no less than 500, what is the name of the player who committed the most rule violations?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.sum_7yr_GP > 500 ORDER BY T2.PIM DESC LIMIT 1\n```"}]}, {"id": "train-6932", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the height in centimeter of the tallest player born in Edmonton, Alberta, Canada?"}, {"from": "gpt", "value": "```sql\nSELECT T2.height_in_cm FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T1.birthplace = 'Edmonton, AB, CAN' ORDER BY T2.height_in_cm DESC LIMIT 1\n```"}]}, {"id": "train-6933", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players, who were drafted by Anaheim Ducks in 2008, have played for U.S. National U18 Team?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.overallby = 'Anaheim Ducks' AND T1.draftyear = 2008 AND T2.TEAM = 'U.S. National U18 Team'\n```"}]}, {"id": "train-6934", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the weight in kilograms of the player with the highest number of goal differential of all time?"}, {"from": "gpt", "value": "```sql\nSELECT T3.weight_in_kg FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN weight_info AS T3 ON T2.weight = T3.weight_id ORDER BY T1.PLUSMINUS DESC LIMIT 1\n```"}]}, {"id": "train-6935", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the most valuable player in QMJHL league during the 2004-2005 season?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON BETWEEN '2004' AND '2005' AND T1.LEAGUE = 'QMJHL' ORDER BY T1.P DESC LIMIT 1\n```"}]}, {"id": "train-6936", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the players who played for Acadie-Bathurst Titan during the regular season in 1998-1999?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '1998-1999' AND T1.GAMETYPE = 'Regular Season' AND T1.TEAM = 'Acadie-Bathurst Titan'\n```"}]}, {"id": "train-6937", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games did the tallest player have ever played?"}, {"from": "gpt", "value": "```sql\nSELECT T1.GP FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.ELITEID = ( SELECT t.ELITEID FROM PlayerInfo t ORDER BY t.height DESC LIMIT 1 )\n```"}]}, {"id": "train-6938", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the youngest player to have played during the 1997-1998 season for OHL League?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '1997-1998' AND T1.LEAGUE = 'OHL' ORDER BY T2.birthdate DESC LIMIT 1\n```"}]}, {"id": "train-6939", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who played 72 games, how many are left-shooters?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ELITEID) FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.GP = 72 AND T2.shoots = 'L'\n```"}]}, {"id": "train-6940", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in the number of goals scored by Pavel Brendl during the regular season versus the playoffs in the 1998-1999 season?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Rs_G - T4.Pf_G AS diff FROM ( SELECT T2.PlayerName, T1.G AS Rs_G FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.PlayerName = 'Pavel Brendl' AND T1.SEASON = '1998-1999' AND T1.GAMETYPE = 'Regular Season' ) AS T3 INNER JOIN ( SELECT T2.PlayerName, T1.G AS Pf_G FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.PlayerName = 'Pavel Brendl' AND T1.SEASON = '1998-1999' AND T1.GAMETYPE = 'Playoffs' ) AS T4 ON T3.PlayerName = T4.PlayerName\n```"}]}, {"id": "train-6941", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average weight in pounds of all the players with the highest prospects for the draft?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.weight_in_lbs) AS REAL) / COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.CSS_rank = ( SELECT MAX(CSS_rank) FROM PlayerInfo )\n```"}]}, {"id": "train-6942", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the teams that made the playoffs in the 2007-2008 season, identify the percentage that played over 20 games."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN GP > 20 THEN TEAM ELSE NULL END) AS REAL) * 100 / COUNT(TEAM) FROM SeasonStatus WHERE SEASON = '2007-2008' AND GAMETYPE = 'Playoffs'\n```"}]}, {"id": "train-6943", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the player who scored the most goals in a single game in the 2007-2008 season of WHL?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2007-2008' AND T1.LEAGUE = 'WHL' ORDER BY T1.G DESC LIMIT 1\n```"}]}, {"id": "train-6944", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the Chilliwack Chiefs players who have scored 100 points or more in the NHL."}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.TEAM = 'Chilliwack Chiefs' AND T1.P >= 100\n```"}]}, {"id": "train-6945", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the players who weigh 120 kg."}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM weight_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.weight_id = T2.weight WHERE T1.weight_in_kg = 120\n```"}]}, {"id": "train-6946", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the players with the same height as Brian Gionta. How tall are they?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName, T1.height_in_cm FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T2.height = ( SELECT height FROM PlayerInfo WHERE PlayerName = 'Brian Gionta' )\n```"}]}, {"id": "train-6947", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the name and position of the player who has committed the most rule violations."}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName, T2.position_info FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.PIM = ( SELECT MAX(PIM) FROM SeasonStatus )\n```"}]}, {"id": "train-6948", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the player who has the most NHL points in draft year."}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.P = ( SELECT MAX(P) FROM SeasonStatus )\n```"}]}, {"id": "train-6949", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all players drafted by the Toronto Maple Leafs, identify the percentage who are from Eastern Europe."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN nation IN ('Belarus', 'Czech Rep.', 'Slovakia', 'Ukraine') THEN ELITEID ELSE NULL END) AS REAL) * 100 / COUNT(ELITEID) FROM PlayerInfo WHERE overallby = 'Toronto Maple Leafs'\n```"}]}, {"id": "train-6950", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all players drafted by the Toronto Maple Leafs in 2008, identify the player with the highest prospects for the draft."}, {"from": "gpt", "value": "```sql\nSELECT PlayerName FROM PlayerInfo WHERE overallby = 'Toronto Maple Leafs' AND draftyear = '2008' ORDER BY CSS_rank DESC LIMIT 1\n```"}]}, {"id": "train-6951", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the player and his team who made the playoffs in the 2006-2007 season of SuperElit league with the highest points."}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName, T1.TEAM FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2006-2007' AND T1.GAMETYPE = 'Playoffs' AND T1.LEAGUE = 'SuperElit' ORDER BY T1.P DESC LIMIT 1\n```"}]}, {"id": "train-6952", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players who were drafted by the Toronto Maple Leafs have played over 300 games in their first 7 years of the NHL career?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ELITEID) FROM PlayerInfo WHERE overallby = 'Toronto Maple Leafs' AND sum_7yr_GP > 300\n```"}]}, {"id": "train-6953", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How tall is the player from Yale University who picked up 28 penalty minutes in the 2005-2006 season?"}, {"from": "gpt", "value": "```sql\nSELECT T3.height_in_cm FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN height_info AS T3 ON T2.height = T3.height_id WHERE T1.SEASON = '2005-2006' AND T1.TEAM = 'Yale Univ.' AND T1.PIM = 28\n```"}]}, {"id": "train-6954", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all goals scored by Calgary Hitmen in the 2007-2008 season, identify the percentage scored by Ian Schultz."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.PlayerName = 'Ian Schultz' THEN T1.G ELSE 0 END) AS REAL) * 100 / SUM(T1.G) FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2007-2008' AND T1.TEAM = 'Calgary Hitmen'\n```"}]}, {"id": "train-6955", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all penalty minutes picked up by Ak Bars Kazan in the 1999-2000 season, identify the percentage picked up by Yevgeni Muratov."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.PlayerName = 'Yevgeni Muratov' THEN T1.PIM ELSE 0 END) AS REAL) * 100 / SUM(T1.PIM) FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '1999-2000' AND T1.TEAM = 'Ak Bars Kazan'\n```"}]}, {"id": "train-6956", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the birthplace of Aaron Gagnon?"}, {"from": "gpt", "value": "```sql\nSELECT birthplace FROM PlayerInfo WHERE PlayerName = 'Aaron Gagnon'\n```"}]}, {"id": "train-6957", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the weight in kg of Tony Martensson?"}, {"from": "gpt", "value": "```sql\nSELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.PlayerName = 'Tony Martensson'\n```"}]}, {"id": "train-6958", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the name of players who weight 190 lbs."}, {"from": "gpt", "value": "```sql\nSELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T2.weight_in_lbs = 190\n```"}]}, {"id": "train-6959", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who has the heaviest weight?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id ORDER BY T2.weight_in_kg DESC LIMIT 1\n```"}]}, {"id": "train-6960", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of players who were born in Denmark and weight above 154 lbs?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.nation = 'Denmark' AND T2.weight_in_lbs > 154 THEN T1.ELITEID ELSE NULL END) AS REAL) * 100 / COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id\n```"}]}, {"id": "train-6961", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team does Andreas Jamtin belong to?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.TEAM FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.PlayerName = 'Andreas Jamtin'\n```"}]}, {"id": "train-6962", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the seasons that Niklas Eckerblom played."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.SEASON FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.PlayerName = 'Niklas Eckerblom'\n```"}]}, {"id": "train-6963", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the type of game that Matthias Trattnig played."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.GAMETYPE FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.PlayerName = 'Matthias Trattnig'\n```"}]}, {"id": "train-6964", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the nation of players who played for the 1997-1998 season ."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.nation FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '1997-1998'\n```"}]}, {"id": "train-6965", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest point highest point of Per Mars in the draft year?"}, {"from": "gpt", "value": "```sql\nSELECT T1.P FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.PlayerName = 'Per Mars' ORDER BY T1.P DESC LIMIT 1\n```"}]}, {"id": "train-6966", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the Italian players, who has the shortest height?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T2.nation = 'Italy' ORDER BY T1.height_in_cm ASC LIMIT 1\n```"}]}, {"id": "train-6967", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the name of players who have a height of 5'8\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T1.height_in_inch = '5''8\"'\n```"}]}, {"id": "train-6968", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players were born in 1982 and have a height above 182cm?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T1.height_in_cm > 182 AND strftime('%Y', T2.birthdate) = '1982'\n```"}]}, {"id": "train-6969", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of Russian players who have a height of under 200 inch?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.height_in_cm < 200 AND T2.nation = 'Russia' THEN T2.ELITEID ELSE NULL END) AS REAL) * 100 / COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height\n```"}]}, {"id": "train-6970", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the USA players, who has the lightest weight?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM weight_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.weight_id = T2.weight WHERE T2.nation = 'USA' ORDER BY T1.weight_in_lbs ASC LIMIT 1\n```"}]}, {"id": "train-6971", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who among the players in season 2000-2001 has committed the highest rule violations or penalty minutes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' ORDER BY T1.PIM DESC LIMIT 1\n```"}]}, {"id": "train-6972", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of all players in team Avangard Omsk in season 2000-2001."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.TEAM = 'Avangard Omsk'\n```"}]}, {"id": "train-6973", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who among the players drafted by Arizona Coyotes in 2000 has committed the highest rule violations?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.overallby = 'Arizona Coyotes' AND T2.draftyear = 2000 ORDER BY T1.PIM DESC LIMIT 1\n```"}]}, {"id": "train-6974", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players were drafted by Arizona Coyotes whose height reaches 195 centimeters?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height WHERE T2.overallby = 'Arizona Coyotes' AND T1.height_in_cm = 195\n```"}]}, {"id": "train-6975", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of all players from Avangard Omsk that have played for playoffs in season 2000-2001."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.TEAM = 'Avangard Omsk' AND T1.GAMETYPE = 'Playoffs'\n```"}]}, {"id": "train-6976", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the most valuable player who played in the 2000-2001 season of the International league?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.LEAGUE = 'International' ORDER BY T1.P DESC LIMIT 1\n```"}]}, {"id": "train-6977", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players who were born in 1980 weigh 185 in pounds?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ELITEID) FROM weight_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.weight_id = T2.weight WHERE T1.weight_in_lbs = 185 AND strftime('%Y', T2.birthdate) = '1980'\n```"}]}, {"id": "train-6978", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who has played the most game plays in the 2000-2001 season of the International league?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.LEAGUE = 'International' ORDER BY T1.GP DESC LIMIT 1\n```"}]}, {"id": "train-6979", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of all players from Avangard Omsk who played in the 2000-2001 season of the International league that have no goals in draft year."}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.LEAGUE = 'International' AND T1.TEAM = 'Czech Republic (all)' AND T1.G = 0\n```"}]}, {"id": "train-6980", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the oldest player who played for Avangard Omsk during the regular season in 2000-2001?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2000-2001' AND T1.GAMETYPE = 'Regular Season' AND T1.TEAM = 'Avangard Omsk' ORDER BY T2.birthdate ASC LIMIT 1\n```"}]}, {"id": "train-6981", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who played in OHL league during the regular season in 2007-2008, who is the player that attained the most number of assist?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PlayerName FROM SeasonStatus AS T1 INNER JOIN PlayerInfo AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.SEASON = '2007-2008' AND T1.LEAGUE = 'OHL' AND T1.GAMETYPE = 'Regular Season' ORDER BY T1.A DESC LIMIT 1\n```"}]}, {"id": "train-6982", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teams did the heaviest player drafted by Arizona Coyotes have played for?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.TEAM) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN weight_info AS T3 ON T1.weight = T3.weight_id WHERE T1.overallby = 'Arizona Coyotes' ORDER BY T3.weight_in_lbs DESC LIMIT 1\n```"}]}, {"id": "train-6983", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average weight in pounds of all players drafted by Arizona Coyotes."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.weight_in_lbs) AS REAL) / COUNT(T2.ELITEID) FROM weight_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.weight_id = T2.weight WHERE T2.overallby = 'Arizona Coyotes'\n```"}]}, {"id": "train-6984", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average height in centimeter of all players who played in Acadie-Bathurst Titan during regular season."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.height_in_cm) AS REAL) / COUNT(T2.ELITEID) FROM height_info AS T1 INNER JOIN PlayerInfo AS T2 ON T1.height_id = T2.height INNER JOIN SeasonStatus AS T3 ON T2.ELITEID = T3.ELITEID WHERE T3.TEAM = 'Acadie-Bathurst Titan' AND T3.GAMETYPE = 'Regular Season'\n```"}]}, {"id": "train-6985", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games did Per Mars play in the 1997-1998 season?"}, {"from": "gpt", "value": "```sql\nSELECT T2.GP FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.SEASON = '1997-1998' AND T1.PlayerName = 'Pavel Patera'\n```"}]}, {"id": "train-6986", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How heavy is Matthias Trattnig in kilograms?"}, {"from": "gpt", "value": "```sql\nSELECT T2.weight_in_kg FROM PlayerInfo AS T1 INNER JOIN weight_info AS T2 ON T1.weight = T2.weight_id WHERE T1.PlayerName = 'Pavel Patera'\n```"}]}, {"id": "train-6987", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of players who have a height over 5'9."}, {"from": "gpt", "value": "```sql\nSELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN height_info AS T2 ON T1.height = T2.height_id WHERE T2.height_in_inch > '5''9\"'\n```"}]}, {"id": "train-6988", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What team did Niklas Eckerblom play in the 1997-1998 season?"}, {"from": "gpt", "value": "```sql\nSELECT T2.TEAM FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.SEASON = '1997-1998' AND T1.PlayerName = 'Niko Kapanen'\n```"}]}, {"id": "train-6989", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team has the most Swedish?"}, {"from": "gpt", "value": "```sql\nSELECT T.TEAM FROM ( SELECT T2.TEAM, COUNT(DISTINCT T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.nation = 'Sweden' GROUP BY T2.TEAM ORDER BY COUNT(DISTINCT T1.ELITEID) DESC LIMIT 1 ) AS T\n```"}]}, {"id": "train-6990", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many playoffs did Per Mars participate in?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.GP) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T1.PlayerName = 'Per Mars' AND T2.GAMETYPE = 'Playoffs'\n```"}]}, {"id": "train-6991", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the player who had the most goals for team Rimouski Oceanic in playoff."}, {"from": "gpt", "value": "```sql\nSELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.TEAM = 'Rimouski Oceanic' AND T2.GAMETYPE = 'Playoffs' ORDER BY T2.G DESC LIMIT 1\n```"}]}, {"id": "train-6992", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country do most players of team Plymouth Whalers come from?"}, {"from": "gpt", "value": "```sql\nSELECT T.nation FROM ( SELECT T1.nation, COUNT(T1.ELITEID) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.TEAM = 'Plymouth Whalers' GROUP BY T1.nation ORDER BY COUNT(T1.ELITEID) DESC LIMIT 1 ) AS T\n```"}]}, {"id": "train-6993", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who had the most assists of team Plymouth Whalers in the 1999-2000 season?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.TEAM = 'Plymouth Whalers' AND T2.SEASON = '1999-2000' ORDER BY T2.A DESC LIMIT 1\n```"}]}, {"id": "train-6994", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the height of all players from team Oshawa Generals in inches."}, {"from": "gpt", "value": "```sql\nSELECT T3.height_in_inch FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN height_info AS T3 ON T1.height = T3.height_id WHERE T2.TEAM = 'Oshawa Generals'\n```"}]}, {"id": "train-6995", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the oldest player that participated in OHL league in the 1997 - 2000 season?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PlayerName FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.LEAGUE = 'OHL' AND T2.SEASON = '1999-2000' ORDER BY T1.birthdate LIMIT 1\n```"}]}, {"id": "train-6996", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the tallest player in team USA U20?"}, {"from": "gpt", "value": "```sql\nSELECT T.PlayerName FROM ( SELECT T1.PlayerName, T3.height_in_cm FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN height_info AS T3 ON T1.height = T3.height_id WHERE T2.TEAM = 'USA U20' ORDER BY T3.height_in_cm DESC ) AS T WHERE T.height_in_cm = ( SELECT MAX(T3.height_in_cm) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID INNER JOIN height_info AS T3 ON T1.height = T3.height_id WHERE T2.TEAM = 'USA U20' )\n```"}]}, {"id": "train-6997", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of Swedish players in playoffs games in the 1997 - 2000 season?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT CAST(COUNT(CASE WHEN T1.nation = 'Sweden' THEN T1.ELITEID ELSE NULL END) OVER (PARTITION BY T2.SEASON) AS REAL) * 100 / COUNT(T1.ELITEID) OVER (PARTITION BY T2.SEASON) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.SEASON IN ('1997-1998', '1998-1999', '1999-2000')\n```"}]}, {"id": "train-6998", "db_id": "ice_hockey_draft", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of penalty minutes of Swedish players in OHL league among all players."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.nation = 'Sweden' THEN T2.PIM ELSE NULL END) AS REAL) * 100 / COUNT(*) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.LEAGUE = 'OHL'\n```"}]}, {"id": "train-6999", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average standard cost of product number CA-1098?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.StandardCost) FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductNumber = 'CA-1098'\n```"}]}, {"id": "train-7000", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the products, list the product name and its corresponding start date for the current standard cost."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.StartDate FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T2.EndDate IS NULL\n```"}]}, {"id": "train-7001", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the products whereby the standard cost is $80 more than previous standard cost in history."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.StandardCost - T2.StandardCost > 80 GROUP BY T1.Name\n```"}]}, {"id": "train-7002", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all products and total quantity for each item for shopping cart ID 14951."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.Quantity FROM Product AS T1 INNER JOIN ShoppingCartItem AS T2 ON T1.ProductID = T2.ProductID WHERE T2.ShoppingCartID = 14951\n```"}]}, {"id": "train-7003", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the product name with more than 5 quantity in the shopping cart."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Product AS T1 INNER JOIN ShoppingCartItem AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Quantity > 5\n```"}]}, {"id": "train-7004", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the purchase order transactions, name all the products with low quality."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Name FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Class = 'L' AND T2.TransactionType = 'P' ORDER BY T1.Name\n```"}]}, {"id": "train-7005", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide all the transactions whereby the quantiy is more than 10,000 pieces. State the product name and the selling price."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Name, T1.ListPrice FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Quantity > 10000\n```"}]}, {"id": "train-7006", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which is a high quality product but with the lowest transacted quantity?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Class = 'H' ORDER BY T2.Quantity ASC LIMIT 1\n```"}]}, {"id": "train-7007", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many transactions are there for product under the Mountain line?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.TransactionID) FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductLine = 'M'\n```"}]}, {"id": "train-7008", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much would be the total sales profit for shopping cart ID 20621 ?"}, {"from": "gpt", "value": "```sql\nSELECT SUM((T1.ListPrice - T1.StandardCost) * T2.Quantity) FROM Product AS T1 INNER JOIN ShoppingCartItem AS T2 ON T1.ProductID = T2.ProductID WHERE T2.ShoppingCartID = 20621\n```"}]}, {"id": "train-7009", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all product names that are high in quality. Please also state its selling price."}, {"from": "gpt", "value": "```sql\nSELECT Name, ListPrice FROM Product WHERE Class = 'H'\n```"}]}, {"id": "train-7010", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product line has the most products that are salable?"}, {"from": "gpt", "value": "```sql\nSELECT ProductLine FROM Product WHERE FinishedGoodsFlag = 1 GROUP BY ProductLine ORDER BY COUNT(FinishedGoodsFlag) DESC LIMIT 1\n```"}]}, {"id": "train-7011", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide details of review from reviewer whose name begin with letter 'J'. State the product ID, rating and comments."}, {"from": "gpt", "value": "```sql\nSELECT ProductID, Rating, Comments FROM ProductReview WHERE ReviewerName LIKE 'J%'\n```"}]}, {"id": "train-7012", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the product name, product line, rating and the selling price of product with the lowest rating."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.ProductLine, T2.Rating, T1.ListPrice FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID ORDER BY T2.Rating ASC LIMIT 1\n```"}]}, {"id": "train-7013", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the profit of each products. List all products with more than $100 in profit."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT Name FROM Product WHERE ListPrice - StandardCost > 100\n```"}]}, {"id": "train-7014", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the product name, reviewer name, rating and comments for product under the road line."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.ReviewerName, T2.Rating, T2.Comments FROM Product AS T1 INNER JOIN ProductReview AS T2 USING (productID) WHERE T1.ProductLine = 'R'\n```"}]}, {"id": "train-7015", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people reviewed for product named HL Mountain Pedal? What is the average rating?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ProductID), AVG(T2.Rating) FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'HL Mountain Pedal'\n```"}]}, {"id": "train-7016", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the purchase order whereby all received quantity were rejected? Name those product."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Product AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.ProductID = T2.ProductID WHERE T2.RejectedQty = T2.ReceivedQty AND T2.RejectedQty <> 0\n```"}]}, {"id": "train-7017", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all products without any rejected quantity, which product has the highest line total? State the product name and unit price."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.UnitPrice FROM Product AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.ProductID = T2.ProductID WHERE T2.RejectedQty = 0 ORDER BY T2.LineTotal DESC LIMIT 1\n```"}]}, {"id": "train-7018", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all product names and its product line for all purchase order with order quantity of 5000 or more."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.ProductLine FROM Product AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderQty > 4999\n```"}]}, {"id": "train-7019", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total ordered quantity for products under the 'Touring' line?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.OrderQty) FROM Product AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductLine = 'T'\n```"}]}, {"id": "train-7020", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the low quality product, which product has the highest line total? List the product name and its line total?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.LineTotal FROM Product AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.ProductID = T2.ProductID WHERE Class = 'L' ORDER BY OrderQty * UnitPrice DESC LIMIT 1\n```"}]}, {"id": "train-7021", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product has the highest profit on net? State the product name."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID ORDER BY T2.LastReceiptCost - T2.StandardPrice DESC LIMIT 1\n```"}]}, {"id": "train-7022", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all products with minimum order quantity of 100 and order them by product name in descending order."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Name FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID WHERE T2.MinOrderQty = 100 ORDER BY T1.Name DESC\n```"}]}, {"id": "train-7023", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name and calculate its profit for product with the highest rating in review."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.ListPrice - T1.StandardCost FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID ORDER BY T2.Rating DESC LIMIT 1\n```"}]}, {"id": "train-7024", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total profit all transactions with product ID 827?"}, {"from": "gpt", "value": "```sql\nSELECT SUM((T1.ListPrice - T1.StandardCost) * T2.Quantity) FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductID = 827\n```"}]}, {"id": "train-7025", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which currency pair's average exchange rate for the day is the highest?"}, {"from": "gpt", "value": "```sql\nSELECT FromCurrencyCode, ToCurrencyCode FROM CurrencyRate ORDER BY AverageRate DESC LIMIT 1\n```"}]}, {"id": "train-7026", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products with the highest unit price were ordered?"}, {"from": "gpt", "value": "```sql\nSELECT OrderQty FROM PurchaseOrderDetail ORDER BY UnitPrice DESC LIMIT 1\n```"}]}, {"id": "train-7027", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between Northwest and Southeast of the United States, which territory one recorded the highest amount of sales last year?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM SalesTerritory WHERE CountryRegionCode = 'US' AND (Name = 'Northwest' OR Name = 'Southeast') ORDER BY SalesLastYear DESC LIMIT 1\n```"}]}, {"id": "train-7028", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the Document Control Manager who is in charge of all Level 1 approved documents?"}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.MiddleName, T1.LastName FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Document AS T3 ON T3.Owner = T2.BusinessEntityID WHERE T2.JobTitle = 'Document Control Manager' AND T3.DocumentLevel = 1 AND T3.Status = 2 GROUP BY T1.FirstName, T1.MiddleName, T1.LastName\n```"}]}, {"id": "train-7029", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which customer has the highest subtotal amount of sales orders whose assigned to the salesperson with the highest bonus?"}, {"from": "gpt", "value": "```sql\nSELECT T1.CustomerID FROM SalesOrderHeader AS T1 INNER JOIN SalesPerson AS T2 ON T1.SalesPersonID = T2.BusinessEntityID ORDER BY T1.SubTotal DESC LIMIT 1\n```"}]}, {"id": "train-7030", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total price of Sales Order ID 46625 with Volume Discount 11 to 14 and Product ID 716?"}, {"from": "gpt", "value": "```sql\nSELECT T2.UnitPrice * T2.OrderQty FROM SpecialOffer AS T1 INNER JOIN SalesOrderDetail AS T2 ON T1.SpecialOfferID = T2.SpecialOfferID WHERE T1.Description = 'Volume Discount 11 to 14' AND T1.SpecialOfferID = 2 AND T2.ProductID = 716 AND T2.SalesOrderID = 46625\n```"}]}, {"id": "train-7031", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the products that has a reorder inventory point of no more than 600, how many manufactured in-house products that takes 1 day to manufacture with BOM Level 4 are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ProductID) FROM Product AS T1 INNER JOIN BillOfMaterials AS T2 ON T1.ProductID = T2.ProductAssemblyID WHERE T1.MakeFlag = 1 AND T1.DaysToManufacture = 1 AND T2.BOMLevel = 4 AND T1.ReorderPoint <= 600\n```"}]}, {"id": "train-7032", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest amount of bonus earned by the sales person in Canada?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Bonus FROM SalesTerritory AS T1 INNER JOIN SalesPerson AS T2 ON T1.TerritoryID = T2.TerritoryID WHERE T1.CountryRegionCode = 'CA' ORDER BY T2.SalesQuota DESC LIMIT 1\n```"}]}, {"id": "train-7033", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the product that has the lowest rating?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Rating = ( SELECT Rating FROM ProductReview ORDER BY Rating ASC LIMIT 1 )\n```"}]}, {"id": "train-7034", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the workers who started working in 2009 are from the Production Department?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.BusinessEntityID) FROM Department AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.DepartmentID = T2.DepartmentID WHERE T2.StartDate >= '2009-01-01' AND T2.StartDate < '2010-01-01' AND T1.Name = 'Production'\n```"}]}, {"id": "train-7035", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the company's highest-paid single female employee? Include her full name and job title."}, {"from": "gpt", "value": "```sql\nSELECT T3.FirstName, T3.MiddleName, T3.LastName, T1.JobTitle FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Person AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T1.MaritalStatus = 'S' AND T1.Gender = 'F' ORDER BY T2.Rate DESC LIMIT 1\n```"}]}, {"id": "train-7036", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the Vice President of Engineering and when did he join the company? Indicate his/her full name."}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleName, T2.LastName, T1.HireDate FROM Employee AS T1 INNER JOIN Person AS T2 USING (BusinessEntityID) WHERE T1.JobTitle = 'Vice President of Engineering'\n```"}]}, {"id": "train-7037", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many active employees whose payrate is equal or below 30 per hour."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.CurrentFlag = 1 AND T2.Rate <= 30\n```"}]}, {"id": "train-7038", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which department has a worker who just recently started working?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Department AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.DepartmentID = T2.DepartmentID ORDER BY T2.StartDate DESC LIMIT 1\n```"}]}, {"id": "train-7039", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which store sales person was reently hired? Indicate his/her full name and gender."}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleName, T2.LastName, T1.Gender FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonType = 'SP'\n```"}]}, {"id": "train-7040", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How frequently do the employee with the least number of sick leave hours get paid?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PayFrequency FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T1.SickLeaveHours ASC LIMIT 1\n```"}]}, {"id": "train-7041", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which job title has the lowest pay?"}, {"from": "gpt", "value": "```sql\nSELECT T1.JobTitle FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T2.Rate ASC LIMIT 1\n```"}]}, {"id": "train-7042", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of employees that worked in the Finance department?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.BusinessEntityID) FROM Department AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 USING (DepartmentID) WHERE T1.Name = 'Finance'\n```"}]}, {"id": "train-7043", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the profit of the product with the highest list price and of the product with the lowest list price other than 0? Indicates the depth the component is from its parent."}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT ListPrice - StandardCost FROM Product WHERE ListPrice != 0 ORDER BY ListPrice DESC LIMIT 1 ) , ( SELECT ListPrice - StandardCost FROM Product WHERE ListPrice != 0 ORDER BY ListPrice LIMIT 1 )\n```"}]}, {"id": "train-7044", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the companies to which Adventure Works Cycles purchases parts or other goods, what is the profit on net obtained from the vendor who has an above average credit rating? Kindly indicate each names of the vendor and the corresponding net profits."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name, T1.LastReceiptCost - T1.StandardPrice FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.CreditRating = 3\n```"}]}, {"id": "train-7045", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many accounts have an address that is too long?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Address WHERE AddressLine2 <> ''\n```"}]}, {"id": "train-7046", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the postal code of the street address of the account that is latest updated?"}, {"from": "gpt", "value": "```sql\nSELECT PostalCode FROM Address ORDER BY ModifiedDate DESC LIMIT 1\n```"}]}, {"id": "train-7047", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the longest assembly item duration for bicycles?"}, {"from": "gpt", "value": "```sql\nSELECT JULIANDAY(EndDate) - JULIANDAY(StartDate) FROM BillOfMaterials ORDER BY JULIANDAY(EndDate) - JULIANDAY(StartDate) DESC LIMIT 1\n```"}]}, {"id": "train-7048", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many assembly items for bicycles aren't finished?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BillOfMaterialsID) FROM BillOfMaterials WHERE EndDate IS NULL\n```"}]}, {"id": "train-7049", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the unit measure code of the component that is of the greatest need in quantity to create the assembly."}, {"from": "gpt", "value": "```sql\nSELECT UnitMeasureCode FROM BillOfMaterials ORDER BY PerAssemblyQty DESC LIMIT 1\n```"}]}, {"id": "train-7050", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many product maintenance documents are private?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DocumentNode) FROM Document WHERE DocumentSummary IS NULL\n```"}]}, {"id": "train-7051", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of the documents that are pending approval."}, {"from": "gpt", "value": "```sql\nSELECT Title FROM Document WHERE Status = 1\n```"}]}, {"id": "train-7052", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the job titles of the employees who has a document that has been approved."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.BusinessEntityID, T2.JobTitle FROM Document AS T1 INNER JOIN Employee AS T2 ON T1.Owner = T2.BusinessEntityID WHERE T1.Status = 2\n```"}]}, {"id": "train-7053", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the pay frequency of the oldest employee?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PayFrequency FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T2.BirthDate ASC LIMIT 1\n```"}]}, {"id": "train-7054", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees whose pay frequencies are the highest, how many of them are married?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.MaritalStatus = 'M' AND T1.PayFrequency = ( SELECT PayFrequency FROM EmployeePayHistory ORDER BY PayFrequency DESC LIMIT 1 )\n```"}]}, {"id": "train-7055", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the employee who has been hired the latest, what is his or her pay rate?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Rate FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T2.HireDate DESC LIMIT 1\n```"}]}, {"id": "train-7056", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees who have a pay rate of above 40, how many of them are male?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Gender = 'M' THEN 1 ELSE 0 END) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.Rate > 40\n```"}]}, {"id": "train-7057", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest pay rate of the employees who are exempt from collective bargaining?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Rate FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.SalariedFlag = 1 ORDER BY T1.Rate DESC LIMIT 1\n```"}]}, {"id": "train-7058", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the employees who have the highest pay frequency, please list their vacation hours."}, {"from": "gpt", "value": "```sql\nSELECT T2.VacationHours FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.BusinessEntityID = ( SELECT BusinessEntityID FROM EmployeePayHistory ORDER BY Rate DESC LIMIT 1 )\n```"}]}, {"id": "train-7059", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the pay rate of the employee who has the longest vacation hours?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Rate FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T2.VacationHours DESC LIMIT 1\n```"}]}, {"id": "train-7060", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees with a pay rate of over 35 have more than 10 sick leave hours?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.SickLeaveHours > 10 AND T1.Rate > 35\n```"}]}, {"id": "train-7061", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the active male employees, how many of them are paid with the highest frequency?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.CurrentFlag = 1 AND T2.Gender = 'M' AND T1.PayFrequency = 2\n```"}]}, {"id": "train-7062", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male employees have the job position of sales person?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.Gender = 'M' AND T2.PersonType = 'SP'\n```"}]}, {"id": "train-7063", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the job position of the oldest employee?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PersonType FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T1.BirthDate ASC LIMIT 1\n```"}]}, {"id": "train-7064", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name style of the employee with the lowest pay rate?"}, {"from": "gpt", "value": "```sql\nSELECT T2.NameStyle FROM EmployeePayHistory AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.Rate IS NOT NULL ORDER BY T1.Rate ASC LIMIT 1\n```"}]}, {"id": "train-7065", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees who are married, how many of them have a western name style?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.NameStyle = 0 AND T1.MaritalStatus = 'M'\n```"}]}, {"id": "train-7066", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees who have more than 10 hours of sick leave, how many of them wish to receive e-mail promotions?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.EmailPromotion = 1 AND T1.SickLeaveHours > 10\n```"}]}, {"id": "train-7067", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the employees who have more than 20 vacations hours and wish to receive e-mail promotions."}, {"from": "gpt", "value": "```sql\nSELECT T1.BusinessEntityID FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.EmailPromotion = 1 AND T1.VacationHours > 20\n```"}]}, {"id": "train-7068", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the additional contact information of the oldest employee with the jod position of sales person."}, {"from": "gpt", "value": "```sql\nSELECT T2.AdditionalContactInfo FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE PersonType = 'SP' ORDER BY T1.BirthDate ASC LIMIT 1\n```"}]}, {"id": "train-7069", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the first name of the male employee who has a western name style?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.NameStyle = 0 AND T1.Gender = 'M'\n```"}]}, {"id": "train-7070", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the active employees, how many of them have a courtesy title of \"Mr\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.CurrentFlag = 1 AND T2.Title = 'Mr.'\n```"}]}, {"id": "train-7071", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the personal information of the married employee who has the highest pay rate."}, {"from": "gpt", "value": "```sql\nSELECT T2.Demographics FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmployeePayHistory AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T1.MaritalStatus = 'M' ORDER BY T3.Rate DESC LIMIT 1\n```"}]}, {"id": "train-7072", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the surname suffix of the employee who works as a store contact and has the longest sick leave hours?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Suffix FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonType = 'SP' ORDER BY T1.SickLeaveHours DESC LIMIT 1\n```"}]}, {"id": "train-7073", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the married employees with the highest pay frequency, how many of them have an eastern name style?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmployeePayHistory AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T1.MaritalStatus = 'M' AND T2.NameStyle = 1 AND T3.Rate = ( SELECT Rate FROM EmployeePayHistory ORDER BY Rate DESC LIMIT 1 )\n```"}]}, {"id": "train-7074", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many active employees do not wish to receive e-mail promotions?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.CurrentFlag = 1 AND T2.EmailPromotion = 1\n```"}]}, {"id": "train-7075", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the credit card IDs of the employees who work as store contact."}, {"from": "gpt", "value": "```sql\nSELECT T2.CreditCardID FROM Person AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.PersonType = 'SC'\n```"}]}, {"id": "train-7076", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many vacation hours do the male employees have on average?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.VacationHours) AS REAL) / COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.Gender = 'M' AND T2.PersonType = 'EM'\n```"}]}, {"id": "train-7077", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees who are married and wish to receive e-mail promotions, how much higher is their highest pay rate from the average pay rate?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.Rate) - SUM(T1.Rate) / COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Employee AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T2.EmailPromotion = 2 AND T3.MaritalStatus = 'M'\n```"}]}, {"id": "train-7078", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: If a married employee has a western name style, what is the probability of him or her working as a store contact?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(IIF(T1.PersonType = 'SC', T1.PersonType, NULL)) AS REAL) / COUNT(T1.PersonType) FROM Person AS T1 INNER JOIN Employee AS T2 WHERE T1.PersonType = 'SC' AND T1.NameStyle = 0 AND T2.MaritalStatus = 'M'\n```"}]}, {"id": "train-7079", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the active employees with over 10 hours of sick leave, what is the percentage of the employees with over 20 vacation hours?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.VacationHours > 20 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.CurrentFlag = 1 AND T2.SickLeaveHours > 10\n```"}]}, {"id": "train-7080", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Average of the last receipt cost of the products whose average lead time is 60 days."}, {"from": "gpt", "value": "```sql\nSELECT SUM(LastReceiptCost) / COUNT(ProductID) FROM ProductVendor WHERE AverageLeadTime = 60\n```"}]}, {"id": "train-7081", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Average cost of purchase orders made during the first six months of 2012."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(ActualCost) AS REAL) / COUNT(TransactionID) FROM TransactionHistoryArchive WHERE TransactionType = 'P' AND TransactionDate >= '2012-01-01' AND TransactionDate < '2012-07-01'\n```"}]}, {"id": "train-7082", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of male employees hired throughout the years 2009 are married?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN MaritalStatus = 'M' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(BusinessEntityID) FROM Employee WHERE SUBSTR(HireDate, 1, 4) = '2009' AND Gender = 'M'\n```"}]}, {"id": "train-7083", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of people named Mary who wants Receive Email promotions of AdventureWorks and selected partners are store contacts?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN EmailPromotion = 2 THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN PersonType = 'SC' THEN 1 ELSE 0 END) FROM Person WHERE FirstName = 'Mary'\n```"}]}, {"id": "train-7084", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List, by ProductID, all products whose profit, relative to the standard price, is negative."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT ProductID FROM ProductVendor WHERE StandardPrice - LastReceiptCost < 0\n```"}]}, {"id": "train-7085", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average total due price of products with approved status?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(TotalDue) / COUNT(TotalDue) FROM PurchaseOrderHeader WHERE Status = 2\n```"}]}, {"id": "train-7086", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage, by number of sales order units, for orders with quantities not greater than 3 and a discount of 0.2?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN OrderQty < 3 AND UnitPriceDiscount = 0.2 THEN 1 ELSE 0 END) AS REAL) / COUNT(SalesOrderID) FROM SalesOrderDetail\n```"}]}, {"id": "train-7087", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Lists all companies by BusinessEntityID that increased their current year sales by more than 60% over last year's sales and have a bonus greater than 3,000."}, {"from": "gpt", "value": "```sql\nSELECT BusinessEntityID FROM SalesPerson WHERE SalesYTD > SalesLastYear + SalesLastyear * 0.6 AND Bonus > 3000\n```"}]}, {"id": "train-7088", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Add the number of businesses that indicate their home address as their address and those whose address corresponds to the shipping address."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Name = 'Home' THEN 1 ELSE 0 END) , SUM(CASE WHEN T2.Name = 'Shipping' THEN 1 ELSE 0 END) FROM BusinessEntityAddress AS T1 INNER JOIN AddressType AS T2 ON T1.AddressTypeID = T2.AddressTypeID\n```"}]}, {"id": "train-7090", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What company has a Colonial Voice card that expired in March 2005?"}, {"from": "gpt", "value": "```sql\nSELECT T2.BusinessEntityID FROM CreditCard AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.CreditCardID = T2.CreditCardID WHERE T1.CardType = 'ColonialVoice' AND T1.ExpMonth = 3 AND T1.ExpYear = 2005\n```"}]}, {"id": "train-7091", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the credit rating of the company whose average lead time is 16 days for a standard price of 18.9900 and whose last receipt date is August 27, 2011?"}, {"from": "gpt", "value": "```sql\nSELECT T2.CreditRating FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.StandardPrice = 18.9900 AND T1.AverageLeadTime = 16 AND STRFTIME('%Y-%m-%d', T1.LastReceiptDate) = '2011-08-27'\n```"}]}, {"id": "train-7092", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the number of products if we add the products of the accessories and components categories."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ProductID) FROM Product WHERE Name LIKE '%accessories %' OR Name LIKE '%components%'\n```"}]}, {"id": "train-7093", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the job title of the newest employee in department 12?"}, {"from": "gpt", "value": "```sql\nSELECT T1.JobTitle FROM Employee AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.DepartmentID = 12 ORDER BY T2.StartDate DESC LIMIT 1\n```"}]}, {"id": "train-7094", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the first and last name of all unmarried male Production Supervisors."}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.MaritalStatus = 'S' AND T1.Gender = 'M' AND T1.JobTitle LIKE 'Production Supervisor%'\n```"}]}, {"id": "train-7095", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products are there if we add all those located in the Subassembly category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.LocationID) FROM Location AS T1 INNER JOIN ProductInventory AS T2 USING (LocationID) WHERE T1.Name = 'Subassembly'\n```"}]}, {"id": "train-7096", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Sum the total number of products rejected for having a trim length that is too long."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.ScrappedQty) FROM ScrapReason AS T1 INNER JOIN WorkOrder AS T2 ON T1.ScrapReasonID = T2.ScrapReasonID WHERE T1.Name = 'Trim length too long'\n```"}]}, {"id": "train-7097", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total quantity of purchased product that has been prepared by employee number 257 and is in pending shipment status."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.OrderQty) FROM PurchaseOrderHeader AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.PurchaseOrderID = T2.PurchaseOrderID WHERE T1.Status = 1\n```"}]}, {"id": "train-7098", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: If we discount the products that do not have any type of offer, how many different products have been sold in an amount greater than 2 units per order?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.ProductID) FROM SalesOrderDetail AS T1 INNER JOIN SpecialOfferProduct AS T2 ON T1.SpecialOfferID = T2.SpecialOfferID INNER JOIN SpecialOffer AS T3 ON T2.SpecialOfferID = T3.SpecialOfferID WHERE T1.OrderQty > 2 AND T1.UnitPriceDiscount = 0\n```"}]}, {"id": "train-7099", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What type of transaction was made with the only yellow product, size 62 and with a minimum inventory stock of 500 units?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.TransactionType FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Size = 62 AND T1.Color = 'Yellow' AND T1.SafetyStockLevel = 500\n```"}]}, {"id": "train-7100", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the subcategory to which the gray product with the lowest safety stock level belongs?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM ProductSubcategory AS T1 INNER JOIN Product AS T2 USING (ProductSubcategoryID) WHERE T2.Color = 'Grey' GROUP BY T1.Name\n```"}]}, {"id": "train-7101", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the product cost end date with the highest weight in grams?"}, {"from": "gpt", "value": "```sql\nSELECT T2.EndDate FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.WeightUnitMeasureCode = 'G' ORDER BY T1.Weight DESC LIMIT 1\n```"}]}, {"id": "train-7102", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the total products ordered were not rejected by Drill size?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.VacationHours > 20 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessEntityID) FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.CurrentFlag = 1 AND T2.SickLeaveHours > 10\n```"}]}, {"id": "train-7103", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average of the total ordered quantity of products purchased whose shipping method was Cargo Transport 5."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.ShipMethodID = 5, T3.OrderQty, 0)) AS REAL) / COUNT(T3.ProductID) FROM ShipMethod AS T1 INNER JOIN PurchaseOrderHeader AS T2 ON T1.ShipMethodID = T2.ShipMethodID INNER JOIN PurchaseOrderDetail AS T3 ON T2.PurchaseOrderID = T3.PurchaseOrderID\n```"}]}, {"id": "train-7104", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of the rates that apply to the provinces that are in the territory that obtained the greatest increase in sales with respect to the previous year."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM SalesTerritory AS T1 INNER JOIN StateProvince AS T2 ON T1.CountryRegionCode = T2.CountryRegionCode INNER JOIN SalesTaxRate AS T3 ON T2.StateProvinceID = T3.StateProvinceID ORDER BY (T1.SalesYTD - T1.SalesLastYear) / T1.SalesLastYear DESC LIMIT 1\n```"}]}, {"id": "train-7105", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees earn their salaries on a monthly basis at an hourly rate of more than 50?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BusinessEntityID) FROM EmployeePayHistory WHERE rate * PayFrequency > 50\n```"}]}, {"id": "train-7106", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the employee of company number 1's full name?"}, {"from": "gpt", "value": "```sql\nSELECT FirstName, MiddleName, LastName FROM Person WHERE BusinessEntityID = 1 AND PersonType = 'EM'\n```"}]}, {"id": "train-7107", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the supplier number 1492?"}, {"from": "gpt", "value": "```sql\nSELECT NAME FROM Vendor WHERE BusinessEntityID = 1492\n```"}]}, {"id": "train-7108", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many vendors only consented to move on with the 500 to 15000 piece order in terms of quality?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ProductVendor WHERE MinOrderQty > 500 AND MaxOrderQty < 15000\n```"}]}, {"id": "train-7109", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the departments that are part of the Executive General and Administration group."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Department WHERE GroupName = 'Executive General and Administration'\n```"}]}, {"id": "train-7110", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the family names of any employees whose middle names begin with C."}, {"from": "gpt", "value": "```sql\nSELECT LastName FROM Person WHERE PersonType = 'EM' AND MiddleName LIKE 'C%'\n```"}]}, {"id": "train-7111", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many vendors are having their products ordered with an average delivery time of 25 days?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT BusinessEntityID) FROM ProductVendor WHERE AverageLeadTime = 25\n```"}]}, {"id": "train-7112", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any 3 product numbers with the lowest standard cost."}, {"from": "gpt", "value": "```sql\nSELECT ProductID FROM ProductCostHistory ORDER BY StandardCost ASC LIMIT 3\n```"}]}, {"id": "train-7113", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many black-colored products are there that cannot be sold?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ProductID) FROM Product WHERE FinishedGoodsFlag = 0 AND Color = 'Black'\n```"}]}, {"id": "train-7114", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top three employees with the most unused sick leave along with their position titles."}, {"from": "gpt", "value": "```sql\nSELECT JobTitle FROM Employee ORDER BY SickLeaveHours DESC LIMIT 3\n```"}]}, {"id": "train-7115", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full address of address number 11906?"}, {"from": "gpt", "value": "```sql\nSELECT AddressLine1, AddressLine2 FROM Address WHERE AddressID = 11906\n```"}]}, {"id": "train-7116", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is business number 1580's net profit?"}, {"from": "gpt", "value": "```sql\nSELECT LastReceiptCost - StandardPrice FROM ProductVendor WHERE BusinessEntityID = 1580\n```"}]}, {"id": "train-7117", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the sales revenue for item number 740?"}, {"from": "gpt", "value": "```sql\nSELECT ListPrice - StandardCost FROM Product WHERE ProductID = 740\n```"}]}, {"id": "train-7118", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers gave a product the best possible rating? Please list their names."}, {"from": "gpt", "value": "```sql\nSELECT ReviewerName FROM ProductReview WHERE Rating = 5\n```"}]}, {"id": "train-7119", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the company that Adventure Works deal with that have poor credit rating? Please provide their business number."}, {"from": "gpt", "value": "```sql\nSELECT BusinessEntityID FROM Vendor WHERE CreditRating = ( SELECT CreditRating FROM Vendor ORDER BY CreditRating DESC LIMIT 1 )\n```"}]}, {"id": "train-7120", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the forename and birthdate of person number 18?"}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T2.BirthDate FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.BusinessEntityID = 18\n```"}]}, {"id": "train-7121", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What job is person number 322 currently holding?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM ContactType AS T1 INNER JOIN BusinessEntityContact AS T2 ON T1.ContactTypeID = T2.ContactTypeID WHERE T2.BusinessEntityID = 332\n```"}]}, {"id": "train-7123", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the currency of Brazil?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Currency AS T1 INNER JOIN CountryRegionCurrency AS T2 ON T1.CurrencyCode = T2.CurrencyCode INNER JOIN CountryRegion AS T3 ON T2.CountryRegionCode = T3.CountryRegionCode WHERE T3.Name = 'Brazil'\n```"}]}, {"id": "train-7124", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people work in the finance department?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.BusinessEntityID) FROM Department AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.DepartmentID = T2.DepartmentID WHERE T1.Name = 'Finance'\n```"}]}, {"id": "train-7125", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long does it take for the business to receive the item it has purchased? Who is the vendor for business number 1496?"}, {"from": "gpt", "value": "```sql\nSELECT T1.AverageLeadTime, T2.Name FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 USING (businessentityid) WHERE T2.BusinessEntityID = 1496 GROUP BY T1.AverageLeadTime, T2.Name\n```"}]}, {"id": "train-7126", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many accounts are in Bothell as opposed to Kenmore? What is the name of the State that comprises these two cities?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.city = 'Bothell', 1, 0)) - SUM(IIF(T1.city = 'Kenmore', 1, 0)) , stateprovincecode FROM Address AS T1 INNER JOIN StateProvince AS T2 ON T1.stateprovinceid = T2.stateprovinceid GROUP BY stateprovincecode\n```"}]}, {"id": "train-7127", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which chromoly steel product model has AdventureWorks saved in English?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ProductModelID FROM ProductModelProductDescriptionCulture AS T1 INNER JOIN Culture AS T2 USING (cultureid) INNER JOIN ProductDescription AS T3 USING (productdescriptionid) WHERE T3.Description LIKE 'Chromoly steel%' AND T2.Name = 'English'\n```"}]}, {"id": "train-7128", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the total number of companies with a commission percentage of 0.018 or above, along with each company's assigned geographical location."}, {"from": "gpt", "value": "```sql\nSELECT T1.BusinessEntityID, T2.'Group' FROM SalesPerson AS T1 INNER JOIN SalesTerritory AS T2 USING (territoryid) WHERE T1.CommissionPct >= 0.018\n```"}]}, {"id": "train-7130", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which role has the most common contact among businesses?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM ContactType AS T1 INNER JOIN BusinessEntityContact AS T2 ON T1.ContactTypeID = T2.ContactTypeID GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC LIMIT 1\n```"}]}, {"id": "train-7131", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the salespeople's email addresses?"}, {"from": "gpt", "value": "```sql\nSELECT T2.EmailAddress FROM Person AS T1 INNER JOIN EmailAddress AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.PersonType = 'SP'\n```"}]}, {"id": "train-7132", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which position does Suchitra hold?"}, {"from": "gpt", "value": "```sql\nSELECT T2.JobTitle FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'Suchitra'\n```"}]}, {"id": "train-7133", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees work for AdvertureWorks that is single?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessentityID) FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.PersonType = 'EM' AND T2.MaritalStatus = 'S'\n```"}]}, {"id": "train-7134", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much do the works data saved in English and Arabic differ from one another?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Name = 'English' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.Name = 'Arabic' THEN 1 ELSE 0 END) FROM Culture AS T1 INNER JOIN ProductModelProductDescriptionCulture AS T2 ON T1.CultureID = T2.CultureID WHERE T1.Name = 'English' OR T1.Name = 'Arabic'\n```"}]}, {"id": "train-7135", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the location of business number 1?"}, {"from": "gpt", "value": "```sql\nSELECT T1.AddressLine1 FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 USING (AddressID) WHERE T2.BusinessEntityID = 1\n```"}]}, {"id": "train-7136", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the businesses along with their numbers that have their accounts located in Duvall."}, {"from": "gpt", "value": "```sql\nSELECT T2.BusinessEntityID FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 ON T1.AddressID = T2.AddressID WHERE T1.City = 'Duvall'\n```"}]}, {"id": "train-7137", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of the AdventureWorks data is in Thai?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Name = 'Thai' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.CultureID) FROM Culture AS T1 INNER JOIN ProductModelProductDescriptionCulture AS T2 ON T1.CultureID = T2.CultureID\n```"}]}, {"id": "train-7138", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of AdventureWorks employees are men?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Gender = 'M' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessentityID) FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessentityID = T2.BusinessentityID WHERE T1.PersonType = 'EM'\n```"}]}, {"id": "train-7139", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where is the address 15873 located, in what city and state? Does that city belong to a province where the code exists?"}, {"from": "gpt", "value": "```sql\nSELECT T2.City, T1.Name, T1.IsOnlyStateProvinceFlag FROM StateProvince AS T1 INNER JOIN Address AS T2 ON T1.StateProvinceID = T2.StateProvinceID WHERE T2.AddressID = 15873\n```"}]}, {"id": "train-7140", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full address of business number 24?"}, {"from": "gpt", "value": "```sql\nSELECT T1.AddressLine1, T1.AddressLine2 FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 ON T1.AddressID = T2.AddressID WHERE T2.BusinessEntityID = 24\n```"}]}, {"id": "train-7141", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year is credit card No.9648's Expiration Year?"}, {"from": "gpt", "value": "```sql\nSELECT ExpYear FROM CreditCard WHERE CreditCardID = 9648\n```"}]}, {"id": "train-7142", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's Emma H Harris's Business Entity ID number?"}, {"from": "gpt", "value": "```sql\nSELECT BusinessEntityID FROM Person WHERE FirstName = 'Emma' AND LastName = 'Harris'\n```"}]}, {"id": "train-7143", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the location id for Debur and Polish?"}, {"from": "gpt", "value": "```sql\nSELECT LocationID FROM Location WHERE Name = 'Debur and Polish'\n```"}]}, {"id": "train-7144", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the Department ids under the Sales and Marketing Group?"}, {"from": "gpt", "value": "```sql\nSELECT DepartmentID FROM Department WHERE GroupName = 'Sales and Marketing'\n```"}]}, {"id": "train-7145", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which sales person made the sale of 1635823.3967 last year? Give the Business Entity ID."}, {"from": "gpt", "value": "```sql\nSELECT BusinessEntityID FROM SalesPerson WHERE SalesLastYear = '1635823.3967'\n```"}]}, {"id": "train-7146", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the Shift start time for Shift ID No.2?"}, {"from": "gpt", "value": "```sql\nSELECT StartTime FROM Shift WHERE ShiftID = '2'\n```"}]}, {"id": "train-7147", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is contact Type ID No.16 represent for?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM ContactType WHERE ContactTypeID = '16'\n```"}]}, {"id": "train-7148", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the minimum shipping charge for \"OVERSEAS - DELUXE\"?"}, {"from": "gpt", "value": "```sql\nSELECT ShipBase FROM ShipMethod WHERE Name = 'OVERSEAS - DELUXE'\n```"}]}, {"id": "train-7149", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please tell the meaning of CultureID \"fr\"."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Culture WHERE CultureID = 'fr'\n```"}]}, {"id": "train-7150", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the Mauritius Rupee's currency code."}, {"from": "gpt", "value": "```sql\nSELECT CurrencyCode FROM Currency WHERE Name = 'Mauritius Rupee'\n```"}]}, {"id": "train-7151", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name cellphone number's Type ID?"}, {"from": "gpt", "value": "```sql\nSELECT PhoneNumberTypeID FROM PhoneNumberType WHERE Name = 'Cell'\n```"}]}, {"id": "train-7152", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the older production technician who was hired in 2008/12/7, what's his/her birthday?"}, {"from": "gpt", "value": "```sql\nSELECT BirthDate FROM Employee WHERE HireDate = '2008-12-07'\n```"}]}, {"id": "train-7153", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the product ID No.793's model name?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Product AS T1 INNER JOIN ProductModel AS T2 ON T1.ProductModelID = T2.ProductModelID WHERE T1.ProductID = 793\n```"}]}, {"id": "train-7154", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the unit measure codes for product ID No.762?"}, {"from": "gpt", "value": "```sql\nSELECT T2.UnitMeasureCode FROM Product AS T1 INNER JOIN UnitMeasure AS T2 ON T1.SizeUnitMeasureCode = T2.UnitMeasureCode OR T1.WeightUnitMeasureCode = T2.UnitMeasureCode WHERE T1.ProductID = 762 GROUP BY T1.ProductID, T2.UnitMeasureCode\n```"}]}, {"id": "train-7155", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where is Business Entity ID No.4 located at? Give the address down to street."}, {"from": "gpt", "value": "```sql\nSELECT AddressLine1, AddressLine2 FROM Address WHERE AddressID IN ( SELECT AddressID FROM BusinessEntityAddress WHERE BusinessEntityID = 4 )\n```"}]}, {"id": "train-7156", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the on going assembly item Component ID No. 494, what's the Unit measure for it?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM BillOfMaterials AS T1 INNER JOIN UnitMeasure AS T2 ON T1.UnitMeasureCode = T2.UnitMeasureCode WHERE T1.ComponentID = 494 AND T1.EndDate IS NULL GROUP BY T2.name\n```"}]}, {"id": "train-7157", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the document Control Assistant who was born on 1975/12/25, how many private documents did he/she have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.BusinessEntityID) FROM Document AS T1 INNER JOIN Employee AS T2 ON T1.Owner = T2.BusinessEntityID WHERE T2.JobTitle = 'Document Control Assistant' AND T2.BirthDate = '1975-12-25' AND T1.DocumentSummary IS NULL\n```"}]}, {"id": "train-7158", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To the products which could make the profit as 21.9037, what were their list price after October of 2012?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ListPrice FROM Product AS T1 INNER JOIN ProductListPriceHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ListPrice - T1.StandardCost > 21.9037 AND STRFTIME('%Y-%m-%d', T2.StartDate) >= '2012-10-01'\n```"}]}, {"id": "train-7160", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many letters are there in Catherine Ward's e-mail account passwords?"}, {"from": "gpt", "value": "```sql\nSELECT LENGTH(T2.PasswordHash) FROM Person AS T1 INNER JOIN Password AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'Catherine' AND T1.LastName = 'Ward'\n```"}]}, {"id": "train-7161", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What rating did Jill give for HL Mountain Pedal?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Rating FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ReviewerName = 'Jill' AND T2.Name = 'HL Mountain Pedal'\n```"}]}, {"id": "train-7162", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the profit for the Freewheel?"}, {"from": "gpt", "value": "```sql\nSELECT T1.LastReceiptCost - T1.StandardPrice FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Freewheel'\n```"}]}, {"id": "train-7163", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Did Rachel Valdez complete her sales task?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Bonus FROM SalesPerson AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.FirstName = 'Rachel' AND T2.LastName = 'Valdez'\n```"}]}, {"id": "train-7164", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many types of tax did the sales happen in Quebec have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.Name) FROM SalesTaxRate AS T1 INNER JOIN StateProvince AS T2 ON T1.StateProvinceID = T2.StateProvinceID WHERE T2.Name = 'Quebec'\n```"}]}, {"id": "train-7165", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's Kevin A Wright's email address?"}, {"from": "gpt", "value": "```sql\nSELECT T2.EmailAddress FROM Person AS T1 INNER JOIN EmailAddress AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'Kevin' AND T1.MiddleName = 'A' AND T1.LastName = 'Wright'\n```"}]}, {"id": "train-7166", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of State Province of France that doesn't have a State Province Code?"}, {"from": "gpt", "value": "```sql\nSELECT T1.CountryRegionCode FROM StateProvince AS T1 INNER JOIN CountryRegion AS T2 ON T1.CountryRegionCode = T2.CountryRegionCode WHERE T2.Name = 'France' AND T1.IsOnlyStateProvinceFlag = 1\n```"}]}, {"id": "train-7167", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What kind of transaction type for the \"HL Road Frame - Black, 48\" order happened in 2012/12/13?"}, {"from": "gpt", "value": "```sql\nSELECT T1.TransactionType FROM TransactionHistory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'HL Road Frame - Black, 48' AND STRFTIME('%Y-%m-%d',T1.TransactionDate) = '2013-07-31'\n```"}]}, {"id": "train-7168", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which type of transaction was it for the \"LL Road Handlebars\" order happened in 2012/11/3?"}, {"from": "gpt", "value": "```sql\nSELECT T1.TransactionType FROM TransactionHistoryArchive AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'LL Road Handlebars' AND STRFTIME('%Y-%m-%d',T1.TransactionDate) = '2012-11-03'\n```"}]}, {"id": "train-7169", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How is the Credit Rating for company whose rowguid is \"33671A4E-DF2B-4879-807B-E3F930DD5C0C\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.CreditRating FROM Vendor AS T1 INNER JOIN BusinessEntity AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.rowguid = '33671A4E-DF2B-4879-807B-E3F930DD5C0C'\n```"}]}, {"id": "train-7170", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the PreferredVendorStatus for the company which has the rowguid of \"684F328D-C185-43B9-AF9A-37ACC680D2AF\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PreferredVendorStatus FROM Vendor AS T1 INNER JOIN BusinessEntity AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.rowguid = '684F328D-C185-43B9-AF9A-37ACC680D2AF'\n```"}]}, {"id": "train-7171", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For person id No.2054, is his/her vendor still active?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ActiveFlag FROM Vendor AS T1 INNER JOIN BusinessEntityContact AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonID = 2054\n```"}]}, {"id": "train-7174", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's Lynn N Tsoflias's job title?"}, {"from": "gpt", "value": "```sql\nSELECT T2.JobTitle FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'Lynn' AND T1.MiddleName = 'N' AND T1.LastName = 'Tsoflias'\n```"}]}, {"id": "train-7175", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of the sub categories for bikes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ProductCategory AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductCategoryID = T2.ProductCategoryID WHERE T1.Name = 'Bikes'\n```"}]}, {"id": "train-7176", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the document Control Assistant who was hired on 2009/1/22, what is the percentage of private documents did he/she have?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.DocumentSummary IS NOT NULL THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.DocumentSummary) FROM Document AS T1 INNER JOIN Employee AS T2 ON T1.Owner = T2.BusinessEntityID WHERE T2.JobTitle = 'Document Control Assistant' AND T2.HireDate = '2009-01-22'\n```"}]}, {"id": "train-7177", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is HL Grip Tape's profit ratio?"}, {"from": "gpt", "value": "```sql\nSELECT (T1.LastReceiptCost - T1.StandardPrice) / T1.StandardPrice FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'HL Grip Tape'\n```"}]}, {"id": "train-7179", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the product assembly ID that come with unit measure code EA and BOM level of 2, at the same time have per assembly quantity of more than 10?"}, {"from": "gpt", "value": "```sql\nSELECT ProductAssemblyID FROM BillOfMaterials WHERE UnitMeasureCode = 'EA' AND BOMLevel = 2 AND PerAssemblyQty > 10\n```"}]}, {"id": "train-7180", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many location IDs have actual resource hours of 2?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(LocationID) FROM WorkOrderRouting WHERE ActualResourceHrs = 2\n```"}]}, {"id": "train-7181", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the stocked quantity of products manufactured from location ID 40?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM WorkOrderRouting AS T1 INNER JOIN BillOfMaterials AS T2 ON T1.LocationID = T2.ProductAssemblyID INNER JOIN WorkOrder AS T3 ON T3.WorkOrderID = T1.WorkOrderID WHERE T1.LocationID = 40\n```"}]}, {"id": "train-7182", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the total per assembly quantity for unit measure code EA, IN and OZ respectively? What are the name of these 3 code?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.PerAssemblyQty), T2.Name FROM BillOfMaterials AS T1 INNER JOIN UnitMeasure AS T2 ON T1.UnitMeasureCode = T2.UnitMeasureCode WHERE T1.UnitMeasureCode IN ('EA', 'IN', 'OZ') GROUP BY T2.Name\n```"}]}, {"id": "train-7183", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product ID do not have any work order ID?"}, {"from": "gpt", "value": "```sql\nSELECT ProductID FROM Product WHERE ProductID NOT IN ( SELECT T1.ProductID FROM Product AS T1 INNER JOIN WorkOrder AS T2 ON T1.ProductID = T2.ProductID )\n```"}]}, {"id": "train-7184", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of product purchased with transaction type P?"}, {"from": "gpt", "value": "```sql\nSELECT ProductID FROM Product WHERE ProductID IN ( SELECT ProductID FROM TransactionHistory WHERE TransactionType = 'P' )\n```"}]}, {"id": "train-7185", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the full name of accountants in the company."}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle = 'Accountant'\n```"}]}, {"id": "train-7186", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the job position currently occupied by Ken J S\u00c3\u00a1nchez?"}, {"from": "gpt", "value": "```sql\nSELECT T1.JobTitle FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.FirstName = 'Ken' AND T2.MiddleName = 'J' AND T2.LastName = 'S\u00e1nchez'\n```"}]}, {"id": "train-7187", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male employees do not wish to receive e-mail promotion?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.EmailPromotion = 0 AND T1.Gender = 'M'\n```"}]}, {"id": "train-7188", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the top sales person who achived highest percentage of projected sales quota in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT BusinessEntityID FROM SalesPerson WHERE BusinessEntityID IN ( SELECT BusinessEntityID FROM SalesPersonQuotaHistory WHERE STRFTIME('%Y', QuotaDate) = '2013' ) ORDER BY CAST(SalesLastYear AS REAL) / SalesQuota DESC LIMIT 1\n```"}]}, {"id": "train-7189", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the non-sales employees are married?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonType = 'EM' AND T1.MaritalStatus = 'M'\n```"}]}, {"id": "train-7190", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the Production Technicians who are single, how many of them are vendor contact?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle LIKE 'Production Technician%' AND T1.MaritalStatus = 'S' AND T2.PersonType = 'VC'\n```"}]}, {"id": "train-7191", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total sick leave hours of employees who do not wish to receive any e-mail promotion?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.SickLeaveHours) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.EmailPromotion = 0\n```"}]}, {"id": "train-7192", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the sales people, who are hired prior to 2010?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonType = 'SP' AND SUBSTR(T1.HireDate, 0, 4) < 2010\n```"}]}, {"id": "train-7193", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which sales person achieved the highest sales YTD? What is the projected yearly sales quota in 2011 for this person?"}, {"from": "gpt", "value": "```sql\nSELECT T1.BusinessEntityID, SUM(T1.SalesQuota) FROM SalesPerson AS T1 INNER JOIN SalesPersonQuotaHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE STRFTIME('%Y', T2.QuotaDate) = '2011' GROUP BY T1.BusinessEntityID ORDER BY SUM(T1.SalesYTD) DESC LIMIT 1\n```"}]}, {"id": "train-7194", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people with the name Alex are single and occupying organization level of 1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.FirstName = 'Alex' AND T1.MaritalStatus = 'S' AND T1.OrganizationLevel = 1\n```"}]}, {"id": "train-7195", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average vacation hours taken by Sales person?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.VacationHours) AS REAL) / COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonType = 'SP'\n```"}]}, {"id": "train-7196", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the last name and job title of owner for document \"Crank Arm and Tire Maintenance\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.LastName, T3.JobTitle FROM Person AS T1 INNER JOIN Document AS T2 ON T1.BusinessEntityID = T2.Owner INNER JOIN Employee AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T2.Title = 'Crank Arm and Tire Maintenance'\n```"}]}, {"id": "train-7197", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees do not have any suffix and what are their organization level?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.BusinessEntityID) FROM ( SELECT T1.BusinessEntityID FROM Employee AS T1 INNER JOIN Person AS T2 USING (BusinessEntityID) WHERE T2.Suffix IS NULL GROUP BY T1.BusinessEntityID ) AS T3\n```"}]}, {"id": "train-7198", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the sales people who achieved projected sales quota 2013, is there any person from territory ID 1? If yes, state the business entity ID."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.BusinessEntityID FROM SalesPerson AS T1 INNER JOIN SalesPersonQuotaHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.TerritoryID = 1 AND STRFTIME('%Y', QuotaDate) = '2013'\n```"}]}, {"id": "train-7199", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the employees that submitted resume to Human Resource Department and got hired? State the last name."}, {"from": "gpt", "value": "```sql\nSELECT T3.LastName FROM Employee AS T1 INNER JOIN JobCandidate AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Person AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T1.BusinessEntityID IN (212, 274)\n```"}]}, {"id": "train-7200", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the email address of female single employees."}, {"from": "gpt", "value": "```sql\nSELECT T3.EmailAddress FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmailAddress AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T1.Gender = 'F' AND T1.MaritalStatus = 'S'\n```"}]}, {"id": "train-7201", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the color of products that were reviewed?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Color FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductID = 709 OR 937 OR 798\n```"}]}, {"id": "train-7202", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the projected sales quota amount in 2013 and sales YTD amount for sales person with business entity ID 275?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.SalesQuota) FROM SalesPerson AS T1 INNER JOIN SalesPersonQuotaHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.BusinessEntityID = 275 AND STRFTIME('%Y', QuotaDate) = '2013'\n```"}]}, {"id": "train-7203", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the business entity ID who did not achieved projected yearly sales quota in 2013."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.BusinessEntityID FROM SalesPerson AS T1 INNER JOIN SalesPersonQuotaHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE STRFTIME('%Y', T2.QuotaDate) = '2013' AND T1.SalesQuota < T1.SalesLastYear\n```"}]}, {"id": "train-7204", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees who wish to receive e-mail promotion from AdventureWorks, how many percent of them are female?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Gender = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.EmailPromotion = 1\n```"}]}, {"id": "train-7205", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times is married non sales employees against single non-sales employees?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.MaritalStatus = 'M' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T1.MaritalStatus = 'S' THEN 1 ELSE 0 END) FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.PersonType = 'EM'\n```"}]}, {"id": "train-7206", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the total bonus received by sales person and what is the percentage of it against the projected yearly sales quota in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.Bonus) , CAST(SUM(T1.Bonus) AS REAL) * 100 / SUM(T1.SalesQuota) FROM SalesPerson AS T1 INNER JOIN SalesPersonQuotaHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE STRFTIME('%Y', T2.QuotaDate) = '2013'\n```"}]}, {"id": "train-7207", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many types of credit cards are there and how many are vista?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CardNumber) FROM CreditCard WHERE CardType = 'vista'\n```"}]}, {"id": "train-7208", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the product with the id \"475\"?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Product WHERE ProductID = 475\n```"}]}, {"id": "train-7209", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees born before 1980 , how many of them are single?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BusinessEntityID) FROM Employee WHERE MaritalStatus = 's' AND BirthDate < '1980-1-1'\n```"}]}, {"id": "train-7210", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the names of the stores assigned to the sales person with the id \"277\"."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Store WHERE SalesPersonID = 277\n```"}]}, {"id": "train-7211", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products with the id \"989\" were sold in August 2013?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(Quantity) FROM TransactionHistory WHERE TransactionDate LIKE '2013-08%' AND TransactionType = 'S' AND ProductID = 989\n```"}]}, {"id": "train-7212", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of the credit cards that had expired by 2007."}, {"from": "gpt", "value": "```sql\nSELECT CardNumber FROM CreditCard WHERE ExpYear < 2007\n```"}]}, {"id": "train-7213", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the pay rates of all employees that were hired at 20 years of age."}, {"from": "gpt", "value": "```sql\nSELECT T2.Rate FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE STRFTIME('%Y', T1.HireDate) - STRFTIME('%Y', T1.BirthDate) = 20\n```"}]}, {"id": "train-7214", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the territory assigned to the sales person with business id \"277\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM SalesPerson AS T1 INNER JOIN SalesTerritory AS T2 ON T1.TerritoryID = T2.TerritoryID WHERE T1.BusinessEntityID = 277\n```"}]}, {"id": "train-7215", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the Vice President of Production?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle = 'Vice President of Production'\n```"}]}, {"id": "train-7216", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees in the Information Service department work the evening shift?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.BusinessEntityID) FROM Department AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.DepartmentID = T2.DepartmentID INNER JOIN Shift AS T3 ON T2.ShiftId = T3.ShiftId WHERE T1.Name = 'Information Services' AND T3.Name = 'Evening'\n```"}]}, {"id": "train-7217", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the purchase order ids of the vendor with a below average rating."}, {"from": "gpt", "value": "```sql\nSELECT T2.PurchaseOrderID FROM Vendor AS T1 INNER JOIN PurchaseOrderHeader AS T2 ON T1.BusinessEntityID = T2.VendorID WHERE T1.CreditRating = 5\n```"}]}, {"id": "train-7219", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total shipment by \"cargo transport 5\" cost of all purchase orders created on 12/14/2011?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(t2.freight) FROM ShipMethod AS t1 INNER JOIN PurchaseOrderHeader AS t2 ON t1.shipmethodid = t2.shipmethodid WHERE t1.name = 'cargo transport 5' AND t2.orderdate = '2011-12-14'\n```"}]}, {"id": "train-7220", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many sales orders did the salesperson David R. Campbell create?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.TotalDue) FROM Person AS T1 INNER JOIN SalesOrderHeader AS T2 ON T1.ModifiedDate = T2.DueDate WHERE T1.FirstName = 'David' AND T1.MiddleName = 'R' AND T1.LastName = 'Campbell' AND T1.PersonType = 'SP'\n```"}]}, {"id": "train-7221", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the email address of the Facilities Manager?"}, {"from": "gpt", "value": "```sql\nSELECT T3.EmailAddress FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmailAddress AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T1.JobTitle = 'Facilities Manager'\n```"}]}, {"id": "train-7222", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are there in Canada?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.CustomerID) FROM SalesTerritory AS T1 INNER JOIN Customer AS T2 ON T1.TerritoryID = T2.TerritoryID WHERE T1.Name = 'Canada'\n```"}]}, {"id": "train-7223", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the shipping address for the sales order \"43873\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ShipToAddressID FROM SalesOrderHeader AS T1 INNER JOIN Address AS T2 ON T1.BillToAddressID = T2.AddressID WHERE T1.SalesOrderID = 43873 GROUP BY T1.ShipToAddressID\n```"}]}, {"id": "train-7224", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the first names of the people with more than 65 sick leave hours."}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.SickLeaveHours > 65\n```"}]}, {"id": "train-7225", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the production technicians, how many have a below average pay rate for a production technician?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle LIKE 'Production Technician%' AND T2.Rate < ( SELECT AVG(T2.Rate) FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle LIKE 'Production Technician%' )\n```"}]}, {"id": "train-7226", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What proportion of sales orders are made from the United Kingdom?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Name = 'United Kingdom' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.SalesOrderID) FROM SalesOrderHeader AS T1 INNER JOIN SalesTerritory AS T2 ON T1.TerritoryID = T2.TerritoryID\n```"}]}, {"id": "train-7228", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the business ID of the person who has made the most sales total year to date?"}, {"from": "gpt", "value": "```sql\nSELECT BusinessEntityID FROM SalesPerson ORDER BY SalesYTD DESC LIMIT 1\n```"}]}, {"id": "train-7229", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all active vendors who offer a purchasing web service."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Vendor WHERE ActiveFlag = 1\n```"}]}, {"id": "train-7231", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total cost for all the orders placed on 5/29/2013?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(TotalDue) FROM PurchaseOrderHeader WHERE OrderDate LIKE '2013-05-29%'\n```"}]}, {"id": "train-7232", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common first name among the vendor contact?"}, {"from": "gpt", "value": "```sql\nSELECT FirstName FROM Person WHERE PersonType = 'VC' GROUP BY FirstName ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-7233", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name of all the 'Production Technician - WC50'"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 USING (BusinessEntityID) WHERE T1.JobTitle = 'Production Technician - WC50' GROUP BY T2.FirstName, T2.MiddleName, T2.LastName\n```"}]}, {"id": "train-7234", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Minipumps have been sold?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(OrderQty) FROM SalesOrderDetail WHERE ProductID IN ( SELECT ProductID FROM Product WHERE Name = 'Minipump' )\n```"}]}, {"id": "train-7235", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the person's business ID with a vista credit card number \"11113366963373\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.BusinessEntityID FROM CreditCard AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.CreditCardID = T2.CreditCardID WHERE T1.CardNumber = 11113366963373\n```"}]}, {"id": "train-7236", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where does the person with the BusinessEntityID \"5555\" live?"}, {"from": "gpt", "value": "```sql\nSELECT T3.City, T3.AddressLine1 FROM BusinessEntityAddress AS T1 INNER JOIN AddressType AS T2 ON T1.AddressTypeID = T2.AddressTypeID INNER JOIN Address AS T3 ON T1.AddressID = T3.AddressID WHERE T1.BusinessEntityID = 5555 AND T2.Name = 'Home'\n```"}]}, {"id": "train-7237", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the names of products with the special offer \"15\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM SpecialOfferProduct AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.SpecialOfferID = 15\n```"}]}, {"id": "train-7238", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the credit card number for Michelle E Cox?"}, {"from": "gpt", "value": "```sql\nSELECT T3.CreditCardID FROM Person AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN CreditCard AS T3 ON T2.CreditCardID = T3.CreditCardID WHERE T1.FirstName = 'Michelle' AND T1.MiddleName = 'E' AND T1.LastName = 'Cox'\n```"}]}, {"id": "train-7239", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the reason for sales order \"51883\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM SalesOrderHeaderSalesReason AS T1 INNER JOIN SalesReason AS T2 ON T1.SalesReasonID = T2.SalesReasonID WHERE T1.SalesOrderID = 51883\n```"}]}, {"id": "train-7240", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the credit card number for the sales order \"45793\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.CardNumber FROM SalesOrderHeader AS T1 INNER JOIN CreditCard AS T2 ON T1.CreditCardID = T2.CreditCardID WHERE T1.SalesOrderID = 45793\n```"}]}, {"id": "train-7241", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the sales people in the Northwest US."}, {"from": "gpt", "value": "```sql\nSELECT T2.BusinessEntityID FROM SalesTerritory AS T1 INNER JOIN SalesPerson AS T2 ON T1.TerritoryID = T2.TerritoryID WHERE T1.Name = 'Northwest' AND T1.CountryRegionCode = 'US'\n```"}]}, {"id": "train-7242", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Production Technician has the highest pay rate?"}, {"from": "gpt", "value": "```sql\nSELECT T1.BusinessEntityID FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle LIKE 'Production Technician%' ORDER BY T2.Rate DESC LIMIT 1\n```"}]}, {"id": "train-7243", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the sales person in charge of the territory with the id \"9\"? Provide their full name."}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleName, T2.LastName FROM SalesPerson AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.TerritoryID = 9\n```"}]}, {"id": "train-7244", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description of the discount for the product with the id \"762\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Description FROM SpecialOfferProduct AS T1 INNER JOIN SpecialOffer AS T2 ON T1.SpecialOfferID = T2.SpecialOfferID WHERE T1.ProductID = 762\n```"}]}, {"id": "train-7245", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compare the average pay rate of male and female employees."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.Rate) FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID GROUP BY T1.Gender\n```"}]}, {"id": "train-7246", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of employees who work the night shift?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Name = 'Night' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.BusinessEntityID) FROM Shift AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.ShiftId = T2.ShiftId\n```"}]}, {"id": "train-7247", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many married male employees were born before the year 1960?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BusinessEntityID) FROM Employee WHERE MaritalStatus = 'M' AND STRFTIME('%Y', BirthDate) < '1960' AND Gender = 'M'\n```"}]}, {"id": "train-7248", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 5 types of products with the highest selling price? ?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Product ORDER BY ListPrice DESC LIMIT 5\n```"}]}, {"id": "train-7249", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did the company hired its first Accountant?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(HireDate) FROM Employee WHERE JobTitle = 'Accountant'\n```"}]}, {"id": "train-7250", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2007, which job position was hired the most?"}, {"from": "gpt", "value": "```sql\nSELECT JobTitle FROM Employee WHERE STRFTIME('%Y', HireDate) = '2007' GROUP BY HireDate ORDER BY COUNT(JobTitle) DESC LIMIT 1\n```"}]}, {"id": "train-7251", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT LastReceiptCost - StandardPrice FROM ProductVendor ORDER BY StandardPrice DESC LIMIT 1\n```"}]}, {"id": "train-7252", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many departments did Sheela Ward work in between 1/1/2011 to 12/31/2012"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.Name) FROM Person AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Department AS T3 ON T2.DepartmentID = T3.DepartmentID WHERE T1.FirstName = 'Sheela' AND T1.LastName = 'Word' AND STRFTIME('%Y', T3.ModifiedDate) BETWEEN '2011' AND '2012'\n```"}]}, {"id": "train-7253", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of the sales agents in the company by 12/31/2009?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(2009 - STRFTIME('%Y', T2.BirthDate)) FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.PersonType = 'SP'\n```"}]}, {"id": "train-7254", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which group does the department with the least amount of workers belong to? Indicate the name of the department as well."}, {"from": "gpt", "value": "```sql\nSELECT T2.GroupName FROM EmployeeDepartmentHistory AS T1 INNER JOIN Department AS T2 ON T1.DepartmentID = T2.DepartmentID GROUP BY T2.GroupName ORDER BY COUNT(T1.BusinessEntityID) LIMIT 1\n```"}]}, {"id": "train-7255", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the age of the oldest Marketing Specialist by 12/31/2015 and what is his/her hourly rate?"}, {"from": "gpt", "value": "```sql\nSELECT 2015 - STRFTIME('%Y', T1.BirthDate), T2.Rate FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle = 'Marketing Specialist' ORDER BY 2015 - STRFTIME('%Y', T1.BirthDate) DESC LIMIT 1\n```"}]}, {"id": "train-7256", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total amount due of all the purchases made by the company to the vendor that has the lowest selling price amount of a single product? Indicate the name of the vendor to which the purchases was made."}, {"from": "gpt", "value": "```sql\nSELECT T1.UnitPrice, T3.Name FROM PurchaseOrderDetail AS T1 INNER JOIN PurchaseOrderHeader AS T2 ON T1.PurchaseOrderID = T2.PurchaseOrderID INNER JOIN Vendor AS T3 ON T2.VendorID = T3.BusinessEntityID ORDER BY T1.UnitPrice LIMIT 1\n```"}]}, {"id": "train-7257", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who made the purchase order with the greatest total due before freight? Indicate her employee ID and calculate for his/her age when he/she was hired."}, {"from": "gpt", "value": "```sql\nSELECT T2.BusinessEntityID, STRFTIME('%Y', T2.HireDate) - STRFTIME('%Y', T2.BirthDate) FROM PurchaseOrderHeader AS T1 INNER JOIN Employee AS T2 ON T1.EmployeeID = T2.BusinessEntityID ORDER BY T1.TotalDue DESC LIMIT 1\n```"}]}, {"id": "train-7258", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the position of the employee with the 10th highest salary? Indicate his/her salary amount and his/her full name."}, {"from": "gpt", "value": "```sql\nSELECT T2.JobTitle, T1.Rate, T3.FirstName, T3.MiddleName, T3.LastName FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Person AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID ORDER BY T1.Rate DESC LIMIT 9, 1\n```"}]}, {"id": "train-7259", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the profit of a single product that received the highest rating from John Smith? List the product/s' names."}, {"from": "gpt", "value": "```sql\nSELECT T1.ListPrice - T1.StandardCost, T1.Name FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID WHERE T2.ReviewerName = 'John Smith' ORDER BY T2.Rating DESC LIMIT 1\n```"}]}, {"id": "train-7260", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the salary rate per hour that the company paid to the first 5 employees that they hired?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Rate FROM EmployeePayHistory AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Person AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID ORDER BY T2.HireDate ASC LIMIT 0, 5\n```"}]}, {"id": "train-7261", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the vendors with maximum orders betweeen 500 to 750, which vendor has the 10th highest profit on net?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.MaxOrderQty BETWEEN 500 AND 750 ORDER BY T1.LastReceiptCost - T1.StandardPrice DESC LIMIT 9, 1\n```"}]}, {"id": "train-7262", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: As of 12/31/2011, how long has the employee assigned to all pending for approval papers been working in the company from the date he was hired?"}, {"from": "gpt", "value": "```sql\nSELECT 2011 - STRFTIME('%Y', T2.HireDate) FROM Document AS T1 INNER JOIN Employee AS T2 ON T1.Owner = T2.BusinessEntityID WHERE T1.Status = 1\n```"}]}, {"id": "train-7263", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Jill ranked which medium-quality class product as the highest, and how long will it take the company to manufacture such a product?"}, {"from": "gpt", "value": "```sql\nSELECT T1.DaysToManufacture FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Rating = 5 AND T1.Class = 'M' ORDER BY T2.Rating LIMIT 1\n```"}]}, {"id": "train-7264", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the first job position that the company needed, and who was hired? Indicate his/her full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.JobTitle, T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T1.HireDate LIMIT 1\n```"}]}, {"id": "train-7265", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many work orders with quantities ranging from 100 to 250 have a reorder point of no more than 375?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.TransactionID) FROM TransactionHistory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Quantity BETWEEN 100 AND 250 AND T2.ReorderPoint <= 375\n```"}]}, {"id": "train-7266", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the average salary of female employees in comparison to male employees?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.Rate) FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.Gender = 'F'\n```"}]}, {"id": "train-7267", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the vendors to which the company purchased its women's tights products?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.Name FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID INNER JOIN ProductSubcategory AS T3 ON T1.ProductSubcategoryID = T3.ProductSubcategoryID INNER JOIN Vendor AS T4 ON T2.BusinessEntityID = T4.BusinessEntityID WHERE T1.MakeFlag = 0 AND T1.Style = 'W' AND T3.Name = 'Tights'\n```"}]}, {"id": "train-7268", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How frequently does the first-ever Scheduling Assistant get paid?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PayFrequency FROM Employee AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle = 'Scheduling Assistant' ORDER BY T1.HireDate LIMIT 1\n```"}]}, {"id": "train-7269", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What product has the fewest online orders from one customer? List the product's class, line of business, and list price."}, {"from": "gpt", "value": "```sql\nSELECT T2.Class, T2.ProductLine, T2.ListPrice FROM ShoppingCartItem AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID GROUP BY T1.ProductID ORDER BY SUM(Quantity) LIMIT 1\n```"}]}, {"id": "train-7270", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the sales person who has the the highest commission percent received per sale?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleName, T2.LastName FROM SalesPerson AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T1.CommissionPct DESC LIMIT 1\n```"}]}, {"id": "train-7271", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the second oldest person in the company at the time he was hired?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY STRFTIME('%Y', T1.HireDate) - STRFTIME('%Y', T1.BirthDate) DESC LIMIT 1, 1\n```"}]}, {"id": "train-7272", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total profit gained by the company from the product that has the highest amount of quantity ordered from online customers? Indicate the name of the product."}, {"from": "gpt", "value": "```sql\nSELECT (T2.ListPrice - T2.StandardCost) * SUM(T1.Quantity), T2.Name FROM ShoppingCartItem AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID GROUP BY T1.ProductID, T2.Name, T2.ListPrice, T2.StandardCost, T1.Quantity ORDER BY SUM(T1.Quantity) DESC LIMIT 1\n```"}]}, {"id": "train-7273", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest amount of difference between the ordered quantity and actual quantity received in a single purchase order and to which vendor was the purchase order made?"}, {"from": "gpt", "value": "```sql\nSELECT T2.OrderQty - T2.ReceivedQty, VendorID FROM PurchaseOrderHeader AS T1 INNER JOIN PurchaseOrderDetail AS T2 ON T1.PurchaseOrderID = T2.PurchaseOrderID ORDER BY T2.OrderQty - T2.ReceivedQty DESC LIMIT 1\n```"}]}, {"id": "train-7274", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average lead time of product ID 843? Calculate for its profit on net and indicate the full location to which the vendor is located."}, {"from": "gpt", "value": "```sql\nSELECT T1.AverageLeadTime, T1.LastReceiptCost - T1.StandardPrice, T4.AddressLine1, T4.AddressLine2 , T4.City, T4.PostalCode FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN BusinessEntityAddress AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID INNER JOIN Address AS T4 ON T3.AddressID = T4.AddressID WHERE T1.ProductID = 843\n```"}]}, {"id": "train-7275", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many salespersons haven't met quota?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BusinessEntityID) FROM SalesPerson WHERE Bonus = 0\n```"}]}, {"id": "train-7276", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the sales with a tax applied to retail transaction, how many of them are charged by multiple types of taxes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(SalesTaxRateID) FROM SalesTaxRate WHERE Name LIKE '%+%'\n```"}]}, {"id": "train-7277", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the highest product cost of a purchase order."}, {"from": "gpt", "value": "```sql\nSELECT ActualCost FROM TransactionHistory WHERE TransactionType = 'P' ORDER BY ActualCost DESC LIMIT 1\n```"}]}, {"id": "train-7278", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the current status of the order with the highest shipping cost?"}, {"from": "gpt", "value": "```sql\nSELECT Status FROM SalesOrderHeader ORDER BY Freight DESC LIMIT 1\n```"}]}, {"id": "train-7279", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products are out of stock?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ProductID) FROM ProductVendor WHERE OnOrderQty = 0\n```"}]}, {"id": "train-7280", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest profit on net for a product?"}, {"from": "gpt", "value": "```sql\nSELECT LastReceiptCost - StandardPrice FROM ProductVendor ORDER BY LastReceiptCost - StandardPrice DESC LIMIT 1\n```"}]}, {"id": "train-7281", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which reviewer gives the biggest number of the highest rating?"}, {"from": "gpt", "value": "```sql\nSELECT ReviewerName FROM ProductReview WHERE Rating = ( SELECT Rating FROM ProductReview ORDER BY Rating DESC LIMIT 1 )\n```"}]}, {"id": "train-7282", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product gets the most reviews?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID GROUP BY T1.ProductID ORDER BY COUNT(T1.ProductReviewID) DESC LIMIT 1\n```"}]}, {"id": "train-7283", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products that are purchased, how many of them have never received the highest rating?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ProductID) FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.MakeFlag = 0 AND T1.Rating != 5\n```"}]}, {"id": "train-7284", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the biggest amount of reviews a salable product gets?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Comments FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.FinishedGoodsFlag = 1 GROUP BY T1.Comments ORDER BY COUNT(T1.ProductReviewID) DESC LIMIT 1\n```"}]}, {"id": "train-7285", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products that are both manufactured in house and salable, how many of them get over 10 reviews?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductReview AS T1 INNER JOIN Product AS T2 USING (ProductID) WHERE T2.FinishedGoodsFlag = 1 AND T2.MakeFlag = 1 GROUP BY T2.Name ORDER BY COUNT(T1.COMMENTS) > 10\n```"}]}, {"id": "train-7286", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the products that get over 10 reviews and a salable."}, {"from": "gpt", "value": "```sql\nSELECT T2.NAME FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.FinishedGoodsFlag = 1 GROUP BY T2.NAME ORDER BY COUNT(T1.comments) > 10\n```"}]}, {"id": "train-7287", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the reviewers who have given the highest rating for a medium class, women's product."}, {"from": "gpt", "value": "```sql\nSELECT T1.ReviewerName FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Class = 'M' AND T2.Style = 'W' AND T1.Rating = 5\n```"}]}, {"id": "train-7288", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the class of the product with the most reviews?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Class FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID GROUP BY T2.Class ORDER BY COUNT(T1.ProductReviewID) DESC LIMIT 1\n```"}]}, {"id": "train-7289", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the e-mails of the reviewers who have reviewed high class."}, {"from": "gpt", "value": "```sql\nSELECT T1.EmailAddress FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Class = 'H'\n```"}]}, {"id": "train-7290", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the products that have over 3 price changes."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductListPriceHistory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID GROUP BY T2.Name ORDER BY COUNT(T1.ListPrice) > 3\n```"}]}, {"id": "train-7291", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the product description of Headset Ball Bearings?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Description FROM ProductDescription AS T1 INNER JOIN Product AS T2 WHERE T2.Name = 'Headset Ball Bearings' AND T1.productDescriptionID = T2.ProductID\n```"}]}, {"id": "train-7292", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest vendor's selling price for Hex Nut 5?"}, {"from": "gpt", "value": "```sql\nSELECT T1.StandardPrice FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Hex Nut 5' ORDER BY T1.StandardPrice DESC LIMIT 1\n```"}]}, {"id": "train-7293", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the vendors' usual selling prices of the product Hex Nut 5."}, {"from": "gpt", "value": "```sql\nSELECT T1.StandardPrice FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Hex Nut 5' GROUP BY T1.StandardPrice ORDER BY COUNT(T1.StandardPrice) DESC LIMIT 1\n```"}]}, {"id": "train-7294", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the vendors that sell the product Hex Nut 5, how many of them have a good credit rating?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.Name) FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Vendor AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T2.Name = 'Hex Nut 5' AND T3.CreditRating = 1 AND 3\n```"}]}, {"id": "train-7295", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the website purchasing links of the vendors from whom the product Hex Nut 5 can be purchased."}, {"from": "gpt", "value": "```sql\nSELECT T3.PurchasingWebServiceURL FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Vendor AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T2.Name = 'Hex Nut 5'\n```"}]}, {"id": "train-7296", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which vendor's selling price for Hex Nut 5 is the lowest, please give the vendor's name."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Vendor AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T2.Name = 'Hex Nut 5' ORDER BY T1.StandardPrice LIMIT 1\n```"}]}, {"id": "train-7297", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many high-class products are sold by preferred vendors?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Name) FROM ProductVendor AS T1 INNER JOIN Product AS T2 USING (ProductID) INNER JOIN Vendor AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T3.PreferredVendorStatus = 1 AND T2.Class = 'M'\n```"}]}, {"id": "train-7298", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give all the list prices of the product LL Fork."}, {"from": "gpt", "value": "```sql\nSELECT T2.ListPrice FROM Product AS T1 INNER JOIN ProductListPriceHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'LL Fork'\n```"}]}, {"id": "train-7299", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products from the mountain product line, how many of them are sold by over 2 vendors?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.ProductLine = 'M' THEN 1 ELSE 0 END) FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Vendor AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID GROUP BY T1.ProductID HAVING COUNT(T1.Name) > 2\n```"}]}, {"id": "train-7300", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products that get over at least 1 review, how many of them are from the mountain product line?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.ProductLine = 'M' THEN 1 ELSE 0 END) FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID GROUP BY T1.ProductID HAVING COUNT(T1.ProductReviewID) > 1\n```"}]}, {"id": "train-7301", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the email adresses of the reviewers who have given the lowest rating to the product HL Mountain Pedal."}, {"from": "gpt", "value": "```sql\nSELECT T1.EmailAddress FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'HL Mountain Pedal' ORDER BY T1.Rating LIMIT 1\n```"}]}, {"id": "train-7302", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products that take more than 2 days to make are out of stock?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ProductID) FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.OnOrderQty IS NULL OR T1.OnOrderQty = 0\n```"}]}, {"id": "train-7303", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the products that are out of stock and purchased in house."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.MakeFlag = 0 AND (T1.OnOrderQty IS NULL OR T1.OnOrderQty = 0)\n```"}]}, {"id": "train-7304", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the salable products from the mountain product line, how many of them have the most reviews?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.ProductLine = 'M' THEN 1 ELSE 0 END) FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.FinishedGoodsFlag = 1 GROUP BY T1.ProductID ORDER BY COUNT(T1.ProductReviewID) DESC LIMIT 1\n```"}]}, {"id": "train-7305", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average selling price of different vendors of the product Hex Nut 5?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.StandardPrice) / COUNT(T1.BusinessEntityID) FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Name = 'Hex Nut 5'\n```"}]}, {"id": "train-7306", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the product that has the highest average rating from the mountain product line?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.ProductLine = 'M' GROUP BY T2.Name ORDER BY CAST(SUM(T1.Rating) AS REAL) / COUNT(T1.ProductID) DESC LIMIT 1\n```"}]}, {"id": "train-7307", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top 3 house-manufactured products with the highest average rating."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T2.MakeFlag = 1 GROUP BY T2.Name ORDER BY SUM(T1.Rating) DESC LIMIT 1\n```"}]}, {"id": "train-7308", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the non-sales employees in ascending order of its business entitty ID."}, {"from": "gpt", "value": "```sql\nSELECT FirstName, LastName FROM Person WHERE PersonType = 'EM' ORDER BY BusinessEntityID\n```"}]}, {"id": "train-7309", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all person in the individual retail whose last name is 'Anderson'."}, {"from": "gpt", "value": "```sql\nSELECT FirstName, MiddleName, LastName FROM Person WHERE LastName = 'Anderson' AND PersonType = 'IN'\n```"}]}, {"id": "train-7310", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of employees who had left the company? When were they hired?"}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName, T2.HireDate FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmployeeDepartmentHistory AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T3.EndDate IS NOT NULL\n```"}]}, {"id": "train-7311", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all salaried employee who are hired in 2007 and later."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE STRFTIME('%Y', T2.HireDate) >= '2007' AND T2.SalariedFlag = 1\n```"}]}, {"id": "train-7312", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of married employees with less than 20 vacation hours."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.MaritalStatus = 'M' AND T2.VacationHours < 20\n```"}]}, {"id": "train-7313", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the oldest employee who is working on night shift. How old is the employee?"}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName , STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', BirthDate) FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmployeeDepartmentHistory AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T3.ShiftId = 3 ORDER BY STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', BirthDate) DESC LIMIT 1\n```"}]}, {"id": "train-7314", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all staff in the Shipping and Receiving department who are hired in 2009."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmployeeDepartmentHistory AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID INNER JOIN Department AS T4 ON T3.DepartmentID = T4.DepartmentID WHERE STRFTIME('%Y', T2.HireDate) = '2009' AND T4.Name = 'Shipping and Receiving'\n```"}]}, {"id": "train-7315", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the job title of the oldest employee in the company? In which department is he in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.JobTitle, T4.Name FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmployeeDepartmentHistory AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID INNER JOIN Department AS T4 ON T3.DepartmentID = T4.DepartmentID ORDER BY T2.HireDate LIMIT 1\n```"}]}, {"id": "train-7316", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Based on the lastet payrate of each employee, calculate the average hourly payrate for each department."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.Rate) FROM EmployeePayHistory AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Department AS T3 ON T2.DepartmentID = T3.DepartmentID WHERE T1.RateChangeDate = ( SELECT MAX(T1.RateChangeDate) FROM EmployeePayHistory AS T1 INNER JOIN Department AS T2 ON T1.BusinessEntityID = T2.DepartmentID )\n```"}]}, {"id": "train-7317", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Other than the Chief Executive Officer, who is the employee who has the highest payrate? State the rate."}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.LastName FROM EmployeePayHistory AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Employee AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T3.JobTitle NOT LIKE 'Chief Executive Officer' ORDER BY T1.Rate DESC LIMIT 1\n```"}]}, {"id": "train-7318", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the vendor who has the shortest average lead time for Product ID 319."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Vendor AS T1 INNER JOIN ProductVendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.ProductID = 319 ORDER BY T2.AverageLeadTime LIMIT 1\n```"}]}, {"id": "train-7319", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all product name from Australia Bike Retailer order by product ID."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM Vendor AS T1 INNER JOIN ProductVendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Product AS T3 ON T2.ProductID = T3.ProductID WHERE T1.Name = 'Australia Bike Retailer'\n```"}]}, {"id": "train-7320", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which vendor gives the best profit on net for product ID 342?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Vendor AS T1 INNER JOIN ProductVendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T2.ProductID = 342 ORDER BY T2.LastReceiptCost - T2.StandardPrice DESC LIMIT 1\n```"}]}, {"id": "train-7321", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the current payrate of Rob Walters? Calculate the percentage increment from his previous payrate."}, {"from": "gpt", "value": "```sql\nSELECT T2.Rate , (MAX(T2.Rate) - MIN(T2.Rate)) * 100 / MAX(T2.Rate) FROM Person AS T1 INNER JOIN EmployeePayHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'Rob' AND T1.LastName = 'Walters'\n```"}]}, {"id": "train-7322", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average length of employment for employee working in the Research and Development deparment."}, {"from": "gpt", "value": "```sql\nSELECT 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'\n```"}]}, {"id": "train-7323", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of employee in Adventure Works?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', BirthDate)) FROM Employee\n```"}]}, {"id": "train-7324", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees in Adventure Works, calculate the percentage of them working as sales representatives."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN JobTitle = 'Sales Representative' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(BusinessEntityID) FROM Employee\n```"}]}, {"id": "train-7326", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the person who owns a distinguish credt card."}, {"from": "gpt", "value": "```sql\nSELECT T3.FirstName, T3.LastName FROM CreditCard AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.CreditCardID = T2.CreditCardID INNER JOIN Person AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T1.CardType = 'Distinguish'\n```"}]}, {"id": "train-7327", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the sales person for store Area Bike Accessories. Which territory is he / she in?"}, {"from": "gpt", "value": "```sql\nSELECT T4.Name FROM Store AS T1 INNER JOIN SalesPerson AS T2 ON T1.SalesPersonID = T2.BusinessEntityID INNER JOIN Person AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID INNER JOIN SalesTerritory AS T4 ON T2.TerritoryID = T4.TerritoryID WHERE T1.Name = 'Area Bike Accessories'\n```"}]}, {"id": "train-7329", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all products that started selling in 2013. State its respective vendor's name."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T3.Name FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Vendor AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE STRFTIME('%Y', T1.SellStartDate) = '2013'\n```"}]}, {"id": "train-7330", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Names the Sales Representative with the highest year to date sales."}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleName, T2.LastName FROM SalesPerson AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T1.SalesYTD DESC LIMIT 1\n```"}]}, {"id": "train-7331", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all product only MOQ of 1,000 and with standard cost more than 17."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductVendor AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Vendor AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T1.MaxOrderQty = 1000 AND T2.StandardCost > 17\n```"}]}, {"id": "train-7332", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the oldest married male? State his job title."}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.LastName, T1.JobTitle FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.Gender = 'M' AND T1.MaritalStatus = 'M' ORDER BY T1.BirthDate LIMIT 1\n```"}]}, {"id": "train-7333", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the vendor for product number WB-H098."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID INNER JOIN Vendor AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T1.ProductNumber = 'WB-H098'\n```"}]}, {"id": "train-7334", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the vendor with the least average lead time for Product ID 348."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.ProductID = 348 ORDER BY T1.AverageLeadTime ASC LIMIT 1\n```"}]}, {"id": "train-7335", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the employee who are born in or after 1970 and with the least sick leave hour."}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE STRFTIME('%Y', T1.BirthDate) > '1970' ORDER BY T1.SickLeaveHours LIMIT 1\n```"}]}, {"id": "train-7336", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average age of employee in each department and state which department has the youngest employees."}, {"from": "gpt", "value": "```sql\nSELECT STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.BirthDate) + 1 , T3.Name FROM Employee AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 USING (BusinessEntityID) INNER JOIN Department AS T3 USING (DepartmentID) ORDER BY T1.BirthDate DESC LIMIT 1\n```"}]}, {"id": "train-7337", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the IDs of any three AdventureWorks product subcategories."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT ProductCategoryID FROM ProductSubcategory LIMIT 3\n```"}]}, {"id": "train-7338", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the differences between the 288th salesperson's predicted annual sales and his or her actual sales thus far?"}, {"from": "gpt", "value": "```sql\nSELECT SalesYTD - SalesQuota FROM SalesPerson WHERE BusinessEntityID = 288\n```"}]}, {"id": "train-7339", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list three businesses with the lowest total sales from last year."}, {"from": "gpt", "value": "```sql\nSELECT BusinessEntityID FROM SalesPerson ORDER BY SalesLastYear LIMIT 3\n```"}]}, {"id": "train-7340", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which three sales regions have generated the most revenue thus far?"}, {"from": "gpt", "value": "```sql\nSELECT TerritoryID FROM SalesTerritory ORDER BY SalesYTD DESC LIMIT 3\n```"}]}, {"id": "train-7341", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What categories of offers qualify for group discounts for resellers?"}, {"from": "gpt", "value": "```sql\nSELECT Type FROM SpecialOffer WHERE Category = 'Reseller'\n```"}]}, {"id": "train-7342", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest possible discount rate for 'Excess Inventory'?"}, {"from": "gpt", "value": "```sql\nSELECT DiscountPct FROM SpecialOffer WHERE Type = 'Excess Inventory' ORDER BY DiscountPct DESC LIMIT 1\n```"}]}, {"id": "train-7343", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference between the actual manufacturing cost of product number 818 and the estimated manufacturing cost?"}, {"from": "gpt", "value": "```sql\nSELECT PlannedCost - ActualCost FROM WorkOrderRouting WHERE ProductID = 818\n```"}]}, {"id": "train-7344", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many materials still need to be assembled and have a depth of 2 between each component and their parent product?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM BillOfMaterials WHERE BOMLevel = 2 AND EndDate IS NULL\n```"}]}, {"id": "train-7345", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the approved documents are confidential?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DocumentNode) FROM Document WHERE Status = 2 AND DocumentSummary IS NULL\n```"}]}, {"id": "train-7346", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the sales tax records charged by multiple types of tax?"}, {"from": "gpt", "value": "```sql\nSELECT SalesTaxRateID FROM SalesTaxRate WHERE Name LIKE '%+%'\n```"}]}, {"id": "train-7347", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which work order transaction number has the highest product quantity?"}, {"from": "gpt", "value": "```sql\nSELECT TransactionID FROM TransactionHistory WHERE TransactionType = 'W' ORDER BY Quantity DESC LIMIT 1\n```"}]}, {"id": "train-7348", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any 3 vendors that are not recommended by Adventure Works."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Vendor WHERE PreferredVendorStatus = 0 LIMIT 3\n```"}]}, {"id": "train-7349", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many vendors does Adventure Works still work with but are not preferable?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BusinessEntityID) FROM Vendor WHERE PreferredVendorStatus = 0 AND ActiveFlag = 1\n```"}]}, {"id": "train-7350", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees who began working in 2009 or later had night shifts?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Shift AS T2 ON T1.ShiftId = T2.ShiftId WHERE T2.ShiftId = 3 AND STRFTIME('%Y', T2.StartTime) >= '2009'\n```"}]}, {"id": "train-7351", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which department, altogether, has the most personnel who work the evening shift?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM EmployeeDepartmentHistory AS T1 INNER JOIN Shift AS T2 ON T1.ShiftId = T2.ShiftId INNER JOIN Department AS T3 ON T1.DepartmentID = T3.DepartmentID WHERE T2.Name = 'Night' GROUP BY T3.Name ORDER BY COUNT(T1.BusinessEntityID) DESC LIMIT 1\n```"}]}, {"id": "train-7352", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shipments by truck were made?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ShipMethod AS T1 INNER JOIN SalesOrderHeader AS T2 USING (ShipMethodID) WHERE T1.Name = 'XRQ - TRUCK GROUND'\n```"}]}, {"id": "train-7353", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the sales reasons for order 43718?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM SalesOrderHeaderSalesReason AS T1 INNER JOIN SalesReason AS T2 ON T1.SalesReasonID = T2.SalesReasonID WHERE T1.SalesOrderID = 43718\n```"}]}, {"id": "train-7354", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What bike subcategories are there?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM ProductSubcategory AS T1 INNER JOIN ProductCategory AS T2 ON T1.ProductCategoryID = T2.ProductCategoryID WHERE T2.name = 'Bikes'\n```"}]}, {"id": "train-7355", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which sales areas are expected to have the highest yearly sales quota?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM SalesPerson AS T1 INNER JOIN SalesTerritory AS T2 ON T1.TerritoryID = T2.TerritoryID GROUP BY T1.TerritoryID ORDER BY SUM(T1.SalesQuota) DESC LIMIT 1\n```"}]}, {"id": "train-7356", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What goods were sold to customers in accordance with sales order number 43660?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Product AS T1 INNER JOIN SalesOrderDetail AS T2 ON T1.ProductID = T2.ProductID WHERE T2.SalesOrderID = 43660\n```"}]}, {"id": "train-7357", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top 5 products with the most orders."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Product AS T1 INNER JOIN SalesOrderDetail AS T2 ON T1.ProductID = T2.ProductID GROUP BY T1.Name ORDER BY SUM(T2.OrderQty) DESC LIMIT 0, 5\n```"}]}, {"id": "train-7358", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where are the shelves where the down tube product was stored?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Shelf FROM Product AS T1 INNER JOIN ProductInventory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Down Tube'\n```"}]}, {"id": "train-7359", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which address type does \"Fun Toys and Bikes\" fall under?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM BusinessEntityAddress AS T1 INNER JOIN AddressType AS T2 ON T1.AddressTypeID = T2.AddressTypeID INNER JOIN Store AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T3.Name = 'Fun Toys and Bikes'\n```"}]}, {"id": "train-7360", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the \"Next-Door Bike Store\" point of contact?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM ContactType AS T1 INNER JOIN BusinessEntityContact AS T2 ON T1.ContactTypeID = T2.ContactTypeID INNER JOIN Store AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID WHERE T3.Name = 'Next-Door Bike Store'\n```"}]}, {"id": "train-7361", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the order reference number for the \"Mountain End Caps\" product?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ReferenceOrderID FROM Product AS T1 INNER JOIN TransactionHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Mountain End Caps'\n```"}]}, {"id": "train-7362", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the 12th business's first line address?"}, {"from": "gpt", "value": "```sql\nSELECT T1.AddressLine1 FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 ON T1.AddressID = T2.AddressID WHERE T2.BusinessEntityID = 12\n```"}]}, {"id": "train-7363", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three businesses with their IDs that are located in Dallas City."}, {"from": "gpt", "value": "```sql\nSELECT T2.BusinessEntityID FROM Address AS T1 INNER JOIN BusinessEntityAddress AS T2 ON T1.AddressID = T2.AddressID WHERE T1.City = 'Dallas' LIMIT 3\n```"}]}, {"id": "train-7364", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the state that Racine belongs to?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Address AS T1 INNER JOIN StateProvince AS T2 ON T1.StateProvinceID = T2.StateProvinceID WHERE T1.City = 'Racine'\n```"}]}, {"id": "train-7365", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in percentage between the product descriptions written in Arabic and Thai?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Name = 'Arabic' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T1.Name = 'Thai' THEN 1 ELSE 0 END) FROM Culture AS T1 INNER JOIN ProductModelProductDescriptionCulture AS T2 ON T1.CultureID = T2.CultureID\n```"}]}, {"id": "train-7366", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of businesses in the Northwest US have forecasted annual sales of above 300,000?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.SalesQuota > 300000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.BusinessEntityID) FROM SalesPerson AS T1 INNER JOIN SalesTerritory AS T2 ON T1.TerritoryID = T2.TerritoryID WHERE T2.CountryRegionCode = 'US' AND T2.Name = 'Northwest'\n```"}]}, {"id": "train-7367", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the Crankarm product's net profit?"}, {"from": "gpt", "value": "```sql\nSELECT T2.LastReceiptCost - T2.StandardPrice FROM Product AS T1 INNER JOIN ProductVendor AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE '%Crankarm%'\n```"}]}, {"id": "train-7368", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the product with the almost highest review score?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID WHERE T2.Rating = ( SELECT Rating FROM ProductReview ORDER BY Rating DESC LIMIT 1 )\n```"}]}, {"id": "train-7369", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the company's second highest salary per hour for employees who are paid monthly?"}, {"from": "gpt", "value": "```sql\nSELECT Rate FROM EmployeePayHistory WHERE PayFrequency = 1 ORDER BY Rate DESC LIMIT 1, 1\n```"}]}, {"id": "train-7370", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Vista cards expired before the year 2007?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CreditCardID) FROM CreditCard WHERE CardType = 'Vista' AND ExpYear < 2007\n```"}]}, {"id": "train-7371", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What time does the company's night shift begin? Indicate the answer in regular form."}, {"from": "gpt", "value": "```sql\nSELECT StartTime FROM Shift WHERE Name = 'Night'\n```"}]}, {"id": "train-7372", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the weight in pounds of the style that is produced the most by the company? If there are multiple products sharing the same weight, indicate the name of each one of them and their corresponding weights."}, {"from": "gpt", "value": "```sql\nSELECT Weight FROM Product WHERE WeightUnitMeasureCode = 'LB' GROUP BY Weight ORDER BY COUNT(Style) DESC LIMIT 1\n```"}]}, {"id": "train-7373", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which territory has the greatest difference in sales from previous year to this year? Indicate the difference, as well as the name and country of the region."}, {"from": "gpt", "value": "```sql\nSELECT SalesLastYear - SalesYTD, Name, CountryRegionCode FROM SalesTerritory ORDER BY SalesLastYear - SalesYTD DESC LIMIT 1\n```"}]}, {"id": "train-7374", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the top 6 products that has the biggest size in centimeter and what are its reorder point?"}, {"from": "gpt", "value": "```sql\nSELECT Name, ReorderPoint FROM Product WHERE SizeUnitMeasureCode = 'CM' ORDER BY Size DESC LIMIT 6\n```"}]}, {"id": "train-7375", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the amount to be paid by the company for the purchase order with the third highest freight amount?"}, {"from": "gpt", "value": "```sql\nSELECT TotalDue FROM PurchaseOrderHeader ORDER BY Freight DESC LIMIT 2, 1\n```"}]}, {"id": "train-7376", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What profit will the company gain if they sell 10 items of the product that has the lightest weight?"}, {"from": "gpt", "value": "```sql\nSELECT 10 * (ListPrice - StandardCost) FROM Product WHERE Weight IS NOT NULL ORDER BY Weight LIMIT 1\n```"}]}, {"id": "train-7377", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the tax amount of the purchase order with the biggest tax amount? Indicate the purchase order ID."}, {"from": "gpt", "value": "```sql\nSELECT TaxAmt, PurchaseOrderID FROM PurchaseOrderHeader ORDER BY TaxAmt DESC LIMIT 1\n```"}]}, {"id": "train-7378", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many person have a projected yearly sales of no more than 50,000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BusinessEntityID) FROM SalesPersonQuotaHistory WHERE SalesQuota < 500000\n```"}]}, {"id": "train-7379", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees who were born before 1969, what is the work shift of the 6th oldest employee?"}, {"from": "gpt", "value": "```sql\nSELECT T3.StartTime, T3.EndTime FROM Employee AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Shift AS T3 ON T2.ShiftId = T3.ShiftId WHERE STRFTIME('%Y', T1.BirthDate) < '1969' ORDER BY T1.BirthDate LIMIT 5, 1\n```"}]}, {"id": "train-7380", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product allows the company to make the highest profit on a single item among those that are the fastest to manufacture? Indicate the rating of the product if there any."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.Rating FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID WHERE T1.DaysToManufacture = ( SELECT DaysToManufacture FROM Product ORDER BY DaysToManufacture LIMIT 1 ) ORDER BY T1.ListPrice - T1.StandardCost DESC LIMIT 1\n```"}]}, {"id": "train-7381", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the full names of the sales person whose bonuses are less than 1,000?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleName, T2.LastName FROM SalesPerson AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.Bonus < 1000\n```"}]}, {"id": "train-7382", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did the Senior Tool Designer, who was 33 years old at the time he was hired, stopped working in the Engineering department?"}, {"from": "gpt", "value": "```sql\nSELECT T2.EndDate 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 T1.JobTitle = 'Senior Tool Designer' AND STRFTIME('%Y', T1.HireDate) - STRFTIME('%Y', T1.BirthDate) = 33 AND T2.EndDate IS NOT NULL\n```"}]}, {"id": "train-7383", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the vendors with an average credit rating, what is the overall total due amount of purchases made by the company to the vendor that isn't preferrerd if another vendor is available?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.TotalDue) FROM Vendor AS T1 INNER JOIN PurchaseOrderHeader AS T2 ON T1.BusinessEntityID = T2.VendorID WHERE T1.CreditRating = 4 AND T1.PreferredVendorStatus = 0\n```"}]}, {"id": "train-7384", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which department has the most number of night shifts?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM Shift AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.ShiftId = T2.ShiftId INNER JOIN Department AS T3 ON T2.DepartmentID = T3.DepartmentID GROUP BY T2.DepartmentID ORDER BY COUNT(T1.Name = 'Night') DESC LIMIT 1\n```"}]}, {"id": "train-7385", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much profit can the company gained from selling two high class black Road Bikes with a size of 58?"}, {"from": "gpt", "value": "```sql\nSELECT 2 * (T1.ListPrice - T1.StandardCost) FROM Product AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductSubcategoryID = T2.ProductSubcategoryID WHERE T1.Class = 'H' AND T1.Color = 'Black' AND T1.Size = 58 AND T2.Name = 'Road Bikes'\n```"}]}, {"id": "train-7386", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the full names of the 10 youngest married male production technicians?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.JobTitle LIKE 'Production Technician%' AND T1.Gender = 'M' AND T1.MaritalStatus = 'M' ORDER BY T1.BirthDate DESC LIMIT 10\n```"}]}, {"id": "train-7387", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the products with an average lead time of 60, which vendor has the highest profit on net? Indicate the credit rating of such vendor."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name, T2.CreditRating FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.AverageLeadTime = 60 ORDER BY T1.LastReceiptCost - T1.StandardPrice DESC LIMIT 1\n```"}]}, {"id": "train-7388", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the profit on net of the products that have exactly 200 maximum order quantity? Indicate the name of the vendors to which these products were purchased from."}, {"from": "gpt", "value": "```sql\nSELECT T1.LastReceiptCost - T1.StandardPrice, T2.Name FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.MaxOrderQty = 200\n```"}]}, {"id": "train-7389", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the non-sales employee who made the most number of rejected purchase orders?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.LastName FROM PurchaseOrderHeader AS T1 INNER JOIN Person AS T2 ON T1.EmployeeID = T2.BusinessEntityID WHERE T2.PersonType = 'EM' AND T1.Status = 3 GROUP BY T2.FirstName, T2.LastName ORDER BY COUNT(T1.PurchaseOrderID) DESC LIMIT 1\n```"}]}, {"id": "train-7390", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the vendor with the second lowest minimum order quantity?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY T1.MaxOrderQty ASC LIMIT 1, 1\n```"}]}, {"id": "train-7391", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much are the minimum orders of the vendors that are no longer used by the company?"}, {"from": "gpt", "value": "```sql\nSELECT T2.MinOrderQty FROM Vendor AS T1 INNER JOIN ProductVendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.ActiveFlag = 0 ORDER BY T2.MinOrderQty LIMIT 1\n```"}]}, {"id": "train-7392", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the employees whose vacation hours are no more than 10, what is the age of the oldest employee at the time he/she was hired? Indicate his/her full name."}, {"from": "gpt", "value": "```sql\nSELECT STRFTIME('%Y', T1.HireDate) - STRFTIME('%Y', T1.BirthDate), T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.VacationHours <= 10 ORDER BY STRFTIME('%Y', T1.HireDate) - STRFTIME('%Y', T1.BirthDate) DESC LIMIT 1\n```"}]}, {"id": "train-7393", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the primary type of all single female employees hired between 1/1/2008 to 12/31/2008?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PersonType FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.Gender = 'F' AND T1.MaritalStatus = 'S' AND STRFTIME('%Y-%m-%d', T1.HireDate) BETWEEN '2008-1-1' AND '2008-12-31' GROUP BY T2.PersonType ORDER BY COUNT(T2.PersonType) DESC LIMIT 1\n```"}]}, {"id": "train-7394", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the company's profit on the product that was rated second-highest by David?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ListPrice - T2.StandardCost FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ReviewerName = 'David' ORDER BY T1.Rating DESC LIMIT 1\n```"}]}, {"id": "train-7395", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which geographic area does the city with the second lowest tax rate belongs to? Indicate the name of the state or province as well."}, {"from": "gpt", "value": "```sql\nSELECT T3.'Group', T2.Name FROM SalesTaxRate AS T1 INNER JOIN StateProvince AS T2 ON T1.StateProvinceID = T2.StateProvinceID INNER JOIN SalesTerritory AS T3 ON T2.TerritoryID = T3.TerritoryID ORDER BY T1.TaxRate LIMIT 1, 1\n```"}]}, {"id": "train-7396", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average profit of all the low class universal road frames? Indicate how many variety of sizes are there and the available colors."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.ListPrice - T1.StandardCost), COUNT(DISTINCT T1.Size) , COUNT(DISTINCT T1.Style) FROM Product AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductSubcategoryID = T2.ProductSubcategoryID WHERE T1.Class = 'L' AND T2.Name = 'Road Frames' GROUP BY T1.Class, T1.Color\n```"}]}, {"id": "train-7397", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the discount percentage of \"LL Road Frame Sale\"?"}, {"from": "gpt", "value": "```sql\nSELECT DiscountPct FROM SpecialOffer WHERE Description = 'LL Road Frame Sale'\n```"}]}, {"id": "train-7398", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many discount are of the type \"Excess Inventory\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(SpecialOfferID) FROM SpecialOffer WHERE Type = 'Excess Inventory'\n```"}]}, {"id": "train-7399", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which seasonal discount had the highest discount percentage?"}, {"from": "gpt", "value": "```sql\nSELECT Description FROM SpecialOffer WHERE Type = 'Seasonal Discount' ORDER BY DiscountPct DESC LIMIT 1\n```"}]}, {"id": "train-7400", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top 3 discounts with the highest discount percentage and fall under the reseller category."}, {"from": "gpt", "value": "```sql\nSELECT Description, DiscountPct FROM SpecialOffer WHERE Category = 'Reseller' ORDER BY DiscountPct DESC LIMIT 0, 3\n```"}]}, {"id": "train-7401", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where can I get the demographic information about the Valley Bicycle Specialists store?"}, {"from": "gpt", "value": "```sql\nSELECT Demographics FROM Store WHERE Name = 'Valley Bicycle Specialists'\n```"}]}, {"id": "train-7402", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the products that are manufactured in-house, how many of them are salable?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(FinishedGoodsFlag) FROM Product WHERE MakeFlag = 1\n```"}]}, {"id": "train-7403", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the minimum inventory quantity of Chainring Bolts?"}, {"from": "gpt", "value": "```sql\nSELECT SafetyStockLevel FROM Product WHERE Name = 'Chainring Bolts'\n```"}]}, {"id": "train-7404", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product has the highest standard cost?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Product ORDER BY StandardCost DESC LIMIT 1\n```"}]}, {"id": "train-7405", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What type of employee is David Bradley?"}, {"from": "gpt", "value": "```sql\nSELECT PersonType FROM Person WHERE FirstName = 'David' AND LastName = 'Bradley'\n```"}]}, {"id": "train-7406", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees who are store contacts, how many of them have a title of \"Mr.\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(BusinessEntityID) FROM Person WHERE PersonType = 'SC' AND Title = 'Mr.'\n```"}]}, {"id": "train-7407", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where can I find the Valley Bicycle Specialists store?"}, {"from": "gpt", "value": "```sql\nSELECT T2.AddressLine1, T2.AddressLine2 FROM BusinessEntityAddress AS T1 INNER JOIN Address AS T2 ON T1.AddressID = T2.AddressID INNER JOIN Store AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T3.Name = 'Valley Bicycle Specialists'\n```"}]}, {"id": "train-7408", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which e-mail address should I write if I want to contact David Bradley?"}, {"from": "gpt", "value": "```sql\nSELECT T2.EmailAddress FROM Person AS T1 INNER JOIN EmailAddress AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'David' AND T1.LastName = 'Bradley'\n```"}]}, {"id": "train-7410", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the hashed password of David Bradley?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PasswordHash FROM Person AS T1 INNER JOIN Password AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.FirstName = 'David' AND T1.LastName = 'Bradley'\n```"}]}, {"id": "train-7411", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the e-mail addresses of all the employees who wish to receive e-mail promotions from Adventureworks and selected partners."}, {"from": "gpt", "value": "```sql\nSELECT T2.EmailAddress FROM Person AS T1 INNER JOIN EmailAddress AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.EmailPromotion = 2\n```"}]}, {"id": "train-7412", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please show the credit card number of David Bradley."}, {"from": "gpt", "value": "```sql\nSELECT T3.CardNumber FROM Person AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN CreditCard AS T3 ON T2.CreditCardID = T3.CreditCardID WHERE T1.FirstName = 'David' AND T1.LastName = 'Bradley'\n```"}]}, {"id": "train-7413", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year will the David Bradley's credit card expire?"}, {"from": "gpt", "value": "```sql\nSELECT T3.ExpYear FROM Person AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN CreditCard AS T3 ON T2.CreditCardID = T3.CreditCardID WHERE T1.FirstName = 'David' AND T1.LastName = 'Bradley'\n```"}]}, {"id": "train-7414", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the store contact employees whose credit cards expired in 2007."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Person AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN CreditCard AS T3 ON T2.CreditCardID = T3.CreditCardID WHERE T3.ExpYear = 2007 AND T1.PersonType = 'SC'\n```"}]}, {"id": "train-7415", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the store contact employees, how many of them have a Vista credit card?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.FirstName) FROM Person AS T1 INNER JOIN PersonCreditCard AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN CreditCard AS T3 ON T2.CreditCardID = T3.CreditCardID WHERE T3.CardType = 'Vista' AND T1.PersonType = 'SC'\n```"}]}, {"id": "train-7416", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many departments have David Bradley been in?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.DepartmentID) FROM Person AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Department AS T3 ON T2.DepartmentID = T3.DepartmentID WHERE T1.FirstName = 'David' AND T1.LastName = 'Bradley'\n```"}]}, {"id": "train-7417", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the departments that David Bradley used to belong to."}, {"from": "gpt", "value": "```sql\nSELECT T2.DepartmentID FROM Person AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Department AS T3 ON T2.DepartmentID = T3.DepartmentID WHERE T1.FirstName = 'David' AND T1.LastName = 'Bradley'\n```"}]}, {"id": "train-7418", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people were there in the Engineering Department in the year 2009?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM Person 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 = 'Engineering' AND STRFTIME('%Y', T2.EndDate) > '2009' AND STRFTIME('%Y', T2.StartDate) < '2009'\n```"}]}, {"id": "train-7419", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which employee has been in the Engineering Department the longest? Please give his or her firstname and lastname."}, {"from": "gpt", "value": "```sql\nSELECT T1.FirstName, T1.LastName FROM Person 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 = 'Engineering' ORDER BY T2.EndDate - T2.StartDate DESC LIMIT 1\n```"}]}, {"id": "train-7420", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees in the Manufacturing group in 2007, how many of them are store contacts?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Department AS T2 ON T1.DepartmentID = T2.DepartmentID INNER JOIN Person AS T3 ON T1.BusinessEntityID WHERE T3.PersonType = 'SC' AND T2.GroupName = 'Manufacturing' AND STRFTIME('%Y', T1.EndDate) >= '2007' AND STRFTIME('%Y', T1.StartDate) <= '2007'\n```"}]}, {"id": "train-7421", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the credit card numbers of all the employees who have left the Finance Department."}, {"from": "gpt", "value": "```sql\nSELECT T3.CardNumber FROM EmployeeDepartmentHistory AS T1 INNER JOIN Department AS T2 ON T1.DepartmentID = T2.DepartmentID INNER JOIN CreditCard AS T3 ON T1.ModifiedDate = T3.ModifiedDate INNER JOIN PersonCreditCard AS T4 ON T3.CreditCardID = T4.CreditCardID WHERE T2.Name = 'Finance' AND T1.EndDate IS NOT NULL\n```"}]}, {"id": "train-7422", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees working in the Engineering Department in 2007 would have their credit cards expired in the same year?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Department AS T2 ON T1.DepartmentID = T2.DepartmentID INNER JOIN PersonCreditCard AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID INNER JOIN CreditCard AS T4 ON T3.CreditCardID = T4.CreditCardID WHERE T4.ExpYear = 2007 AND T2.Name = 'Engineering'\n```"}]}, {"id": "train-7423", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the e-mail address of the employee who switched departments for the most times?"}, {"from": "gpt", "value": "```sql\nSELECT 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\n```"}]}, {"id": "train-7424", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the employees who don't wish to receive promotion e-mails, how many of them belong to or once belonged to the Engineering Department?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Department AS T3 ON T1.DepartmentID = T3.DepartmentID WHERE T3.Name = 'Engineering' AND T2.EmailPromotion = 0\n```"}]}, {"id": "train-7425", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees came into the Quality Assurance Group in the year 2007?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.BusinessEntityID) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Department AS T2 ON T1.DepartmentID = T2.DepartmentID WHERE T2.GroupName = 'Quality Assurance' AND STRFTIME('%Y', T1.StartDate) = '2007'\n```"}]}, {"id": "train-7426", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the product names of all the products on the LL Road Frame Sale."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM SpecialOffer AS T1 INNER JOIN SpecialOfferProduct AS T2 ON T1.SpecialOfferID = T2.SpecialOfferID INNER JOIN Product AS T3 ON T2.ProductID = T3.ProductID WHERE T1.Description = 'LL Road Frame Sale'\n```"}]}, {"id": "train-7427", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products were on the LL Road Frame Sale?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT ProductID) FROM SpecialOffer AS T1 INNER JOIN SpecialOfferProduct AS T2 ON T1.SpecialOfferID = T2.SpecialOfferID WHERE T1.Description = 'LL Road Frame Sale'\n```"}]}, {"id": "train-7428", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Has the product Chainring Bolts been on any of the sales?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN COUNT(T1.Description) >= 1 THEN 'Yes' ELSE 'No' END FROM SpecialOffer AS T1 INNER JOIN SpecialOfferProduct AS T2 ON T1.SpecialOfferID = T2.SpecialOfferID INNER JOIN Product AS T3 ON T2.ProductID = T3.ProductID WHERE T3.Name = 'Chainring Bolts'\n```"}]}, {"id": "train-7429", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products from the Clothing category were on the LL Road Frame Sale?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.ProductID) FROM SpecialOffer AS T1 INNER JOIN SpecialOfferProduct AS T2 ON T1.SpecialOfferID = T2.SpecialOfferID INNER JOIN Product AS T3 ON T2.ProductID = T3.ProductID INNER JOIN ProductSubcategory AS T4 ON T3.ProductSubcategoryID = T4.ProductSubcategoryID INNER JOIN ProductCategory AS T5 ON T4.ProductCategoryID = T5.ProductCategoryID WHERE T1.Description = 'LL Road Frame Sale' AND T4.Name = 'Clothing'\n```"}]}, {"id": "train-7430", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the products that are under the Clothing category that are manufactured in-house and salable."}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T1.MakeFlag = 1 THEN T1.Name END FROM Product AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductSubcategoryID = T2.ProductSubcategoryID INNER JOIN ProductCategory AS T3 ON T2.ProductCategoryID = T3.ProductCategoryID WHERE T2.ProductSubcategoryID = 3\n```"}]}, {"id": "train-7431", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the employees that have left the Engineering Department, what is the average time of their stay?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(365 * (STRFTIME('%Y', T1.EndDate) - STRFTIME('%Y', T1.StartDate)) + 30 * (STRFTIME('%m', T1.EndDate) - STRFTIME('%m', T1.StartDate)) + STRFTIME('%d', T1.EndDate) - STRFTIME('%d', T1.StartDate)) AS REAL) / COUNT(T1.BusinessEntityID) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Department AS T2 ON T1.DepartmentID = T2.DepartmentID WHERE T2.Name = 'Engineering' AND T1.EndDate IS NOT NULL\n```"}]}, {"id": "train-7432", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average pay rate of the employees who worked in the Engineering Departmentin 2007?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.Rate) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Department AS T2 ON T1.DepartmentID = T2.DepartmentID INNER JOIN EmployeePayHistory AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T2.Name = 'Engineering' AND STRFTIME('%Y', EndDate) > '2007' AND STRFTIME('%Y', T1.StartDate) < '2007'\n```"}]}, {"id": "train-7433", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much more expensive in percentage is the product with the highest selling price from the product with the lowest selling price in the Clothing category?"}, {"from": "gpt", "value": "```sql\nSELECT (MAX(T1.ListPrice) - MIN(T1.ListPrice)) * 100 / MIN(T1.ListPrice) FROM Product AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductSubcategoryID = T2.ProductSubcategoryID INNER JOIN ProductCategory AS T3 ON T2.ProductCategoryID = T3.ProductCategoryID WHERE T3.Name = 'Clothing'\n```"}]}, {"id": "train-7434", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average profit of all the products from the Clothing category?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.ListPrice - T1.StandardCost) / COUNT(T1.ProductID) FROM Product AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductSubcategoryID = T2.ProductSubcategoryID INNER JOIN ProductCategory AS T3 ON T2.ProductCategoryID = T3.ProductCategoryID WHERE T3.Name = 'Clothing'\n```"}]}, {"id": "train-7435", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product cost the least in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT ProductID FROM ProductCostHistory WHERE StartDate LIKE '2013%' ORDER BY StandardCost LIMIT 1\n```"}]}, {"id": "train-7436", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all products with the color yellow."}, {"from": "gpt", "value": "```sql\nSELECT ProductID FROM Product WHERE Color = 'Yellow'\n```"}]}, {"id": "train-7437", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the bussiness id for Mr. Hung-Fu Ting?"}, {"from": "gpt", "value": "```sql\nSELECT BusinessEntityID FROM Person WHERE Title = 'Mr.' AND FirstName = 'Hung-Fu' AND LastName = 'Ting'\n```"}]}, {"id": "train-7439", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the price for the product with the id \"912\"?"}, {"from": "gpt", "value": "```sql\nSELECT ListPrice FROM ProductListPriceHistory WHERE ProductID = 912\n```"}]}, {"id": "train-7440", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is there a work order where the planned cost is different from the actual cost?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN ActualCost = PlannedCost THEN 'No' ELSE 'Yes' END FROM WorkOrderRouting\n```"}]}, {"id": "train-7441", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the thumbnail photo file for the product with the id \"979\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ThumbnailPhotoFileName FROM ProductProductPhoto AS T1 INNER JOIN ProductPhoto AS T2 ON T1.ProductPhotoID = T2.ProductPhotoID WHERE T1.ProductID = 979\n```"}]}, {"id": "train-7442", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the names of the products with the price of more than 1000$."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Name FROM ProductListPriceHistory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ListPrice > 1000\n```"}]}, {"id": "train-7443", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the product with the most profit?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ProductID FROM ProductListPriceHistory AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID ORDER BY T1.ListPrice - T2.StandardCost DESC LIMIT 1\n```"}]}, {"id": "train-7444", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the product stored in location 1 compartment L container 6?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductInventory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.LocationID = 1 AND T1.Shelf = 'L' AND T1.Bin = 6\n```"}]}, {"id": "train-7445", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are locations of the work order \"35493\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM WorkOrderRouting AS T1 INNER JOIN Location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.WorkOrderID = 35493\n```"}]}, {"id": "train-7446", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the products with a large photo?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ProductID FROM ProductPhoto AS T1 INNER JOIN ProductProductPhoto AS T2 ON T1.ProductPhotoID = T2.ProductPhotoID WHERE T1.LargePhotoFileName LIKE '%large.gif'\n```"}]}, {"id": "train-7447", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the socks products."}, {"from": "gpt", "value": "```sql\nSELECT T2.ProductID FROM ProductSubcategory AS T1 INNER JOIN Product AS T2 ON T1.ProductSubcategoryID = T2.ProductSubcategoryID WHERE T1.Name = 'Socks'\n```"}]}, {"id": "train-7448", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: With 100$, how many Cable Lock can you buy?"}, {"from": "gpt", "value": "```sql\nSELECT 100 / T2.ListPrice FROM Product AS T1 INNER JOIN ProductListPriceHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Cable Lock'\n```"}]}, {"id": "train-7449", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the scrap reason for work order \"57788\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM WorkOrder AS T1 INNER JOIN ScrapReason AS T2 ON T1.ScrapReasonID = T2.ScrapReasonID WHERE T1.WorkOrderID = 57788\n```"}]}, {"id": "train-7450", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the cost for the sports?"}, {"from": "gpt", "value": "```sql\nSELECT T2.StandardCost FROM Product AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE '%Sport%'\n```"}]}, {"id": "train-7451", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products with the id \"476\" are stored in Metal Storage?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Quantity FROM Location AS T1 INNER JOIN ProductInventory AS T2 ON T1.LocationID = T2.LocationID WHERE T2.ProductID = 476 AND T1.Name = 'Metal Storage'\n```"}]}, {"id": "train-7452", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the products with lower than average cost."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.ProductID FROM ProductCostHistory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.StandardCost < ( SELECT SUM(StandardCost) / COUNT(ProductID) FROM Product )\n```"}]}, {"id": "train-7453", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the the percentage of profit for the product \"858\"?"}, {"from": "gpt", "value": "```sql\nSELECT (T1.ListPrice - T2.StandardCost) * 100 / T2.StandardCost FROM ProductListPriceHistory AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductID = 858\n```"}]}, {"id": "train-7454", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products with a thumpnail photo?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ProductID) FROM ProductProductPhoto WHERE ProductPhotoID != 1\n```"}]}, {"id": "train-7455", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many days did it take to end the work order \"425\"?"}, {"from": "gpt", "value": "```sql\nSELECT 365 * (STRFTIME('%Y', ActualEndDate) - STRFTIME('%Y', ActualStartDate)) + 30 * (STRFTIME('%m', ActualEndDate) - STRFTIME('%m', ActualStartDate)) + STRFTIME('%d', ActualEndDate) - STRFTIME('%d', ActualStartDate) FROM WorkOrderRouting WHERE WorkOrderID = 425\n```"}]}, {"id": "train-7456", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which product has the highest price in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT ProductID FROM ProductListPriceHistory WHERE StartDate LIKE '2012%' ORDER BY ListPrice DESC LIMIT 1\n```"}]}, {"id": "train-7457", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the cost for the product \"847\"?"}, {"from": "gpt", "value": "```sql\nSELECT StandardCost FROM ProductCostHistory WHERE ProductID = 847\n```"}]}, {"id": "train-7458", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the organization level for Human Resources Manager?"}, {"from": "gpt", "value": "```sql\nSELECT OrganizationLevel FROM Employee WHERE JobTitle = 'Human Resources Manager'\n```"}]}, {"id": "train-7459", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the work orders didn\u2019t meet the due date?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(WorkOrderID) FROM WorkOrder WHERE EndDate > DueDate\n```"}]}, {"id": "train-7460", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the cost and the product number of product with the id \"888\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.StandardCost, T2.ProductNumber FROM ProductCostHistory AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductID = 888\n```"}]}, {"id": "train-7461", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many products using \"roadster_black_small.gif\" as the thumbnail photo?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.ProductID) FROM ProductPhoto AS T1 INNER JOIN ProductProductPhoto AS T2 ON T1.ProductPhotoID = T2.ProductPhotoID WHERE T1.LargePhotoFileName = 'roadster_black_large.gif'\n```"}]}, {"id": "train-7462", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the locations ids, compartments and containers for the Lock Ring"}, {"from": "gpt", "value": "```sql\nSELECT T2.LocationID, T2.Shelf, T2.Bin FROM Product AS T1 INNER JOIN ProductInventory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE 'Lock Ring'\n```"}]}, {"id": "train-7463", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What category do Road Frames fall into?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductSubcategory AS T1 INNER JOIN ProductCategory AS T2 ON T1.ProductCategoryID = T2.ProductCategoryID WHERE T1.Name = 'Road Frames'\n```"}]}, {"id": "train-7464", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the scraped work orders for handling damage reason."}, {"from": "gpt", "value": "```sql\nSELECT T2.WorkOrderID FROM ScrapReason AS T1 INNER JOIN WorkOrder AS T2 ON T1.ScrapReasonID = T2.ScrapReasonID WHERE T1.Name = 'Handling damage'\n```"}]}, {"id": "train-7465", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the profit for the product \"792\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ListPrice - T2.StandardCost FROM ProductListPriceHistory AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.ProductID = 792\n```"}]}, {"id": "train-7466", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who owns the email address \"regina7@adventure-works.com\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.FirstName, T2.LastName FROM EmailAddress AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.EmailAddress = 'regina7@adventure-works.com'\n```"}]}, {"id": "train-7467", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where are the locations where the product \"810\" is stored?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ProductInventory AS T1 INNER JOIN Location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.ProductID = 810\n```"}]}, {"id": "train-7468", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the product the work order \"2540\" was making?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM WorkOrder AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID WHERE T1.WorkOrderID = 2540\n```"}]}, {"id": "train-7469", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the price for the AWC Logo Cap?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ListPrice FROM Product AS T1 INNER JOIN ProductListPriceHistory AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'AWC Logo Cap'\n```"}]}, {"id": "train-7470", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the work orders that is related to the Down Tube."}, {"from": "gpt", "value": "```sql\nSELECT T2.WorkOrderID FROM Product AS T1 INNER JOIN WorkOrder AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name = 'Down Tube'\n```"}]}, {"id": "train-7471", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the the average percentage of profit for the all the product?"}, {"from": "gpt", "value": "```sql\nSELECT AVG((T1.ListPrice - T2.StandardCost) * 100 / T2.StandardCost) FROM ProductListPriceHistory AS T1 INNER JOIN ProductCostHistory AS T2 ON T1.ProductID = T2.ProductID\n```"}]}, {"id": "train-7472", "db_id": "works_cycles", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What proportion of work order is in Subassembly?"}, {"from": "gpt", "value": "```sql\nSELECT 100.0 * SUM(CASE WHEN T1.Name = 'Subassembly' THEN 1 ELSE 0 END) / COUNT(T2.WorkOrderID) FROM Location AS T1 INNER JOIN WorkOrderRouting AS T2 ON T1.LocationID = T2.LocationID\n```"}]}, {"id": "train-7473", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many object samples are there in image no.1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(OBJ_SAMPLE_ID) FROM IMG_OBJ WHERE IMG_ID = 1\n```"}]}, {"id": "train-7474", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have over 20 object samples?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.IMG_ID) FROM ( SELECT IMG_ID FROM IMG_OBJ GROUP BY IMG_ID HAVING COUNT(OBJ_SAMPLE_ID) > 20 ) T1\n```"}]}, {"id": "train-7475", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of the image with the most number of object samples?"}, {"from": "gpt", "value": "```sql\nSELECT IMG_ID FROM IMG_OBJ GROUP BY IMG_ID ORDER BY COUNT(OBJ_SAMPLE_ID) DESC LIMIT 1\n```"}]}, {"id": "train-7476", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the object samples in class no. 297 in image no.1."}, {"from": "gpt", "value": "```sql\nSELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 1 AND OBJ_CLASS_ID = 297\n```"}]}, {"id": "train-7477", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many self-relations are there between the object samples in image no.5?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN IMG_ID = 5 THEN 1 ELSE 0 END) FROM IMG_REL WHERE OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID\n```"}]}, {"id": "train-7478", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the bounding box of the object sample in image no.5 that has a self-relation?"}, {"from": "gpt", "value": "```sql\nSELECT T2.X, T2.Y, T2.W, T2.H FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID WHERE T1.IMG_ID = 5 AND T1.OBJ1_SAMPLE_ID = T1.OBJ2_SAMPLE_ID\n```"}]}, {"id": "train-7479", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many object samples in image no.1 are in the class of \"man\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.OBJ_CLASS = 'man' THEN 1 ELSE 0 END) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1\n```"}]}, {"id": "train-7480", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have at least one object sample in the class of \"man\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.IMG_ID) FROM ( SELECT T2.IMG_ID FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.OBJ_CLASS = 'man' GROUP BY T2.IMG_ID ) T\n```"}]}, {"id": "train-7481", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the classes of all the object samples in image no.1."}, {"from": "gpt", "value": "```sql\nSELECT T1.OBJ_CLASS FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 GROUP BY T1.OBJ_CLASS\n```"}]}, {"id": "train-7482", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the relation between object sample no.8 and object sample no.4 in image no.1?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 1 AND T2.OBJ1_SAMPLE_ID = 8 AND T2.OBJ2_SAMPLE_ID = 4\n```"}]}, {"id": "train-7483", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many pairs of object samples in image no.1 have the relation of \"parked on\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.PRED_CLASS = 'parked on' THEN 1 ELSE 0 END) FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 1 AND T2.OBJ1_SAMPLE_ID != OBJ2_SAMPLE_ID\n```"}]}, {"id": "train-7484", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all the predicted relation classes of object sample no.14 in image no.1."}, {"from": "gpt", "value": "```sql\nSELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.OBJ1_SAMPLE_ID = 14 AND T2.OBJ2_SAMPLE_ID = 14\n```"}]}, {"id": "train-7485", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have at least one pair of object samples with the relation \"parked on\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.PRED_CLASS = 'parked on' THEN 1 ELSE 0 END) FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID\n```"}]}, {"id": "train-7486", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of all the images with more than 2 pairs of object samples with the relation \"parked on\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.IMG_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.PRED_CLASS = 'parked on' AND T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID GROUP BY T2.IMG_ID HAVING COUNT(T2.IMG_ID) > 2\n```"}]}, {"id": "train-7487", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which predicted relation class does the self-relation of the object sample in image no.5 belong?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 5 AND T2.OBJ1_SAMPLE_ID = T2.OBJ2_SAMPLE_ID\n```"}]}, {"id": "train-7488", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the bounding boxes of the object samples with a predicted relation class of \"by\" in image no.1?"}, {"from": "gpt", "value": "```sql\nSELECT T3.X, T3.Y, T3.W, T3.H FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 AND T1.PRED_CLASS = 'by'\n```"}]}, {"id": "train-7489", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average difference in the y coordinate of 2 object samples with the relation \"parked on\" in image no.1?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T3.Y) AS REAL) / COUNT(CASE WHEN T1.PRED_CLASS = 'parked on' THEN 1 ELSE NULL END) FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 AND T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID\n```"}]}, {"id": "train-7490", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the object samples in the class of \"man\" in image no.1?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.OBJ_CLASS = 'man' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.OBJ_CLASS_ID) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 1\n```"}]}, {"id": "train-7491", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the total number of the attribute classes."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ATT_CLASS_ID) FROM ATT_CLASSES\n```"}]}, {"id": "train-7492", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many object classes are there in the database?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(OBJ_CLASS_ID) FROM OBJ_CLASSES\n```"}]}, {"id": "train-7493", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of predicted classes."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(PRED_CLASS_ID) FROM PRED_CLASSES\n```"}]}, {"id": "train-7494", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the bounding box of the kite in image no.2324765."}, {"from": "gpt", "value": "```sql\nSELECT T2.X, T2.Y, T2.W, T2.H FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2324765 AND T1.OBJ_CLASS = 'kite'\n```"}]}, {"id": "train-7495", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many white objects are there in image no.2347915?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.ATT_CLASS = 'white' THEN 1 ELSE 0 END) FROM IMG_OBJ_ATT AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 2347915\n```"}]}, {"id": "train-7496", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of samples in image no.2377985 whose attribute is electrical."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.ATT_CLASS = 'white' THEN 1 ELSE 0 END) FROM IMG_OBJ_ATT AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 2347915\n```"}]}, {"id": "train-7497", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the relationship between object sample no.12 and no.8 of image no.2345511?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 2345511 AND T2.OBJ1_SAMPLE_ID = 12 AND T2.OBJ2_SAMPLE_ID = 8\n```"}]}, {"id": "train-7498", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the object number of the sample which has the relationship of \"lying on\" with object sample no.1 from image no.2345524."}, {"from": "gpt", "value": "```sql\nSELECT T2.OBJ1_SAMPLE_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 2345524 AND T1.PRED_CLASS = 'lying on' AND T2.OBJ2_SAMPLE_ID = 1\n```"}]}, {"id": "train-7499", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many samples of food object are there in image no.6?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.OBJ_SAMPLE_ID) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 6 AND T1.OBJ_CLASS = 'food'\n```"}]}, {"id": "train-7500", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of images containing the object sample of \"suit\"."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.IMG_ID) FROM ( SELECT T2.IMG_ID FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.OBJ_CLASS = 'suit' GROUP BY T2.IMG_ID ) T\n```"}]}, {"id": "train-7501", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the relationship between \"feathers\" and \"onion\" in image no.2345528?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_SAMPLE_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE (T4.OBJ_CLASS = 'feathers' OR T4.OBJ_CLASS = 'onion') AND T2.IMG_ID = 2345528 GROUP BY T1.PRED_CLASS\n```"}]}, {"id": "train-7504", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many samples of \"wall\" are there in image no.2353079?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.OBJ_CLASS = 'wall' THEN 1 ELSE 0 END) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2353079\n```"}]}, {"id": "train-7505", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the object class of sample no.10 of image no.2320341."}, {"from": "gpt", "value": "```sql\nSELECT T1.OBJ_CLASS FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2320341 AND T2.OBJ_SAMPLE_ID = 10\n```"}]}, {"id": "train-7506", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times is the number of images containing \"broccoli\" than \"tomato\"?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.OBJ_CLASS = 'broccoli' THEN T2.OBJ_SAMPLE_ID ELSE NULL END) AS REAL) / COUNT(CASE WHEN T1.OBJ_CLASS = 'tomato' THEN T2.OBJ_SAMPLE_ID ELSE NULL END) times FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID\n```"}]}, {"id": "train-7507", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have at least 25 attributes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT IMG_ID FROM IMG_OBJ_att GROUP BY IMG_ID HAVING COUNT(ATT_CLASS_ID) > 25 ) T1\n```"}]}, {"id": "train-7508", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the ids of the images that have a self-relation relationship."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT IMG_ID FROM IMG_REL WHERE OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID\n```"}]}, {"id": "train-7509", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many objects are there in the attribute class id with the highest number of objects?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_att GROUP BY IMG_ID ORDER BY COUNT(ATT_CLASS_ID) DESC LIMIT 1\n```"}]}, {"id": "train-7510", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the id of all the objects belonging to the transportation class?"}, {"from": "gpt", "value": "```sql\nSELECT OBJ_CLASS_ID FROM OBJ_CLASSES WHERE OBJ_CLASS IN ('bus', 'train', 'aeroplane', 'car', 'etc')\n```"}]}, {"id": "train-7511", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the corresponding classes for the \"very large bike\" attribute?"}, {"from": "gpt", "value": "```sql\nSELECT ATT_CLASS_ID FROM ATT_CLASSES WHERE ATT_CLASS = 'very large'\n```"}]}, {"id": "train-7512", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the unique id number identifying the onion object class?"}, {"from": "gpt", "value": "```sql\nSELECT OBJ_CLASS_ID FROM OBJ_CLASSES WHERE OBJ_CLASS = 'onion'\n```"}]}, {"id": "train-7513", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the corresponding classes for attributes of image id 8."}, {"from": "gpt", "value": "```sql\nSELECT T2.ATT_CLASS FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 8\n```"}]}, {"id": "train-7514", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the bounding box of the object with image id 4 and a prediction relationship class id of 144?"}, {"from": "gpt", "value": "```sql\nSELECT T2.X, T2.Y, T2.W, T2.H FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID WHERE T1.PRED_CLASS_ID = 144 AND T1.IMG_ID = 3\n```"}]}, {"id": "train-7515", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have at least 5 \"black\" classes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(IMGID) FROM ( SELECT T1.IMG_ID AS IMGID FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.ATT_CLASS = 'black' GROUP BY T1.IMG_ID HAVING COUNT(T1.ATT_CLASS_ID) >= 5 ) T3\n```"}]}, {"id": "train-7516", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the prediction relationship class id of the tallest image?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PRED_CLASS_ID FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID ORDER BY T2.H DESC LIMIT 1\n```"}]}, {"id": "train-7517", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which image has the highest number of \"white\" class attributes?"}, {"from": "gpt", "value": "```sql\nSELECT T1.IMG_ID AS IMGID FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.ATT_CLASS = 'white' GROUP BY T1.IMG_ID ORDER BY COUNT(T1.ATT_CLASS_ID) DESC LIMIT 1\n```"}]}, {"id": "train-7518", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the x and y coordinates of all the images with a prediction relationship class id of 98?"}, {"from": "gpt", "value": "```sql\nSELECT T2.X, T2.Y FROM IMG_REL AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.IMG_ID = T2.IMG_ID WHERE T1.PRED_CLASS_ID = 98\n```"}]}, {"id": "train-7519", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many prediction classes with \"has\" captions are there for image id 3050?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.PRED_CLASS_ID) FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 3050 AND T2.PRED_CLASS = 'has'\n```"}]}, {"id": "train-7520", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the explanations about object classes of all the images with an x and y coordinate of 0."}, {"from": "gpt", "value": "```sql\nSELECT T1.OBJ_CLASS FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.X = 0 AND T2.Y = 0 GROUP BY T1.OBJ_CLASS\n```"}]}, {"id": "train-7521", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the captions of all the self-relation relationship prediction classes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN pred_classes AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.OBJ1_SAMPLE_ID = T1.OBJ2_SAMPLE_ID GROUP BY T2.PRED_CLASS\n```"}]}, {"id": "train-7522", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give all the bounding boxes for image 2222 whose object classes are feathers."}, {"from": "gpt", "value": "```sql\nSELECT T2.X, T2.Y, T2.H, T2.W FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2222 AND T1.OBJ_CLASS = 'feathers'\n```"}]}, {"id": "train-7523", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the objects that have multiple relations, how many images whose captions for the prediction class ids are \"on\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.PRED_CLASS_ID) FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.OBJ1_SAMPLE_ID != T1.OBJ2_SAMPLE_ID AND T2.PRED_CLASS = 'on'\n```"}]}, {"id": "train-7524", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the object class of the image with a bounding box of 0, 0, 135, 212?"}, {"from": "gpt", "value": "```sql\nSELECT T1.OBJ_CLASS FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.X = 0 AND T2.Y = 0 AND T2.W = 135 AND T2.H = 212\n```"}]}, {"id": "train-7525", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the dimensions of the bounding box that contains the keyboard that was spotted in image no. 3."}, {"from": "gpt", "value": "```sql\nSELECT T1.W, T1.H FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 3 AND T2.OBJ_CLASS = 'keyboard'\n```"}]}, {"id": "train-7527", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Define the onion's bounding box on image no. 285930."}, {"from": "gpt", "value": "```sql\nSELECT T1.X, T1.Y, T1.W, T1.H FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 285930 AND T2.OBJ_CLASS = 'onion'\n```"}]}, {"id": "train-7528", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many objects can you spot in image no. 72? What objects may be identified on the same image and within the bounding box represented as (341, 27, 42, 51)?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T1.IMG_ID = 1, 1, 0)), SUM(IIF(T1.X = 341 AND T1.Y = 27 AND T1.W = 42 AND T1.H = 51, 1, 0)) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID\n```"}]}, {"id": "train-7529", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On image no. 5, name the attributes that are composed of multiple objects."}, {"from": "gpt", "value": "```sql\nSELECT T2.ATT_CLASS FROM IMG_OBJ_ATT AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 5 GROUP BY T2.ATT_CLASS HAVING COUNT(T2.ATT_CLASS) > 2\n```"}]}, {"id": "train-7530", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What attributes are used to describe the wall on image no. 27."}, {"from": "gpt", "value": "```sql\nSELECT T4.ATT_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID INNER JOIN IMG_OBJ_ATT AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN ATT_CLASSES AS T4 ON T3.ATT_CLASS_ID = T4.ATT_CLASS_ID WHERE T2.OBJ_CLASS = 'wall' AND T1.IMG_ID = 27 GROUP BY T4.ATT_CLASS\n```"}]}, {"id": "train-7531", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the object element that is described as being scattered on image no. 10."}, {"from": "gpt", "value": "```sql\nSELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID INNER JOIN IMG_OBJ_ATT AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN ATT_CLASSES AS T4 ON T3.ATT_CLASS_ID = T4.ATT_CLASS_ID WHERE T4.ATT_CLASS = 'scattered' AND T1.IMG_ID = 10 GROUP BY T2.OBJ_CLASS\n```"}]}, {"id": "train-7532", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images contain 'bridge' as an object element?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'bridge'\n```"}]}, {"id": "train-7533", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many object elements are there on average in each image?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(OBJ_CLASS_ID) AS REAL) / COUNT(DISTINCT IMG_ID) FROM IMG_OBJ\n```"}]}, {"id": "train-7534", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What colour is the van that can be spotted in image no. 1?"}, {"from": "gpt", "value": "```sql\nSELECT T4.ATT_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID INNER JOIN IMG_OBJ_ATT AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN ATT_CLASSES AS T4 ON T3.ATT_CLASS_ID = T4.ATT_CLASS_ID WHERE T2.OBJ_CLASS = 'van' AND T1.IMG_ID = 1 GROUP BY T4.ATT_CLASS\n```"}]}, {"id": "train-7535", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the objects, their attributes, and the relationships that comprise the scene on image no. 1 within the bounding box, represented as (388, 369, 48, 128)."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.OBJ_CLASS, T4.ATT_CLASS, T6.PRED_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID INNER JOIN IMG_OBJ_ATT AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN ATT_CLASSES AS T4 ON T3.ATT_CLASS_ID = T4.ATT_CLASS_ID INNER JOIN IMG_REL AS T5 ON T1.IMG_ID = T5.IMG_ID INNER JOIN PRED_CLASSES AS T6 ON T5.PRED_CLASS_ID = T6.PRED_CLASS_ID WHERE T1.IMG_ID = 1 AND T1.X = 388 AND T1.Y = 369 AND T1.W = 48 AND T1.H = 128\n```"}]}, {"id": "train-7536", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the relationship between object sample no. 25 and object sample no. 2 on image no. 1?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 1 AND T1.OBJ1_SAMPLE_ID = 25 AND T1.OBJ2_SAMPLE_ID = 2\n```"}]}, {"id": "train-7537", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many attributes are related to the object sample no. 7 on image no. 4?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_ATT WHERE IMG_ID = 4 AND OBJ_SAMPLE_ID = 7\n```"}]}, {"id": "train-7538", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many object elements can be detected on image no. 31?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(OBJ_CLASS_ID) FROM IMG_OBJ WHERE IMG_ID = 31\n```"}]}, {"id": "train-7539", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On image no. 20, identify the attribute ID that is composed of the highest number of objects."}, {"from": "gpt", "value": "```sql\nSELECT ATT_CLASS_ID FROM IMG_OBJ_ATT WHERE IMG_ID = 20 GROUP BY ATT_CLASS_ID ORDER BY COUNT(ATT_CLASS_ID) DESC LIMIT 1\n```"}]}, {"id": "train-7540", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Define the bounding box of the object sample no. 7 on image no. 42."}, {"from": "gpt", "value": "```sql\nSELECT X, Y, W, H FROM IMG_OBJ WHERE IMG_ID = 42 AND OBJ_SAMPLE_ID = 7\n```"}]}, {"id": "train-7541", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On image no. 99 identify the percentage of objects that are described as white."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.ATT_CLASS = 'white' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(OBJ_SAMPLE_ID) FROM IMG_OBJ_ATT AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 99\n```"}]}, {"id": "train-7542", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many attribute classes are there for image id 5?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_ATT WHERE IMG_ID = 5\n```"}]}, {"id": "train-7543", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the explanation about object class 10."}, {"from": "gpt", "value": "```sql\nSELECT OBJ_CLASS FROM OBJ_CLASSES WHERE OBJ_CLASS_ID = 10\n```"}]}, {"id": "train-7544", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the object class of the image with a bounding (422, 63, 77, 363)."}, {"from": "gpt", "value": "```sql\nSELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.X = 422 AND T1.Y = 63 AND T1.W = 77 AND T1.H = 363\n```"}]}, {"id": "train-7545", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the caption for the prediction class id 12?"}, {"from": "gpt", "value": "```sql\nSELECT PRED_CLASS FROM PRED_CLASSES WHERE PRED_CLASS_ID = 12\n```"}]}, {"id": "train-7546", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the bounding box of the image 8."}, {"from": "gpt", "value": "```sql\nSELECT X, Y, W, H FROM IMG_OBJ WHERE IMG_ID = 8\n```"}]}, {"id": "train-7547", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many object samples in image no.908 are in the class of tip?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.OBJ_CLASS = 'tip' THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 908\n```"}]}, {"id": "train-7548", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out the number of object samples in image no.41 which are in the class of \"kitchen\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.OBJ_CLASS = 'kitchen' THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 41\n```"}]}, {"id": "train-7549", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the image numbers that contain the \"paint\" object."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'paint'\n```"}]}, {"id": "train-7550", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many samples of clouds are there in the image no.2315533?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.IMG_ID = 2315533 THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'clouds'\n```"}]}, {"id": "train-7551", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which object classes belong to the onion category?"}, {"from": "gpt", "value": "```sql\nSELECT OBJ_CLASS_ID FROM OBJ_CLASSES WHERE OBJ_CLASS = 'onion'\n```"}]}, {"id": "train-7552", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the bounding box of \"spoon\" in image id 1344?"}, {"from": "gpt", "value": "```sql\nSELECT T1.X, T1.Y, T1.W, T1.H FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 1344 AND T2.OBJ_CLASS = 'spoon'\n```"}]}, {"id": "train-7553", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of \"surface\" object samples in image No.2654?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.OBJ_CLASS = 'surface' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OBJ_CLASS_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 2654\n```"}]}, {"id": "train-7554", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images include the \"wood\" objects?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'wood'\n```"}]}, {"id": "train-7555", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the object class of the image with tallest bounding box."}, {"from": "gpt", "value": "```sql\nSELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID ORDER BY T1.H DESC LIMIT 1\n```"}]}, {"id": "train-7556", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of \"airplane\" object class in the table."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.OBJ_CLASS = 'airplane' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.OBJ_CLASS) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID\n```"}]}, {"id": "train-7557", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many samples of animal objects are there in image no.660?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'animal' AND T1.IMG_ID = 660\n```"}]}, {"id": "train-7558", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name number of samples of \"bed\" object are there in the image No.1098?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.OBJ_CLASS = 'bed' THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 1098\n```"}]}, {"id": "train-7559", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the object class of the image with lowest bounding box."}, {"from": "gpt", "value": "```sql\nSELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID ORDER BY T1.H LIMIT 1\n```"}]}, {"id": "train-7561", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which images have more than 20 object samples?"}, {"from": "gpt", "value": "```sql\nSELECT IMG_ID FROM IMG_OBJ GROUP BY IMG_ID HAVING COUNT(IMG_ID) > 20\n```"}]}, {"id": "train-7562", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which object in image 8 is the widest? State its object sample ID."}, {"from": "gpt", "value": "```sql\nSELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 8 ORDER BY W DESC LIMIT 1\n```"}]}, {"id": "train-7563", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the object in image 5 where the object with the coordinate of (634, 468)."}, {"from": "gpt", "value": "```sql\nSELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 5 AND X = 634 AND Y = 468\n```"}]}, {"id": "train-7564", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which object has the highest attribute classes?"}, {"from": "gpt", "value": "```sql\nSELECT OBJ_SAMPLE_ID FROM IMG_OBJ_ATT GROUP BY OBJ_SAMPLE_ID ORDER BY COUNT(OBJ_SAMPLE_ID) DESC LIMIT 1\n```"}]}, {"id": "train-7565", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio between the number of object samples in image 1 and the number of object samples in image 6?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN IMG_ID = 1 THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN IMG_ID = 6 THEN 1 ELSE 0 END) FROM IMG_OBJ\n```"}]}, {"id": "train-7566", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average of object samples for the image."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(OBJ_SAMPLE_ID) AS REAL) / COUNT(DISTINCT IMG_ID) FROM IMG_OBJ\n```"}]}, {"id": "train-7567", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the IDs of images that have objects with the attributes of 'wired'."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.IMG_ID FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.ATT_CLASS = 'wired'\n```"}]}, {"id": "train-7568", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the object classes in image 10."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 10\n```"}]}, {"id": "train-7570", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the prediction class between object class 'chain' and 'label' in image 2360078?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T2.PRED_CLASS_ID = T1.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T1.IMG_ID = T3.IMG_ID AND T1.OBJ1_SAMPLE_ID = T3.OBJ_SAMPLE_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T1.IMG_ID = 2360078 AND T1.OBJ1_SAMPLE_ID = 15 OR T1.OBJ2_SAMPLE_ID = 18\n```"}]}, {"id": "train-7571", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have objects with the attributes of polka dot?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.OBJ_SAMPLE_ID) FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.ATT_CLASS = 'polka dot'\n```"}]}, {"id": "train-7572", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the attributes of the widest object in image 400?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T2.IMG_ID = 400 ORDER BY T3.W DESC LIMIT 1\n```"}]}, {"id": "train-7573", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of the object class that has in most images."}, {"from": "gpt", "value": "```sql\nSELECT OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID GROUP BY T2.OBJ_CLASS ORDER BY COUNT(T1.OBJ_CLASS_ID) DESC LIMIT 1\n```"}]}, {"id": "train-7574", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the width and height of the object with the class of 'van' in image 1."}, {"from": "gpt", "value": "```sql\nSELECT T1.H, T1.W FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 1 AND T2.OBJ_CLASS = 'van'\n```"}]}, {"id": "train-7575", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the coordinate of X and Y for the object with the attribute of 'sparse' in image 1."}, {"from": "gpt", "value": "```sql\nSELECT T3.OBJ_SAMPLE_ID, T3.X, T3.Y FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T3.IMG_ID = 1 AND T1.ATT_CLASS = 'sparse'\n```"}]}, {"id": "train-7576", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of object samples that are related to street lights."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.OBJ_CLASS = 'street lights' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OBJ_SAMPLE_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID\n```"}]}, {"id": "train-7577", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Based on image 5, what is the percentage of images that belong windows object class?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.OBJ_SAMPLE_ID) AS REAL) * 100 / COUNT(CASE WHEN T1.IMG_ID = 5 THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'windows'\n```"}]}, {"id": "train-7578", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have an x-coordinate of 5 and y-coordinate of 5?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE X = 5 AND Y = 5\n```"}]}, {"id": "train-7579", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have less than 15 object samples?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE OBJ_SAMPLE_ID < 15\n```"}]}, {"id": "train-7580", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have a total of 10 attribute classes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE OBJ_CLASS_ID = 10\n```"}]}, {"id": "train-7581", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ID of all images with objects that have multiple relations."}, {"from": "gpt", "value": "```sql\nSELECT IMG_ID FROM IMG_REL GROUP BY PRED_CLASS_ID HAVING COUNT(DISTINCT OBJ1_SAMPLE_ID) != 0 AND COUNT(DISTINCT OBJ2_SAMPLE_ID) != 0\n```"}]}, {"id": "train-7582", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have \"vegetable\" and \"fruits\" as their object classes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'vegetables' OR T2.OBJ_CLASS = 'fruits'\n```"}]}, {"id": "train-7583", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the image ID with a predicted class of \"parked on\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.IMG_ID FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.PRED_CLASS = 'parked on'\n```"}]}, {"id": "train-7584", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the object classes of the images that have a (5,5) coordinate."}, {"from": "gpt", "value": "```sql\nSELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.X = 5 AND T1.Y = 5\n```"}]}, {"id": "train-7585", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have \"keyboard\" as their object class?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'keyboard'\n```"}]}, {"id": "train-7586", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the width and height of the bounding box of the object with \"keyboard\" as their object class and (5, 647) as their coordinate?"}, {"from": "gpt", "value": "```sql\nSELECT T1.W, T1.H FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'keyboard' AND T1.X = 5 AND T1.Y = 647\n```"}]}, {"id": "train-7587", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the ID of the images that have an attribute class of \"horse\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.IMG_ID FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.ATT_CLASS = 'horse'\n```"}]}, {"id": "train-7588", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the x-coordinate and y-coordinate of the image with an attribute class of ''horse\" and an object class of \"fur\"."}, {"from": "gpt", "value": "```sql\nSELECT T3.X, T3.Y FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T1.ATT_CLASS = 'horse' AND T4.OBJ_CLASS = 'fur'\n```"}]}, {"id": "train-7589", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the attribute classes of the image ID \"15\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.IMG_ID = 15\n```"}]}, {"id": "train-7590", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For those objects that have multiple relations, how many images have a prediction class of \"reading\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.IMG_ID) FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.PRED_CLASS = 'reading'\n```"}]}, {"id": "train-7591", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have \"picture\" as their attribute class?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.IMG_ID) FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.ATT_CLASS = 'picture'\n```"}]}, {"id": "train-7592", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many images have \"picture\" as their attribute class and \"bear\" as their object class?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.IMG_ID) FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T1.ATT_CLASS = 'picture' AND T4.OBJ_CLASS = 'bear'\n```"}]}, {"id": "train-7593", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the attribute classes of the images that have a (5,5) coordinate."}, {"from": "gpt", "value": "```sql\nSELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T3.X = 5 AND T3.Y = 5\n```"}]}, {"id": "train-7594", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of images with an attribute class of \"keyboard\"."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.IMG_ID) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'keyboard'\n```"}]}, {"id": "train-7595", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the ratio of the total number of images with an object class of \"man\" and \"person\"."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.OBJ_CLASS = 'man' THEN 1 ELSE 0 END) AS REAL) / COUNT(CASE WHEN T2.OBJ_CLASS = 'person' THEN 1 ELSE 0 END) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID\n```"}]}, {"id": "train-7596", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the object sample IDs of image ID 17 with coordinates (0,0)."}, {"from": "gpt", "value": "```sql\nSELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 17 AND X = 0 AND Y = 0\n```"}]}, {"id": "train-7597", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all bounding box widths and heights of object sample ID 2."}, {"from": "gpt", "value": "```sql\nSELECT W, H FROM IMG_OBJ WHERE OBJ_SAMPLE_ID = 2\n```"}]}, {"id": "train-7598", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the Y coordinate of image ID 12, how many are 0?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE IMG_ID = 12 AND Y = 0\n```"}]}, {"id": "train-7599", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the attribute classes of image ID 22."}, {"from": "gpt", "value": "```sql\nSELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.IMG_ID = 22\n```"}]}, {"id": "train-7600", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the object classes of image ID 36 with coordinates (0,0)."}, {"from": "gpt", "value": "```sql\nSELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 36 AND T1.X = 0 AND T1.Y = 0\n```"}]}, {"id": "train-7601", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write 10 coordinates with the object class \"pizza.\""}, {"from": "gpt", "value": "```sql\nSELECT T1.IMG_ID, T1.X, T1.Y FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'pizza' LIMIT 10\n```"}]}, {"id": "train-7602", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What object class is in the X and Y coordinates of 126 and 363?"}, {"from": "gpt", "value": "```sql\nSELECT T1.IMG_ID, T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.X = 126 AND T1.Y = 363\n```"}]}, {"id": "train-7603", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common object class of image ID 56?"}, {"from": "gpt", "value": "```sql\nSELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 56 GROUP BY T2.OBJ_CLASS ORDER BY COUNT(T2.OBJ_CLASS_ID) DESC LIMIT 1\n```"}]}, {"id": "train-7604", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the object classes of image ID 22 alongside the object's width and height."}, {"from": "gpt", "value": "```sql\nSELECT T1.W, T1.H, T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 22\n```"}]}, {"id": "train-7605", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the predicate class of image ID 68?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 68\n```"}]}, {"id": "train-7606", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 'has' predicate classes does image ID 107 have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.PRED_CLASS) FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 107 AND T2.PRED_CLASS = 'has'\n```"}]}, {"id": "train-7607", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the most common predicate class of image ID 4434."}, {"from": "gpt", "value": "```sql\nSELECT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 4434 ORDER BY T2.PRED_CLASS DESC LIMIT 1\n```"}]}, {"id": "train-7608", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the number of 'dress' object classes and include their X and Y coordinates in image ID 1764."}, {"from": "gpt", "value": "```sql\nSELECT T1.X, T1.Y FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 1764 AND T2.OBJ_CLASS = 'dress'\n```"}]}, {"id": "train-7609", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the X and Y coordinates of the sample object of image ID 23 that has the 'cast' attribute class."}, {"from": "gpt", "value": "```sql\nSELECT T3.OBJ_SAMPLE_ID, T3.X, T3.Y FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T3.IMG_ID = 23 AND T1.ATT_CLASS = 'cast'\n```"}]}, {"id": "train-7610", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many 'blue' attribute classes are there on image ID 2355735?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ATT_CLASS) FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.IMG_ID = 2355735 AND T1.ATT_CLASS = 'blue'\n```"}]}, {"id": "train-7611", "db_id": "image_and_language", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average width and height of the objects in image ID 47? List their object classes as well."}, {"from": "gpt", "value": "```sql\nSELECT T2.OBJ_CLASS, AVG(T1.W), AVG(T1.H) FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 47 GROUP BY T2.OBJ_CLASS\n```"}]}, {"id": "train-7612", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the first Name and last name of all players not from USA and who are born in 1990 ."}, {"from": "gpt", "value": "```sql\nSELECT firstName, lastName FROM Master WHERE birthYear = 1990 AND birthCountry != 'USA'\n```"}]}, {"id": "train-7613", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all players' given name who are good at both left and right hand and playing the forward position."}, {"from": "gpt", "value": "```sql\nSELECT nameGiven FROM Master WHERE shootCatch IS NULL AND pos = 'F'\n```"}]}, {"id": "train-7614", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the players who were not in the Hall of Fame list."}, {"from": "gpt", "value": "```sql\nSELECT firstName, lastName FROM Master WHERE hofID IS NULL\n```"}]}, {"id": "train-7615", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the youngest player who is still living. State the given name and date of birth."}, {"from": "gpt", "value": "```sql\nSELECT nameGiven , nameGiven , birthYear, birthMon, birthDay FROM Master WHERE deathYear IS NULL ORDER BY birthYear DESC, birthMon DESC, birthday DESC LIMIT 1\n```"}]}, {"id": "train-7616", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the deceased players who are good at both left and right hand, list the player's name and the age when he died."}, {"from": "gpt", "value": "```sql\nSELECT firstName, lastName, deathYear - birthYear FROM Master WHERE shootCatch IS NULL AND deathYear IS NOT NULL\n```"}]}, {"id": "train-7617", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the goalies who played for more than two teams from Year 2000 to 2005."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year >= 2000 AND T2.year <= 2005 GROUP BY T2.playerID HAVING COUNT(DISTINCT T2.tmID) > 2\n```"}]}, {"id": "train-7618", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average weight of players who have height greater than 72 inches."}, {"from": "gpt", "value": "```sql\nSELECT AVG(weight) FROM Master WHERE height > 72\n```"}]}, {"id": "train-7619", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the goalies who have played more than total of 5000 minutes in the all the season played. State given name of the player and from which country was he born."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.nameGiven, T1.birthCountry FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID GROUP BY T1.nameGiven, T1.birthCountry HAVING SUM(T2.Min) > 5000\n```"}]}, {"id": "train-7620", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the goaltenders who had played in both PCHA and NHL league."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.lgID IN ('PCHA', 'NHL') GROUP BY T2.playerID HAVING COUNT(DISTINCT T2.lgID) > 1\n```"}]}, {"id": "train-7621", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all deceased goalies by last name. List the season where he had the most time played."}, {"from": "gpt", "value": "```sql\nSELECT T1.playerID, T2.year, Min FROM Master AS T1 INNER JOIN Goalies AS T2 ON T2.playerID = T1.playerID WHERE T1.deathYear IS NOT NULL ORDER BY T2.Min DESC LIMIT 1\n```"}]}, {"id": "train-7622", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all goalies from year 2000 to 2010 for team COL. State their given name, height, weight and age of today."}, {"from": "gpt", "value": "```sql\nSELECT T1.nameGiven, T1.height , T1.weight, STRFTIME('%Y', CURRENT_TIMESTAMP) - birthYear FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'COL' AND T2.year >= 2000 AND T2.year <= 2010 GROUP BY T1.playerID\n```"}]}, {"id": "train-7623", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all goalies with 10 or more empty net goals. Name the players and season where he played."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName , T2.year FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.ENG >= 10\n```"}]}, {"id": "train-7624", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the goalie who has the lowest percentage of goals against among all the shots against recorded. Name the players and season where he played."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName, T2.year FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE CAST(T2.GA AS REAL) / T2.SA IS NOT NULL ORDER BY CAST(T2.GA AS REAL) / T2.SA LIMIT 1\n```"}]}, {"id": "train-7625", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all goalies who played in the year 2005 season and shorter than 72 inches. List all the team names he play for."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.firstName, T1.lastName, T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.tmID = T3.tmID WHERE T2.year = 2005 AND T1.height < 72\n```"}]}, {"id": "train-7626", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the nick name of player ID 'aubinje01'. List all the teams and season he played for."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.nameNick, T3.year, T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.tmID = T3.tmID WHERE T1.playerID = 'aubinje01'\n```"}]}, {"id": "train-7627", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the goalies with the most seasons played. State the average time he played for each season."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName, T2.year, AVG(T2.Min) FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T1.playerID = ( SELECT playerID FROM Goalies GROUP BY playerID ORDER BY COUNT(playerID) DESC LIMIT 1 ) GROUP BY T1.firstName, T1.lastName, T2.year\n```"}]}, {"id": "train-7628", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.firstName, T1.lastName, T2.year FROM Master AS T1 INNER JOIN ( SELECT playerID, year FROM Goalies WHERE CAST(SHO AS REAL) / GA > 0.05 ) AS T2 ON T2.playerID = T1.playerID\n```"}]}, {"id": "train-7629", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the deceased players whose death country is different from his birth country order by birth year."}, {"from": "gpt", "value": "```sql\nSELECT firstName, lastName FROM Master WHERE birthCountry != deathCountry ORDER BY birthYear\n```"}]}, {"id": "train-7630", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the players played both in NHL and WHA. List the given name and first year they were in NHL and first year in WHA."}, {"from": "gpt", "value": "```sql\nSELECT nameGiven, firstNHL, firstWHA FROM Master WHERE firstNHL IS NOT NULL AND firstWHA IS NOT NULL\n```"}]}, {"id": "train-7631", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the living players who have two positions. State their given name the position they play."}, {"from": "gpt", "value": "```sql\nSELECT firstName, lastName, pos FROM Master WHERE deathYear IS NULL AND pos LIKE '%/%'\n```"}]}, {"id": "train-7632", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the nick name of the tallest player? If the player had left NHL, mention the last season he was with NHL."}, {"from": "gpt", "value": "```sql\nSELECT nameNick, lastNHL FROM Master ORDER BY height DESC LIMIT 1\n```"}]}, {"id": "train-7633", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average height of player who were born in 1990 and after? Compare the average height with players who were born before 1990."}, {"from": "gpt", "value": "```sql\nSELECT AVG(IIF(birthYear < 1990, height, NULL)) - AVG(IIF(birthYear >= 1990, height, NULL)) FROM Master\n```"}]}, {"id": "train-7634", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the goalies who are good at left hand and also has become a coach after retirement. Name all teams he had played before."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT firstName, lastName, T3.name FROM Goalies AS T1 INNER JOIN Master AS T2 ON T2.playerID = T1.playerID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T1.playerID IS NOT NULL AND T2.coachID IS NOT NULL AND T2.shootCatch = 'L' AND T2.pos = 'G'\n```"}]}, {"id": "train-7635", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the deceased goalies and the teams he had played whose birth country was in Canada."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT firstName, lastName, T3.name FROM Goalies AS T1 INNER JOIN Master AS T2 ON T2.playerID = T1.playerID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T2.birthCountry = 'Canada' AND T2.deathYear IS NOT NULL AND T2.pos = 'G'\n```"}]}, {"id": "train-7636", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the goalies and season they played when Boston Bruins won number 1 in rank."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName, T3.year FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.year = T3.year AND T2.tmID = T3.tmID WHERE T1.deathYear IS NOT NULL AND T3.name = 'Boston Bruins' AND T3.rank = 1 AND T1.pos = 'G'\n```"}]}, {"id": "train-7637", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all goalies who are still alive, whose first season in NHL in before 1950. List the team names they were in."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.lgID = T3.lgID AND T2.year = T3.year WHERE T1.deathYear IS NOT NULL AND T1.firstNHL < 1950\n```"}]}, {"id": "train-7638", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all players who becomes coach after retirement, state the given name of coach and which teams and years did they coach?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.nameGiven, T3.name, T3.year FROM Coaches AS T1 INNER JOIN Master AS T2 ON T2.coachID = T1.coachID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T2.playerID IS NOT NULL AND T2.coachID IS NOT NULL\n```"}]}, {"id": "train-7639", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches who was never a player, who has highest percentage of game winning? Provide the given name of the coach and team he coached."}, {"from": "gpt", "value": "```sql\nSELECT T2.nameGiven, T3.name FROM Coaches AS T1 INNER JOIN Master AS T2 ON T2.coachID = T1.coachID INNER JOIN Teams AS T3 ON T1.lgID = T3.lgID WHERE T1.coachID IS NOT NULL ORDER BY CAST(T1.w AS REAL) / T1.g DESC LIMIT 1\n```"}]}, {"id": "train-7640", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which coach has the best performance for team DET in history? What was the winning percentage? Name the coach and the year he coached."}, {"from": "gpt", "value": "```sql\nSELECT CAST(T2.W AS REAL) / T2.G, T1.firstName, T1.lastName, T2.year FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID INNER JOIN ( SELECT coachID FROM Coaches ORDER BY CAST(w AS REAL) / g DESC LIMIT 1 ) AS T3 ON T2.coachID = T3.coachID\n```"}]}, {"id": "train-7641", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the coach who had coached the the most seasons in MTL? State his given name, date of birth and all teams he had coaches before."}, {"from": "gpt", "value": "```sql\nSELECT T2.nameGiven , T2.birthYear, T2.birthMon, T2.birthDay, T3.name FROM Goalies AS T1 INNER JOIN Master AS T2 ON T2.playerID = T1.playerID INNER JOIN Teams AS T3 ON T3.lgID = T1.lgID WHERE T3.tmID = 'MTL' GROUP BY T2.nameGiven, T2.birthYear, T2.birthMon, T2.birthDay, T3.name ORDER BY COUNT(T2.coachID) DESC LIMIT 1\n```"}]}, {"id": "train-7642", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all goalies with more lost than won games for two seasons or more. State the name of the player and team he played."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.firstName, T1.lastName, T3.name FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T2.year = T3.year AND T2.tmID = T3.tmID WHERE T1.pos = 'G' AND T2.L > T2.W GROUP BY T1.firstName, T1.lastName, T3.name HAVING COUNT(T3.year) > 2\n```"}]}, {"id": "train-7643", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the goalies born in year 1987, who are good in both right hand and left hand? Calculate his percentage of winning for every season he played."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName, T2.year, CAST(T2.W AS REAL) / T2.GP FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T1.birthYear = 1987 AND T1.shootCatch IS NULL\n```"}]}, {"id": "train-7644", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is given name for player 'aebisda01'. Calculate the average time in minutes for the all his games played as goaltender."}, {"from": "gpt", "value": "```sql\nSELECT T1.nameGiven, CAST(SUM(T2.Min) AS REAL) / SUM(T2.GP) FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T1.playerID = 'aebisda01' GROUP BY T1.nameGiven\n```"}]}, {"id": "train-7645", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all living goalies who have greater than 50% wins among all games played. State their last name and first name."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T1.deathYear IS NOT NULL GROUP BY T1.playerID HAVING CAST(SUM(T2.Min) AS REAL) / SUM(T2.GP) > 0.5\n```"}]}, {"id": "train-7646", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players and coaches are awarded after death?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(note) FROM AwardsMisc WHERE note IS NOT NULL\n```"}]}, {"id": "train-7647", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who won an award in the year 1983, how many of them play the position of goalie?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(playerID) FROM AwardsPlayers WHERE pos = 'G' AND year = 1983\n```"}]}, {"id": "train-7648", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many coaches worked a temporary term in the year 2007?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(coachID) FROM Coaches WHERE year = 2007 AND notes = 'interim'\n```"}]}, {"id": "train-7649", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shoutouts are there in the regular season of 1977?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(year) FROM CombinedShutouts WHERE year = 1977 AND `R/P` = 'R'\n```"}]}, {"id": "train-7650", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teams scored against their opponent who had pulled their goalie in the year 2005?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(tmID) FROM Goalies WHERE year = 2005 AND ENG IS NULL\n```"}]}, {"id": "train-7651", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the years in which the NHL League had shots recorded while the goalie was on the ice."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT year FROM Goalies WHERE lgID = 'NHL' AND SA IS NOT NULL\n```"}]}, {"id": "train-7652", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teams have the same total number of postseason wins and postseason loses?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT COUNT(tmID) FROM Goalies WHERE PostW = PostL\n```"}]}, {"id": "train-7653", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the name of the person who was in the Hall of Fame in the year 1978."}, {"from": "gpt", "value": "```sql\nSELECT name FROM HOF WHERE year = 1978\n```"}]}, {"id": "train-7654", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people were in the Hall of Fame's Builder category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(hofID) FROM HOF WHERE category = 'Builder'\n```"}]}, {"id": "train-7655", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the people who got into the Hall of Fame after the year 1980, how many of them belong to the category of \"Player\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(hofID) FROM HOF WHERE year > 1980 AND category = 'Player'\n```"}]}, {"id": "train-7656", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the Nicknames of the players who got in the Hall of Fame in 2007."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.nameNick FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T2.year = 2007\n```"}]}, {"id": "train-7657", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Did the tallest player got in the Hall of Fame? If yes, please list the year when he got in the Hall of Fame."}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN T1.hofID IS NULL THEN 'NO' ELSE T2.year END FROM Master AS T1 LEFT JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.height = ( SELECT MAX(height) FROM Master )\n```"}]}, {"id": "train-7658", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the awards the coaches who are born in Canada have won."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.award FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.birthCountry = 'Canada'\n```"}]}, {"id": "train-7659", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches whose team has over 30 wins in a year, how many of them are born in the USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.coachID) FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.W > 30 AND T1.birthCountry = 'USA'\n```"}]}, {"id": "train-7660", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches who have taught teams from the NHL League, how many of them are from Canada?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.coachID) FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.lgID = 'NHL' AND T1.birthCountry = 'Canada'\n```"}]}, {"id": "train-7661", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the awards won by coaches who were born in 1952."}, {"from": "gpt", "value": "```sql\nSELECT T2.award FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.birthYear = 1952\n```"}]}, {"id": "train-7662", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches who have received an award in 1940, how many of them are born in Toronto?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.coachID) FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 1940 AND T1.birthCity = 'Toronto'\n```"}]}, {"id": "train-7663", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches who have received an award after the year 1940, how many of them have already died?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.coachID) FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.deathYear IS NOT NULL AND T2.year > 1940\n```"}]}, {"id": "train-7664", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the awards won by coaches who taught the NHL League and have already died."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.award FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.deathYear IS NOT NULL AND T2.lgID = 'NHL'\n```"}]}, {"id": "train-7665", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches who have gotten in the Hall of Fame, how many of them have a weight of over 195?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.coachID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.weight > 195\n```"}]}, {"id": "train-7666", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the first name of the players who are good at both left hands and right hands for goalie and have gotten in the Hall of Fame."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.shootCatch IS NULL\n```"}]}, {"id": "train-7667", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who became coaches, how many of them have gotten in the Hall of Fame?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.playerID IS NOT NULL AND T1.coachID IS NOT NULL\n```"}]}, {"id": "train-7668", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the birth cities of the players who have won an award in the year 1970."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.birthCity FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1970\n```"}]}, {"id": "train-7669", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players born in Toronto have won the All-Rookie award?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'All-Rookie' AND T1.birthCity = 'Toronto'\n```"}]}, {"id": "train-7670", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who have won the All-Rookie award, how many of them have died?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'All-Rookie' AND T1.deathYear IS NOT NULL\n```"}]}, {"id": "train-7671", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who died in Massachussets, how many of them have won an award?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.deathState = 'MA'\n```"}]}, {"id": "train-7672", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the awards the players who died in Arlington have won."}, {"from": "gpt", "value": "```sql\nSELECT T2.award FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.deathCity = 'Kemptville'\n```"}]}, {"id": "train-7673", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the nicknames of the players who have won the All-Rookie award and are born in March."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.nameNick FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'All-Rookie' AND T1.birthMon = 3\n```"}]}, {"id": "train-7674", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who were born in July and August, how many of them got in the Hall of Fame?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.birthMon IN (7, 8)\n```"}]}, {"id": "train-7675", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which month was the player who has won the most awards born?"}, {"from": "gpt", "value": "```sql\nSELECT T1.birthMon FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID GROUP BY T2.playerID ORDER BY COUNT(T2.award) DESC LIMIT 1\n```"}]}, {"id": "train-7676", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Players born in which year have received the most awards in total?"}, {"from": "gpt", "value": "```sql\nSELECT T1.birthYear FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID GROUP BY T1.birthYear ORDER BY COUNT(T2.award) DESC LIMIT 1\n```"}]}, {"id": "train-7677", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is the most award-winning player from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.birthCountry FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID GROUP BY T1.birthCountry ORDER BY COUNT(T2.award) DESC LIMIT 1\n```"}]}, {"id": "train-7678", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the most players in the Hall of Fame?"}, {"from": "gpt", "value": "```sql\nSELECT T1.birthCountry FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID GROUP BY T1.birthCountry ORDER BY COUNT(T1.playerID) DESC LIMIT 1\n```"}]}, {"id": "train-7679", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the positions of the players who were born in Canada and have won the All-Rookie award."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.pos FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCountry = 'Canada' AND T2.award = 'All-Rookie'\n```"}]}, {"id": "train-7680", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average BMI of all the coaches who have gotten in the Hall of Fame?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.weight / (T1.height * T1.height)) / COUNT(T1.coachID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID\n```"}]}, {"id": "train-7681", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of American players among all the players who have gotten in the Hall of Fame?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.birthCountry = 'USA' THEN T1.playerID ELSE NULL END) AS REAL) * 100 / COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID\n```"}]}, {"id": "train-7682", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many years did player Id \"healygl01\" play?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(year) FROM Goalies WHERE playerID = 'healygl01'\n```"}]}, {"id": "train-7683", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team did player Id \"roypa01\" play in 1992? Give the team id."}, {"from": "gpt", "value": "```sql\nSELECT tmID FROM Goalies WHERE playerID = 'roypa01' AND year = 1992\n```"}]}, {"id": "train-7684", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the total number of the games that player Id \"rutlewa01\" played in 1967?"}, {"from": "gpt", "value": "```sql\nSELECT GP FROM Goalies WHERE playerID = 'rutlewa01' AND year = 1967\n```"}]}, {"id": "train-7685", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show me how many minutes player Id \"valiqst01\" played in the game in 2007 season."}, {"from": "gpt", "value": "```sql\nSELECT Min FROM Goalies WHERE playerID = 'valiqst01' AND year = 2007\n```"}]}, {"id": "train-7686", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games did player Id \"vanbijo01\" win in the 1990 season?"}, {"from": "gpt", "value": "```sql\nSELECT W FROM Goalies WHERE playerID = 'vanbijo01' AND year = 1990\n```"}]}, {"id": "train-7687", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In how many games did player Id \"vernomi01\" end up with a tie or an overtime loss in the 1998 season?"}, {"from": "gpt", "value": "```sql\nSELECT `T/OL` FROM Goalies WHERE playerID = 'vernomi01' AND year = 1998\n```"}]}, {"id": "train-7688", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the coach who won Second Team All-Star in 1933, how many wins did he have that year?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.W) FROM Coaches AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 1933 AND T2.award = 'Second Team All-Star'\n```"}]}, {"id": "train-7689", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Did legendsID \"P194502\" personally attend his Hall of Fame dedication?"}, {"from": "gpt", "value": "```sql\nSELECT IIF(T1.note = 'posthumous', 'YES', 'NO') FROM AwardsMisc AS T1 RIGHT JOIN Master AS T2 ON T1.ID = T2.playerID WHERE T2.legendsID = 'P194502'\n```"}]}, {"id": "train-7690", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which position did Mike Antonovich play?"}, {"from": "gpt", "value": "```sql\nSELECT T1.pos FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.firstName = 'Mike' AND T1.lastName = 'Antonovich'\n```"}]}, {"id": "train-7691", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the coach who co-coached with Dave Lewis in 1998, where was his birth place?"}, {"from": "gpt", "value": "```sql\nSELECT T1.birthCountry FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 1998 AND T2.notes = 'co-coach with Dave Lewis'\n```"}]}, {"id": "train-7692", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which player who showed as the third goalie in a game has the biggest weight? Give the full name of the player."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.stint = 3 ORDER BY T1.weight DESC LIMIT 1\n```"}]}, {"id": "train-7693", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who had 10 empty net goals in their career, who is the tallest? Show his full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID GROUP BY T2.playerID, T1.height HAVING SUM(T2.ENG) > 10 ORDER BY T1.height DESC LIMIT 1\n```"}]}, {"id": "train-7694", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the goalie who had the most shutouts in 2010, what's his catching hand?"}, {"from": "gpt", "value": "```sql\nSELECT T1.shootCatch FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 2010 GROUP BY T2.playerID ORDER BY SUM(T2.SHO) DESC LIMIT 1\n```"}]}, {"id": "train-7695", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the youngest goalie among those who had more than 150 goal againsts in 2002 season?"}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 2002 AND T2.GA > 150 GROUP BY T2.playerID, T1.birthYear, T1.birthMon, T1.birthMon HAVING SUM(T2.GA) ORDER BY T1.birthYear DESC, T1.birthMon DESC, SUM(T1.birthDay) DESC LIMIT 1\n```"}]}, {"id": "train-7696", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the history of team id NJD, which goalie saved the most goal attempts? Give his full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.tmID = 'NJD' GROUP BY T2.playerID ORDER BY SUM(T2.SA - T2.GA) DESC LIMIT 1\n```"}]}, {"id": "train-7697", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which teams had the most postseason empty net goals in 2010 season? List their team names."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM Goalies AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID WHERE T1.year = 2010 GROUP BY T2.name ORDER BY SUM(PostENG) DESC LIMIT 1\n```"}]}, {"id": "train-7698", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the team which had the most postseason shutouts in 1995, how many points did they have that year?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.SHO) FROM Scoring AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1995 GROUP BY T2.tmID ORDER BY SUM(T2.PostSHO) DESC LIMIT 1\n```"}]}, {"id": "train-7699", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which coach had the highest winning rates in the 2009 season? What's coach's nickname."}, {"from": "gpt", "value": "```sql\nSELECT T2.coachID, T1.nameNick FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 2009 ORDER BY CAST(T2.W AS REAL) / (T2.W + T2.L) DESC LIMIT 1\n```"}]}, {"id": "train-7700", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the team had the biggest power play percentage in 2011, who was their coach that season? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.coachID FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID WHERE T2.year = 2011 ORDER BY CAST(T2.PPG AS REAL) / T2.PPC DESC LIMIT 1\n```"}]}, {"id": "train-7701", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the Stanley Cup finals history, how many games did player id \"broadpu01\" play in 1922?"}, {"from": "gpt", "value": "```sql\nSELECT GP FROM ScoringSC WHERE playerID = 'broadpu01' AND YEAR = 1922\n```"}]}, {"id": "train-7702", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many years did player Id \"cleghsp01\" make to the Stanley Cup finals?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(year) FROM ScoringSC WHERE playerID = 'cleghsp01'\n```"}]}, {"id": "train-7703", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the number of goals did player Id \"dyeba01\" make in the 1921 Stanley Cup finals?"}, {"from": "gpt", "value": "```sql\nSELECT G FROM ScoringSC WHERE playerID = 'dyeba01' AND year = 1921\n```"}]}, {"id": "train-7704", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who made the most assists in a single game in the Stanley Cup finals ?"}, {"from": "gpt", "value": "```sql\nSELECT playerID FROM ScoringSC ORDER BY A DESC LIMIT 1\n```"}]}, {"id": "train-7705", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which league did player id\"adamsja01\" play in 1920?"}, {"from": "gpt", "value": "```sql\nSELECT lgID FROM ScoringSC WHERE playerID = 'adamsja01' AND year = 1920\n```"}]}, {"id": "train-7706", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What position did player id \"hartgi01\" play in his Stanley Cup finals performance?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT pos FROM ScoringSC WHERE playerID = 'hartgi01'\n```"}]}, {"id": "train-7707", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the team which had three different goalies in the 2011 postseason games, how many games did they win in the regular season?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.W) FROM Goalies AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID WHERE T2.year = 2011 GROUP BY T1.tmID HAVING COUNT(DISTINCT T1.playerID) = 3\n```"}]}, {"id": "train-7708", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year was the goalie who had the most postseaon shots Against in 2008 born?"}, {"from": "gpt", "value": "```sql\nSELECT T1.birthYear FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 2008 ORDER BY T2.PostSA DESC LIMIT 1\n```"}]}, {"id": "train-7709", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many years were there after Don Waddell retired and became a coach in NHL?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.year) - MIN(T2.year) FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T1.firstName = 'Don' AND T1.lastName = 'Waddell'\n```"}]}, {"id": "train-7710", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which is the catching hand for the goaltender who had the most shutouts in 1996?"}, {"from": "gpt", "value": "```sql\nSELECT T1.shootCatch FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1996 ORDER BY T2.SHO DESC LIMIT 1\n```"}]}, {"id": "train-7711", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the birthday for the goalie who had most goal againsts in 1965 season?"}, {"from": "gpt", "value": "```sql\nSELECT T1.birthYear, T1.birthMon, birthDay FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1965 ORDER BY T2.GA DESC LIMIT 1\n```"}]}, {"id": "train-7712", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For he who had the highest plus / minus on the court in the 1981 season, what's his full name?"}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1981 GROUP BY T2.playerID ORDER BY SUM(T2.`+/-`) DESC LIMIT 1\n```"}]}, {"id": "train-7713", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the weight of the player who had the most Power Play Goals in the 21st century?"}, {"from": "gpt", "value": "```sql\nSELECT T1.weight FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T2.year > 2000 GROUP BY T1.playerID, T1.weight ORDER BY SUM(T2.PPG) DESC LIMIT 1\n```"}]}, {"id": "train-7714", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the player who scored 7 shorthanded goals in 1989, what's his dominant hand?"}, {"from": "gpt", "value": "```sql\nSELECT T1.shootCatch FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1989 GROUP BY T2.playerID HAVING SUM(T2.SHG) = 7\n```"}]}, {"id": "train-7715", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the most clutch player in 1986? Give his full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1986 GROUP BY T2.playerID ORDER BY SUM(T2.GWG) DESC LIMIT 1\n```"}]}, {"id": "train-7716", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many shots on goal did Cam Neely had in the year of 1990?"}, {"from": "gpt", "value": "```sql\nSELECT T2.SOG FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T1.firstName = 'Cam' AND T1.lastName = 'Neely' AND T2.year = '1990'\n```"}]}, {"id": "train-7717", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the coach for the team which had the most bench minors penalty in 2003\uff1f"}, {"from": "gpt", "value": "```sql\nSELECT 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 ORDER BY SUM(T1.BenchMinor) DESC LIMIT 1\n```"}]}, {"id": "train-7718", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the goalies whose weight are above 190, who had most goal againsts in 1978 season?"}, {"from": "gpt", "value": "```sql\nSELECT T1.playerID FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = '1978' AND T2.weight > 190 ORDER BY T1.GA DESC LIMIT 1\n```"}]}, {"id": "train-7719", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of winning rate of improvement since Alain Vigneault became the coach of Vancouver Canucks in 2006 season?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.year = 2006 THEN CAST(T1.W AS REAL) * 100 / (T1.W + T1.L) ELSE 0 END) - ( SELECT CAST(W AS REAL) * 100 / (W + L) FROM Teams WHERE year = '2005' AND name = 'Vancouver Canucks' ) 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.name = 'Vancouver Canucks' AND T3.firstName = 'Alain' AND T3.lastName = 'Vigneault'\n```"}]}, {"id": "train-7720", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the goalie who had the highest defensive success rate in the postseason of 2011, what's his legends ID ?"}, {"from": "gpt", "value": "```sql\nSELECT T2.legendsID FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2011 ORDER BY 1 - CAST(T1.PostGA AS REAL) / T1.PostSA DESC LIMIT 1\n```"}]}, {"id": "train-7721", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many former athletes go on to become coaches after retiring?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(playerID) FROM Master WHERE playerID IS NOT NULL AND coachID IS NOT NULL\n```"}]}, {"id": "train-7722", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the teams with the most number of ties, how many penalty was committed by a player or coach that is not on the ice? Indicate the name of the team."}, {"from": "gpt", "value": "```sql\nSELECT BenchMinor, name FROM Teams ORDER BY T DESC LIMIT 1\n```"}]}, {"id": "train-7723", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which NHL award was most frequently won by the coach with the most wins?"}, {"from": "gpt", "value": "```sql\nSELECT award FROM Teams AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.lgID = T2.lgID WHERE T1.lgID = 'NHL' GROUP BY T2.coachID, T2.award ORDER BY COUNT(T2.award) DESC LIMIT 1\n```"}]}, {"id": "train-7724", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the power play percentage of the team with the most number of loses?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(PPG) AS REAL) * 100 / SUM(PPC) FROM Teams GROUP BY tmID ORDER BY SUM(L) DESC LIMIT 1\n```"}]}, {"id": "train-7725", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players were included in the Hall of Fame on average between 1950 and 1980?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(name) AS REAL) / 30 FROM HOF WHERE year BETWEEN 1950 AND 1980 AND category = 'Player'\n```"}]}, {"id": "train-7726", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country produced the most number of hockey players? Identify which year was most of the hockey players are born."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT birthCountry, birthYear FROM Master GROUP BY birthCountry, birthYear ORDER BY COUNT(birthCountry) DESC LIMIT 1\n```"}]}, {"id": "train-7727", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many wins does the team have whose goaltender have the most number of successfully stopping the other team from scoring during the entire game?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(W) FROM Goalies GROUP BY tmID ORDER BY SUM(SHO) DESC LIMIT 1\n```"}]}, {"id": "train-7728", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team recorded the most number of road victories in 2005? Indicate the team ID."}, {"from": "gpt", "value": "```sql\nSELECT tmID FROM TeamSplits WHERE YEAR = '2005' ORDER BY rW DESC LIMIT 1\n```"}]}, {"id": "train-7729", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the position of the 9th oldest hockey player?"}, {"from": "gpt", "value": "```sql\nSELECT pos FROM Master WHERE birthYear IS NOT NULL ORDER BY birthYear, birthMon, birthDay LIMIT 8\n```"}]}, {"id": "train-7730", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many goals were scored while the goalkeeper was on the ice in the 1924 WCHL by the goalie with the most goals scored?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(PostGA) FROM Goalies WHERE lgID = 'WCHL' AND year = '1924' GROUP BY playerID ORDER BY SUM(PostGA) DESC LIMIT 1\n```"}]}, {"id": "train-7731", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2006, what is the overall number of october defeats for the team with the most October defeats? Indicate the team ID."}, {"from": "gpt", "value": "```sql\nSELECT OctL, tmID FROM TeamSplits WHERE year = '2006' ORDER BY OctL DESC LIMIT 1\n```"}]}, {"id": "train-7732", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many players, whose shooting/catching hand is both left and right, debuted their first NHL in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(playerID) FROM Master WHERE shootCatch IS NULL AND firstNHL = '2011'\n```"}]}, {"id": "train-7733", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year recorded the most number of goals by a player and how old was the player at the time the most number of goals was achieved by him?"}, {"from": "gpt", "value": "```sql\nSELECT T1.year, T1.year - T2.birthYear FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID GROUP BY T1.year, T1.year - T2.birthYear ORDER BY SUM(T1.G) DESC LIMIT 1\n```"}]}, {"id": "train-7734", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average height of all the goalies born in the 70s who's a left shooting/catching dominant and to which team do the tallest player/s play for most recently?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.height) AS REAL) / COUNT(*) FROM AwardsPlayers AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T2.height IS NOT NULL AND (T2.pos = 'LW' OR T2.pos = 'L/C')\n```"}]}, {"id": "train-7735", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total amount of assists of the NHL player with the most assists in history? Please indicate his/her full name."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.A), T2.firstName, T2.lastName FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.lgID = 'NHL' GROUP BY T2.firstName, T2.lastName ORDER BY SUM(T1.A) DESC LIMIT 1\n```"}]}, {"id": "train-7736", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the power play percentage of the team with the least number of penalty kill chances and to which team were they playing against? Indicate whether the team lost or victorious."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.A), T2.firstName, T2.lastName FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.lgID = 'NHL' GROUP BY T2.firstName, T2.lastName ORDER BY SUM(T1.A) DESC LIMIT 1\n```"}]}, {"id": "train-7737", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the awards won by the coach who coached the team with the most number of victories of all time? Indicate the choach ID."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.coachID, T1.award FROM AwardsCoaches AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID GROUP BY T2.coachID, T1.award ORDER BY SUM(T2.w) DESC LIMIT 1\n```"}]}, {"id": "train-7738", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the losing team during an exhibition game in 1912?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM SeriesPost AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND tmIDLoser = tmID WHERE T1.note = 'EX' AND T2.year = '1912'\n```"}]}, {"id": "train-7739", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long has the NHL player been playing during the year when he recorded the least number of times being on the ice when a goal is scored for the team versus against the team? Indicate his full name."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.firstNHL - T1.year, T3.nameGiven , T3.firstName, T3.lastName FROM Scoring AS T1 INNER JOIN Teams AS T2 ON T2.tmID = T1.tmID INNER JOIN Master AS T3 ON T1.playerID = T3.playerID GROUP BY T3.firstName, T3.lastName, T3.nameGiven, T3.firstNHL - T1.year, T3.firstName, T3.lastName ORDER BY SUM(T1.`+/-`) ASC LIMIT 1\n```"}]}, {"id": "train-7740", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 2003 to 2005, what are the given names of the players with the most number of games played whose Penalty minutes is between 200 to 250?"}, {"from": "gpt", "value": "```sql\nSELECT T2.nameGiven FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID AND T1.PIM BETWEEN 200 AND 250 AND T1.year BETWEEN 2003 AND 2005 ORDER BY T1.GP DESC LIMIT 1\n```"}]}, {"id": "train-7741", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How old was the goaltender who scored the fewest goals while on the ice when he retired from the NHL?"}, {"from": "gpt", "value": "```sql\nSELECT T2.lastNHL - T2.birthYear FROM GoaliesSC AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T2.lastNHL IS NOT NULL GROUP BY T2.lastNHL, T2.birthYear ORDER BY SUM(GA) LIMIT 1\n```"}]}, {"id": "train-7742", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which position has won the most awards and who is the most recent player that was awarded with an award in that position? Indicate the name of the award and the full name of the player."}, {"from": "gpt", "value": "```sql\nSELECT T1.pos, T2.award, T1.nameGiven, T1.lastName FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T2.coachID = T1.coachID GROUP BY T1.pos, T2.award, T1.nameGiven, T1.lastName ORDER BY COUNT(T2.award) LIMIT 1\n```"}]}, {"id": "train-7743", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many games did the coach who received the first-ever Second Team All-Star award play before receiving such award?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.g) FROM Coaches AS T1 INNER JOIN ( SELECT coachID, year FROM AwardsCoaches WHERE award = 'Second Team All-Star' ORDER BY year LIMIT 1 ) AS T2 ON T1.coachID = T2.coachID AND T1.year < T2.year\n```"}]}, {"id": "train-7744", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teams did the team with the most victories in 1915 play against?\nIndicate the name of the team who won the most games in 1915, as well as the names of the opposing team."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT oppID), T2.tmID, T2.oppID FROM Teams AS T1 INNER JOIN TeamVsTeam AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID WHERE T2.year = 1915 GROUP BY T2.tmID, T2.oppID ORDER BY SUM(T2.W) DESC LIMIT 1\n```"}]}, {"id": "train-7745", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the teams whose shorthanded goals are between 1 to 5, which player is the most trustworthy in the critical moment?"}, {"from": "gpt", "value": "```sql\nSELECT T2.nameGiven, T2.lastName FROM Scoring AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.SHG BETWEEN 1 AND 5 ORDER BY T1.GWG DESC LIMIT 1\n```"}]}, {"id": "train-7746", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1997, how many loss did the coach have who temporary coached Tampa Bay Lightning? Indicate his/her coach ID."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.l), T1.coachID FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.notes = 'interim' AND T1.year = '1997' AND T2.name = 'Tampa Bay Lightning' GROUP BY T1.coachID\n```"}]}, {"id": "train-7747", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players whose short handed assists are greater or equal to 7, what is the final standing of the team with the most number of assists? Indicate the year to which the most number of assists was achieved and the name of the team."}, {"from": "gpt", "value": "```sql\nSELECT T2.rank, T2.year, T2.name FROM Scoring AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.SHA >= 7 ORDER BY T1.A DESC LIMIT 1\n```"}]}, {"id": "train-7748", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the coach whose team placed 4th in the 1969 game? Indicate their coachID."}, {"from": "gpt", "value": "```sql\nSELECT T1.coachID FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 1969 AND T2.rank = 4\n```"}]}, {"id": "train-7749", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 1917 to 1920, what are the names of the team who ranked first in the first half of the season each year?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.name FROM TeamsHalf AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.half = 1 AND T1.rank = 1 AND T1.year BETWEEN 1917 AND 1920\n```"}]}, {"id": "train-7750", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Canadian players, between the ages of 18 and 24 when they initially played their first NHL, had a cumulative goal total of no more than 5? Indicate their complete names, the year, and the team for which they scored the specified amount of goals."}, {"from": "gpt", "value": "```sql\nSELECT T2.nameGiven, T2.lastName, T2.birthYear, birthMon, birthDay , T3.tmID FROM Scoring AS T1 INNER JOIN Master AS T2 ON T2.playerID = T1.playerID INNER JOIN Teams AS T3 ON T3.tmID = T1.tmID WHERE (T2.firstNHL - T2.birthYear) BETWEEN 18 AND 24 AND T3.G < 5\n```"}]}, {"id": "train-7751", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many bench minor penalties did the team St. Louis Blues got in total in all the games?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(BenchMinor) AS REAL) / 2 FROM Teams WHERE name = 'St. Louis Blues'\n```"}]}, {"id": "train-7752", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the power play chances of New York Rangers in 2009?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(PPG AS REAL) / PPC FROM Teams WHERE year = 2009 AND name = 'New York Rangers'\n```"}]}, {"id": "train-7753", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest total points a team got in a year?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(Pts), year FROM Teams GROUP BY year, tmID ORDER BY SUM(Pts) DESC LIMIT 1\n```"}]}, {"id": "train-7754", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the teams that had more wins than loses in the year 2006, how many of them have over 100 points?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(tmID) FROM Teams WHERE year = 2006 AND W > L AND Pts > 100\n```"}]}, {"id": "train-7755", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team got the most bench minor penalties in 2006?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM Teams WHERE year = 2006 GROUP BY tmID, name ORDER BY CAST(SUM(BenchMinor) AS REAL) / 2 DESC LIMIT 1\n```"}]}, {"id": "train-7756", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the first 3 teams that got the most penalty minutes in 2006."}, {"from": "gpt", "value": "```sql\nSELECT name FROM Teams WHERE year = 2006 GROUP BY tmID, name ORDER BY SUM(PIM) DESC LIMIT 3\n```"}]}, {"id": "train-7757", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team had the highest penalty kill chances in 1995, Florida Panthers, Edmonton Oilers or Los Angeles Kings?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM Teams WHERE year = 1995 AND name IN ('Florida Panthers', 'Edmonton Oilers', 'Los Angeles Kings') ORDER BY PKC DESC LIMIT 1\n```"}]}, {"id": "train-7758", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the team that got more wins than loses in the Stanley Cup finals in 1917?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = '1917' AND T1.W > T1.L\n```"}]}, {"id": "train-7759", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the teams that have played in 1922's Stanley Cup finals."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = '1922'\n```"}]}, {"id": "train-7760", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the teams that played in 1922's Stanley Cup finals, how many of them had over 20 points in that year?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.tmID) FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = '1922' AND T2.Pts > 20\n```"}]}, {"id": "train-7761", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What were the penalty minutes in 1923's Stanley Cup finals of the team that ranked second in that year?"}, {"from": "gpt", "value": "```sql\nSELECT T1.PIM FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = '1923' AND T2.rank = 2\n```"}]}, {"id": "train-7762", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team got the most wins in the Stanley Cup finals?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year GROUP BY T2.name ORDER BY SUM(T1.W) DESC LIMIT 1\n```"}]}, {"id": "train-7763", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many wins did the Philadelphia Flyers have over the Boston Bruins in 1985?"}, {"from": "gpt", "value": "```sql\nSELECT T1.W FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 1985 AND T1.tmID = ( SELECT DISTINCT tmID FROM Teams WHERE name = 'Philadelphia Flyers' ) AND T1.oppID = ( SELECT DISTINCT tmID FROM Teams WHERE name = 'Boston Bruins' )\n```"}]}, {"id": "train-7764", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the teams that had a tie in 1909."}, {"from": "gpt", "value": "```sql\nSELECT T2.name, T3.name FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN Teams AS T3 ON T1.year = T3.year AND T1.oppID = T3.tmID WHERE T1.year = 1909 AND T1.T = 1\n```"}]}, {"id": "train-7765", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the first names of the coaches who have taught the Montreal Canadiens."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.firstName FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Montreal Canadiens'\n```"}]}, {"id": "train-7766", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many coaches of the Montreal Canadiens have gotten in the Hall of Fame?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT hofID) FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Montreal Canadiens'\n```"}]}, {"id": "train-7767", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the height of the tallest coach of the Montreal Canadiens."}, {"from": "gpt", "value": "```sql\nSELECT T3.height FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Montreal Canadiens' AND T3.coachID IS NOT NULL ORDER BY T3.height DESC LIMIT 1\n```"}]}, {"id": "train-7768", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the first names of the coaches whose team played in 1922's Stanley Cup finals."}, {"from": "gpt", "value": "```sql\nSELECT T3.firstName FROM Coaches AS T1 INNER JOIN TeamsSC AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.year = 1922\n```"}]}, {"id": "train-7769", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches who have taught the Philadelphia Flyers, how many of them are born in March?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.coachID) FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Philadelphia Flyers' AND T3.birthMon = 3\n```"}]}, {"id": "train-7770", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches who are born in the USA, how many of them used to train the Philadelphia Flyers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.coachID) FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Philadelphia Flyers' AND T3.birthCountry = 'USA'\n```"}]}, {"id": "train-7771", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many coaches who have taught the Buffalo Sabres have died?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.coachID) FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Buffalo Sabres' AND T3.deathYear IS NOT NULL\n```"}]}, {"id": "train-7772", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the nick names of the coaches who are from the USA and have taught the Buffalo Sabres."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT nameNick FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Buffalo Sabres' AND T3.birthCountry = 'USA'\n```"}]}, {"id": "train-7773", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the coaches who taught the teams in 1922's Stanley Cup finals, how many of them are from the USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.coachID) FROM Coaches AS T1 INNER JOIN TeamsSC AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.year = 1922 AND T3.birthCountry = 'USA'\n```"}]}, {"id": "train-7774", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the year 2000, which team has played the most games against the Buffalo Sabres?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.oppID = T2.tmID INNER JOIN Teams AS T3 ON T1.year = T3.year AND T1.tmID = T3.tmID WHERE T1.year = 2000 AND T2.name = 'Buffalo Sabres' GROUP BY T3.name ORDER BY SUM(T2.G) DESC LIMIT 1\n```"}]}, {"id": "train-7775", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the teams that have played against the Buffalo Sabres."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.name FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.oppID = T2.tmID INNER JOIN Teams AS T3 ON T1.year = T3.year AND T1.tmID = T3.tmID WHERE T2.name = 'Buffalo Sabres'\n```"}]}, {"id": "train-7776", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many penalty minutes did the Montreal Canadiens have in the 1918's Stanley Cup Finals?"}, {"from": "gpt", "value": "```sql\nSELECT T2.PIM FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens' AND T1.year = 1918\n```"}]}, {"id": "train-7777", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the year that the Montreal Canadiens had 24 penalty minutes in the Stanley Cup finals, how many wins did the team had in total?"}, {"from": "gpt", "value": "```sql\nSELECT T2.W FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens' AND T2.PIM = 24\n```"}]}, {"id": "train-7778", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year did the Montreal Canadiens have 49 penalty minutes in the Stanley Cup finals? Was it 1924, 1923 or 1918?"}, {"from": "gpt", "value": "```sql\nSELECT T1.year FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens' AND T2.PIM = 49\n```"}]}, {"id": "train-7779", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which coach was the first one to teach the Montreal Canadiens, please give his first name."}, {"from": "gpt", "value": "```sql\nSELECT T3.firstName FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Montreal Canadiens' ORDER BY T1.year LIMIT 1\n```"}]}, {"id": "train-7780", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average winning rate of the Buffalo Sabres in 2000?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CAST(T2.W AS REAL) / T2.G) / COUNT(T1.oppID) FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID WHERE T2.name = 'Buffalo Sabres' AND T1.year = 2000\n```"}]}, {"id": "train-7781", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many penalty minutes did the Montreal Canadiens have on average in the Stanley Cup Finals?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.PIM) AS REAL) / COUNT(T2.PIM) FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens'\n```"}]}, {"id": "train-7782", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average winning rate of the Montreal Canadiens in the Stanley Cup finals?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.W / T2.G) / SUM(T2.G + T2.W) FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens'\n```"}]}, {"id": "train-7783", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of American coaches among all the coaches who taught the Montreal Canadiens?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CAST(T2.W AS REAL) / T2.G) / SUM(T2.G + T2.W) FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens'\n```"}]}, {"id": "train-7784", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the latest non player/builder to become the hall of famer? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT name FROM HOF WHERE category IN ('Player', 'Builder') ORDER BY year DESC LIMIT 1\n```"}]}, {"id": "train-7785", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the referees, who became a hall of famer in the 1970s? What's his hofID?"}, {"from": "gpt", "value": "```sql\nSELECT name, hofID FROM HOF WHERE category = 'Builder' AND year BETWEEN 1970 AND 1979\n```"}]}, {"id": "train-7786", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the year 1958, what is the total number of players that became hall of famers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(hofID) FROM HOF WHERE category = 'Player' AND year = 1958\n```"}]}, {"id": "train-7787", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many hall of famers both played and coached in the league?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(playerID) FROM Master WHERE hofID IS NOT NULL AND playerID IS NOT NULL AND coachID IS NOT NULL\n```"}]}, {"id": "train-7788", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of players whose last name is Green that played in the league but not coached?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(playerID) FROM Master WHERE lastName = 'Green' AND coachID IS NULL\n```"}]}, {"id": "train-7789", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the team that Scotty Bowman coached in 1982, how many bench minor penalties did they have that year?"}, {"from": "gpt", "value": "```sql\nSELECT T2.BenchMinor FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T3.firstName = 'Scotty' AND T3.lastName = 'Bowman' AND T1.year = 1982\n```"}]}, {"id": "train-7790", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the players who had 10 empty net goals in their career, who is the tallest? Show his full name."}, {"from": "gpt", "value": "```sql\nSELECT T2.firstName, T2.lastName FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.ENG = 10 ORDER BY T2.height DESC LIMIT 1\n```"}]}, {"id": "train-7791", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which was the dominant hand for the goaltender who played 32 games for QUN in 1973? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT T2.shootCatch, T2.firstName, T2.lastName FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID AND T1.year = 1973 WHERE T1.tmID = 'QUN' AND T1.GP = 32\n```"}]}, {"id": "train-7792", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the goalie whose last name is \"Young\", how many teams did he play in?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.tmID) FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T2.lastName = 'Young'\n```"}]}, {"id": "train-7793", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the goalkeeper that became a coach than a Hall of Famer, who played for BOS in 1972?"}, {"from": "gpt", "value": "```sql\nSELECT T2.firstName, T2.lastName , IIF(T1.tmID = 'BOS', 'YES', 'NO') FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 1972 AND T1.tmID = 'BOS' AND T2.coachID IS NOT NULL AND T2.hofID IS NULL\n```"}]}, {"id": "train-7794", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the goalie whose legendsID is \"P196402\" , how many games did he play in the league?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.GP) FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T2.legendsID = 'P196402'\n```"}]}, {"id": "train-7795", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the history of all the Quebec Bulldogs, which goalie had the most play minutes for the team? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT T2.firstName, T2.lastName FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T1.tmID = T3.tmID AND T1.year = T3.year WHERE T3.name = 'Quebec Bulldogs' AND T2.pos = 'D' GROUP BY T1.playerID, T2.firstName, T2.lastName ORDER BY SUM(T1.Min) DESC LIMIT 1\n```"}]}, {"id": "train-7796", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many goalies played for Calgary Flames?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT playerID) FROM Goalies AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.name = 'Calgary Flames'\n```"}]}, {"id": "train-7797", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Minnesota North Stars' goalkeeper had the most Goal Againsts in his play time?"}, {"from": "gpt", "value": "```sql\nSELECT playerID FROM Goalies AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.name = 'Minnesota North Stars' GROUP BY T1.playerID ORDER BY SUM(T1.GA) DESC LIMIT 1\n```"}]}, {"id": "train-7798", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Haileybury Hockey Club goalies became a hall of famer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.playerID) FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T1.tmID = T3.tmID AND T1.year = T3.year WHERE T3.name = 'Haileybury Hockey Club' AND T2.hofID IS NOT NULL\n```"}]}, {"id": "train-7799", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the goalie who had the most shutouts in 2010, what's his catching hand?"}, {"from": "gpt", "value": "```sql\nSELECT T2.shootCatch FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2010 GROUP BY T2.shootCatch ORDER BY SUM(T1.SHO) DESC LIMIT 1\n```"}]}, {"id": "train-7800", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the decrease rate of the game plays did David Aebischer after he got traded in 2005?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(CASE WHEN T1.year = 2005 THEN T1.GP ELSE 0 END) - SUM(CASE WHEN T1.year = 2006 THEN T1.GP ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T1.year = 2005 THEN T1.GP ELSE 0 END) FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T2.firstName = 'David' AND T2.lastName = 'Aebischer'\n```"}]}, {"id": "train-7801", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the player ID and coach ID of person who have become coach after retirement."}, {"from": "gpt", "value": "```sql\nSELECT playerID, coachID FROM Master WHERE playerID IS NOT NULL AND coachID IS NOT NULL\n```"}]}, {"id": "train-7802", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the player ID of player with average height of 75."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT playerID FROM Master GROUP BY playerID HAVING AVG(height) = 75\n```"}]}, {"id": "train-7803", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the heaviest player? State player ID of 5 heaviest players."}, {"from": "gpt", "value": "```sql\nSELECT playerID FROM Master ORDER BY weight DESC LIMIT 5\n```"}]}, {"id": "train-7804", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of players origin from Finland?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT firstName, lastName FROM Master WHERE birthCountry = 'Finland'\n```"}]}, {"id": "train-7805", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down player ID of players who have passed away."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT playerID FROM Master WHERE deathYear IS NOT NULL AND playerID IS NOT NULL\n```"}]}, {"id": "train-7806", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the first name of coaches who still coach after year 2000."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.firstName FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year > 2000\n```"}]}, {"id": "train-7807", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the height and weight for coaches who have won awards in 1930?"}, {"from": "gpt", "value": "```sql\nSELECT T1.height, T1.weight FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = '1930'\n```"}]}, {"id": "train-7808", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the total goals for player with player ID aaltoan01 and how old is this person?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.G), STRFTIME('%Y', CURRENT_TIMESTAMP) - T1.birthyear FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T1.playerID = 'aaltoan01' GROUP BY T1.birthyear\n```"}]}, {"id": "train-7809", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is there any coach who has not been a player before but has won award? State the ID."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.coachID FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.playerID IS NULL\n```"}]}, {"id": "train-7810", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which player ID are left winger and weight more than 200?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT playerID FROM Master WHERE pos LIKE '%L%' AND weight > 200 AND playerID IS NOT NULL AND pos = 'L'\n```"}]}, {"id": "train-7811", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of game played for players from USA?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.GP) FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCountry = 'USA'\n```"}]}, {"id": "train-7812", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total points scored by team ID ANA and list down the coashes of the team."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.Pts), T1.coachID FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T2.tmID = T1.tmID WHERE T2.tmID = 'ANA' GROUP BY T1.coachID\n```"}]}, {"id": "train-7813", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1976, how many goals achieved by team 'BIR' in Division 'EW'?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.G) FROM Teams AS T1 INNER JOIN Scoring AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.divID = 'EW' AND T1.tmID = 'BIR' AND T1.year = 1976\n```"}]}, {"id": "train-7814", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2010, how many loses made by team 'BOS' and how many assists were made by the players?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.L), SUM(T2.A) FROM Teams AS T1 INNER JOIN Scoring AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.tmID = 'BOS' AND T1.year = 2010\n```"}]}, {"id": "train-7815", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the total weights of players for team 'ANA' as per year 1997?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.weight) FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1997 AND T2.tmID = 'ANA'\n```"}]}, {"id": "train-7816", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the shortest player and state the team ID of that player from 1925 to 1936."}, {"from": "gpt", "value": "```sql\nSELECT T2.playerID, T2.tmID FROM ( SELECT playerID FROM Master WHERE height IS NOT NULL ORDER BY height ASC LIMIT 1 ) AS T1 INNER JOIN ( SELECT DISTINCT playerID, tmID FROM Scoring WHERE year BETWEEN 1925 AND 1936 ) AS T2 ON T1.playerID = T2.playerID\n```"}]}, {"id": "train-7817", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which team has the highest winning rate in year 2000? State the team ID and list down the birth country of it's players."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.tmID, T1.birthCountry FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID INNER JOIN ( SELECT year, tmID FROM Teams WHERE year = 2000 ORDER BY W / (W + L) DESC LIMIT 1 ) AS T3 ON T2.tmID = T3.tmID AND T2.year = T3.year\n```"}]}, {"id": "train-7818", "db_id": "hockey", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 1998, How many wins were made by team 'CAR' per game played? Who contributed the most goals? State the player ID."}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.W AS REAL) / T1.G, T2.playerID FROM Teams AS T1 INNER JOIN Scoring AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.tmID = 'CAR' AND T1.year = 1998 GROUP BY T1.W / T1.G, T2.playerID ORDER BY SUM(T2.G) DESC LIMIT 1\n```"}]}, {"id": "train-7819", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the shortest life expectancy?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Country ORDER BY LifeExpectancy LIMIT 1\n```"}]}, {"id": "train-7820", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List any five countries which use English as an official language."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' AND T2.IsOfficial = 'T' LIMIT 5\n```"}]}, {"id": "train-7821", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average population per city in Karnataka district."}, {"from": "gpt", "value": "```sql\nSELECT AVG(Population) FROM City WHERE District = 'Karnataka' GROUP BY ID\n```"}]}, {"id": "train-7822", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the languages used in the USA."}, {"from": "gpt", "value": "```sql\nSELECT Language FROM CountryLanguage WHERE CountryCode = 'USA'\n```"}]}, {"id": "train-7823", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries use Portuguese?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Language = 'Portuguese' THEN 1 ELSE 0 END) FROM CountryLanguage\n```"}]}, {"id": "train-7824", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities are there in England?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ID) FROM City WHERE District = 'England'\n```"}]}, {"id": "train-7825", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities are there in the country with the largest surface area?"}, {"from": "gpt", "value": "```sql\nSELECT T2.ID FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.SurfaceArea = ( SELECT MAX(SurfaceArea) FROM Country )\n```"}]}, {"id": "train-7826", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the capital city and population of San Marino?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Capital, T2.Population FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'San Marino'\n```"}]}, {"id": "train-7827", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the languages used in Turkmenistan."}, {"from": "gpt", "value": "```sql\nSELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Turkmenistan'\n```"}]}, {"id": "train-7828", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name, capital city and its official language of the country with the highest life expectancy."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.Capital, T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode INNER JOIN City AS T3 ON T1.Code = T3.CountryCode WHERE T2.IsOfficial = 'T' ORDER BY T1.LifeExpectancy DESC LIMIT 1\n```"}]}, {"id": "train-7830", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List any five countries which use English as an official language."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' AND T2.IsOfficial = 'T' LIMIT 5\n```"}]}, {"id": "train-7831", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the languages used in Baltic Countries, provide the languages which are used by over 80%.\n\n"}, {"from": "gpt", "value": "```sql\nSELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Region = 'Baltic Countries' AND T2.Percentage > 80\n```"}]}, {"id": "train-7832", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the languages used in Baltic Countries, provide the languages which are used by over 80%."}, {"from": "gpt", "value": "```sql\nSELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Region = 'Baltic Countries' AND T2.Percentage > 80\n```"}]}, {"id": "train-7833", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name, located country, and life expectancy of the most populated city"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name, T1.Code, T1.LifeExpectancy FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T2.Population DESC LIMIT 1\n```"}]}, {"id": "train-7834", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the capital city and languages used in the country with the shortest life expectancy."}, {"from": "gpt", "value": "```sql\nSELECT T1.Capital, T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode INNER JOIN City AS T3 ON T1.Code = T3.CountryCode ORDER BY T1.LifeExpectancy LIMIT 1\n```"}]}, {"id": "train-7835", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the country, population, capital city, and official language of the country with the smallest surface area."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.Population, T1.Capital, T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode INNER JOIN City AS T3 ON T1.Code = T3.CountryCode WHERE T2.IsOfficial = 'T' ORDER BY T1.SurfaceArea LIMIT 1\n```"}]}, {"id": "train-7836", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of countries in North America use English?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.Language = 'English', 1, 0)) AS REAL) * 100 / COUNT(T1.Code) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode\n```"}]}, {"id": "train-7837", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the district name of the city with the smallest population."}, {"from": "gpt", "value": "```sql\nSELECT District FROM City ORDER BY Population LIMIT 1\n```"}]}, {"id": "train-7838", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which continent does the country with the smallest surface area belongs?"}, {"from": "gpt", "value": "```sql\nSELECT Continent FROM Country ORDER BY SurfaceArea LIMIT 1\n```"}]}, {"id": "train-7839", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the head of the state where the most crowded city belongs?"}, {"from": "gpt", "value": "```sql\nSELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T2.Population DESC LIMIT 1\n```"}]}, {"id": "train-7840", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries that officially use the English language, what country has the highest capital?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Code FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' AND T2.IsOfficial = 'T' ORDER BY T1.Capital DESC LIMIT 1\n```"}]}, {"id": "train-7841", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the cities that belong to the country with a life expectancy of 66.4."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.LifeExpectancy = 66.4\n```"}]}, {"id": "train-7842", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the head of the state of the country with the lowest percentage use of English as their language."}, {"from": "gpt", "value": "```sql\nSELECT T1.HeadOfState FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' ORDER BY T2.Percentage LIMIT 1\n```"}]}, {"id": "train-7843", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the surface area of the country where Sutton Coldfield city belongs?"}, {"from": "gpt", "value": "```sql\nSELECT T1.SurfaceArea FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Sutton Coldfield'\n```"}]}, {"id": "train-7844", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the languages of the countries that have population below 8000."}, {"from": "gpt", "value": "```sql\nSELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Population < 8000\n```"}]}, {"id": "train-7845", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the official languages used in Belgium?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Belgium' AND T2.IsOfficial = 'T'\n```"}]}, {"id": "train-7846", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the cities and district names that belong to the country with Hajastan as its local name."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name, T2.District FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.LocalName = 'Hajastan'\n```"}]}, {"id": "train-7847", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many languages are used in Cyprus?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.Name = 'Cyprus' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode\n```"}]}, {"id": "train-7848", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the language used by the people of Belize."}, {"from": "gpt", "value": "```sql\nSELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Belize'\n```"}]}, {"id": "train-7849", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the districts belong to the country headed by Adolf Ogi."}, {"from": "gpt", "value": "```sql\nSELECT T2.District FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = 'Adolf Ogi'\n```"}]}, {"id": "train-7850", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the head of the country where Santa Catarina district belongs?"}, {"from": "gpt", "value": "```sql\nSELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.District = 'Santa Catarina'\n```"}]}, {"id": "train-7851", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries that have GNP greater than 1500, what is the percentage of the countries have English as its language?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.Language = 'English', 1, 0)) AS REAL) * 100 / COUNT(T1.Code) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GNP > 1500\n```"}]}, {"id": "train-7852", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In English speaking countries, provide the difference between the number of countries with republic and constitutional monarchy as its government form."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.GovernmentForm = 'Republic') - COUNT(T1.GovernmentForm = 'ConstitutionalMonarchy') FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English'\n```"}]}, {"id": "train-7853", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What country declared its independence in 1994?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Country WHERE IndepYear = 1994\n```"}]}, {"id": "train-7854", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the countries in Asia."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Country WHERE Continent = 'Asia'\n```"}]}, {"id": "train-7855", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What country in Asia has the largest gross national product(GNP)?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Country WHERE Continent = 'Asia' ORDER BY GNP DESC LIMIT 1\n```"}]}, {"id": "train-7856", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities are in the Philippines?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ID) FROM City WHERE Name = 'PHL'\n```"}]}, {"id": "train-7857", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the local name of Ukraine that they are also known for?"}, {"from": "gpt", "value": "```sql\nSELECT LocalName FROM Country WHERE Name = 'Ukraine'\n```"}]}, {"id": "train-7858", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries have Socialistic Republic form of government?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Code) FROM Country WHERE GovernmentForm = 'Socialistic Republic'\n```"}]}, {"id": "train-7859", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the official language of China?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'China' AND T2.IsOfficial = 'T'\n```"}]}, {"id": "train-7860", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of the population of China used Chinese as their language?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Percentage FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'China' AND T2.Language = 'Chinese'\n```"}]}, {"id": "train-7861", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the form of government that the city of Manila has?"}, {"from": "gpt", "value": "```sql\nSELECT T1.GovernmentForm FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Manila'\n```"}]}, {"id": "train-7863", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the languages used in Europe."}, {"from": "gpt", "value": "```sql\nSELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = 'Europe'\n```"}]}, {"id": "train-7864", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the head of state of the country where the city of Pyongyang is under?"}, {"from": "gpt", "value": "```sql\nSELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Pyongyang'\n```"}]}, {"id": "train-7865", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unofficial languages are used in Italy?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.IsOfficial = 'F' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Italy'\n```"}]}, {"id": "train-7866", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What city in Russia has the least population?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Russian Federation' ORDER BY T2.Population ASC LIMIT 1\n```"}]}, {"id": "train-7867", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the cities in the country where there is high life expectancy at birth."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.LifeExpectancy DESC LIMIT 1\n```"}]}, {"id": "train-7868", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the official and unofficial languages used by the country that declared its independence in 1830."}, {"from": "gpt", "value": "```sql\nSELECT T2.Language, T2.IsOfficial FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.IndepYear = 1830 GROUP BY T2.Language, T2.IsOfficial\n```"}]}, {"id": "train-7869", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the capital city of the country with largest population?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Capital FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.Population DESC LIMIT 1\n```"}]}, {"id": "train-7870", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the countries in the continent of Asia that use English as their unofficial language."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = 'Asia' AND T2.IsOfficial = 'F' GROUP BY T1.Name\n```"}]}, {"id": "train-7871", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average GNP of all countries that use Arabic language."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.GNP) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'Arabic'\n```"}]}, {"id": "train-7872", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of the surface area of all countries that uses Chinese as one of their languages."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.Language = 'Chinese', T1.SurfaceArea, 0)) AS REAL) * 100 / SUM(T1.SurfaceArea) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode\n```"}]}, {"id": "train-7873", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the smallest surface area?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Country ORDER BY SurfaceArea ASC LIMIT 1\n```"}]}, {"id": "train-7874", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the name of the largest population country."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Country ORDER BY Population DESC LIMIT 1\n```"}]}, {"id": "train-7875", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the language of the smallest population country?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.Population ASC LIMIT 1\n```"}]}, {"id": "train-7876", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the name of countries whereby English is their official language."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' AND T2.IsOfficial = 'T'\n```"}]}, {"id": "train-7877", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the official language of the countries which declared independence after 1990,"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.IndepYear > 1990 AND T2.IsOfficial = 'T'\n```"}]}, {"id": "train-7878", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of English used in Australia?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Percentage FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Australia' AND T2.Language = 'English'\n```"}]}, {"id": "train-7879", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down languages used in Malaysia."}, {"from": "gpt", "value": "```sql\nSELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Malaysia'\n```"}]}, {"id": "train-7880", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the most crowded city in the world?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T2.Population DESC LIMIT 1\n```"}]}, {"id": "train-7881", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the life expectancy of residents in the most crowded city?"}, {"from": "gpt", "value": "```sql\nSELECT T2.LifeExpectancy FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.Population DESC LIMIT 1\n```"}]}, {"id": "train-7882", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the GNP of the least crowded city in the world?"}, {"from": "gpt", "value": "```sql\nSELECT T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.Population ASC LIMIT 1\n```"}]}, {"id": "train-7883", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Within the 5 most crowded cities in the world, which country has the most languages used?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM ( SELECT T1.Name, T2.Language FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode GROUP BY T1.Name, T1.Population, T2.Language ORDER BY T1.Population DESC ) AS T3 GROUP BY t3.Name ORDER BY COUNT(Language) DESC LIMIT 1\n```"}]}, {"id": "train-7884", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the smallest surface area and the most crowded city?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.Population DESC, T2.SurfaceArea DESC LIMIT 1\n```"}]}, {"id": "train-7885", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all cities of China."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.Name = 'China'\n```"}]}, {"id": "train-7887", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average life expentancy of countries that speak Arabic?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.LifeExpectancy) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'Arabic'\n```"}]}, {"id": "train-7888", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the GNP growth rate by the country of Shanghai?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((T1.GNP - T1.GNPOld) AS REAL) / T1.GNPOld FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Shanghai'\n```"}]}, {"id": "train-7889", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the district of Zaanstad?"}, {"from": "gpt", "value": "```sql\nSELECT District FROM City WHERE name = 'Zaanstad'\n```"}]}, {"id": "train-7890", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What city has the highest population?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM City ORDER BY Population DESC LIMIT 1\n```"}]}, {"id": "train-7891", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the district of the city with a population of 201843."}, {"from": "gpt", "value": "```sql\nSELECT District FROM City WHERE population = 201843\n```"}]}, {"id": "train-7892", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What country has the largest surface area?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM Country ORDER BY SurfaceArea DESC LIMIT 1\n```"}]}, {"id": "train-7893", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries have a life expectancy of 75.1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Country WHERE LifeExpectancy = 75.1\n```"}]}, {"id": "train-7894", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the year of independence of Brunei?"}, {"from": "gpt", "value": "```sql\nSELECT IndepYear FROM Country WHERE Name = 'Brunei'\n```"}]}, {"id": "train-7895", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries have no GNP?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Country WHERE GNP = 0\n```"}]}, {"id": "train-7896", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average surface area of all countries?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(SurfaceArea) FROM Country\n```"}]}, {"id": "train-7897", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many languages are there in the country where Tocantins district belongs?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.Language) FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.District = 'Tocantins'\n```"}]}, {"id": "train-7898", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the districts that belong to the country with the largest surface area?"}, {"from": "gpt", "value": "```sql\nSELECT T1.District FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.Name = ( SELECT Name FROM Country ORDER BY SurfaceArea DESC LIMIT 1 )\n```"}]}, {"id": "train-7899", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities are there in the country ruled by Kostis Stefanopoulos?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.Name) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.HeadOfState = 'Kostis Stefanopoulos'\n```"}]}, {"id": "train-7900", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the official languages used in Greece?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.IsOfficial = 'T' AND T2.name = 'Greece'\n```"}]}, {"id": "train-7901", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the population of the country where Queimados city belongs."}, {"from": "gpt", "value": "```sql\nSELECT T2.Population FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Queimados'\n```"}]}, {"id": "train-7902", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the official languages of the country where you can find the city with the least population?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Language FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IsOfficial = 'T' ORDER BY T1.Population ASC LIMIT 1\n```"}]}, {"id": "train-7903", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the surface area and GNP of the country where Namibe district belongs?"}, {"from": "gpt", "value": "```sql\nSELECT T2.SurfaceArea, T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Namibe'\n```"}]}, {"id": "train-7904", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the country that officially uses English as their language."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.IsOfficial = 'T' AND T1.Language = 'English'\n```"}]}, {"id": "train-7905", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the districts that belong to the country with the lowest surface area?"}, {"from": "gpt", "value": "```sql\nSELECT T1.District FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T2.SurfaceArea ASC LIMIT 1\n```"}]}, {"id": "train-7906", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the country names of countries that have a GNP lower than 1000 and have Dutch as their language."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.GNP < 1000 AND T1.IsOfficial = 'T' AND T1.Language = 'Dutch'\n```"}]}, {"id": "train-7907", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the GNP of the country where district \"Entre Rios\" belongs?"}, {"from": "gpt", "value": "```sql\nSELECT T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Entre Rios' LIMIT 1\n```"}]}, {"id": "train-7908", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the local name of the country where \"The Valley\" city belongs?"}, {"from": "gpt", "value": "```sql\nSELECT T2.LocalName FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'The Valley'\n```"}]}, {"id": "train-7909", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the cities belongs to the country that has surface area greater than 7000000."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name, T1.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.SurfaceArea > 7000000\n```"}]}, {"id": "train-7910", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the life expectancy of the countries that uses Japanese as their language?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.LifeExpectancy) FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Language = 'Japanese'\n```"}]}, {"id": "train-7911", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities are there in the country with the surface area of 652090?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name, COUNT(T1.Name) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.SurfaceArea = 652090 GROUP BY T2.Name\n```"}]}, {"id": "train-7912", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the languages of countries with an independence year between 1980 to 1995."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name, T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.IndepYear BETWEEN 1980 AND 1995\n```"}]}, {"id": "train-7913", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the life expectancy of the people living in Calama city?"}, {"from": "gpt", "value": "```sql\nSELECT T2.LifeExpectancy FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Calama'\n```"}]}, {"id": "train-7914", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the language used in the country ruled by Pierre Buyoya."}, {"from": "gpt", "value": "```sql\nSELECT T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.HeadOfState = 'Pierre Buyoya'\n```"}]}, {"id": "train-7915", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In countries with constitutional monarchy, what is the percentage of cities located in the district of England?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.District = 'England' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.GovernmentForm = 'Constitutional Monarchy'\n```"}]}, {"id": "train-7916", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cities with a population between 140000 and 150000, list the country that has life expectancy greater than 80% life expectancy of all countries."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Population BETWEEN 140000 AND 150000 GROUP BY T2.Name, LifeExpectancy HAVING LifeExpectancy < ( SELECT AVG(LifeExpectancy) FROM Country ) * 0.8\n```"}]}, {"id": "train-7917", "db_id": "world", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries that use Italian as their language, what is the percentage of republic countries?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.GovernmentForm = 'Republic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Language = 'Italian'\n```"}]}, {"id": "train-7918", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many podcasts are there in the category which has the most podcasts?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(podcast_id) FROM categories WHERE category = ( SELECT category FROM categories GROUP BY category ORDER BY COUNT(podcast_id) DESC LIMIT 1 )\n```"}]}, {"id": "train-7919", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the podcast that are categorized in four or more categories?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.podcast_id) FROM ( SELECT podcast_id FROM categories GROUP BY podcast_id HAVING COUNT(category) >= 4 ) AS T1\n```"}]}, {"id": "train-7920", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the itunes id and url for podcast titled 'Brown Suga Diaries'."}, {"from": "gpt", "value": "```sql\nSELECT itunes_id, itunes_url FROM podcasts WHERE title = 'Brown Suga Diaries'\n```"}]}, {"id": "train-7921", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all podcast with its itunes url for all title containing the word 'Dream'."}, {"from": "gpt", "value": "```sql\nSELECT itunes_url FROM podcasts WHERE title LIKE '%Dream%' GROUP BY itunes_url\n```"}]}, {"id": "train-7922", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all the categories for podcast titled 'I Heart My Life Show'."}, {"from": "gpt", "value": "```sql\nSELECT T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'I Heart My Life Show'\n```"}]}, {"id": "train-7923", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the podcast title and its itunes url under the 'society-culture' category."}, {"from": "gpt", "value": "```sql\nSELECT T2.title, T2.itunes_url FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'society-culture'\n```"}]}, {"id": "train-7924", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people rated 5 for the podcast which title contains the word 'spoiler' under the 'art' category '?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.podcast_id) FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title LIKE '%spoilers%' AND T1.category = 'arts' AND T3.rating = 5\n```"}]}, {"id": "train-7925", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the authors who created review for podcast titled 'Pop Rocket' in 2016 with rating less than 5."}, {"from": "gpt", "value": "```sql\nSELECT T2.author_id FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Pop Rocket' AND T2.created_at LIKE '2016-%' AND T2.rating < 5\n```"}]}, {"id": "train-7926", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all the podcast title and its category with average rating of more than 3.0."}, {"from": "gpt", "value": "```sql\nSELECT T2.title, T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id GROUP BY T3.podcast_id HAVING AVG(T3.rating) > 3\n```"}]}, {"id": "train-7927", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all content reviewed for podcast with the best rating under the 'fiction' category. State the podcast title."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T3.rating = 5 AND T1.category = 'fiction'\n```"}]}, {"id": "train-7928", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the podcast title, content review and rating for all reviews with titled 'Love it!'"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title, T2.content, T2.rating FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'Love it!'\n```"}]}, {"id": "train-7929", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the author, rating and review creation date of review for podcast title 'In The Thick'."}, {"from": "gpt", "value": "```sql\nSELECT T2.author_id, T2.rating, T2.created_at FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'In The Thick' GROUP BY T2.author_id, T2.rating, T2.created_at\n```"}]}, {"id": "train-7930", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which podcast was reviewed the latest? State the date of creation, podcast tile and rating."}, {"from": "gpt", "value": "```sql\nSELECT T1.podcast_id, T2.created_at, T2.title, T2.rating FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id ORDER BY T2.created_at DESC LIMIT 1\n```"}]}, {"id": "train-7931", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the podcast title, rating and review content created by '76A4C24B6038145'."}, {"from": "gpt", "value": "```sql\nSELECT T2.title, T2.rating, T2.content FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = '76A4C24B6038145'\n```"}]}, {"id": "train-7932", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all reviews with the worst rating, state the podcast title as well as the review title and content."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title, T2.title, T2.content FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.rating = 1\n```"}]}, {"id": "train-7933", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all reviews created in May 2019. State the title of podcast and review rating."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title, T2.rating FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.created_at LIKE '2019-05-%'\n```"}]}, {"id": "train-7934", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating for the podcast that is most reviewed?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id GROUP BY T1.podcast_id ORDER BY COUNT(T2.content) DESC LIMIT 1\n```"}]}, {"id": "train-7935", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which category does the podcast titled 'SciFi Tech Talk' belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'SciFi Tech Talk'\n```"}]}, {"id": "train-7936", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the podcast in which a commentor left a comment with the title 'Long time listener, calling it quits?' Include the URL of the podcast as well."}, {"from": "gpt", "value": "```sql\nSELECT podcast_id, itunes_url FROM podcasts WHERE podcast_id = ( SELECT podcast_id FROM reviews WHERE title = 'Long time listener, calling it quits' )\n```"}]}, {"id": "train-7937", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the names of podcasts under the 'true crime' category."}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'true-crime'\n```"}]}, {"id": "train-7938", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write all the review content belonging to StormCast: The Official Warhammer Age of Sigmar Podcast."}, {"from": "gpt", "value": "```sql\nSELECT content FROM reviews WHERE podcast_id = ( SELECT podcast_id FROM podcasts WHERE title = 'StormCast: The Official Warhammer Age of Sigmar Podcast' )\n```"}]}, {"id": "train-7939", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write all the review titles and the contents belonging to the podcast 'More Stupider: A 90-Day Fiance Podcast' with a review rating of 1."}, {"from": "gpt", "value": "```sql\nSELECT title, content FROM reviews WHERE podcast_id = ( SELECT podcast_id FROM podcasts WHERE title = 'More Stupider: A 90-Day Fiance Podcast' ) AND rating = 1\n```"}]}, {"id": "train-7940", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many reviews does 'LifeAfter/The Message' have which were rated below 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'LifeAfter/The Message' AND T2.rating <= 3\n```"}]}, {"id": "train-7941", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The 'More Stupider: A 90-Day Fiance Podcast' belongs to which category and what is the average rating of the podcast?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.rating) FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title = 'More Stupider: A 90-Day Fiance Podcast'\n```"}]}, {"id": "train-7942", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the arts-books and arts-design categories, which one has more podcasts and what is the numerical difference between them?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT category FROM categories WHERE category = 'arts-books' OR category = 'arts-design' GROUP BY category ORDER BY COUNT(podcast_id) DESC LIMIT 1 ) \"has more podcasts\" , ( SELECT SUM(CASE WHEN category = 'arts-books' THEN 1 ELSE 0 END) - SUM(CASE WHEN category = 'arts-design' THEN 1 ELSE 0 END) FROM categories ) \"differenct BETWEEN arts-books and arts-design\"\n```"}]}, {"id": "train-7943", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many total reviews runned at in June 2022 were added to the podcasts?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(reviews_added) FROM runs WHERE run_at LIKE '2022-06-%'\n```"}]}, {"id": "train-7944", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many podcast reviews with a rating of 3 were created during the first quarter of 2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(podcast_id) FROM reviews WHERE rating = 3 AND created_at BETWEEN '2015-01-01T00:00:00-07:00' AND '2015-03-31T23:59:59-07:00'\n```"}]}, {"id": "train-7945", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of podcasts in the fiction-science-fiction category."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN category = 'fiction-science-fiction' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(podcast_id) OR '%' \"percentage\" FROM categories\n```"}]}, {"id": "train-7946", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating of all the podcasts with reviews created in 2019?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(rating) FROM reviews WHERE created_at BETWEEN '2019-01-01T00:00:00-07:00' AND '2019-12-31T23:59:59-07:00'\n```"}]}, {"id": "train-7947", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of reviews added each year of the total reviews added?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(CASE WHEN run_at LIKE '2022-%' THEN reviews_added ELSE 0 END) - SUM(CASE WHEN run_at LIKE '2021-%' THEN reviews_added ELSE 0 END)) AS REAL) * 100 / SUM(reviews_added) OR '%' \"percentage\" FROM runs\n```"}]}, {"id": "train-7948", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicates the title of all podcasts in the fiction category."}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'fiction'\n```"}]}, {"id": "train-7949", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the rating and category of the podcast entitled Sitcomadon?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.rating, T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title = 'Sitcomadon'\n```"}]}, {"id": "train-7950", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the id of the reviewer whose itunes id is 1516665400."}, {"from": "gpt", "value": "```sql\nSELECT T2.author_id FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.itunes_id = 1516665400\n```"}]}, {"id": "train-7951", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the titles of the podcasts whose reviews were created between 2018-08-22T11:53:16-07:00 and 2018-11-20T11:14:20-07:00?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.created_at BETWEEN '2018-08-22T11:53:16-07:00' AND '2018-11-20T11:14:20-07:00'\n```"}]}, {"id": "train-7952", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which categories do the podcasts of the reviewer whose id is EFB34EAC8E9397C belong?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.category FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = 'EFB34EAC8E9397C'\n```"}]}, {"id": "train-7953", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the slug and the itunes url of the podcast whose review content was written Can't stop listening."}, {"from": "gpt", "value": "```sql\nSELECT slug, itunes_url FROM podcasts WHERE podcast_id IN ( SELECT podcast_id FROM reviews WHERE content = 'Can''t stop listening' )\n```"}]}, {"id": "train-7954", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What dates were the Don't Lie To Your Life Coach podcast reviews created?"}, {"from": "gpt", "value": "```sql\nSELECT created_at FROM reviews WHERE podcast_id = ( SELECT podcast_id FROM podcasts WHERE title = 'Don''t Lie To Your Life Coach' )\n```"}]}, {"id": "train-7955", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In how many categories were podcast reviews created in the last six months of 2016? List them."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.category) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.created_at BETWEEN '2016-07-01T00:00:00-07:00' AND '2016-12-31T23:59:59-07:00'\n```"}]}, {"id": "train-7956", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average rating of the true crime category."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.rating) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'true-crime'\n```"}]}, {"id": "train-7957", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the titles of the art category."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts'\n```"}]}, {"id": "train-7958", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating of all the podcasts in category art?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.rating) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts'\n```"}]}, {"id": "train-7959", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names of podcasts in the art category in 2018."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts' AND T2.created_at LIKE '2018-%'\n```"}]}, {"id": "train-7960", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write the names of the podcasts in the music category that have a rating greater than 3."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'music' AND T2.rating > 3\n```"}]}, {"id": "train-7961", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which titles have the content \"love\" but the category is art produced between 2018 and 2019."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE (T2.created_at LIKE '2018-%' AND T1.category = 'arts' AND T2.content LIKE '%love%') OR (T2.created_at LIKE '2019-%' AND T1.category = 'arts' AND T2.content LIKE '%love%')\n```"}]}, {"id": "train-7962", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the category and itune url of the title \"Scaling Global\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.category, T2.itunes_url FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'Scaling Global'\n```"}]}, {"id": "train-7963", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating of podcasts in comedy category?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.rating) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'comedy'\n```"}]}, {"id": "train-7964", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the least common category?"}, {"from": "gpt", "value": "```sql\nSELECT category FROM categories GROUP BY category ORDER BY COUNT(podcast_id) ASC LIMIT 1\n```"}]}, {"id": "train-7965", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the longest review?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM reviews ORDER BY LENGTH(content) DESC LIMIT 1\n```"}]}, {"id": "train-7966", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the review with the title \"Hosts bring the show down\" for?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM podcasts WHERE podcast_id = ( SELECT podcast_id FROM reviews WHERE title = 'Hosts bring the show down' )\n```"}]}, {"id": "train-7967", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which \"music\" podcast has the longest title?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'music' ORDER BY LENGTH(T2.title) DESC LIMIT 1\n```"}]}, {"id": "train-7968", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the cagetories for all the podcasts with \"jessica\" in the title."}, {"from": "gpt", "value": "```sql\nSELECT category FROM categories WHERE podcast_id IN ( SELECT podcast_id FROM podcasts WHERE title LIKE '%jessica%' )\n```"}]}, {"id": "train-7969", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the category for the \"Moist Boys\" podcast?"}, {"from": "gpt", "value": "```sql\nSELECT category FROM categories WHERE podcast_id IN ( SELECT podcast_id FROM podcasts WHERE title = 'Moist Boys' )\n```"}]}, {"id": "train-7970", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all of the two-star reviews and their categories."}, {"from": "gpt", "value": "```sql\nSELECT T1.category FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.rating = 2\n```"}]}, {"id": "train-7971", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the podcasts reviewed by a reviewer who has a review titled \"Inspired & On Fire!\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'Inspired & On Fire!'\n```"}]}, {"id": "train-7972", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the titles and categories of all the podcasts with a review that has \"Absolutely fantastic\" in it?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title, T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T3.content LIKE '%Absolutely fantastic%'\n```"}]}, {"id": "train-7973", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which category has the most reviews?"}, {"from": "gpt", "value": "```sql\nSELECT T1.category FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id GROUP BY T1.category ORDER BY COUNT(T2.podcast_id) DESC LIMIT 1\n```"}]}, {"id": "train-7974", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the urls for all the \"fiction-science-fiction\" podcasts."}, {"from": "gpt", "value": "```sql\nSELECT itunes_url FROM podcasts WHERE podcast_id IN ( SELECT podcast_id FROM categories WHERE category = 'fiction-science-fiction' )\n```"}]}, {"id": "train-7975", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the content of the earliest review for the \"Stuff You Should Know\" podcast?"}, {"from": "gpt", "value": "```sql\nSELECT T2.content FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Stuff You Should Know' ORDER BY T2.created_at ASC LIMIT 1\n```"}]}, {"id": "train-7976", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many reviews does \"Planet Money\" have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.podcast_id) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Planet Money'\n```"}]}, {"id": "train-7977", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating for the \"crime-junkie\" podcast?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Crime Junkie'\n```"}]}, {"id": "train-7978", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of podcasts are \"technology\" podcasts? List all of them."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.category = 'technology' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.title) OR '%' \"percentage\" FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id\n```"}]}, {"id": "train-7979", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the content of the review under the title \"really interesting!\" and is created on 2018-04-24 at 12:05:16?"}, {"from": "gpt", "value": "```sql\nSELECT content FROM reviews WHERE title = 'really interesting!' AND created_at = '2018-04-24T12:05:16-07:00'\n```"}]}, {"id": "train-7980", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which category is the podcast \"Scaling Global\" under?"}, {"from": "gpt", "value": "```sql\nSELECT category FROM categories WHERE podcast_id IN ( SELECT podcast_id FROM podcasts WHERE title = 'Scaling Global' )\n```"}]}, {"id": "train-7981", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the podcasts under the category \"arts-performing-arts\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts-performing-arts'\n```"}]}, {"id": "train-7982", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many reviews are created for the podcast \"Scaling Global\" under?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.content) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Scaling Global'\n```"}]}, {"id": "train-7983", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the reviews for the podcast \"Please Excuse My Dead Aunt Sally\", how many of them are made in the year 2019?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.created_at) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.created_at LIKE '2019-%'\n```"}]}, {"id": "train-7984", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of the podcasts for which the author whose ID is F7E5A318989779D has written a review."}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = 'F7E5A318989779D'\n```"}]}, {"id": "train-7985", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many ratings of 5 have been given to the podcast \"Please Excuse My Dead Aunt Sally\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.rating = 5\n```"}]}, {"id": "train-7986", "db_id": "music_platform_2", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rating of the podcast \"Please Excuse My Dead Aunt Sally\"?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally'\n```"}]}, {"id": "train-7987", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many universities have at least 80,000 students in the year 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university_year WHERE num_students > 80000 AND year = 2011\n```"}]}, {"id": "train-7988", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ranking system ID of the award criteria?"}, {"from": "gpt", "value": "```sql\nSELECT ranking_system_id FROM ranking_criteria WHERE criteria_name = 'Award'\n```"}]}, {"id": "train-7989", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many state universities are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university WHERE university_name LIKE '%State%'\n```"}]}, {"id": "train-7990", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the student staff ratio of the university with the highest student staff ratio of all time?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(student_staff_ratio) FROM university_year WHERE student_staff_ratio = ( SELECT MAX(student_staff_ratio) FROM university_year )\n```"}]}, {"id": "train-7991", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many criteria belong to ranking system ID 3?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(id) FROM ranking_criteria WHERE ranking_system_id = 3\n```"}]}, {"id": "train-7992", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of the university that has only 1% of international students between 2011 to 2015?"}, {"from": "gpt", "value": "```sql\nSELECT university_id FROM university_year WHERE pct_international_students = 1 AND year BETWEEN 2011 AND 2015\n```"}]}, {"id": "train-7993", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the country that has the most universities."}, {"from": "gpt", "value": "```sql\nSELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id GROUP BY T2.country_name ORDER BY COUNT(T1.university_name) DESC LIMIT 1\n```"}]}, {"id": "train-7994", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the university that had the highest number of international students for 6 consecutive years?"}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id ORDER BY T1.pct_international_students DESC LIMIT 1\n```"}]}, {"id": "train-7995", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2014, what is the name of the university which was considered a leader in the publications rank?"}, {"from": "gpt", "value": "```sql\nSELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Publications Rank' AND T2.year = 2014 AND T1.id = 17 ORDER BY T2.score DESC LIMIT 1\n```"}]}, {"id": "train-7996", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the university that has the lowest number of students of all time?"}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id ORDER BY T1.num_students LIMIT 1\n```"}]}, {"id": "train-7997", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many universities are there in the United States of America?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'United States of America'\n```"}]}, {"id": "train-7998", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2016, what is the name of the university in Australia with the highest score in Citations criteria?"}, {"from": "gpt", "value": "```sql\nSELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id INNER JOIN country AS T4 ON T4.id = T3.country_id WHERE T1.criteria_name = 'Citations' AND T2.year = 2016 AND T1.id = 4 AND T4.country_name = 'Australia' ORDER BY T2.score DESC LIMIT 1\n```"}]}, {"id": "train-7999", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many universities scored 0 in Awards between 2005 to 2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T1.criteria_name = 'Award' AND T2.year BETWEEN 2005 AND 2015 AND T2.score = 0\n```"}]}, {"id": "train-8000", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is the University of Oxford located?"}, {"from": "gpt", "value": "```sql\nSELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE university_name = 'University of Oxford'\n```"}]}, {"id": "train-8001", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times did the Yale University achieve a score of no less than 10 in the Quality of Education Rank?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'Yale University' AND T2.score >= 10 AND T1.criteria_name = 'Quality of Education Rank'\n```"}]}, {"id": "train-8002", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the criteria under Center for World University Rankings?"}, {"from": "gpt", "value": "```sql\nSELECT T2.criteria_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Center for World University Rankings'\n```"}]}, {"id": "train-8003", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of all the universities that have no less than 50,000 students in the year 2012."}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.num_students > 50000 AND T1.year = 2012\n```"}]}, {"id": "train-8004", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 2011 to 2016, in which countries can you find the universities where at least 50% of its students are international students?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.country_name FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.pct_international_students > 50 AND T2.year BETWEEN 2011 AND 2016\n```"}]}, {"id": "train-8005", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many universities have no less than 20,000 female students in 2016? Identify how many of the said universities are located in the United States of America."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) , SUM(CASE WHEN T3.country_name = 'United States of America' THEN 1 ELSE 0 END) AS nums_in_usa FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2016 AND T2.num_students * T2.pct_female_students / 100 > 20000\n```"}]}, {"id": "train-8006", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the top 5 universities with the highest number of international students?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id ORDER BY (CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) DESC LIMIT 5\n```"}]}, {"id": "train-8007", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the university ID of the university with the largest student staff ratio?"}, {"from": "gpt", "value": "```sql\nSELECT university_id FROM university_year ORDER BY student_staff_ratio DESC LIMIT 1\n```"}]}, {"id": "train-8008", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the year where a university had the lowest number of students."}, {"from": "gpt", "value": "```sql\nSELECT year FROM university_year ORDER BY num_students ASC LIMIT 1\n```"}]}, {"id": "train-8009", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compute the average percentage of female students."}, {"from": "gpt", "value": "```sql\nSELECT AVG(pct_female_students) FROM university_year\n```"}]}, {"id": "train-8010", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of international students and number of students in 2013 in university ID 20."}, {"from": "gpt", "value": "```sql\nSELECT pct_international_students * num_students, num_students FROM university_year WHERE year = 2013 AND university_id = 20\n```"}]}, {"id": "train-8011", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the university ID of Harvard University?"}, {"from": "gpt", "value": "```sql\nSELECT id FROM university WHERE university_name = 'Harvard University'\n```"}]}, {"id": "train-8012", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the university ID of the university that scored 100 in 2011."}, {"from": "gpt", "value": "```sql\nSELECT university_id FROM university_ranking_year WHERE score = 100 AND year = 2011\n```"}]}, {"id": "train-8013", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ranking system of the ranking criteria named Quality of Education Rank."}, {"from": "gpt", "value": "```sql\nSELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Quality of Education Rank'\n```"}]}, {"id": "train-8014", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the student staff ratio of Harvard University in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT T1.student_staff_ratio FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Harvard University' AND T1.year = 2012\n```"}]}, {"id": "train-8015", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the location of the university ID 112."}, {"from": "gpt", "value": "```sql\nSELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.id = 112\n```"}]}, {"id": "train-8016", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total number of students in universities located in Sweden."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.num_students) FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T3.country_name = 'Sweden'\n```"}]}, {"id": "train-8017", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ranking criteria ID of Brown University in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ranking_criteria_id FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Brown University' AND T1.year = 2014\n```"}]}, {"id": "train-8018", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of universities located in Spain."}, {"from": "gpt", "value": "```sql\nSELECT T1.university_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Spain'\n```"}]}, {"id": "train-8019", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the criteria name of the university ID 32 in 2015?"}, {"from": "gpt", "value": "```sql\nSELECT T1.criteria_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T2.university_id = 32 AND T2.year = 2015\n```"}]}, {"id": "train-8020", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compute the average score of the university located in Brazil."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.score) FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T3.country_name = 'Brazil'\n```"}]}, {"id": "train-8021", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which country does the most populated university in 2014 located ?"}, {"from": "gpt", "value": "```sql\nSELECT T2.country_id FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2014 ORDER BY T1.num_students DESC LIMIT 1\n```"}]}, {"id": "train-8022", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the score and number of international students in university ID 100 in 2015."}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.num_students * T1.pct_international_students AS REAL) / 100, T2.score FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.year = 2015 AND T1.university_id = 100\n```"}]}, {"id": "train-8023", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the student population of the university that scored 98 in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.num_students) FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.score = 98 AND T1.year = 2013\n```"}]}, {"id": "train-8024", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the criteria names under the ranking system called Center for World University Ranking."}, {"from": "gpt", "value": "```sql\nSELECT T2.criteria_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Center for World University Rankings'\n```"}]}, {"id": "train-8025", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the country name of universities with the number of students greater than 98% of the average student population of all universities in 2013."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.country_name FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2013 AND T2.num_students * 100 > ( SELECT AVG(num_students) FROM university_year ) * 98\n```"}]}, {"id": "train-8026", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among universities that score below 80 in 2015, what is the percentage of international students?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) / COUNT(*) * 100 FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.score < 80 AND T1.year = 2015\n```"}]}, {"id": "train-8027", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students attended universities were there in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(num_students) FROM university_year WHERE year = 2011\n```"}]}, {"id": "train-8028", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all universities, how many female students were there in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CAST(num_students * pct_female_students AS REAL) / 100) FROM university_year WHERE year = 2011\n```"}]}, {"id": "train-8029", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the student staff ratio at the university with the greatest student staff ratio of all time?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(student_staff_ratio) FROM university_year ORDER BY student_staff_ratio DESC LIMIT 1\n```"}]}, {"id": "train-8030", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the university ID with the most students in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT university_id FROM university_year WHERE year = 2011 ORDER BY num_students DESC LIMIT 1\n```"}]}, {"id": "train-8031", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many institutions with over 50,000 students in 2011 had a percentage of oversea students of more than 10%?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university_year WHERE year = 2011 AND num_students > 50000 AND pct_international_students > 10\n```"}]}, {"id": "train-8032", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ID of the university with the highest percentage of female students in 2012."}, {"from": "gpt", "value": "```sql\nSELECT university_id FROM university_year WHERE year = 2012 ORDER BY pct_female_students DESC LIMIT 1\n```"}]}, {"id": "train-8033", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which university had the highest reputation in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2012 ORDER BY T1.score DESC LIMIT 1\n```"}]}, {"id": "train-8034", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the university that had the most students in 2011."}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 ORDER BY T1.num_students DESC LIMIT 1\n```"}]}, {"id": "train-8035", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the university's name with the highest ranking score in Teaching."}, {"from": "gpt", "value": "```sql\nSELECT T1.university_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id INNER JOIN ranking_criteria AS T3 ON T3.id = T2.ranking_criteria_id WHERE T3.criteria_name = 'Teaching' ORDER BY T2.score DESC LIMIT 1\n```"}]}, {"id": "train-8036", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of Harvard university's international students in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT T1.pct_international_students FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 AND T2.university_name = 'Harvard University'\n```"}]}, {"id": "train-8037", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female students were there at Stanford University in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.num_students * T1.pct_female_students AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 AND T2.university_name = 'Stanford University'\n```"}]}, {"id": "train-8038", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which nation is Harvard University located?"}, {"from": "gpt", "value": "```sql\nSELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'Harvard University'\n```"}]}, {"id": "train-8039", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the ranking system for Teaching criteria?"}, {"from": "gpt", "value": "```sql\nSELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Teaching'\n```"}]}, {"id": "train-8040", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the most famous university in Argentina."}, {"from": "gpt", "value": "```sql\nSELECT T1.university_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T3.country_name = 'Argentina' GROUP BY T1.university_name ORDER BY SUM(T2.score) DESC LIMIT 1\n```"}]}, {"id": "train-8041", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Argentina, how many universities are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Argentina'\n```"}]}, {"id": "train-8042", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which universities have more than 100,000 students in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 AND T1.num_students > 100000\n```"}]}, {"id": "train-8043", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many criteria are associated with ranking system Center for World University Rankings?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.criteria_name) FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Center for World University Rankings'\n```"}]}, {"id": "train-8044", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students at the university earned a score of 90 in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.score = 90 AND T1.year = 2011\n```"}]}, {"id": "train-8045", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top three universities with the most international students?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id GROUP BY T2.university_name ORDER BY SUM(T1.num_students * T1.pct_international_students / 100) DESC LIMIT 3\n```"}]}, {"id": "train-8046", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in overall student enrollment and international student enrollment at the Harvard university from 2011 to 2012?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.num_students) - SUM(CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Harvard University' AND T1.year BETWEEN 2011 AND 2012\n```"}]}, {"id": "train-8047", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many universities had over 30000 students in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university_year WHERE year = 2011 AND num_students > 30000\n```"}]}, {"id": "train-8048", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the country ID of the University of Tokyo?"}, {"from": "gpt", "value": "```sql\nSELECT country_id FROM university WHERE university_name = 'University of Tokyo'\n```"}]}, {"id": "train-8049", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ranking system ID of the Center for World University Rankings."}, {"from": "gpt", "value": "```sql\nSELECT id FROM ranking_system WHERE system_name = 'Center for World University Rankings'\n```"}]}, {"id": "train-8050", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of the Publications Rank criteria?"}, {"from": "gpt", "value": "```sql\nSELECT id FROM ranking_criteria WHERE criteria_name = 'Publications Rank'\n```"}]}, {"id": "train-8051", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many universities had above 30% of international students in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university_year WHERE pct_international_students > 30 AND year = 2013\n```"}]}, {"id": "train-8052", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many universities got less than 50 scores under ranking criteria ID 6 in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university_ranking_year WHERE ranking_criteria_id = 6 AND year = 2011 AND score < 50\n```"}]}, {"id": "train-8053", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of students at Yale University in 2016."}, {"from": "gpt", "value": "```sql\nSELECT T1.num_students FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Yale University' AND T1.year = 2016\n```"}]}, {"id": "train-8054", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the universities in Denmark."}, {"from": "gpt", "value": "```sql\nSELECT T1.university_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Denmark'\n```"}]}, {"id": "train-8055", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the number of staff at the University of Auckland in 2015."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.num_students) AS REAL) / SUM(T1.student_staff_ratio) FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'University of Auckland' AND T1.year = 2015\n```"}]}, {"id": "train-8056", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the University of S\u00c3\u00a3o Paulo?"}, {"from": "gpt", "value": "```sql\nSELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'University of S\u00e3o Paulo'\n```"}]}, {"id": "train-8057", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many international students attended Harvard University in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(T2.num_students * T2.pct_international_students AS REAL) / 100 FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id WHERE T1.university_name = 'Harvard University' AND T2.year = 2012\n```"}]}, {"id": "train-8058", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the number of female students at Arizona State University in 2014."}, {"from": "gpt", "value": "```sql\nSELECT CAST(T2.num_students * T2.pct_female_students AS REAL) / 100 FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id WHERE T1.university_name = 'Arizona State University' AND T2.year = 2014\n```"}]}, {"id": "train-8059", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the universities which got the highest scores."}, {"from": "gpt", "value": "```sql\nSELECT T1.university_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id GROUP BY T1.university_name ORDER BY SUM(T2.score) DESC LIMIT 1\n```"}]}, {"id": "train-8060", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ranking criteria under the Shanghai Ranking system."}, {"from": "gpt", "value": "```sql\nSELECT T2.criteria_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Shanghai Ranking'\n```"}]}, {"id": "train-8061", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2011, which university got the lowest score in teaching criteria?"}, {"from": "gpt", "value": "```sql\nSELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Teaching' AND T2.year = 2011 ORDER BY T2.score ASC LIMIT 1\n```"}]}, {"id": "train-8062", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ranking system name for the \"Quality of Education Rank\" criteria."}, {"from": "gpt", "value": "```sql\nSELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Quality of Education Rank'\n```"}]}, {"id": "train-8063", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of universities got a score above 80 under International criteria in 2016? Among them, name the university which got the highest score."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.score > 80 THEN 1 ELSE 0 END) AS REAL) / COUNT(*), ( SELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'International' AND T2.year = 2016 AND T2.score > 80 ORDER BY T2.score DESC LIMIT 1 ) AS max FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'International' AND T2.year = 2016\n```"}]}, {"id": "train-8064", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ranking criteria and scores in 2005 that were received by Harvard University."}, {"from": "gpt", "value": "```sql\nSELECT T1.criteria_name, T2.score FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'Harvard University' AND T2.year = 2005\n```"}]}, {"id": "train-8065", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average score per university under Alumni criteria in 2008."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.score) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T1.criteria_name = 'Alumni' AND T2.year = 2008\n```"}]}, {"id": "train-8066", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the university and country which had the highest number of international students in 2015."}, {"from": "gpt", "value": "```sql\nSELECT T1.university_name, T3.country_name FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2015 ORDER BY T2.num_students DESC LIMIT 1\n```"}]}, {"id": "train-8067", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students were there in university ID 1 in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT num_students FROM university_year WHERE year = 2011 AND university_id = 1\n```"}]}, {"id": "train-8068", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of the university with the most students in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT university_id FROM university_year WHERE year = 2011 ORDER BY num_students DESC LIMIT 1\n```"}]}, {"id": "train-8069", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the universities with a student staff ratio of over 15 in 2011."}, {"from": "gpt", "value": "```sql\nSELECT university_id FROM university_year WHERE year = 2011 AND student_staff_ratio > 15\n```"}]}, {"id": "train-8070", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the universities with over 20000 students in 2011, how many of them have an international students percentage of over 25% in the same year?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university_year WHERE year = 2011 AND pct_international_students > 25 AND num_students > 20000\n```"}]}, {"id": "train-8071", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the IDs of the universities with the top 3 female students percentage in 2011."}, {"from": "gpt", "value": "```sql\nSELECT university_id FROM university_year WHERE year = 2011 ORDER BY pct_female_students DESC LIMIT 3\n```"}]}, {"id": "train-8072", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year did university ID 1 have the most students?"}, {"from": "gpt", "value": "```sql\nSELECT year FROM university_year WHERE university_id = 1 ORDER BY num_students DESC LIMIT 1\n```"}]}, {"id": "train-8073", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students did Harvard University have in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT T1.num_students FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Harvard University' AND T1.year = 2011\n```"}]}, {"id": "train-8074", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the university with the most international students in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 ORDER BY T1.pct_international_students DESC LIMIT 1\n```"}]}, {"id": "train-8075", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the universities in Australia."}, {"from": "gpt", "value": "```sql\nSELECT T1.university_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Australia'\n```"}]}, {"id": "train-8076", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the universities in Australia, how many of them have more than 15000 students in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T3.country_name = 'Australia' AND T2.year = 2011 AND T2.num_students > 15000\n```"}]}, {"id": "train-8077", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is Harvard University in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'Harvard University'\n```"}]}, {"id": "train-8078", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the university with the highest score in teaching in the year 2011?"}, {"from": "gpt", "value": "```sql\nSELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Teaching' AND T2.year = 2011 ORDER BY T2.score DESC LIMIT 1\n```"}]}, {"id": "train-8079", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the universities with a score in teaching of over 90 in 2011."}, {"from": "gpt", "value": "```sql\nSELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Teaching' AND T2.year = 2011 AND T2.score > 90\n```"}]}, {"id": "train-8080", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the universities with a score in teaching of over 90 in 2011, how many of them are in the United States of America?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Teaching' AND T2.year = 2011 AND T2.score > 90\n```"}]}, {"id": "train-8081", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the ranking criteria of Harvard University in 2011."}, {"from": "gpt", "value": "```sql\nSELECT T1.criteria_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'Harvard University' AND T2.year = 2011\n```"}]}, {"id": "train-8082", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the universities that got 98 in teaching in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T1.criteria_name = 'Teaching' AND T2.year = 2011 AND T2.score = 98\n```"}]}, {"id": "train-8083", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the universities that scored under 60 in teaching in 2011 and are in the United States of America."}, {"from": "gpt", "value": "```sql\nSELECT T3.university_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id INNER JOIN country AS T4 ON T4.id = T3.country_id WHERE T4.country_name = 'United States of America' AND T2.year = 2011 AND T2.score < 60 AND T1.criteria_name = 'Teaching'\n```"}]}, {"id": "train-8084", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the universities in Australia, how many of them have a student staff ratio of over 15 in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T3.country_name = 'Australia' AND T2.student_staff_ratio > 15 AND T2.year = 2011\n```"}]}, {"id": "train-8085", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female students did Stanford University have in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.num_students * T1.pct_female_students AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 AND T2.university_name = 'Stanford University'\n```"}]}, {"id": "train-8086", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the universities with a score in teaching of over 90 in 2011, what is the percentage of those in the United States of America?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T4.country_name = 'United States of America' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) AS per FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id INNER JOIN country AS T4 ON T4.id = T3.country_id WHERE T1.criteria_name = 'Teaching' AND T2.year = 2011 AND T2.score > 90\n```"}]}, {"id": "train-8087", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the id of \"Center for World University Rankings\"."}, {"from": "gpt", "value": "```sql\nSELECT id FROM ranking_system WHERE system_name = 'Center for World University Rankings'\n```"}]}, {"id": "train-8088", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is University of Veterinary Medicine Vienna located in? Give its country id."}, {"from": "gpt", "value": "```sql\nSELECT country_id FROM university WHERE university_name = 'University of Veterinary Medicine Vienna'\n```"}]}, {"id": "train-8089", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the id of the criteria \"Citations Rank\"?"}, {"from": "gpt", "value": "```sql\nSELECT id FROM ranking_criteria WHERE criteria_name = 'Citations Rank'\n```"}]}, {"id": "train-8090", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the id of University of Orl\u00e9ans."}, {"from": "gpt", "value": "```sql\nSELECT id FROM university WHERE university_name = 'University of Orl\u00e9ans'\n```"}]}, {"id": "train-8091", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the university id 268, show its number of students in 2013."}, {"from": "gpt", "value": "```sql\nSELECT num_students FROM university_year WHERE university_id = 268 AND year = 2013\n```"}]}, {"id": "train-8092", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the name of country id 66."}, {"from": "gpt", "value": "```sql\nSELECT country_name FROM country WHERE id = 66\n```"}]}, {"id": "train-8093", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is McMaster University located in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'McMaster University'\n```"}]}, {"id": "train-8094", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Turkish universities are there in the database?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Turkey'\n```"}]}, {"id": "train-8095", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which university had the most students in 2011? Show its name."}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 ORDER BY T1.num_students DESC LIMIT 1\n```"}]}, {"id": "train-8096", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many students were there in University of Michigan in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id WHERE T1.university_name = 'University of Michigan' AND T2.year = 2011\n```"}]}, {"id": "train-8097", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For Chosun University, what was its score on \"Influence Rank\" in 2015?"}, {"from": "gpt", "value": "```sql\nSELECT T2.score FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'Chosun University' AND T1.criteria_name = 'Influence Rank' AND T2.year = 2015\n```"}]}, {"id": "train-8098", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the international students in University of Oslo in 2015?"}, {"from": "gpt", "value": "```sql\nSELECT T2.pct_international_students FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id WHERE T1.university_name = 'University of Oslo' AND T2.year = 2015\n```"}]}, {"id": "train-8099", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the University of Southampton in 2015, on which criteria did it score the best?"}, {"from": "gpt", "value": "```sql\nSELECT T1.criteria_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'University of Southampton' AND T2.year = 2015 ORDER BY T2.score DESC LIMIT 1\n```"}]}, {"id": "train-8100", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which ranking system is criteria \"Total Shanghai\" in?"}, {"from": "gpt", "value": "```sql\nSELECT T1.system_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T2.criteria_name = 'Total Shanghai'\n```"}]}, {"id": "train-8101", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female students were there in Pierre and Marie Curie University in 2015?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.num_students * T1.pct_female_students AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 AND T2.university_name = 'Pierre and Marie Curie University'\n```"}]}, {"id": "train-8102", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the score for University of Florida in \"N and S\" in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT T2.score FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id INNER JOIN university AS T3 ON T3.id = T2.university_id WHERE T3.university_name = 'University of Florida' AND T2.year = 2014 AND T1.criteria_name = 'N and S'\n```"}]}, {"id": "train-8103", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the number of international students of University of Wisconsin-Madison in 2013."}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.num_students * T1.pct_international_students AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2013 AND T2.university_name = 'University of Wisconsin-Madison'\n```"}]}, {"id": "train-8104", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the name of the university with the lowest number of students in 2015."}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 ORDER BY T1.num_students ASC LIMIT 1\n```"}]}, {"id": "train-8105", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times more was the number of students of University of Ottawa than Joseph Fourier University in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.university_name = 'University of Ottawa' THEN T1.num_students ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.university_name = 'Joseph Fourier University' THEN T1.num_students ELSE 0 END) FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2013\n```"}]}, {"id": "train-8106", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of criterias among \"Times Higher Education World University Ranking\",\"Shanghai Ranking\" and \"Center for World University Rankings\"."}, {"from": "gpt", "value": "```sql\nSELECT (SUM(CASE WHEN T1.system_name = 'Center for World University Rankings' THEN 1 ELSE 0 END) + SUM(CASE WHEN T1.system_name = 'Shanghai Ranking' THEN 1 ELSE 0 END) + SUM(CASE WHEN T1.system_name = 'Times Higher Education World University Ranking' THEN 1 ELSE 0 END)) / 3 FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id\n```"}]}, {"id": "train-8107", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average number of students of all universities in 2012."}, {"from": "gpt", "value": "```sql\nSELECT AVG(num_students) FROM university_year WHERE year = 2012\n```"}]}, {"id": "train-8108", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the score of university ID 68 in 2015?"}, {"from": "gpt", "value": "```sql\nSELECT score FROM university_ranking_year WHERE year = 2015 AND university_id = 68\n```"}]}, {"id": "train-8109", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the country ID of Cyprus."}, {"from": "gpt", "value": "```sql\nSELECT id FROM country WHERE country_name = 'Cyprus'\n```"}]}, {"id": "train-8110", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of university with the largest percentage of international students?"}, {"from": "gpt", "value": "```sql\nSELECT university_id FROM university_year ORDER BY pct_international_students DESC LIMIT 1\n```"}]}, {"id": "train-8111", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the criteria name of the ranking criteria ID 13."}, {"from": "gpt", "value": "```sql\nSELECT criteria_name FROM ranking_criteria WHERE id = 13\n```"}]}, {"id": "train-8112", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average score of all universities in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(score) FROM university_ranking_year WHERE year = 2012\n```"}]}, {"id": "train-8113", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In years 2011 to 2013, what is the total number of female students in university ID 40?"}, {"from": "gpt", "value": "```sql\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```"}]}, {"id": "train-8114", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average score of university ID 79 between year 2013 to 2015."}, {"from": "gpt", "value": "```sql\nSELECT AVG(score) FROM university_ranking_year WHERE year BETWEEN 2013 AND 2015 AND university_id = 79\n```"}]}, {"id": "train-8115", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the student staff ratio of university ID 35."}, {"from": "gpt", "value": "```sql\nSELECT student_staff_ratio FROM university_year WHERE university_id = 35\n```"}]}, {"id": "train-8116", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the score of the most populated university in 2011."}, {"from": "gpt", "value": "```sql\nSELECT T2.score FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T1.year = 2011 ORDER BY T1.num_students DESC LIMIT 1\n```"}]}, {"id": "train-8117", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the criteria name where Harvard University scored 100."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.criteria_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id INNER JOIN ranking_criteria AS T3 ON T3.id = T2.ranking_criteria_id WHERE T1.university_name = 'Harvard University' AND T2.score = 100\n```"}]}, {"id": "train-8118", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the university name and ID of the university found in Turkey."}, {"from": "gpt", "value": "```sql\nSELECT T1.university_name, T1.id FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Turkey'\n```"}]}, {"id": "train-8119", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of ranking criteria under the ranking system called Shanghai Ranking?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Shanghai Ranking'\n```"}]}, {"id": "train-8120", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name and score of the university ID 124."}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name, T1.score FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.id = 124\n```"}]}, {"id": "train-8121", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female students are there in University of Pennsylvania in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.num_students * T1.pct_female_students AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2011 AND T2.university_name = 'University of Pennsylvania'\n```"}]}, {"id": "train-8122", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all universities that scored below 50."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.university_name FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.score < 50\n```"}]}, {"id": "train-8123", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many universities are located in Japan?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Japan'\n```"}]}, {"id": "train-8124", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of the university with the highest number of male students."}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id ORDER BY T1.num_students * T1.pct_female_students / 100 - T1.num_students DESC LIMIT 1\n```"}]}, {"id": "train-8125", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the countries of universities that scored 70 and below in 2016."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.country_name FROM university AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.score < 70 AND T2.year = 2016\n```"}]}, {"id": "train-8126", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate number of male students in Emory University in 2011."}, {"from": "gpt", "value": "```sql\nSELECT CAST((T1.num_students - (T1.num_students * T1.pct_female_students)) AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Emory University' AND T1.year = 2011\n```"}]}, {"id": "train-8127", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which country does Johns Hopkins University located?"}, {"from": "gpt", "value": "```sql\nSELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'Johns Hopkins University'\n```"}]}, {"id": "train-8128", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the names of universities with number of students ranges from 400 to 1000."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.num_students BETWEEN 400 AND 1000\n```"}]}, {"id": "train-8129", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In what year does the Brown University score the highest?"}, {"from": "gpt", "value": "```sql\nSELECT T1.year FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Brown University' ORDER BY T1.score DESC LIMIT 1\n```"}]}, {"id": "train-8130", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average score of Emory University from 2011 to 2016."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.score) FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Emory University' AND T1.year BETWEEN 2011 AND 2016\n```"}]}, {"id": "train-8131", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the university with the most number of students in 2015."}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 ORDER BY T1.num_students DESC LIMIT 1\n```"}]}, {"id": "train-8132", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the location and number of female students in university ID 23 in 2011?"}, {"from": "gpt", "value": "```sql\nSELECT T3.country_name, CAST(T2.num_students * T2.pct_female_students AS REAL) / 100 FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T2.year = 2011 AND T1.id = 23\n```"}]}, {"id": "train-8133", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many universities scored 40 in teaching criteria?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T2.score = 40 AND T1.criteria_name = 'Teaching' AND T2.score = 40\n```"}]}, {"id": "train-8134", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the universities in United States of America, what is the percentage of female students in year 2016?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CAST(T2.pct_female_students * T2.num_students AS REAL) / 100) * 100 / SUM(T2.num_students) FROM university AS T1 INNER JOIN university_year AS T2 ON T1.id = T2.university_id INNER JOIN country AS T3 ON T3.id = T1.country_id WHERE T3.country_name = 'United States of America' AND T2.year = 2016\n```"}]}, {"id": "train-8135", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference between the total number of students and the number of international international students in Univeristy of Tokyo from 2011 to 2014."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.num_students) - SUM(CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year BETWEEN 2011 AND 2014 AND T2.university_name = 'University of Tokyo'\n```"}]}, {"id": "train-8136", "db_id": "university", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of universities with a score less than 28% of the average score of all universities in 2015."}, {"from": "gpt", "value": "```sql\nSELECT T2.university_name FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2015 AND T1.score * 100 < ( SELECT AVG(score) * 28 FROM university_ranking_year WHERE year = 2015 )\n```"}]}, {"id": "train-8137", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many units of item no.9 were sold in store no.1 on 2012/1/1?"}, {"from": "gpt", "value": "```sql\nSELECT units FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 AND item_nbr = 9\n```"}]}, {"id": "train-8138", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many units of item no.9 were sold in store no.1 in total in January, 2012?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(units) FROM sales_in_weather WHERE SUBSTR(`date`, 6, 2) = '01' AND SUBSTR(`date`, 1, 4) = '2012' AND item_nbr = 9 AND store_nbr = 1\n```"}]}, {"id": "train-8139", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of the item that sold the best on 2012/1/1 in store no.1?"}, {"from": "gpt", "value": "```sql\nSELECT item_nbr FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 ORDER BY units DESC LIMIT 1\n```"}]}, {"id": "train-8140", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the temperature range of station no.1 on 2012/1/1?"}, {"from": "gpt", "value": "```sql\nSELECT tmax - tmin AS temrange FROM weather WHERE station_nbr = 1 AND `date` = '2012-01-01'\n```"}]}, {"id": "train-8141", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the dates on which the temperature of station no.2 was above the 30-year normal."}, {"from": "gpt", "value": "```sql\nSELECT `date` FROM weather WHERE station_nbr = 2 AND depart > 0\n```"}]}, {"id": "train-8142", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On which day was the weather more windy in station no.1, 2012/1/1 or 2012/1/2?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN (SUM(CASE WHEN `date` = '2012-01-01' THEN avgspeed ELSE 0 END) - SUM(CASE WHEN `date` = '2012-01-02' THEN avgspeed ELSE 0 END)) > 0 THEN '2012-01-01' ELSE '2012-01-02' END FROM weather WHERE station_nbr = 1\n```"}]}, {"id": "train-8143", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of units of item no.5 sold in store no.3 in 2012 on days when the temperature was below the 30-year normal?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.depart < 0 THEN units ELSE 0 END) AS sum FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.item_nbr = 5\n```"}]}, {"id": "train-8144", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many units of item no.5 were sold in store no.3 on the day in 2012 when the max temperature was the highest?"}, {"from": "gpt", "value": "```sql\nSELECT T1.units FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.item_nbr = 5 ORDER BY tmax DESC LIMIT 1\n```"}]}, {"id": "train-8145", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the dew point on the day the most units of item no.5 were sold in store no.3 in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT dewpoint FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.item_nbr = 5 ORDER BY units DESC LIMIT 1\n```"}]}, {"id": "train-8146", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On how many days with the max temperature over 90 did the sale of item no.5 in store no.3 exceed 100?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN units > 100 THEN 1 ELSE 0 END) AS count FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.item_nbr = 5 AND tmax > 90\n```"}]}, {"id": "train-8147", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many units of item no.5 were sold in store no.3 on the day the temperature range was the biggest?"}, {"from": "gpt", "value": "```sql\nSELECT t2.units FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T1.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T2.item_nbr = 5 ORDER BY t3.tmax - t3.tmin DESC LIMIT 1\n```"}]}, {"id": "train-8148", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the days on which over 100 units of item no.5 were sold in store no.3, on which date was the temperature range the biggest?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`date` FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T1.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T2.item_nbr = 5 AND T2.units > 100 ORDER BY tmax - tmin DESC LIMIT 1\n```"}]}, {"id": "train-8149", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many units of item no.5 were sold in store no.3 in total on days with a total precipitation of over 0.05?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.preciptotal > 0.05 THEN units ELSE 0 END) AS sum FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T1.item_nbr = 5\n```"}]}, {"id": "train-8150", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the dates on which the sale of item no.5 in store no.3 exceeded 100 and the average wind speed exceeded 10."}, {"from": "gpt", "value": "```sql\nSELECT T1.`date` FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T1.item_nbr = 5 AND T1.units > 100 AND T3.avgspeed > 10\n```"}]}, {"id": "train-8151", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total units of products sold on the day with the highest max temperature in store no.3 in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T1.`date` LIKE '%2012%' GROUP BY T3.tmax ORDER BY T3.tmax DESC LIMIT 1\n```"}]}, {"id": "train-8152", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more units of item no.16 were sold on the day with the highest max temperature in 2012 in store no.5 than in store no.10?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.item_nbr = 16 AND T1.`date` LIKE '%2012%' AND T1.store_nbr = 5 GROUP BY tmax ORDER BY T3.tmax DESC LIMIT 1 ) - ( SELECT SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.item_nbr = 16 AND T1.`date` LIKE '%2012%' AND T1.store_nbr = 6 GROUP BY tmax ORDER BY T3.tmax DESC LIMIT 1 )\n```"}]}, {"id": "train-8153", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ID of the item that sold the best on the day with the highest max temperature in store no.3 in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT T1.item_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.store_nbr = 3 AND T1.`date` LIKE '%2012%' AND tmax = ( SELECT MAX(tmax) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.store_nbr = 3 AND T1.`date` LIKE '%2012%' ) GROUP BY T1.item_nbr ORDER BY SUM(units) DESC LIMIT 1\n```"}]}, {"id": "train-8154", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On the day with the highest max temperature in 2012, how many items in store no.3 had no sales?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.item_nbr) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr AND T1.store_nbr = 3 AND SUBSTR(T1.`date`, 1, 4) = '2012' AND T1.units = 0 GROUP BY T3.tmax ORDER BY T3.tmax DESC LIMIT 1\n```"}]}, {"id": "train-8155", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many units of item no.5 were sold in store no.3 on average on the days when the max temperature exceeded 90?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.units) AS REAL) / COUNT(T1.`date`) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.store_nbr = 3 AND T1.item_nbr = 5 AND T3.tmax > 90\n```"}]}, {"id": "train-8156", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the units of item no.5 sold among all units of items sold in store no.3 on the day with the highest max temperature in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.item_nbr = 5 THEN units * 1 ELSE 0 END) AS REAL) * 100 / SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.store_nbr = 3 AND T1.`date` LIKE '%2012%' AND T3.tmax = ( SELECT MAX(T3.tmax) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T1.store_nbr = 3 AND T1.`date` LIKE '%2012%' )\n```"}]}, {"id": "train-8157", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the id of the bestsellers of store no.1 on 2012/1/1."}, {"from": "gpt", "value": "```sql\nSELECT item_nbr FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 ORDER BY units DESC LIMIT 1\n```"}]}, {"id": "train-8158", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many no.9 items from store no.11 were sold on 2012/12/7?"}, {"from": "gpt", "value": "```sql\nSELECT units FROM sales_in_weather WHERE `date` = '2012-12-07' AND store_nbr = 11 AND item_nbr = 9\n```"}]}, {"id": "train-8159", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the average temperature of station no.20 on 2014/10/17."}, {"from": "gpt", "value": "```sql\nSELECT tavg FROM weather WHERE `date` = '2014-10-17' AND station_nbr = 20\n```"}]}, {"id": "train-8160", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the resultant wind speed of station no.9 on 2014/1/15."}, {"from": "gpt", "value": "```sql\nSELECT resultspeed FROM weather WHERE `date` = '2014-01-15' AND station_nbr = 9\n```"}]}, {"id": "train-8161", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the id of the weather station with most stores."}, {"from": "gpt", "value": "```sql\nSELECT station_nbr FROM relation GROUP BY station_nbr ORDER BY COUNT(station_nbr) DESC LIMIT 1\n```"}]}, {"id": "train-8162", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which weather station does store no.20 belong to?"}, {"from": "gpt", "value": "```sql\nSELECT station_nbr FROM relation WHERE store_nbr = 20\n```"}]}, {"id": "train-8163", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the temperature range of the home weather station of store no.7 on 2014/4/28."}, {"from": "gpt", "value": "```sql\nSELECT T1.tmax - T1.tmin AS temprange FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 7 AND T1.`date` = '2014-04-28'\n```"}]}, {"id": "train-8164", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the weather station which recorded the highest temperature above the 30-year normal, how many stores does it have?"}, {"from": "gpt", "value": "```sql\nSELECT store_nbr FROM relation WHERE station_nbr = ( SELECT station_nbr FROM weather ORDER BY depart DESC LIMIT 1 )\n```"}]}, {"id": "train-8165", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the home weather station of store no.15, what was the dew point on 2012/2/18?"}, {"from": "gpt", "value": "```sql\nSELECT T1.dewpoint FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 15 AND T1.`date` = '2012-02-18'\n```"}]}, {"id": "train-8166", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the wet-bulb temperature of the weather station which contained store no.6 on 2012/2/15."}, {"from": "gpt", "value": "```sql\nSELECT T1.wetbulb FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 14 AND T1.`date` = '2012-02-15'\n```"}]}, {"id": "train-8167", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of stores which opened on the weather station that recorded the fastest average wind speed."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T.store_nbr) FROM ( SELECT DISTINCT store_nbr FROM relation WHERE station_nbr = ( SELECT station_nbr FROM weather ORDER BY avgspeed DESC LIMIT 1 ) ) T\n```"}]}, {"id": "train-8168", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the max temperature of the weather station which has the no.21 store on 2012/11/9."}, {"from": "gpt", "value": "```sql\nSELECT tmax FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 21 AND T1.`date` = '2012-11-09'\n```"}]}, {"id": "train-8169", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the sunrise time recorded by the home weather station of store no.30 on 2014/2/21."}, {"from": "gpt", "value": "```sql\nSELECT T1.sunrise FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2014-02-21' AND store_nbr = 30\n```"}]}, {"id": "train-8170", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of stores that belongs to the weather station which recorded the deepest snowfall."}, {"from": "gpt", "value": "```sql\nSELECT T2.store_nbr FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr ORDER BY snowfall DESC LIMIT 1\n```"}]}, {"id": "train-8171", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the code summarization for the weather recorded by the weather station which contained the no.2 store on 2013/2/12."}, {"from": "gpt", "value": "```sql\nSELECT T1.codesum FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2013-02-12' AND T2.store_nbr = 2\n```"}]}, {"id": "train-8172", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Show the sea level status recorded by the weather station of store no.19 on 2013/2/24."}, {"from": "gpt", "value": "```sql\nSELECT T1.sealevel FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2013-02-24' AND T2.store_nbr = 19\n```"}]}, {"id": "train-8173", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many inches of total precipitation was recorded by the weather station of store no.2 on 2012/12/25?"}, {"from": "gpt", "value": "```sql\nSELECT T1.preciptotal FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2012-12-25' AND T2.store_nbr = 2\n```"}]}, {"id": "train-8174", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the station pressure status recorded by the weather station which contained no.12 store on 2012/5/15."}, {"from": "gpt", "value": "```sql\nSELECT T1.stnpressure FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` = '2012-05-15' AND T2.store_nbr = 12\n```"}]}, {"id": "train-8175", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage was the total unit sales of store no.10 to the total sales of its weather station on 2014/10/31?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.store_nbr = 10 THEN units * 1 ELSE 0 END) AS REAL) * 100 / SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.`date` = '2014-10-31'\n```"}]}, {"id": "train-8176", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the weather station has store no.9, what was the increased percentage of the average temperature from 2012/2/2 to 2012/2/3?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(CASE WHEN T1.`date` = '2012-02-03' THEN T1.tavg * 1 ELSE 0 END) - SUM(CASE WHEN T1.`date` = '2012-02-02' THEN T1.tavg * 1 ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T1.`date` = '2012-02-02' THEN T1.tavg * 1 ELSE 0 END) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 9\n```"}]}, {"id": "train-8177", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the item number of the product with the highest number of units sold in store number 1 on 1/1/2012?"}, {"from": "gpt", "value": "```sql\nSELECT item_nbr FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 ORDER BY units DESC LIMIT 1\n```"}]}, {"id": "train-8178", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stores are in weather station 12?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(store_nbr) FROM relation WHERE station_nbr = 12\n```"}]}, {"id": "train-8179", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many items weren't sold in store 2 on 1/1/2012?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(item_nbr) FROM sales_in_weather WHERE store_nbr = 2 AND units = 0 AND `date` = '2012-01-01'\n```"}]}, {"id": "train-8180", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 1/1/2012 to 12/31/2014, which date recorded the hottest temperature in weather station 1?"}, {"from": "gpt", "value": "```sql\nSELECT `date` FROM weather WHERE station_nbr = 1 AND CAST(SUBSTR(`date`, 1, 4) AS int) BETWEEN 2012 AND 2014 ORDER BY tmax DESC LIMIT 1\n```"}]}, {"id": "train-8181", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which weather station has the highest number of stores?"}, {"from": "gpt", "value": "```sql\nSELECT station_nbr FROM relation GROUP BY station_nbr ORDER BY COUNT(store_nbr) DESC LIMIT 1\n```"}]}, {"id": "train-8182", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In March 2014, which weather stations recorded the highest number of days whose temperature is below the 30-year normal?"}, {"from": "gpt", "value": "```sql\nSELECT station_nbr FROM weather WHERE SUBSTR(`date`, 1, 4) = '2014' AND SUBSTR(`date`, 6, 2) = '03' AND depart < 0 GROUP BY station_nbr HAVING COUNT(DISTINCT `date`) = ( SELECT COUNT(DISTINCT `date`) FROM weather WHERE SUBSTR(`date`, 1, 4) = '2014' AND SUBSTR(`date`, 6, 2) = '03' AND depart < 0 GROUP BY station_nbr ORDER BY COUNT(`date`) DESC LIMIT 1 )\n```"}]}, {"id": "train-8183", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which weather station does the store that sold the highest quantity of item 9 belongs to?"}, {"from": "gpt", "value": "```sql\nSELECT station_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.item_nbr = 9 GROUP BY T2.station_nbr ORDER BY SUM(T1.units) DESC LIMIT 1\n```"}]}, {"id": "train-8184", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stores belong to the most windy station?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(store_nbr) FROM relation WHERE station_nbr = ( SELECT station_nbr FROM weather ORDER BY avgspeed DESC LIMIT 1 )\n```"}]}, {"id": "train-8185", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the stores in weather station 14 in February 2014, which store had sold no less than 300 quantities for item number 44 in a single day?"}, {"from": "gpt", "value": "```sql\nSELECT T1.store_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T2.station_nbr = 14 AND T1.`date` LIKE '%2014-02%' AND T1.item_nbr = 44 AND units >= 300\n```"}]}, {"id": "train-8186", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most purchased products during the rainy days in June 2013 in weather station 9?"}, {"from": "gpt", "value": "```sql\nSELECT T1.item_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T3.station_nbr = 9 AND T1.`date` LIKE '%2013-06%' AND codesum = 'RA' ORDER BY T1.units DESC LIMIT 1\n```"}]}, {"id": "train-8187", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which station sold the highest quantity of item number 5 overall?"}, {"from": "gpt", "value": "```sql\nSELECT T2.station_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.item_nbr = 5 GROUP BY T2.station_nbr ORDER BY SUM(T1.units) DESC LIMIT 1\n```"}]}, {"id": "train-8188", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the earliest sunrise recorded in the stations with no more than 1 store in February 2012?"}, {"from": "gpt", "value": "```sql\nSELECT T1.station_nbr FROM relation AS T1 INNER JOIN weather AS T2 ON T1.station_nbr = T2.station_nbr WHERE sunrise IS NOT NULL AND T2.`date` LIKE '%2012-02%' AND T1.station_nbr IN ( SELECT station_nbr FROM relation GROUP BY station_nbr HAVING COUNT(store_nbr) = 1 ) ORDER BY sunrise LIMIT 1\n```"}]}, {"id": "train-8189", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In weather station 17, which store sold the highest quantity of item 45 in October 2012?"}, {"from": "gpt", "value": "```sql\nSELECT T1.store_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.item_nbr = 45 AND T2.station_nbr = 17 AND T1.`date` LIKE '%2012-10%' GROUP BY T1.store_nbr ORDER BY SUM(T1.units) DESC LIMIT 1\n```"}]}, {"id": "train-8191", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the top 3 stations that have sold the highest quantities for an item in a single day?"}, {"from": "gpt", "value": "```sql\nSELECT T2.station_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr ORDER BY T1.units DESC LIMIT 3\n```"}]}, {"id": "train-8192", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stores belong to the station with the highest recorded heat of all time?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.store_nbr) FROM ( SELECT station_nbr FROM weather ORDER BY heat DESC LIMIT 1 ) AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr\n```"}]}, {"id": "train-8193", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On February 8, 2014, what is the minimum temperature in the station where store 29 belongs?"}, {"from": "gpt", "value": "```sql\nSELECT tmin FROM relation AS T1 INNER JOIN weather AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.store_nbr = 29 AND T2.`date` = '2014-02-08'\n```"}]}, {"id": "train-8194", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the stations with 3 stores, how many stations have a station pressure of no more than 30 on February 18, 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(station_nbr) FROM weather WHERE `date` = '2014-02-18' AND stnpressure < 30 AND station_nbr IN ( SELECT station_nbr FROM relation GROUP BY station_nbr HAVING COUNT(store_nbr) = 3 )\n```"}]}, {"id": "train-8195", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which station has the highest number of stores? Calculate the said station's average maximum temperature in February 2012."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T2.tmax) AS REAL) / 29 FROM ( SELECT station_nbr FROM relation GROUP BY station_nbr ORDER BY COUNT(store_nbr) DESC LIMIT 1 ) AS T1 INNER JOIN weather AS T2 ON T1.station_nbr = T2.station_nbr WHERE SUBSTR(T2.`date`, 1, 7) = '2012-02'\n```"}]}, {"id": "train-8196", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between the stores under weather station 12, what is the percentage of item 5 sold in store 10 in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.store_nbr = 10 THEN units * 1 ELSE 0 END) AS REAL) * 100 / SUM(units) FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr WHERE station_nbr = 12 AND item_nbr = 5 AND T2.`date` LIKE '%2014%'\n```"}]}, {"id": "train-8197", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the maximum average speed?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(avgspeed) FROM weather\n```"}]}, {"id": "train-8198", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many days did the show fell more than 5 inches?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT `date`) FROM weather WHERE snowfall > 5\n```"}]}, {"id": "train-8199", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many days did the sun rise before 5 AM?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT `date`) AS days FROM weather WHERE sunrise < time('05:00:00')\n```"}]}, {"id": "train-8200", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the minimum dew point?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(dewpoint) FROM weather\n```"}]}, {"id": "train-8201", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the maximum and minimum temperature for station number 1 on 15 January 2012?"}, {"from": "gpt", "value": "```sql\nSELECT tmax, tmin FROM weather WHERE station_nbr = 1 AND `date` = '2012-01-15'\n```"}]}, {"id": "train-8202", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stations were able to sell item 5 on January 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.station_nbr) AS number FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE SUBSTR(`date`, 1, 7) = '2014-01' AND item_nbr = 5\n```"}]}, {"id": "train-8203", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the lowest minimum temperature recorded in store 16 on January 2012?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(tmin) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 16 AND T1.`date` LIKE '%2012-01%'\n```"}]}, {"id": "train-8204", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many units of item 7 have been sold by store 7 when the snow is less than 5 inches?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(units) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr INNER JOIN sales_in_weather AS T3 ON T2.store_nbr = T3.store_nbr WHERE T2.store_nbr = 7 AND T3.item_nbr = 7 AND T1.snowfall < 5\n```"}]}, {"id": "train-8205", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many items were sold by store 9 during a snowy day?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT item_nbr) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr INNER JOIN sales_in_weather AS T3 ON T2.store_nbr = T3.store_nbr WHERE T3.store_nbr = 9 AND T1.snowfall <> 0 AND T1.snowfall IS NOT NULL\n```"}]}, {"id": "train-8206", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out stations number and items sold by store 17."}, {"from": "gpt", "value": "```sql\nSELECT T1.station_nbr, T2.item_nbr FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.store_nbr = 17 GROUP BY T1.station_nbr, T2.item_nbr\n```"}]}, {"id": "train-8207", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out dates when haze is recorded in store 35."}, {"from": "gpt", "value": "```sql\nSELECT T1.`date` FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 35 AND T1.codesum LIKE '%' OR 'HZ' OR '%'\n```"}]}, {"id": "train-8208", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the sea level and average speed for store number 3 and store number 4?"}, {"from": "gpt", "value": "```sql\nSELECT T1.sealevel, T1.avgspeed FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 3 OR T2.store_nbr = 4\n```"}]}, {"id": "train-8209", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which items from store 1 have the highest units sold during rainy day?"}, {"from": "gpt", "value": "```sql\nSELECT T2.item_nbr FROM weather AS T1 INNER JOIN sales_in_weather AS T2 ON T1.`date` = T2.`date` INNER JOIN relation AS T3 ON T2.store_nbr = T3.store_nbr AND T1.station_nbr = T3.station_nbr WHERE T2.store_nbr = 1 AND T1.codesum LIKE '%' OR 'RA' OR '%' GROUP BY T2.item_nbr ORDER BY T2.units DESC LIMIT 1\n```"}]}, {"id": "train-8210", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of the highest and lowest temperature in store 11?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((MAX(T1.tmax) - MIN(T1.tmin)) AS REAL) / MIN(T1.tmin) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.store_nbr = 11\n```"}]}, {"id": "train-8211", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the difference of number of units sold in station number 1 and number 2 on year 2012?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.station_nbr = 1 THEN units ELSE 0 END) - SUM(CASE WHEN T1.station_nbr = 2 THEN units ELSE 0 END) FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr WHERE T2.`date` LIKE '%2012%'\n```"}]}, {"id": "train-8212", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the average temperature difference between store number 18 and 19 on 16 September 2022?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.store_nbr = 18 THEN T2.tavg ELSE 0 END) - SUM(CASE WHEN T1.store_nbr = 19 THEN T2.tavg ELSE 0 END) FROM relation AS T1 INNER JOIN weather AS T2 ON T1.station_nbr = T2.station_nbr WHERE T2.`date` = '2012-09-16'\n```"}]}, {"id": "train-8213", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many units are being sold for item 1 when the average temperature is 83?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(units) FROM weather AS T1 INNER JOIN sales_in_weather AS T2 ON T1.`date` = T2.`date` INNER JOIN relation AS T3 ON T2.store_nbr = T3.store_nbr WHERE T2.item_nbr = 1 AND T1.tavg = 83\n```"}]}, {"id": "train-8214", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference between the units sold for item 1 when the sunset was the earliest and the latest?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT SUM(T2.units) AS sumunit FROM weather AS T1 INNER JOIN sales_in_weather AS T2 ON T1.`date` = T2.`date` INNER JOIN relation AS T3 ON T2.store_nbr = T3.store_nbr WHERE T2.item_nbr = 5 AND sunset IS NOT NULL GROUP BY T1.sunset ORDER BY T1.sunset LIMIT 1 ) - ( SELECT SUM(T2.units) AS sumunit FROM weather AS T1 INNER JOIN sales_in_weather AS T2 ON T1.`date` = T2.`date` INNER JOIN relation AS T3 ON T2.store_nbr = T3.store_nbr WHERE T2.item_nbr = 5 AND sunset IS NOT NULL GROUP BY T1.sunset ORDER BY T1.sunset DESC LIMIT 1 )\n```"}]}, {"id": "train-8215", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the total unit sold for item 10 when the average temperature was below the median temperature?"}, {"from": "gpt", "value": "```sql\nSELECT 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 INNER JOIN sales_in_weather AS T2 ON T1.`date` = T2.`date` INNER JOIN relation AS T3 ON T2.store_nbr = T3.store_nbr WHERE T2.item_nbr = 10 )\n```"}]}, {"id": "train-8216", "db_id": "sales_in_weather", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the average temperature differences during May 2012 for store number 6 and 7?"}, {"from": "gpt", "value": "```sql\nSELECT ( SELECT CAST(SUM(tavg) AS REAL) / COUNT(`date`) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr AND T1.`date` LIKE '%2012-05%' AND T2.store_nbr = 6 ) - ( SELECT CAST(SUM(tavg) AS REAL) / COUNT(`date`) FROM weather AS T1 INNER JOIN relation AS T2 ON T1.station_nbr = T2.station_nbr WHERE T1.`date` LIKE '%2012-05%' AND T2.store_nbr = 7 )\n```"}]}, {"id": "train-8217", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which country does Polish found least in?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ethnicGroup AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'Polish' GROUP BY T2.Name, T1.Percentage ORDER BY T1.Percentage ASC LIMIT 1\n```"}]}, {"id": "train-8218", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which countries have more than 90% of African? List the name of the country in full."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM ethnicGroup AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'African' AND T1.Percentage > 90\n```"}]}, {"id": "train-8219", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the different ethnic group and percentage of the language in Singapore."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.Percentage FROM ethnicGroup AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'Singapore' GROUP BY T1.Name, T1.Percentage\n```"}]}, {"id": "train-8220", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of country which gained independence as republic after 1970."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN Government = 'republic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Country) FROM politics WHERE STRFTIME('%Y', Independence) > '1970'\n```"}]}, {"id": "train-8221", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the GPD for Bosnia and Herzegovina and the type of government it belongs to."}, {"from": "gpt", "value": "```sql\nSELECT T1.GDP, T2.Government FROM economy AS T1 INNER JOIN politics AS T2 ON T1.Country = T2.Country INNER JOIN country AS T3 ON T3.Code = T2.Country WHERE T3.Name = 'Bosnia and Herzegovina'\n```"}]}, {"id": "train-8222", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the country and its population with population growth greater than 2% but infant mortality rate less than 5%."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.Population FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T2.Population_Growth > 2 AND T2.Infant_Mortality < 5\n```"}]}, {"id": "train-8223", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which is the majority of the ethnic group in country with great than 10,000,000 population"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T1.Population > 10000000 GROUP BY T2.Name, T2.Percentage ORDER BY T2.Percentage DESC LIMIT 2\n```"}]}, {"id": "train-8224", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the country with its full name which has the most ethnic group? List them all ethnic group together with its percentage."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.Name, T2.Percentage FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T1.Name = ( SELECT T1.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country GROUP BY T1.Name ORDER BY COUNT(T2.Name) DESC LIMIT 1 ) GROUP BY T1.Name, T2.Name, T2.Percentage\n```"}]}, {"id": "train-8225", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the country with 100% Africans?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM ethnicGroup AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Percentage = 100 AND T1.Name = 'African'\n```"}]}, {"id": "train-8226", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the infant mortality of country with the least Amerindian."}, {"from": "gpt", "value": "```sql\nSELECT T1.Infant_Mortality FROM population AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Country = T2.Country WHERE T2.Name = 'Amerindian' ORDER BY T2.Percentage ASC LIMIT 1\n```"}]}, {"id": "train-8227", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For country with area greater than 600000, what is agriculture percentage of GDP the country contributes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Agriculture FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Area > 600000 AND T2.Agriculture IS NOT NULL\n```"}]}, {"id": "train-8228", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the country with republic government which has the highest population growth?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM population AS T1 INNER JOIN politics AS T2 ON T1.Country = T2.Country WHERE T2.Government = 'republic' ORDER BY T1.Population_Growth DESC LIMIT 1\n```"}]}, {"id": "train-8229", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did 'Bulgaria' gain independence?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Independence FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Bulgaria'\n```"}]}, {"id": "train-8230", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the population of Arab in each country?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Percentage * T1.Population FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Arab'\n```"}]}, {"id": "train-8231", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the population of African in 'Turks and Caicos Islands'?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Percentage * T1.Population FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'African' AND T1.Name = 'Turks and Caicos Islands'\n```"}]}, {"id": "train-8232", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of growth population for country with the lowest infant mortality?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Population_Growth * T1.Population FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T2.Infant_Mortality IS NOT NULL ORDER BY T2.Infant_Mortality ASC LIMIT 1\n```"}]}, {"id": "train-8233", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among countries with more than 400,000 GDP, state its capital and population."}, {"from": "gpt", "value": "```sql\nSELECT T1.Capital, T1.Population FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T2.GDP > 400000\n```"}]}, {"id": "train-8234", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the service of GDP for Brazil."}, {"from": "gpt", "value": "```sql\nSELECT T2.Service * T2.GDP FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Brazil'\n```"}]}, {"id": "train-8235", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the highest infant mortality? Also state its population growth."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.Population_Growth FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country ORDER BY T2.Infant_Mortality DESC LIMIT 1\n```"}]}, {"id": "train-8236", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all countries with negative growth in population. State the country, population and growth."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.Population, T2.Population_Growth FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T2.Population_Growth < 0\n```"}]}, {"id": "train-8237", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For countries with area between 500000 to 1000000, state the country and infant mortality rate."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.Infant_Mortality FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T1.Area BETWEEN 500000 AND 1000000\n```"}]}, {"id": "train-8238", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries with more than 3% population growth rate, state the country name in full along with its GDP."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T3.GDP FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country INNER JOIN economy AS T3 ON T3.Country = T2.Country WHERE T2.Population_Growth > 3\n```"}]}, {"id": "train-8239", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the infant mortality rate for Ethiopia?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Infant_Mortality FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Ethiopia'\n```"}]}, {"id": "train-8240", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much does the gross domestic products goes to the industry sector for Singapore?"}, {"from": "gpt", "value": "```sql\nSELECT T2.GDP * T2.Industry FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Singapore'\n```"}]}, {"id": "train-8241", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is her GDP in agriculture for the country with the least area?"}, {"from": "gpt", "value": "```sql\nSELECT T2.GDP * T2.Agriculture FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T1.Area ASC LIMIT 1\n```"}]}, {"id": "train-8242", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the biggest percentage of the albanian ethnic group?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Albanian' ORDER BY T2.Percentage DESC LIMIT 1\n```"}]}, {"id": "train-8243", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries with the African ethnic group, how many of them has a population of over 10000000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Name) FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'African' AND T1.Area > 10000000\n```"}]}, {"id": "train-8244", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the name of the countries with over 5 ethnic groups."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country GROUP BY T1.Name HAVING COUNT(T1.Name) > 5\n```"}]}, {"id": "train-8245", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the highest GDP?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T2.GDP DESC LIMIT 1\n```"}]}, {"id": "train-8246", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries with a population of over 10000000, how many of them have a GDP of over 500000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Name) FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T2.GDP > 500000 AND T1.Population > 10000000\n```"}]}, {"id": "train-8247", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the capital cities of the countries with an inflation rate under 2."}, {"from": "gpt", "value": "```sql\nSELECT T1.Capital FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T2.Inflation < 2\n```"}]}, {"id": "train-8248", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the lowest inflation rate?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T2.Inflation IS NOT NULL ORDER BY T2.Inflation ASC LIMIT 1\n```"}]}, {"id": "train-8249", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries whose agriculture percentage of the GDP is under 50%, how many of them have an area of over 8000000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Name) FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T2.Agriculture < 50 AND T1.Area > 8000000\n```"}]}, {"id": "train-8250", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities have a salt lake located in it?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.City) FROM located AS T1 INNER JOIN lake AS T2 ON T1.Lake = T2.Name WHERE T2.Type = 'salt'\n```"}]}, {"id": "train-8251", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the depth of the lakes that are located in the Province of Albania."}, {"from": "gpt", "value": "```sql\nSELECT T2.Depth FROM located AS T1 INNER JOIN lake AS T2 ON T1.Lake = T2.Name WHERE T1.Province = 'Albania'\n```"}]}, {"id": "train-8252", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The lake with the highest altitude is located in which city?"}, {"from": "gpt", "value": "```sql\nSELECT T2.City FROM lake AS T1 LEFT JOIN located AS T2 ON T2.Lake = T1.Name ORDER BY T1.Altitude DESC LIMIT 1\n```"}]}, {"id": "train-8253", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many lakes in the Canary Islands cover an area of over 1000000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Name) FROM located AS T1 INNER JOIN lake AS T2 ON T1.Lake = T2.Name WHERE T1.Province = 'Canary Islands' AND T2.Area > 1000000\n```"}]}, {"id": "train-8254", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the most languages spoken?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country GROUP BY T1.Name ORDER BY COUNT(T2.Name) DESC LIMIT 1\n```"}]}, {"id": "train-8255", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the capital city of the country that has the percentage of Armenian speakers over 90%?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Capital FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Armenian' AND T2.Percentage > 90\n```"}]}, {"id": "train-8256", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries with a population of under 1000000, how many of them have over 2 languages?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country WHERE T1.Population < 1000000 GROUP BY T2.Country HAVING COUNT(T1.Name) > 2\n```"}]}, {"id": "train-8257", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many organizations are founded in countries with a population of under 1000000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Name) FROM country AS T1 INNER JOIN organization AS T2 ON T1.Code = T2.Country WHERE T1.Population < 1000000\n```"}]}, {"id": "train-8258", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many organizations are established after 1999/1/1 in a country whose GDP is under 500000?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Country, COUNT(T1.Country) FROM economy AS T1 INNER JOIN organization AS T2 ON T1.Country = T2.Country WHERE T1.GDP < 500000 AND STRFTIME('%Y', T2.Established) < '1999' GROUP BY T1.Country\n```"}]}, {"id": "train-8259", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries with over 3 organizations, how many of them have an inflation rate of over 5%?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Country) FROM economy AS T1 INNER JOIN organization AS T2 ON T1.Country = T2.Country WHERE T2.Country IN ( SELECT Country FROM organization GROUP BY Country HAVING COUNT(Country) > 3 ) AND T1.Inflation > 5\n```"}]}, {"id": "train-8260", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many organizations are established in the country with the most ethnic groups?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Province) FROM country AS T1 INNER JOIN organization AS T2 ON T1.Code = T2.Country INNER JOIN ethnicGroup AS T3 ON T3.Country = T2.Country GROUP BY T1.Name ORDER BY COUNT(T3.Name) DESC LIMIT 1\n```"}]}, {"id": "train-8261", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the organization names established in the countries where Dutch is spoken."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM language AS T1 INNER JOIN organization AS T2 ON T1.Country = T2.Country WHERE T1.Name = 'Dutch'\n```"}]}, {"id": "train-8262", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many organizations are established in countries where people speak Bosnian?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Name) FROM language AS T1 INNER JOIN organization AS T2 ON T1.Country = T2.Country WHERE T1.Name = 'Bosnian'\n```"}]}, {"id": "train-8263", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest infant mortality rate per thousand of the countries whose inflation is under 3?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.Infant_Mortality) FROM economy AS T1 INNER JOIN population AS T2 ON T1.Country = T2.Country WHERE T1.Inflation < 3\n```"}]}, {"id": "train-8264", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries whose GDP is over 1000000, how many of them have a population groth rate of over 3%?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Country) FROM economy AS T1 INNER JOIN population AS T2 ON T1.Country = T2.Country WHERE T1.GDP > 1000000 AND T2.Population_Growth > 3\n```"}]}, {"id": "train-8265", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the highest GDP per capita?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T2.GDP / T1.Population DESC LIMIT 1\n```"}]}, {"id": "train-8266", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the highest lake area coverage of a country?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Area * 100 / T3.Area FROM located AS T1 INNER JOIN lake AS T2 ON T1.Lake = T2.Name INNER JOIN country AS T3 ON T3.Code = T1.Country ORDER BY T2.Longitude DESC LIMIT 1\n```"}]}, {"id": "train-8267", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average population growth rate of countries where more than 3 languages are used?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.Population_Growth) / COUNT(T3.Country) FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country INNER JOIN population AS T3 ON T3.Country = T2.Country WHERE T2.Country IN ( SELECT Country FROM language GROUP BY Country HAVING COUNT(Country) > 3 ) GROUP BY T3.Country\n```"}]}, {"id": "train-8268", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the countries with an inflation rate that's 30% above the average."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country GROUP BY T1.Name, T2.Inflation HAVING T2.Inflation > AVG(T2.Inflation) * 1.3\n```"}]}, {"id": "train-8269", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where country does Baghdad belongs to?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM country WHERE Province = 'Baghdad'\n```"}]}, {"id": "train-8270", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which religion has the largest population in Martinique?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM country AS T1 INNER JOIN religion AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Martinique' ORDER BY T1.population DESC LIMIT 1\n```"}]}, {"id": "train-8271", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is 41% Christian? Give the full name of the country."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN religion AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Christian' AND T2.Percentage = 41\n```"}]}, {"id": "train-8272", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which two countries does the Detroit River flow through? Give the full name of the country."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM located AS T1 INNER JOIN river AS T2 ON T1.River = T2.Name INNER JOIN country AS T3 ON T3.Code = T1.Country WHERE T2.Name = 'Detroit River'\n```"}]}, {"id": "train-8273", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which two countries have the longest border in the world? Give the full name of the country."}, {"from": "gpt", "value": "```sql\nSELECT T2.Country1, T2.Country2 FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 ORDER BY T2.Length DESC LIMIT 1\n```"}]}, {"id": "train-8274", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the most neighbors? Give the full name of the country."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 GROUP BY T1.Name ORDER BY COUNT(T1.Name) DESC LIMIT 1\n```"}]}, {"id": "train-8275", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is Mountain Cerro Chirripo located in? Give the full name of the country."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Name FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country WHERE T2.Mountain = 'Cerro Chirripo'\n```"}]}, {"id": "train-8276", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many mountains are there in Indonesia?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.Mountain) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Indonesia'\n```"}]}, {"id": "train-8277", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the quantity of the mountains does Japan have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.Mountain) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Japan'\n```"}]}, {"id": "train-8278", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the latitude of the island on which Mount Andrinjitra is located?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Latitude FROM island AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Island WHERE T2.Mountain = 'Andringitra'\n```"}]}, {"id": "train-8280", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the area of Egypt as a percentage of Asia?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Percentage FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent WHERE T3.Name = 'Asia' AND T1.Name = 'Egypt'\n```"}]}, {"id": "train-8281", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the area of Egypt as a percentage of Asia?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Area * 100 / T3.Area FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent WHERE T3.Name = 'Asia' AND T1.Name = 'Egypt'\n```"}]}, {"id": "train-8282", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city in Japan has the most people in the country?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Japan' ORDER BY T2.Population DESC LIMIT 1\n```"}]}, {"id": "train-8283", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the country in which Olsztyn is located, where is the capital?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Capital FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Olsztyn'\n```"}]}, {"id": "train-8285", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Uganda declare independence?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Independence FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Uganda'\n```"}]}, {"id": "train-8286", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What kind of government does Iran have?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Government FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Iran'\n```"}]}, {"id": "train-8287", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where does Bermuda belong to? Give the full name of the country."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM locatedOn AS T1 INNER JOIN island AS T2 ON T1.Island = T2.Name INNER JOIN country AS T3 ON T3.Code = T1.Country WHERE T3.Name = 'Bermuda'\n```"}]}, {"id": "train-8288", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where is the capital of country which has the largest percentage of Malay people?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Capital FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Malay' ORDER BY T2.Percentage DESC LIMIT 1\n```"}]}, {"id": "train-8289", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the third largest country, which ethinic group has the most population?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T1.Name = ( SELECT Name FROM country ORDER BY Area DESC LIMIT 2, 1 ) GROUP BY T2.Name ORDER BY T2.Percentage * T1.Population DESC LIMIT 1\n```"}]}, {"id": "train-8290", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the city of 114339 in population? Give the full name of the country."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T2.Population = 114339\n```"}]}, {"id": "train-8291", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many rivers finally flows to the sea of 459m in depth?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM river WHERE Sea IN ( SELECT Name FROM sea WHERE Depth = 459 )\n```"}]}, {"id": "train-8292", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the area of the country which became independent in 1921/3/13?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Area FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T2.Independence = '1921-03-13'\n```"}]}, {"id": "train-8293", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the population density of the Petropavl's home country?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.Population AS REAL) / T1.Area FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Petropavl'\n```"}]}, {"id": "train-8294", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many more people speak English than speak Scottish in United Kingdom?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Population * (T2.Percentage - T1.Percentage) FROM ethnicGroup AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Country = T2.Country INNER JOIN country AS T3 ON T1.Country = T3.Code WHERE T1.Name = 'Scottish' AND T2.Name = 'English' AND T3.Name = 'United Kingdom'\n```"}]}, {"id": "train-8295", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most populated city of the 12th highest density country?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM country AS T1 INNER JOIN city AS T2 ON T1.Code = T2.Country WHERE T1.Name = ( SELECT Name FROM country ORDER BY CAST(Population AS REAL) / Area LIMIT 11, 1 ) ORDER BY T2.Population DESC LIMIT 1\n```"}]}, {"id": "train-8296", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times longer is the longest border in the United States than the shortest?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.Length) / MIN(T2.Length) FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country2 WHERE T1.Name = 'United States'\n```"}]}, {"id": "train-8297", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the capital cities of the countries that have more than 4 mountains."}, {"from": "gpt", "value": "```sql\nSELECT T1.Capital FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country GROUP BY T1.Name, T1.Capital HAVING COUNT(T1.Name) > 4\n```"}]}, {"id": "train-8298", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many mountains are there in the country with the greatest population?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Mountain) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country GROUP BY T1.Name ORDER BY T1.Population DESC LIMIT 1\n```"}]}, {"id": "train-8299", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries whose agriculture takes up more than 40% of its GDP, how many of them have less than 2 mountains?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.Country) FROM ( SELECT T1.Country FROM economy AS T1 INNER JOIN geo_mountain AS T2 ON T1.Country = T2.Country WHERE T1.Industry < 40 GROUP BY T1.Country HAVING COUNT(T1.Country) < 2 ) AS T3\n```"}]}, {"id": "train-8300", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the mountains in the country with the lowest inflation rate."}, {"from": "gpt", "value": "```sql\nSELECT Mountain FROM geo_mountain WHERE Country = ( SELECT Country FROM economy ORDER BY Inflation ASC LIMIT 1 )\n```"}]}, {"id": "train-8301", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the independent countries whose type of government is republic, what is the biggest number of deserts they have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.Desert) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN geo_desert AS T3 ON T3.Country = T2.Country WHERE T2.Government = 'republic'\n```"}]}, {"id": "train-8302", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the deserts in the countries whose population is over 100000 and covers an area of under 500000."}, {"from": "gpt", "value": "```sql\nSELECT T2.Desert FROM country AS T1 INNER JOIN geo_desert AS T2 ON T1.Code = T2.Country WHERE T1.Area > 100000 AND T1.Population < 500000\n```"}]}, {"id": "train-8303", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many deserts are there in a country where over 90% of people speaks Armenian?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Desert) FROM country AS T1 INNER JOIN geo_desert AS T2 ON T1.Code = T2.Country INNER JOIN language AS T3 ON T1.Code = T2.Country WHERE T3.Name = 'Armenian' AND T3.Percentage > 90\n```"}]}, {"id": "train-8305", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many volcanic mountains are there in countries whose population is no more than 5000000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T3.Name) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country INNER JOIN mountain AS T3 ON T3.Name = T2.Mountain WHERE T3.Type = 'volcanic' AND T1.Population <= 5000000\n```"}]}, {"id": "train-8306", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries with a GDP of over 1000000, how many of them have mountains higher than 1000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.Name) FROM country AS T1 INNER JOIN geo_mountain AS T2 ON T1.Code = T2.Country INNER JOIN economy AS T3 ON T3.Country = T1.Code INNER JOIN mountain AS T4 ON T4.Name = T2.Mountain WHERE T3.GDP > 1000000 AND T4.Height > 1000\n```"}]}, {"id": "train-8307", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the greatest length of the border between 2 independent countries?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T3.Length) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN borders AS T3 ON T3.Country1 = T2.Country WHERE T2.Independence IS NOT NULL\n```"}]}, {"id": "train-8308", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries whose government type is republic, how many of them shares a border that's longer than 200?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.Name) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN borders AS T3 ON T3.Country1 = T2.Country WHERE T2.Government = 'republic' AND T3.Length > 200\n```"}]}, {"id": "train-8309", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the countries that share the shortest border."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 ORDER BY T2.Length ASC LIMIT 1\n```"}]}, {"id": "train-8310", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the GDP of the European Continent?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T4.GDP) FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent INNER JOIN economy AS T4 ON T4.Country = T1.Code WHERE T3.Name = 'Europe'\n```"}]}, {"id": "train-8311", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many mountains are there on the African Continent?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.Name) FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent INNER JOIN province AS T4 ON T4.Country = T1.Code INNER JOIN geo_mountain AS T5 ON T5.Province = T4.Name WHERE T3.Name = 'European'\n```"}]}, {"id": "train-8312", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the deserts on the America Continent, which one covers the greatest area?"}, {"from": "gpt", "value": "```sql\nSELECT T5.Name FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent INNER JOIN geo_desert AS T4 ON T4.Country = T1.Code INNER JOIN desert AS T5 ON T5.Name = T4.Desert WHERE T3.Name = 'America' ORDER BY T5.Area DESC LIMIT 1\n```"}]}, {"id": "train-8313", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the countries on the European Continent that have a population growth of more than 3%."}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent INNER JOIN population AS T4 ON T4.Country = T1.Code WHERE T3.Name = 'Europe' AND T4.Population_Growth > 0.03\n```"}]}, {"id": "train-8314", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many countries on the European Continent has an infant mortality rate per thousand of over 100?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Name) FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country INNER JOIN continent AS T3 ON T3.Name = T2.Continent INNER JOIN population AS T4 ON T4.Country = T1.Code WHERE T3.Name = 'Europe' AND T4.Infant_Mortality < 100\n```"}]}, {"id": "train-8315", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the countries that use Bosnian as their language, how many of them don't have a positive population growth rate?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.Name) FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country INNER JOIN population AS T3 ON T3.Country = T2.Country WHERE T2.Name = 'Bosnian' AND T3.Population_Growth < 0\n```"}]}, {"id": "train-8316", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average percentage of agriculture of GDP in countries on the African Continent?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T4.Agriculture) FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN economy AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Africa'\n```"}]}, {"id": "train-8317", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the independent countries, how many of them has a GDP per capita of over 5000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.Name) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN economy AS T3 ON T3.Country = T2.Country WHERE T2.Independence IS NOT NULL AND T3.GDP > 5000\n```"}]}, {"id": "train-8318", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average inflation rate of the biggest continent?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T4.Inflation) FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN economy AS T4 ON T4.Country = T3.Code WHERE T1.Name = ( SELECT Name FROM continent ORDER BY Area DESC LIMIT 1 )\n```"}]}, {"id": "train-8319", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which island is city Balikpapan located on? How big is the island?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name, T3.Area FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T1.Name = 'Balikpapan'\n```"}]}, {"id": "train-8320", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the cities in Sumatra and state the population of each city."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.Population FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T3.Name = 'Sumatra'\n```"}]}, {"id": "train-8321", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On which island does South Yorkshire situated? State it's longtitude and latitude."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.Longitude, T3.Latitude FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T1.Province = 'South Yorkshire'\n```"}]}, {"id": "train-8322", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all islands that are greater than the island on which Warwickshire is located."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT Name FROM island WHERE Area > ( SELECT DISTINCT T3.Area FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T1.Province = 'Warwickshire' )\n```"}]}, {"id": "train-8323", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For island area less than 200, list the island name and city it belongs to."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.Name, T1.Name FROM city AS T1 INNER JOIN locatedOn AS T2 ON T1.Name = T2.City INNER JOIN island AS T3 ON T3.Name = T2.Island WHERE T3.Area < 200\n```"}]}, {"id": "train-8324", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which province is city Glenrothes located? What is the capital of the province?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Province, T1.Capital FROM province AS T1 INNER JOIN city AS T2 ON T1.Name = T2.Province AND T1.Country = T2.Country WHERE T2.Name = 'Glenrothes'\n```"}]}, {"id": "train-8325", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the all the cities and its city population for provinces with population more than 1000000."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.Population FROM city AS T1 INNER JOIN province AS T2 ON T2.Name = T1.Province WHERE T2.Population > 1000000\n```"}]}, {"id": "train-8326", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the coral islands along with its city and province."}, {"from": "gpt", "value": "```sql\nSELECT City, Province FROM locatedOn WHERE Island IN ( SELECT Name FROM island WHERE Type = 'coral' )\n```"}]}, {"id": "train-8327", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average population for all cities location at Baltic Sea?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.Population) FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN sea AS T3 ON T3.Name = T2.Sea WHERE T3.Name = 'Baltic Sea'\n```"}]}, {"id": "train-8328", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of population in Edmonton city to the population of its province."}, {"from": "gpt", "value": "```sql\nSELECT CAST(T1.Population AS REAL) * 100 / T2.Population FROM city AS T1 INNER JOIN province AS T2 ON T1.Province = T2.Name WHERE T1.Name = 'Edmonton'\n```"}]}, {"id": "train-8329", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which are the rivers that flows to Black Sea?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM river WHERE Sea = 'Black Sea'\n```"}]}, {"id": "train-8330", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of the lake in Albania province and in which city does it located at."}, {"from": "gpt", "value": "```sql\nSELECT Lake, City FROM located WHERE Province = 'Albania' AND Lake IS NOT NULL\n```"}]}, {"id": "train-8334", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please state the longest river that flows to the Mediterranean Sea."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM river WHERE Sea = 'Mediterranean Sea' ORDER BY Length DESC LIMIT 1\n```"}]}, {"id": "train-8335", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of the mountains on Andes which are non-volcanic?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN type != 'volcano' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM mountain WHERE Mountains = 'Andes'\n```"}]}, {"id": "train-8336", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the cities and provinces located at the rivers that flows to Atlantic Ocean."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.Province FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Sea = 'Atlantic Ocean'\n```"}]}, {"id": "train-8337", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name and length of rivers located at 'Orleans' city?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name, T3.Length FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T1.Name = 'Orleans'\n```"}]}, {"id": "train-8339", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the river of which Lorraine is on. Please name the mountains where to source flow from?"}, {"from": "gpt", "value": "```sql\nSELECT T1.SourceLongitude, T1.SourceLatitude, T1.SourceAltitude FROM river AS T1 INNER JOIN geo_river AS T2 ON T2.River = T1.Name WHERE T2.Province = 'Lorraine'\n```"}]}, {"id": "train-8341", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the river at Little Rock city. State the length of the river."}, {"from": "gpt", "value": "```sql\nSELECT T3.Length FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T1.Name = 'Little Rock'\n```"}]}, {"id": "train-8342", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all rivers and province it is located that is greater than 1000 in length."}, {"from": "gpt", "value": "```sql\nSELECT T1.Province, T2.Name FROM geo_river AS T1 INNER JOIN river AS T2 ON T1.River = T2.Name WHERE T2.Length > 1000\n```"}]}, {"id": "train-8344", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide all rivers name and length in USA."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.Name, T3.Length FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T2.Country = 'USA'\n```"}]}, {"id": "train-8345", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average height of all mountains in Nepal?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.Height) FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain WHERE T2.Province = 'Nepal'\n```"}]}, {"id": "train-8346", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all cities where Seine is located at, which city has the greatest population? Calculate the difference from the city with least population."}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.Population) - MIN(T1.population) FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Name = 'Seine'\n```"}]}, {"id": "train-8347", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which are the 2 rivers located at Belgrade city? Which river is longer and how by much?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.Length FROM river AS T1 INNER JOIN located AS T2 ON T1.Name = T2.River INNER JOIN city AS T3 ON T3.Name = T2.City WHERE T3.Name = 'Belgrade'\n```"}]}, {"id": "train-8348", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which nations have a 100% Spanish-speaking population?"}, {"from": "gpt", "value": "```sql\nSELECT Country FROM language WHERE Name = 'Spanish' AND Percentage = 100\n```"}]}, {"id": "train-8349", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which countries are dependent on the British Crown?"}, {"from": "gpt", "value": "```sql\nSELECT Country FROM politics WHERE Government = 'British crown dependency'\n```"}]}, {"id": "train-8350", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the rivers in Canada?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.River FROM located AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'Canada' AND T1.River IS NOT NULL\n```"}]}, {"id": "train-8351", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the country whose citizens have the lowest purchasing power?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM economy AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code ORDER BY T1.Inflation DESC LIMIT 1\n```"}]}, {"id": "train-8352", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What province does the 4th most populous city in the United Kingdom belong to, and how many people live there?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Province, T1.Population FROM city AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'United Kingdom' ORDER BY T1.Population DESC LIMIT 3, 1\n```"}]}, {"id": "train-8353", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Jewish residents are there in Moldova?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Percentage * T1.Population FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Moldova' AND T2.Name = 'Jewish'\n```"}]}, {"id": "train-8354", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average area of Asian countries?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(Area) FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country WHERE T2.Continent = 'Asia'\n```"}]}, {"id": "train-8355", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country is home to the world's tiniest desert, and what are its longitude and latitude?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country, T1.Latitude, T1.Longitude FROM desert AS T1 INNER JOIN geo_desert AS T2 ON T1.Name = T2.Desert WHERE T1.Name = ( SELECT Name FROM desert ORDER BY Area ASC LIMIT 1 )\n```"}]}, {"id": "train-8356", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people in Montenegro speaks Serbian?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Percentage * T2.Population FROM language AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'Serbian' AND T2.Name = 'Montenegro'\n```"}]}, {"id": "train-8357", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many mountains are there in the country with the most land area?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(Mountain) FROM geo_mountain WHERE Country = ( SELECT Code FROM country ORDER BY Area DESC LIMIT 1 )\n```"}]}, {"id": "train-8358", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which sea is the shallowest and which country surrounds it?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.Name FROM located AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE Sea = ( SELECT Name FROM sea ORDER BY Depth ASC LIMIT 1 )\n```"}]}, {"id": "train-8359", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which nation's GDP is the lowest among those that are communist states?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM politics AS T1 INNER JOIN economy AS T2 ON T1.Country = T2.Country WHERE T1.Government = 'Communist state' ORDER BY T2.GDP ASC LIMIT 1\n```"}]}, {"id": "train-8360", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What kind of political system is in place in the country with the highest inflation rate?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Government FROM politics AS T1 INNER JOIN economy AS T2 ON T1.Country = T2.Country ORDER BY T2.Inflation DESC LIMIT 1\n```"}]}, {"id": "train-8361", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which nation has the greatest infant mortality rate among those that attained independence in 1960?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Country FROM politics AS T1 INNER JOIN population AS T2 ON T1.Country = T2.Country WHERE STRFTIME('%Y', T1.Independence) = '1960' ORDER BY T2.Infant_Mortality DESC LIMIT 1\n```"}]}, {"id": "train-8362", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the smallest border's length, and what form of government do the two nations bordering it have?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Government, T3.Government FROM politics AS T1 INNER JOIN borders AS T2 ON T1.Country = T2.Country1 INNER JOIN politics AS T3 ON T3.Country = T2.Country2 ORDER BY T2.Length ASC LIMIT 1\n```"}]}, {"id": "train-8363", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Arabic-speaking country has the smallest population?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Arabic' AND T2.Percentage = 100 ORDER BY T1.Population ASC LIMIT 1\n```"}]}, {"id": "train-8364", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What provinces encompass the world's biggest desert in terms of overall area?"}, {"from": "gpt", "value": "```sql\nSELECT Province FROM geo_desert WHERE Desert = ( SELECT Name FROM desert ORDER BY Area DESC LIMIT 1 )\n```"}]}, {"id": "train-8365", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many lakes are there in the 4th most populous African country with a republican form of government?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM geo_lake WHERE Country = ( SELECT T4.Code FROM ( SELECT T2.Code, T2.Population FROM encompasses AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code INNER JOIN politics AS T3 ON T1.Country = T3.Country WHERE T1.Continent = 'Africa' AND T1.Percentage = 100 AND T3.Government = 'republic' ORDER BY Population DESC LIMIT 4 ) AS T4 ORDER BY population ASC LIMIT 1 )\n```"}]}, {"id": "train-8366", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which religion is most prevalent in Asia?"}, {"from": "gpt", "value": "```sql\nSELECT T4.Name FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN religion AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Asia' GROUP BY T4.Name ORDER BY SUM(T4.Percentage) DESC LIMIT 1\n```"}]}, {"id": "train-8368", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the sea that can be found on the island with the biggest area?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM islandIn AS T1 INNER JOIN sea AS T2 ON T2.Name = T1.Sea WHERE T1.Island = ( SELECT Name FROM island ORDER BY Area DESC LIMIT 1 )\n```"}]}, {"id": "train-8369", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the three nations where the longest river that empties into the Atlantic Ocean stretches to?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.Country FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Name = ( SELECT Name FROM river WHERE Sea = 'Atlantic Ocean' ORDER BY Length DESC LIMIT 1 )\n```"}]}, {"id": "train-8370", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people reside in the nation's capital city, which is situated in the nation that attained independence on 8/15/1947?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Population FROM politics AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code INNER JOIN city AS T3 ON T3.Name = T2.Capital WHERE T1.Independence = '1947-08-15'\n```"}]}, {"id": "train-8371", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of Afro-Asian people in the most populous Asian country governed by a monarchy?"}, {"from": "gpt", "value": "```sql\nSELECT T5.Percentage * T6.Population FROM ethnicGroup AS T5 INNER JOIN country AS T6 ON T5.Country = T6.Code WHERE Country = ( SELECT T3.Code FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN politics AS T4 ON T4.Country = T3.Code WHERE T4.Government = 'monarchy' AND T1.Name = 'Asia' ORDER BY T3.Population DESC LIMIT 1 ) AND T5.Name = 'Afro-Asian'\n```"}]}, {"id": "train-8372", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the cities along the Euphrat River's course? Indicate the capital city of the nation where the Euphrat River flows."}, {"from": "gpt", "value": "```sql\nSELECT T2.City, T1.Capital FROM country AS T1 INNER JOIN located AS T2 ON T1.Code = T2.Country INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Name = 'Euphrat'\n```"}]}, {"id": "train-8373", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the proportion of English-speaking citizens in the countries that rely on the United States compared to the total number of citizens in those countries?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Percentage * T1.Population FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country INNER JOIN politics AS T3 ON T3.Country = T2.Country WHERE T3.Dependent = 'USA' AND T2.Name = 'English'\n```"}]}, {"id": "train-8374", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which federal republic country in Europe has the most provinces, and what proportion of GDP is devoted to services?\nCalculate the population density as well."}, {"from": "gpt", "value": "```sql\nSELECT T1.Country, T2.Service , SUM(T1.Population) / SUM(T1.Area) FROM province AS T1 INNER JOIN economy AS T2 ON T1.Country = T2.Country WHERE T1.Country IN ( SELECT Country FROM encompasses WHERE Continent = 'Europe' ) GROUP BY T1.Country, T2.Service ORDER BY COUNT(T1.Name) DESC LIMIT 1\n```"}]}, {"id": "train-8375", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the capital of the 3rd most populated country in Asia and what is the capital city's ratio in percentage (%) against the overall population of the country?"}, {"from": "gpt", "value": "```sql\nSELECT T4.Capital, CAST(T3.Population AS REAL) * 100 / T4.Population FROM city AS T3 INNER JOIN ( SELECT T1.Capital , T1.Population FROM country AS T1 INNER JOIN encompasses AS T2 ON T1.Code = T2.Country WHERE T2.Continent = 'Asia' ORDER BY T1.Population DESC LIMIT 2, 1 ) AS T4 ON T3.Name = T4.Capital\n```"}]}, {"id": "train-8376", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the name of the second biggest desert?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM desert ORDER BY Area DESC LIMIT 1, 1\n```"}]}, {"id": "train-8377", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the main spoken language in MNE?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM language WHERE Country = 'MNE' ORDER BY Percentage DESC LIMIT 1\n```"}]}, {"id": "train-8378", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the percentage of people in Cayman Islands speak English?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Percentage FROM language AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'Cayman Islands' AND T1.Name = 'English'\n```"}]}, {"id": "train-8379", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country was the source of Pjandsh River? Give the full name of the country."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN located AS T2 ON T1.Code = T2.Country WHERE T2.River = 'Pjandsh'\n```"}]}, {"id": "train-8380", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the countries have the population north of a billion, which one has the lowest GDP? Give the full name of the country."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Population > 1000000000 ORDER BY T2.GDP ASC LIMIT 1\n```"}]}, {"id": "train-8382", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much sea is around the island where Kerinci Mountain is located?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T4.Sea) FROM mountain AS T1 INNER JOIN mountainOnIsland AS T2 ON T1.Name = T2.Mountain INNER JOIN island AS T3 ON T3.Name = T2.Island INNER JOIN islandIn AS T4 ON T4.Island = T3.Name WHERE T1.Name = 'Kerinci'\n```"}]}, {"id": "train-8383", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which three countries does the Amazonas flow through? Give the full name of the countries."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.Name FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River INNER JOIN country AS T4 ON T4.Code = T2.Country WHERE T3.Name = 'Amazonas'\n```"}]}, {"id": "train-8384", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country became independent on 1492-01-01? Give the full name of the country."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T2.Independence = '1492-01-01'\n```"}]}, {"id": "train-8385", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities in France have a population of more than 100,000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.Name) FROM country AS T1 INNER JOIN city AS T2 ON T2.Country = T1.Code WHERE T1.Name = 'France' AND T2.Population > 100000\n```"}]}, {"id": "train-8386", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the rivers finally flows to the sea of 540m in depth, which one has the longest length?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM sea AS T1 INNER JOIN river AS T2 ON T2.Sea = T1.Name WHERE T1.Depth = 540 ORDER BY T2.Length DESC LIMIT 1\n```"}]}, {"id": "train-8389", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For all the countries that is smaller than 100 square kilometres, which one has the most GDP?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Area < 100 ORDER BY T2.GDP DESC LIMIT 1\n```"}]}, {"id": "train-8390", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of cities that Japan have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.Name) FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T1.Name = 'Japan'\n```"}]}, {"id": "train-8391", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city has most population other than its capital in Bangladesh?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T1.Name = 'Bangladesh' AND T3.Name <> T1.Capital ORDER BY T3.Population DESC LIMIT 1\n```"}]}, {"id": "train-8392", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which non capital city has the most people of all?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name <> T1.Capital ORDER BY T3.Population DESC LIMIT 1\n```"}]}, {"id": "train-8393", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which country is the city of Grozny? Give the full name of the country."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name = 'Grozny'\n```"}]}, {"id": "train-8394", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which religion has the majority of the people in Japan?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM country AS T1 INNER JOIN religion AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Japan' ORDER BY T2.Percentage DESC LIMIT 1\n```"}]}, {"id": "train-8395", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which two countries have the border in length of 803 km? Give the full names of the countries."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T3.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 INNER JOIN country AS T3 ON T3.Code = T2.Country2 WHERE T2.Length = 803\n```"}]}, {"id": "train-8396", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of the total area of Russia is in Europe?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Percentage FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country WHERE T3.Name = 'Russia' AND T1.Name = 'Europe'\n```"}]}, {"id": "train-8397", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full names of the countries that are located in more than one continent."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country GROUP BY T3.Name HAVING COUNT(T3.Name) > 1\n```"}]}, {"id": "train-8398", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many people are there in Fareham's mother country?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Population FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name = 'Fareham'\n```"}]}, {"id": "train-8399", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What's the number of infant mortality in Switzerland in a year?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Infant_Mortality * T1.Population * T2.Population_Growth FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Switzerland'\n```"}]}, {"id": "train-8400", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many mountains are there in the United States?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.Name) FROM mountain AS T1 INNER JOIN geo_mountain AS T2 ON T1.Name = T2.Mountain INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN country AS T4 ON T4.Province = T3.Name WHERE T4.Name = 'United States'\n```"}]}, {"id": "train-8401", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did Equatorial Guinea become independent?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Independence FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Equatorial Guinea'\n```"}]}, {"id": "train-8402", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the GDP per capita in Switzerland?"}, {"from": "gpt", "value": "```sql\nSELECT T2.GDP / T1.Population FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Switzerland'\n```"}]}, {"id": "train-8403", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the GDP for Service of the country with Fuenlabrada as its city."}, {"from": "gpt", "value": "```sql\nSELECT T4.Service * T4.GDP FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name INNER JOIN economy AS T4 ON T4.Country = T2.Country WHERE T3.Name = 'Fuenlabrada'\n```"}]}, {"id": "train-8404", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times longer is the longest river in Tajikistan than the shortest river?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.Length) / MIN(T2.Length) FROM located AS T1 INNER JOIN river AS T2 ON T1.River = T2.Name WHERE T1.Country = 'TJ'\n```"}]}, {"id": "train-8405", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the population density of Hanoi's home country?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Population / T1.Area FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Province = T2.Name WHERE T3.Name = 'Hanoi'\n```"}]}, {"id": "train-8406", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In countries where there is more than one ethnic group, name the ethnic group with the greatest presence in each country and the country to which it corresponds."}, {"from": "gpt", "value": "```sql\nSELECT Country, Name FROM ethnicGroup AS T1 WHERE Percentage < 100 AND Percentage = ( SELECT MAX(Percentage) FROM ethnicGroup AS T2 WHERE T1.Country = T2.Country )\n```"}]}, {"id": "train-8407", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many deserts are not located in a single country? Name them."}, {"from": "gpt", "value": "```sql\nSELECT Desert FROM geo_desert GROUP BY Desert HAVING COUNT(DISTINCT Country) > 1\n```"}]}, {"id": "train-8408", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many rivers belong to more than one country? Name the provinces where we can find them."}, {"from": "gpt", "value": "```sql\nSELECT River, GROUP_CONCAT(Province) FROM geo_river GROUP BY River HAVING COUNT(DISTINCT Country) > 1\n```"}]}, {"id": "train-8409", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of the border does Angola share with each of the countries with which it borders?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.Name = 'Angola' THEN T1.Length ELSE 0 END) * 100 / SUM(T1.Length) FROM borders AS T1 LEFT JOIN country AS T2 ON T1.Country1 = T2.Code\n```"}]}, {"id": "train-8410", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percent of the non volcanic islands in the Lesser Antilles group of islands have an area of no more than 300 square kilometers?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN Area <= 300 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM island WHERE Islands = 'Lesser Antilles' AND (Type != 'volcanic' OR Type IS NULL)\n```"}]}, {"id": "train-8411", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the countries in which English is spoken, what percentage has English as their only language?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.Percentage = 100 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Name) FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'English'\n```"}]}, {"id": "train-8412", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name of the capitals of the countries that have less than 99.95% less population than the country that has the most population."}, {"from": "gpt", "value": "```sql\nSELECT Capital FROM country WHERE Population <= ( SELECT MAX(Population) - MAX(Population) * 0.9995 FROM country )\n```"}]}, {"id": "train-8413", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Average length of the rivers flowing into the Donau River."}, {"from": "gpt", "value": "```sql\nSELECT * FROM river WHERE Name = 'Donau'\n```"}]}, {"id": "train-8414", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Based on the data shown at Target, what percentage of countries are non-Christian?"}, {"from": "gpt", "value": "```sql\nSELECT 100 - (CAST(SUM(CASE WHEN Target = 'Christian' THEN 1 ELSE 0 END) AS REAL)) * 100 / COUNT(Country) FROM target\n```"}]}, {"id": "train-8415", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country with a city with a population between 50,000 and 300,000 inhabitants and which is a member of an organization established between 03/01/1991 and 04/30/1991 is also a member of the EBRD?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM country AS T1 INNER JOIN isMember AS T2 ON T1.Code = T2.Country INNER JOIN organization AS T3 ON T3.Country = T2.Country INNER JOIN city AS T4 ON T4.Country = T3.Country WHERE T3.Abbreviation = 'EBRD' AND T4.Population BETWEEN 50000 AND 300000 AND T3.Established BETWEEN '1991-01-31' AND '1991-04-30'\n```"}]}, {"id": "train-8416", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which river with its mouth in the Donau River and a length greater than 500 km is located in Slovenia?"}, {"from": "gpt", "value": "```sql\nSELECT T2.River FROM country AS T1 INNER JOIN geo_river AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Slovenia' AND T2.River IN ( SELECT NAME FROM river WHERE Length > 500 AND River = 'Donau' )\n```"}]}, {"id": "train-8417", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city is the sea whose depth is 4232 meters less than that of the Bay of Bengal?"}, {"from": "gpt", "value": "```sql\nSELECT T2.City FROM sea AS T1 INNER JOIN located AS T2 ON T1.Name = T2.Sea INNER JOIN city AS T3 ON T3.Name = T2.City WHERE ( SELECT Depth FROM sea WHERE Name LIKE '%Bengal%' ) - T1.Depth = 4235\n```"}]}, {"id": "train-8418", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city is the lake located at coordinates longitude -85.35 and latitude 11.6?"}, {"from": "gpt", "value": "```sql\nSELECT T2.City FROM lake AS T1 INNER JOIN located AS T2 ON T1.Name = T2.Lake INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN city AS T4 ON T4.Province = T3.Name WHERE T1.Longitude = -85.35 AND T1.Latitude = 11.6\n```"}]}, {"id": "train-8419", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On which continent is the country with the most erosion of real income?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN economy AS T4 ON T4.Country = T3.Code ORDER BY T4.Inflation DESC LIMIT 1\n```"}]}, {"id": "train-8420", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which two Asian countries share a border that is 1,782 kilometers long?"}, {"from": "gpt", "value": "```sql\nSELECT T4.Country1, T4.Country2 FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country INNER JOIN borders AS T4 ON T4.Country1 = T3.Code WHERE T1.Name = 'Asia' AND T4.Length = 1782\n```"}]}, {"id": "train-8421", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the lakes in Bolivia, which is the deepest?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM lake AS T1 INNER JOIN geo_lake AS T2 ON T1.Name = T2.Lake INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN country AS T4 ON T4.Code = T3.Country WHERE T4.Name = 'Bolivia' ORDER BY T1.Depth DESC LIMIT 1\n```"}]}, {"id": "train-8422", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which lake flows the river that is, in turn, the mouth of the Manicouagan River?"}, {"from": "gpt", "value": "```sql\nSELECT NAME FROM lake WHERE river = ( SELECT river FROM river WHERE NAME = 'Manicouagan' )\n```"}]}, {"id": "train-8424", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the seas with which the deepest sea merges."}, {"from": "gpt", "value": "```sql\nSELECT T2.Sea2 FROM sea AS T1 INNER JOIN mergesWith AS T2 ON T1.Name = T2.Sea1 WHERE T1.Name = ( SELECT Name FROM sea ORDER BY Depth DESC LIMIT 1 )\n```"}]}, {"id": "train-8425", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the countries that share territory with more than one continent, in which of them does the average population not exceed 10 inhabitants per square kilometer?"}, {"from": "gpt", "value": "```sql\nSELECT NAME FROM country WHERE CODE IN ( SELECT country FROM encompasses GROUP BY country HAVING COUNT(continent) > 1 ) AND population / Area <= 10\n```"}]}, {"id": "train-8426", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the countries of the Hindu religion, which has the lowest ratio of people per square meter of surface?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN religion AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Hindu' ORDER BY T1.Population / T1.Area ASC LIMIT 1\n```"}]}, {"id": "train-8427", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On what date did the country have a gross domestic product 400% higher than Saint Kitts and Nevis become independent?"}, {"from": "gpt", "value": "```sql\nSELECT Independence FROM politics WHERE country = ( SELECT country FROM economy WHERE GDP = 1100 )\n```"}]}, {"id": "train-8428", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average population ratio of the countries in which organizations were established in 1947?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Population / T1.Area FROM country AS T1 INNER JOIN organization AS T2 ON T1.Code = T2.Country WHERE STRFTIME('%Y', T2.Established) = '1947'\n```"}]}, {"id": "train-8429", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of Anguilla's capital, and where is it located?"}, {"from": "gpt", "value": "```sql\nSELECT Capital, Province FROM country WHERE Name = 'Anguilla'\n```"}]}, {"id": "train-8430", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which nation has the smallest population, and where is its capital located?"}, {"from": "gpt", "value": "```sql\nSELECT Name, Capital FROM country ORDER BY Population ASC LIMIT 1\n```"}]}, {"id": "train-8431", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much more space does Asia have than Europe?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(Area) - MIN(Area) FROM continent WHERE Name = 'Asia' OR Name = 'Europe'\n```"}]}, {"id": "train-8432", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the geographic location of Aarhus city? Please provide the answer with the coordinates of the location."}, {"from": "gpt", "value": "```sql\nSELECT Longitude, Latitude FROM city WHERE Name = 'Aarhus'\n```"}]}, {"id": "train-8433", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the population gap between the United Kingdom and Italy?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(Population) - MIN(Population) FROM country WHERE Name = 'United Kingdom' OR Name = 'Italy'\n```"}]}, {"id": "train-8434", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city is the European Bank for Reconstruction and Development's headquarters? Please include the city and province where the headquarters are located in your answer."}, {"from": "gpt", "value": "```sql\nSELECT City, Province FROM organization WHERE Name = 'European Bank for Reconstruction and Development'\n```"}]}, {"id": "train-8435", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which lake is the largest in terms of both surface area and depth?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM lake ORDER BY Area * Depth DESC LIMIT 1\n```"}]}, {"id": "train-8436", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which two nations are separated from one another by the longest border? Please include the entire names of the nations in your answer."}, {"from": "gpt", "value": "```sql\nSELECT Country1, Country2 FROM borders ORDER BY Length DESC LIMIT 1\n```"}]}, {"id": "train-8437", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which nation has the highest GDP? Please give the nation's full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T2.GDP DESC LIMIT 1\n```"}]}, {"id": "train-8438", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which nation has the lowest proportion of people who speak an African language? Please state the nation's full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'African' ORDER BY T2.Percentage ASC LIMIT 1\n```"}]}, {"id": "train-8439", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has three different religions-Anglicanism, Christianity, and Roman Catholicism and uses 100% English?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM country AS T1 INNER JOIN religion AS T2 ON T1.Code = T2.Country INNER JOIN language AS T3 ON T3.Country = T2.Country WHERE (T2.Name = 'Anglican' OR T2.Name = 'Christian' OR T2.Name = 'Roman Catholic') AND T3.Name = 'English' AND T3.Percentage = 100 GROUP BY T1.Name HAVING COUNT(T1.Name) = 3\n```"}]}, {"id": "train-8440", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top 3 countries with the highest inflation rate."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T2.Inflation DESC LIMIT 3\n```"}]}, {"id": "train-8441", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide a list of every nation where English is spoken and utilized entirely."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN language AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'English' AND T2.Percentage = 100\n```"}]}, {"id": "train-8442", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many businesses were founded after 1960 in a nation that wasn't independent?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.Name) FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country INNER JOIN organization AS T3 ON T3.Country = T2.Country WHERE T2.Independence = NULL AND STRFTIME('%Y', T3.Established) > '1960'\n```"}]}, {"id": "train-8443", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What province did the river Klaeaelv travel through and how long is the river?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Province FROM city AS T1 INNER JOIN located AS T2 ON T1.Name = T2.City INNER JOIN river AS T3 ON T3.Name = T2.River WHERE T3.Name = 'Klaraelv'\n```"}]}, {"id": "train-8444", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Italian regions are bordered by the Mediterranean Sea? How deep is the Mediterranean Sea?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.province), T3.Depth FROM country AS T1 INNER JOIN located AS T2 ON T1.Code = T2.Country INNER JOIN sea AS T3 ON T3.Name = T2.Sea WHERE T1.Code = 'I' AND T3.Name = 'Mediterranean Sea' GROUP BY T3.Depth\n```"}]}, {"id": "train-8445", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What nations are considered British Overseas Territories?"}, {"from": "gpt", "value": "```sql\nSELECT name FROM country WHERE CODE IN ( SELECT country FROM politics WHERE government = 'British Overseas Territories' )\n```"}]}, {"id": "train-8446", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which of the top 3 economies by GDP has the lowest proportion of the economy devoted to agriculture?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T2.GDP DESC, T2.Agriculture ASC LIMIT 1\n```"}]}, {"id": "train-8447", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How big is Africa, and how many nations make up the continent?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Area, COUNT(T3.Name) FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T3.Code = T2.Country WHERE T1.Name = 'Asia' GROUP BY T1.Name, T1.Area\n```"}]}, {"id": "train-8448", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which United States province is home to the greatest number of corporations' corporate headquarters?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Province FROM country AS T1 INNER JOIN organization AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'United States' GROUP BY T1.Province ORDER BY COUNT(T1.Name) DESC LIMIT 1\n```"}]}, {"id": "train-8449", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the most recent three independent nations?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country ORDER BY T2.Independence DESC LIMIT 3\n```"}]}, {"id": "train-8450", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please name any three sovereign nations that have been governed by the republic since 1991."}, {"from": "gpt", "value": "```sql\nSELECT country FROM politics WHERE government = 'republic' AND STRFTIME('%Y', independence) >= '1991' AND country IN ( SELECT country FROM country ) ORDER BY independence LIMIT 3\n```"}]}, {"id": "train-8451", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which company falls under the category of an associated member? Please provide the organization's full name."}, {"from": "gpt", "value": "```sql\nSELECT NAME FROM organization WHERE country IN ( SELECT country FROM politics WHERE dependent != '' )\n```"}]}, {"id": "train-8452", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which nations have a boundary with the Kalahari Desert?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM desert AS T1 INNER JOIN geo_desert AS T2 ON T1.Name = T2.Desert INNER JOIN country AS T3 ON T3.Code = T2.Country WHERE T1.Name = 'Kalahari'\n```"}]}, {"id": "train-8453", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which desert in Kazakhstan is the largest?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM desert AS T1 INNER JOIN geo_desert AS T2 ON T1.Name = T2.Desert INNER JOIN country AS T3 ON T3.Code = T2.Country WHERE T3.Name = 'Kazakstan' ORDER BY T1.Area DESC LIMIT 1\n```"}]}, {"id": "train-8454", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What sea does the Baltic Sea converge with, and how deep is the Baltic Sea?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Sea2, T1.Depth FROM sea AS T1 INNER JOIN mergesWith AS T2 ON T1.Name = T2.Sea1 WHERE T1.Name = 'Baltic Sea'\n```"}]}, {"id": "train-8455", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which constitutional monarchy nations saw the greatest growth in the number of organizations after 1907?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN organization AS T2 ON T1.Code = T2.Country INNER JOIN politics AS T3 ON T3.Country = T2.Country WHERE STRFTIME('%Y', T2.Established) > '1907' AND T3.Government = 'constitutional monarchy' GROUP BY T1.Name ORDER BY COUNT(DISTINCT T2.Name) DESC LIMIT 1\n```"}]}, {"id": "train-8458", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of nations have achieved independence since 1993 and practice parliamentary democracy? Please include any three parliament-based democracies that attained independence after 1993."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(government = 'parliamentary democracy', 1, 0)) , CAST(SUM(IIF(government = 'parliamentary democracy', 1, 0)) AS REAL) * 100 / COUNT(*) FROM politics AS t1 WHERE STRFTIME('%Y', independence) >= '1993'\n```"}]}, {"id": "train-8459", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What proportion of rivers have a length of more than 3,000 miles? Please provide the name of a Russian river that is more than 3,000 miles long."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.Length > 3000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Name) FROM river AS T1 INNER JOIN located AS T2 ON T1.Name = T2.River INNER JOIN country AS T3 ON T3.Code = T2.Country\n```"}]}, {"id": "train-8460", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of ABEDA and when was it established?"}, {"from": "gpt", "value": "```sql\nSELECT Name, Established FROM organization WHERE Abbreviation = 'ABEDA'\n```"}]}, {"id": "train-8461", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all the organisations that were established from 1970 to 1980."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM organization WHERE STRFTIME('%Y', Established) BETWEEN '1970' AND '1980'\n```"}]}, {"id": "train-8462", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide a list of all organisations with headquarters in London?"}, {"from": "gpt", "value": "```sql\nSELECT Name FROM organization WHERE City = 'London'\n```"}]}, {"id": "train-8463", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For each organisations with headquarters in the USA, provide the its full name and the city where the headquarter is located at."}, {"from": "gpt", "value": "```sql\nSELECT Name, City FROM organization WHERE Country = 'USA'\n```"}]}, {"id": "train-8464", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the first organisation established in the Paris city. State its abbreviation, full name and date of establishment."}, {"from": "gpt", "value": "```sql\nSELECT Abbreviation, Name, Established FROM organization WHERE City = 'Paris' ORDER BY Established ASC LIMIT 1\n```"}]}, {"id": "train-8465", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the organisations that where its name contains 'United Nation'. State its full name and its headquarter city."}, {"from": "gpt", "value": "```sql\nSELECT Name, City FROM organization WHERE Name LIKE '%United Nation%'\n```"}]}, {"id": "train-8466", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which 2 countries' border span across the longest length? Provide the country's full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T3.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 INNER JOIN country AS T3 ON T3.Code = T2.Country2 ORDER BY T2.Length DESC LIMIT 1\n```"}]}, {"id": "train-8467", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all countries in which have border with Bulgaria."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 INNER JOIN country AS T3 ON T3.Code = T2.Country2 WHERE T1.Name = 'Bulgaria'\n```"}]}, {"id": "train-8468", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State all countries with border greater than 4,000. List the full country name."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 WHERE T2.Length > 4000\n```"}]}, {"id": "train-8469", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the country member of 'IOC' organization, which country has the most population?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM isMember AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Organization = 'IOC' ORDER BY T2.Population DESC LIMIT 1\n```"}]}, {"id": "train-8470", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all members and member type of the Islamic Development Bank."}, {"from": "gpt", "value": "```sql\nSELECT T2.Country, T2.Type FROM organization AS T1 INNER JOIN isMember AS T2 ON T1.Abbreviation = T2.Organization INNER JOIN country AS T3 ON T2.Country = T3.Code WHERE T1.Name = 'Islamic Development Bank'\n```"}]}, {"id": "train-8471", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the area and population of the country where Asia Pacific Economic Cooperation headquarter is located."}, {"from": "gpt", "value": "```sql\nSELECT T2.Name, T2.Population FROM organization AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T1.Name = 'Asia Pacific Economic Cooperation'\n```"}]}, {"id": "train-8472", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the organization(s) that has 'National Society' as member type."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM organization AS T1 INNER JOIN isMember AS T2 ON T2.Country = T1.Country INNER JOIN country AS T3 ON T2.Country = T3.Code WHERE T2.Type = 'National Society'\n```"}]}, {"id": "train-8473", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the least organization membership?"}, {"from": "gpt", "value": "```sql\nSELECT country FROM organization WHERE country IN ( SELECT Code FROM country ) GROUP BY country ORDER BY COUNT(NAME) LIMIT 1\n```"}]}, {"id": "train-8474", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all countries with 'Category III' membership in 'IFAD' organization. Please also provide the capital of the country."}, {"from": "gpt", "value": "```sql\nSELECT Name, Capital FROM country WHERE Code IN ( SELECT Country FROM isMember WHERE type = 'Category III' AND Organization = 'IFAD' )\n```"}]}, {"id": "train-8475", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the organizations with the most members."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM organization AS T1 INNER JOIN isMember AS T2 ON T2.Country = T1.Country INNER JOIN country AS T3 ON T2.Country = T3.Code GROUP BY T1.Name ORDER BY COUNT(T3.Name) DESC LIMIT 1\n```"}]}, {"id": "train-8476", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the capital of Australia? Is the capital a headquarter to any organization? Name the organization(s)."}, {"from": "gpt", "value": "```sql\nSELECT T2.Capital, T1.Name FROM organization AS T1 INNER JOIN country AS T2 ON T1.City = T2.Capital WHERE T2.Name = 'Australia'\n```"}]}, {"id": "train-8477", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the organizations where headquarters are in the 'USA', what is the percentage of the them are in 'Washington'?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.City = 'Washington' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.City) FROM country AS T1 INNER JOIN organization AS T2 ON T1.Code = T2.Country WHERE T2.Country = 'USA'\n```"}]}, {"id": "train-8478", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the border length between 'USA' and 'MEX'"}, {"from": "gpt", "value": "```sql\nSELECT Length FROM borders WHERE Country1 = 'MEX' AND Country2 = 'USA'\n```"}]}, {"id": "train-8479", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the newest established organization where Singapore is a member of?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name FROM country AS T1 INNER JOIN isMember AS T2 ON T1.Code = T2.Country INNER JOIN organization AS T3 ON T3.Country = T2.Country WHERE T1.Name = 'Singapore' ORDER BY T3.Established DESC LIMIT 1\n```"}]}, {"id": "train-8480", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the population of the city of the 'World Tourism Organization' headquarter."}, {"from": "gpt", "value": "```sql\nSELECT T2.Population FROM organization AS T1 INNER JOIN city AS T2 ON T1.City = T2.Name WHERE T1.Name = 'World Tourism Organization'\n```"}]}, {"id": "train-8483", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the population of the country with the highest infant mortality rate?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Population FROM country AS T1 INNER JOIN population AS T2 ON T1.Code = T2.Country ORDER BY T2.Infant_Mortality DESC LIMIT 1\n```"}]}, {"id": "train-8484", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the inflation rate of Greece."}, {"from": "gpt", "value": "```sql\nSELECT T2.Inflation FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Name = 'Greece'\n```"}]}, {"id": "train-8485", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the government type for the country with the highest percentage GDP in Agriculture."}, {"from": "gpt", "value": "```sql\nSELECT T3.Government FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country INNER JOIN politics AS T3 ON T3.Country = T2.Country ORDER BY T2.Agriculture DESC LIMIT 1\n```"}]}, {"id": "train-8486", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name its capital of all the countries with parliamentary democracy government."}, {"from": "gpt", "value": "```sql\nSELECT T1.Capital FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T2.Government = 'parliamentary democracy'\n```"}]}, {"id": "train-8487", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide a full list of countries and its population with more than 70% of Chinese."}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T1.Population * T2.Percentage FROM country AS T1 INNER JOIN ethnicGroup AS T2 ON T1.Code = T2.Country WHERE T2.Name = 'Chinese' AND T2.Percentage > 70\n```"}]}, {"id": "train-8488", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city has the greatest population, what is its percentage to its country population?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Name, CAST(T3.Population AS REAL) * 100 / T1.Population FROM country AS T1 INNER JOIN province AS T2 ON T1.Code = T2.Country INNER JOIN city AS T3 ON T3.Country = T2.Country ORDER BY T3.Population DESC LIMIT 1\n```"}]}, {"id": "train-8489", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did the United States of America attained it's Independence?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Independence FROM politics AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'United States'\n```"}]}, {"id": "train-8491", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the most recently founded organization in Saudi Arabia?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM organization AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code WHERE T2.Name = 'Saudi Arabia' ORDER BY T1.Established DESC LIMIT 1\n```"}]}, {"id": "train-8492", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the 5th highest infant mortality rate?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Name FROM population AS T1 INNER JOIN country AS T2 ON T1.Country = T2.Code ORDER BY T1.Infant_Mortality DESC LIMIT 4, 1\n```"}]}, {"id": "train-8493", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country has the widest range of religious practices?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name FROM country AS T1 INNER JOIN religion AS T2 ON T1.Code = T2.Country GROUP BY T1.Name ORDER BY COUNT(DISTINCT T2.Name) DESC LIMIT 1\n```"}]}, {"id": "train-8494", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What river has the 17th-longest length overall? Specify it's length."}, {"from": "gpt", "value": "```sql\nSELECT Name, Length FROM river ORDER BY Length DESC LIMIT 16, 1\n```"}]}, {"id": "train-8495", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did the country whose capital is Nouakchott attained it's independence?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Independence FROM country AS T1 INNER JOIN politics AS T2 ON T1.Code = T2.Country WHERE T1.Capital = 'Nouakchott'\n```"}]}, {"id": "train-8496", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the country with the smallest population, and what is its gross domestic product?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.GDP FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country ORDER BY T1.Population ASC LIMIT 1\n```"}]}, {"id": "train-8497", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Zaire region is home to the country's deepest lake's Name it and list its depth."}, {"from": "gpt", "value": "```sql\nSELECT T3.Name, T1.Name, T1.Depth FROM lake AS T1 INNER JOIN located AS T2 ON T1.Name = T2.Lake INNER JOIN province AS T3 ON T3.Name = T2.Province INNER JOIN country AS T4 ON T4.Code = T3.Country WHERE T4.Name = 'Zaire'\n```"}]}, {"id": "train-8499", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which nation, with a population ranging from 60,000,000 to 99,000,000, has the greatest gross domestic product?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Name, T2.GDP FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Population BETWEEN 60000000 AND 90000000 ORDER BY T2.GDP DESC LIMIT 1\n```"}]}, {"id": "train-8500", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which Asian country gave its agricultural sector the largest share of its gross domestic product?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T2.Country = T3.Code INNER JOIN economy AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Asia' ORDER BY T4.Agriculture DESC LIMIT 1\n```"}]}, {"id": "train-8501", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What form of governance does the least prosperous nation in the world have?"}, {"from": "gpt", "value": "```sql\nSELECT T3.Government FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country INNER JOIN politics AS T3 ON T3.Country = T2.Country WHERE T2.GDP IS NOT NULL ORDER BY T2.GDP ASC LIMIT 1\n```"}]}, {"id": "train-8502", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What year saw the greatest number of organizations created on the European continent?"}, {"from": "gpt", "value": "```sql\nSELECT STRFTIME('%Y', T4.Established) FROM continent AS T1 INNER JOIN encompasses AS T2 ON T1.Name = T2.Continent INNER JOIN country AS T3 ON T2.Country = T3.Code INNER JOIN organization AS T4 ON T4.Country = T3.Code WHERE T1.Name = 'Europe' GROUP BY STRFTIME('%Y', T4.Established) ORDER BY COUNT(T4.Name) DESC LIMIT 1\n```"}]}, {"id": "train-8503", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What other country does the most populated nation in the world share a border with and how long is the border between the two nations?"}, {"from": "gpt", "value": "```sql\nSELECT T2.Country2, T2.Length FROM country AS T1 INNER JOIN borders AS T2 ON T1.Code = T2.Country1 INNER JOIN country AS T3 ON T3.Code = T2.Country2 WHERE T1.Name = ( SELECT Name FROM country ORDER BY Population DESC LIMIT 1 )\n```"}]}, {"id": "train-8504", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the population density of the nation whose capital city is in the Distrito Federal province, and what portion of its gross domestic product is devoted to its industries?"}, {"from": "gpt", "value": "```sql\nSELECT T1.Population / T1.Area, T2.Industry FROM country AS T1 INNER JOIN economy AS T2 ON T1.Code = T2.Country WHERE T1.Province = 'Distrito Federal'\n```"}]}, {"id": "train-8505", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Lists all governments with a parliamentary democracy that achieved their independence between 01/01/1950 and 12/31/1999."}, {"from": "gpt", "value": "```sql\nSELECT * FROM politics WHERE STRFTIME('%Y', Independence) BETWEEN '1950' AND '1999' AND Government = 'parliamentary democracy'\n```"}]}, {"id": "train-8506", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of countries became independent during the year 1960?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN STRFTIME('%Y', Independence) = '1960' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Country) FROM politics\n```"}]}, {"id": "train-8507", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all deserts that are not between latitudes 30 and 40."}, {"from": "gpt", "value": "```sql\nSELECT Name FROM desert WHERE Latitude < 30 OR Latitude > 40\n```"}]}, {"id": "train-8508", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the coordinates of all the deserts whose area is in more than one country."}, {"from": "gpt", "value": "```sql\nSELECT T1.Latitude, T1.Longitude FROM desert AS T1 INNER JOIN geo_desert AS T2 ON T1.Name = T2.Desert GROUP BY T1.Name, T1.Latitude, T1.Longitude HAVING COUNT(T1.Name) > 1\n```"}]}, {"id": "train-8509", "db_id": "mondial_geo", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the provincial capital of the province with a population of less than 80,000 that has the highest average population per area?"}, {"from": "gpt", "value": "```sql\nSELECT CapProv FROM province WHERE Population < 80000 ORDER BY Population / Area DESC LIMIT 1\n```"}]}, {"id": "train-8510", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers have never married?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ID) FROM Customers WHERE MARITAL_STATUS = 'Never-married'\n```"}]}, {"id": "train-8511", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the customers, how many of them are teenagers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ID) FROM Customers WHERE age >= 13 AND age <= 19\n```"}]}, {"id": "train-8512", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the occupations of the customers with an education level of 11."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT OCCUPATION FROM Customers WHERE EDUCATIONNUM = 11\n```"}]}, {"id": "train-8513", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the first 60,000 customers' responses to the incentive mailing sent by the marketing department, how many of them are considered a true response?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(REFID) custmoer_number FROM Mailings1_2 WHERE RESPONSE = 'true'\n```"}]}, {"id": "train-8514", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers over 30, how many of them are Machine-op-inspcts?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ID) FROM Customers WHERE OCCUPATION = 'Machine-op-inspct' AND age > 30\n```"}]}, {"id": "train-8515", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many female customers have an education level of over 11?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ID) FROM Customers WHERE EDUCATIONNUM > 11 AND SEX = 'Female'\n```"}]}, {"id": "train-8516", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department, how many of them are female?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.SEX = 'Female' AND T2.RESPONSE = 'true'\n```"}]}, {"id": "train-8517", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the occupations of the customers over 40 and have sent a true response to the incentive mailing sent by the marketing department."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.OCCUPATION FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.age > 40 AND T2.RESPONSE = 'true'\n```"}]}, {"id": "train-8518", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the male customers, how many of them come from a place with over 30,000 inhabitants?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Male' AND T2.INHABITANTS_K > 30\n```"}]}, {"id": "train-8519", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are from the place with the highest average income per month?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID ORDER BY T2.INCOME_K DESC LIMIT 1\n```"}]}, {"id": "train-8520", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers from a place with more than 20,000 and less than 30,000 inhabitants, how many of them are Machine-op-inspcts?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Machine-op-inspct' AND T2.INHABITANTS_K > 20 AND T2.INHABITANTS_K < 30\n```"}]}, {"id": "train-8521", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which customer come from a place with more inhabitants, customer no.0 or customer no.1?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ID FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.ID = 0 OR T1.ID = 1 ORDER BY INHABITANTS_K DESC LIMIT 1\n```"}]}, {"id": "train-8522", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department, how many of them are from a place with more than 30,000 inhabitants?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T3.INHABITANTS_K > 30 AND T2.RESPONSE = 'true'\n```"}]}, {"id": "train-8523", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department, how many of them are divorced males?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.SEX = 'Male' AND T1.MARITAL_STATUS = 'Divorced' AND T2.RESPONSE = 'true'\n```"}]}, {"id": "train-8524", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the first 60,000 customers from the place with the highest average income per month have sent a true response to the incentive mailing sent by the marketing department?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T2.RESPONSE = 'true' ORDER BY T3.INCOME_K DESC LIMIT 1\n```"}]}, {"id": "train-8525", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of inhabitants of the place the most customers are from?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID ORDER BY T2.INHABITANTS_K DESC\n```"}]}, {"id": "train-8526", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers who come from the place with 25746 inhabitants, how many of them are male?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INHABITANTS_K = 25.746 AND T1.SEX = 'Male'\n```"}]}, {"id": "train-8527", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department, how many of them are teenagers?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.age >= 13 AND T1.age <= 19 AND T2.RESPONSE = 'true'\n```"}]}, {"id": "train-8528", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average education level of customers from the place with the highest average income per month?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.EDUCATIONNUM) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID ORDER BY T2.INCOME_K DESC LIMIT 1\n```"}]}, {"id": "train-8529", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average age of first 60,000 customers who sent a true response to the incentive mailing sent by the marketing department?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.age) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T2.RESPONSE = 'true'\n```"}]}, {"id": "train-8530", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the customers are male?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ID) FROM Customers WHERE SEX = 'Male'\n```"}]}, {"id": "train-8531", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the customer's geographic identifier who are handlers or cleaners."}, {"from": "gpt", "value": "```sql\nSELECT GEOID FROM Customers WHERE OCCUPATION = 'Handlers-cleaners'\n```"}]}, {"id": "train-8532", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of customers with an age below 30?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ID) FROM Customers WHERE age < 30\n```"}]}, {"id": "train-8533", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the geographic identifier with an income that ranges from 2100 to 2500."}, {"from": "gpt", "value": "```sql\nSELECT GEOID FROM Demog WHERE INCOME_K >= 2100 AND INCOME_K <= 2500\n```"}]}, {"id": "train-8534", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In geographic identifier from 20 to 50, how many of them has a number of inhabitants below 20?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(GEOID) FROM Demog WHERE INHABITANTS_K < 20 AND GEOID >= 20 AND GEOID <= 50\n```"}]}, {"id": "train-8536", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the level of education and occupation of customers ages from 20 to 35 with an income K of 2000 and below."}, {"from": "gpt", "value": "```sql\nSELECT T1.EDUCATIONNUM, T1.OCCUPATION FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INCOME_K < 2000 AND T1.age >= 20 AND T1.age <= 35\n```"}]}, {"id": "train-8537", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the number of inhabitants of customers with a divorced marital status and older than 50 years old."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.MARITAL_STATUS = 'Divorced' AND T1.age < 50\n```"}]}, {"id": "train-8538", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the geographic identifier and income of the oldest customer?"}, {"from": "gpt", "value": "```sql\nSELECT T1.GEOID, T2.INCOME_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID ORDER BY T1.age DESC LIMIT 1\n```"}]}, {"id": "train-8539", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the male customers with an level of education of 4 and below, list their income K."}, {"from": "gpt", "value": "```sql\nSELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 4 AND SEX = 'Male' )\n```"}]}, {"id": "train-8540", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the occupation and income of male customers with an level of education of 4 to 6."}, {"from": "gpt", "value": "```sql\nSELECT T1.OCCUPATION, T2.INCOME_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.EDUCATIONNUM >= 4 AND T1.EDUCATIONNUM <= 6 AND T1.SEX = 'Male'\n```"}]}, {"id": "train-8541", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In widowed male customers ages from 40 to 60, how many of them has an income ranges from 3000 and above?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.age >= 40 AND T1.age <= 60 AND T1.MARITAL_STATUS = 'Widowed' AND T1.SEX = 'Male' AND T2.INCOME_K >= 2000 AND T2.INCOME_K <= 3000\n```"}]}, {"id": "train-8542", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the occupation of customers within number of inhabitants ranges of 30 to 40?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.OCCUPATION FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INHABITANTS_K >= 30 AND T2.INHABITANTS_K <= 40\n```"}]}, {"id": "train-8543", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the widowed female customers, give the income of those who has an level of education of 5 and below."}, {"from": "gpt", "value": "```sql\nSELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 5 AND SEX = 'Female' AND MARITAL_STATUS = 'Widowed' )\n```"}]}, {"id": "train-8544", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the marital status of customers within the age of 40 to 60 that has the highest income among the group."}, {"from": "gpt", "value": "```sql\nSELECT T1.MARITAL_STATUS FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.age >= 40 AND T1.age <= 60 ORDER BY T2.INCOME_K DESC LIMIT 1\n```"}]}, {"id": "train-8545", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the number of inhabitants of male customers ages from 20 to 30 years old who are farming or fishing?"}, {"from": "gpt", "value": "```sql\nSELECT T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Farming-fishing' AND T1.SEX = 'Male' AND T1.age >= 20 AND T1.age <= 30\n```"}]}, {"id": "train-8546", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers with a marital status of married-civ-spouse, list the number of inhabitants and age of those who are machine-op-inspct."}, {"from": "gpt", "value": "```sql\nSELECT T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Farming-fishing' AND T1.SEX = 'Male' AND T1.age >= 20 AND T1.age <= 30\n```"}]}, {"id": "train-8547", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In female customers ages from 50 to 60, how many of them has an number of inhabitants ranges from 19 to 24?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Female' AND T1.age >= 50 AND T1.age <= 60 AND T2.INHABITANTS_K >= 19 AND T2.INHABITANTS_K <= 24\n```"}]}, {"id": "train-8548", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the income and number of inhabitants of customers with an age greater than the 80% of average age of all customers?"}, {"from": "gpt", "value": "```sql\nSELECT T2.INCOME_K, T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID GROUP BY T2.INCOME_K, T2.INHABITANTS_K HAVING T1.age > 0.8 * AVG(T1.age)\n```"}]}, {"id": "train-8549", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In customers with marital status of never married, what is the percentage of customers with income of 2500 and above?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.INCOME_K > 2500 THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.MARITAL_STATUS = 'Never-married'\n```"}]}, {"id": "train-8550", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find and list the id and geographic ID of the elderly customers with an education level below 3."}, {"from": "gpt", "value": "```sql\nSELECT ID, GEOID FROM Customers WHERE EDUCATIONNUM < 3 AND age > 65\n```"}]}, {"id": "train-8551", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the geographic id of places where the income is above average."}, {"from": "gpt", "value": "```sql\nSELECT AVG(INCOME_K) FROM Demog\n```"}]}, {"id": "train-8552", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the number of customers who did not respond in February of 2007."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(REFID) custmoer_number FROM Mailings1_2 WHERE RESPONSE = 'false' AND REF_DATE BETWEEN '2007-02-01' AND '2007-02-28'\n```"}]}, {"id": "train-8553", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many teenagers are working as Machine-op-inspct?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ID) teenager_number FROM Customers WHERE OCCUPATION = 'Machine-op-inspct' AND age >= 13 AND age <= 19\n```"}]}, {"id": "train-8554", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of customers who provide other services, how many are from places where inhabitants are more than 20000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.OCCUPATION = 'Other-service' AND T2.INHABITANTS_K > 20\n```"}]}, {"id": "train-8555", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the male customer in their twenties, how many are from places where the average income is more than 3000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.GEOID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Male' AND T2.INCOME_K > 3000 AND T1.age >= 20 AND T1.age <= 29\n```"}]}, {"id": "train-8556", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of elderly customers who are never married in the place with geographic ID 24?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.MARITAL_STATUS = 'never married' THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.GEOID = 24\n```"}]}, {"id": "train-8557", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers with an average income per inhabitant above 3000, what percentage are in their eighties?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.age BETWEEN 80 AND 89 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INCOME_K > 3000\n```"}]}, {"id": "train-8558", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the customer's reference ID that has a TRUE response?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(REFID) FROM Mailings1_2 WHERE RESPONSE = 'true'\n```"}]}, {"id": "train-8559", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the customer's reference ID with true response."}, {"from": "gpt", "value": "```sql\nSELECT REFID FROM Mailings1_2 WHERE RESPONSE = 'true'\n```"}]}, {"id": "train-8560", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of widowed customers with an age below 50?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(ID) FROM Customers WHERE MARITAL_STATUS = 'Widowed' AND age < 50\n```"}]}, {"id": "train-8561", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the geographic identifier with an number of inhabitants less than 30."}, {"from": "gpt", "value": "```sql\nSELECT GEOID FROM Demog WHERE INHABITANTS_K < 30\n```"}]}, {"id": "train-8562", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In geographic identifier from 10 to 30, how many of them has an income below 2000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(GEOID) FROM Demog WHERE INCOME_K < 2000 AND GEOID >= 10 AND GEOID <= 30\n```"}]}, {"id": "train-8563", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the marital status of the customer ages 62 with an level of education of 7?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT MARITAL_STATUS FROM Customers WHERE EDUCATIONNUM = 7 AND age = 62\n```"}]}, {"id": "train-8564", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the number of inhabitants of customers with a widowed marital status and false response ."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.MARITAL_STATUS = 'Widowed' AND T2.RESPONSE = 'true'\n```"}]}, {"id": "train-8565", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the response and number of inhabitants of the oldest female customer?"}, {"from": "gpt", "value": "```sql\nSELECT T2.RESPONSE, T3.INHABITANTS_K FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.SEX = 'Female' ORDER BY T1.age DESC LIMIT 1\n```"}]}, {"id": "train-8566", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the female customers with an level of education of 3 and below, list their income."}, {"from": "gpt", "value": "```sql\nSELECT INCOME_K FROM Demog WHERE GEOID IN ( SELECT GEOID FROM Customers WHERE EDUCATIONNUM < 3 AND SEX = 'Female' )\n```"}]}, {"id": "train-8567", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the level of education and income of customers ages from 30 to 55 with a true response."}, {"from": "gpt", "value": "```sql\nSELECT T1.EDUCATIONNUM, T3.INCOME_K FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.age >= 30 AND T1.age <= 55 AND T2.RESPONSE = 'true'\n```"}]}, {"id": "train-8568", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In male customers ages from 30 to 50, how many of them has an income ranges from 2000 to 2300?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Male' AND T1.age >= 30 AND T1.age <= 50 AND T2.INCOME_K >= 2000 AND T2.INCOME_K <= 2300\n```"}]}, {"id": "train-8569", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the educationnum and response of customers within the age of 20 to 30 that has the highest number of inhabitants among the group."}, {"from": "gpt", "value": "```sql\nSELECT T1.EDUCATIONNUM, T2.RESPONSE FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.age >= 20 AND T1.age <= 30 ORDER BY T3.INHABITANTS_K DESC LIMIT 1\n```"}]}, {"id": "train-8570", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the income of female customers ages from 30 to 55 years old and has an occupation of machine-op-inspct?"}, {"from": "gpt", "value": "```sql\nSELECT T2.INCOME_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Female' AND T1.age >= 30 AND T1.age <= 55 AND T1.OCCUPATION = 'Machine-op-inspct'\n```"}]}, {"id": "train-8571", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the marital status and response of female customers with an level of education of 8 and above."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.MARITAL_STATUS, T2.RESPONSE FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.EDUCATIONNUM > 8 AND T1.SEX = 'Female'\n```"}]}, {"id": "train-8572", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the age of female customers within the number of inhabitants below 30?"}, {"from": "gpt", "value": "```sql\nSELECT age FROM Customers WHERE GEOID IN ( SELECT GEOID FROM Demog WHERE INHABITANTS_K < 30 ) AND SEX = 'Female'\n```"}]}, {"id": "train-8573", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the divorced male customers, give the income and response of those who has an level of education of 6 and above."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.INCOME_K, T2.RESPONSE FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.EDUCATIONNUM > 6 AND T1.SEX = 'Male' AND T1.MARITAL_STATUS = 'Divorced'\n```"}]}, {"id": "train-8574", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the occupation and response of female customers within the number of inhabitants range of 20 to 25?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.OCCUPATION, T2.RESPONSE FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID INNER JOIN Demog AS T3 ON T1.GEOID = T3.GEOID WHERE T1.SEX = 'Female' AND T3.INHABITANTS_K >= 20 AND T3.INHABITANTS_K <= 25\n```"}]}, {"id": "train-8575", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In male customers with an occupation handlers or cleaners, what is the percentage of customers with a true response?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.RESPONSE = 'true' THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(T2.REFID) FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.OCCUPATION = 'Handlers-cleaners' AND T1.SEX = 'Male'\n```"}]}, {"id": "train-8576", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the income and number of inhabitants of customers with a reference ID greater than the 50% of average of number of false response?"}, {"from": "gpt", "value": "```sql\nSELECT T2.INCOME_K, T2.INHABITANTS_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID INNER JOIN Mailings1_2 AS T3 ON T1.ID = T3.REFID WHERE T3.REFID > ( SELECT 0.5 * COUNT(CASE WHEN RESPONSE = 'false' THEN 1 ELSE NULL END) / COUNT(RESPONSE) FROM Mailings1_2 )\n```"}]}, {"id": "train-8577", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of male and female among the age of teenager when the education is above 10?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN SEX = 'Male' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN SEX = 'Female' THEN 1 ELSE 0 END) FROM Customers WHERE age BETWEEN 13 AND 19 AND EDUCATIONNUM > 10\n```"}]}, {"id": "train-8578", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the geographic ID and total income per year when the average income is above 3300 dollar."}, {"from": "gpt", "value": "```sql\nSELECT GEOID, INHABITANTS_K * INCOME_K * 12 FROM Demog WHERE INCOME_K > 3300\n```"}]}, {"id": "train-8579", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Point out the greater one between the number of actual responding and not responding to mailing."}, {"from": "gpt", "value": "```sql\nSELECT RESPONSE FROM Mailings1_2 GROUP BY RESPONSE ORDER BY COUNT(RESPONSE) DESC LIMIT 1\n```"}]}, {"id": "train-8580", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find out the yearly income of geographic ID when the customer is female and occupation as sales."}, {"from": "gpt", "value": "```sql\nSELECT T2.INHABITANTS_K * T2.INCOME_K * 12 FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Female' AND T1.OCCUPATION = 'Sales'\n```"}]}, {"id": "train-8581", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the geographic ID which has 33.658K of inhabitants, describe the education, occupation and age of female widow."}, {"from": "gpt", "value": "```sql\nSELECT T1.EDUCATIONNUM, T1.OCCUPATION, T1.age FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INHABITANTS_K = 33.658 AND T1.SEX = 'Female' AND T1.MARITAL_STATUS = 'Widowed'\n```"}]}, {"id": "train-8582", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the response status to customer whose geographic ID of 134."}, {"from": "gpt", "value": "```sql\nSELECT T2.RESPONSE FROM Customers AS T1 INNER JOIN mailings3 AS T2 ON T1.ID = T2.REFID WHERE T1.GEOID = 134\n```"}]}, {"id": "train-8583", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the average income per month and yearly income of the geographic ID in which customer of ID \"209556\" and \"290135\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.INCOME_K, T2.INHABITANTS_K * T2.INCOME_K * 12 FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.ID = 209556 OR T1.ID = 290135\n```"}]}, {"id": "train-8584", "db_id": "software_company", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the reference ID of under 10 who got response by marketing department, compare their education status."}, {"from": "gpt", "value": "```sql\nSELECT T1.EDUCATIONNUM FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T2.REFID < 10 AND T2.RESPONSE = 'true'\n```"}]}, {"id": "train-8585", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many community areas are there in Central Chicago?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Community_Area WHERE side = 'Central'\n```"}]}, {"id": "train-8586", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which district is the community area Lincoln Square grouped into?"}, {"from": "gpt", "value": "```sql\nSELECT side FROM Community_Area WHERE community_area_name = 'Lincoln Square'\n```"}]}, {"id": "train-8587", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which district in Chicago has the most community areas?"}, {"from": "gpt", "value": "```sql\nSELECT side FROM Community_Area GROUP BY side ORDER BY COUNT(side) DESC LIMIT 1\n```"}]}, {"id": "train-8588", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which community area has the least population?"}, {"from": "gpt", "value": "```sql\nSELECT community_area_name FROM Community_Area ORDER BY population ASC LIMIT 1\n```"}]}, {"id": "train-8589", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the person responsible for the crime cases in Central Chicago?"}, {"from": "gpt", "value": "```sql\nSELECT commander FROM District WHERE district_name = 'Central'\n```"}]}, {"id": "train-8590", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the email address to contact the administrator of Central Chicago?"}, {"from": "gpt", "value": "```sql\nSELECT email FROM District WHERE district_name = 'Central'\n```"}]}, {"id": "train-8591", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which community area does the neighborhood Albany Park belong?"}, {"from": "gpt", "value": "```sql\nSELECT T2.community_area_name FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.neighborhood_name = 'Albany Park'\n```"}]}, {"id": "train-8592", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many neighborhoods are there in the community area of Lincoln Square?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.community_area_no) FROM ( SELECT T1.community_area_no FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no WHERE community_area_name = 'Lincoln Square' GROUP BY T1.community_area_no ) T3\n```"}]}, {"id": "train-8593", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the neighborhoods in the community area with the most population."}, {"from": "gpt", "value": "```sql\nSELECT T1.neighborhood_name FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T2.community_area_no = T2.community_area_no ORDER BY T2.population DESC LIMIT 1\n```"}]}, {"id": "train-8594", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the neighborhoods in Central Chicago."}, {"from": "gpt", "value": "```sql\nSELECT T2.neighborhood_name FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.side = 'Central'\n```"}]}, {"id": "train-8595", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the precise location coordinates of all the crimes in Central Chicago."}, {"from": "gpt", "value": "```sql\nSELECT T2.latitude, T2.longitude FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.district_name = 'Central'\n```"}]}, {"id": "train-8596", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crimes had happened in Central Chicago?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T2.district_name = 'Central'\n```"}]}, {"id": "train-8597", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the crimes that had happened in Central Chicago, how many of them were cases of domestic violence?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T2.district_name = 'Central' AND T1.domestic = 'TRUE'\n```"}]}, {"id": "train-8598", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the case numbers of all the crimes with no arrest made in Central Chicago."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T2.district_name = 'Central' AND T1.arrest = 'FALSE'\n```"}]}, {"id": "train-8599", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crimes had happened in the community area with the most population?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.report_no) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no GROUP BY T1.community_area_name ORDER BY T1.population DESC LIMIT 1\n```"}]}, {"id": "train-8600", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the crimes in Woodlawn, how many of them happened in January, 2018?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.community_area_name = 'Woodlawn' THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T2.date LIKE '%1/2018%'\n```"}]}, {"id": "train-8601", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: More crimes happened in which community area in January, 2018, Woodlawn or Lincoln Square?"}, {"from": "gpt", "value": "```sql\nSELECT T1.community_area_name FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.community_area_name IN ('Woodlawn', 'Lincoln Square') AND T2.date LIKE '%1/2018%' GROUP BY T1.community_area_name ORDER BY COUNT(T1.community_area_name) DESC LIMIT 1\n```"}]}, {"id": "train-8602", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the fax number for the district with the most number of crimes in January, 2018?"}, {"from": "gpt", "value": "```sql\nSELECT T1.fax FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.date LIKE '%1/2018%' GROUP BY T2.district_no ORDER BY COUNT(case_number) DESC LIMIT 1\n```"}]}, {"id": "train-8603", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of crimes in a neighborhood in Central Chicago?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.report_no) AS REAL) / COUNT(T2.community_area_no) FROM Crime AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no WHERE T2.side = 'Central'\n```"}]}, {"id": "train-8604", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the crimes in all the districts in Chicago, what is the percentage of them happening in the Central district?"}, {"from": "gpt", "value": "```sql\nSELECT 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\n```"}]}, {"id": "train-8605", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many community areas are in the Far North side?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Community_Area WHERE side = 'Far North '\n```"}]}, {"id": "train-8606", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the commander of Morgan Park district?"}, {"from": "gpt", "value": "```sql\nSELECT commander FROM District WHERE district_name = 'Morgan Park'\n```"}]}, {"id": "train-8607", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where did case No. JB100065 happen? Give the name of the district."}, {"from": "gpt", "value": "```sql\nSELECT T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.case_number = 'JB100065'\n```"}]}, {"id": "train-8608", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where is the coordinate (41.66236555, -87.63470194) located? Give the name of the district."}, {"from": "gpt", "value": "```sql\nSELECT T2.district_name FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.longitude = '-87.63470194' AND T1.latitude = '41.66236555'\n```"}]}, {"id": "train-8609", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the person who was responsible for case No.JB524952."}, {"from": "gpt", "value": "```sql\nSELECT T1.commander FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.case_number = 'JB524952'\n```"}]}, {"id": "train-8610", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many simple assaults happened on 2018/9/8?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.secondary_description = 'SIMPLE' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.date LIKE '%9/8/2018%' AND T2.primary_description = 'ASSAULT'\n```"}]}, {"id": "train-8611", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which district had the most number of first degree murders? Give the district number."}, {"from": "gpt", "value": "```sql\nSELECT T2.district_no FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.secondary_description = 'FIRST DEGREE MURDER' GROUP BY T2.district_no ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-8612", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How severe was case JB296775? Give the index code for severity."}, {"from": "gpt", "value": "```sql\nSELECT T2.iucr_no FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.case_number = 'JB296775'\n```"}]}, {"id": "train-8613", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the community area which had the most pocket-picking thefts."}, {"from": "gpt", "value": "```sql\nSELECT T3.community_area_name FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T1.primary_description = 'THEFT' AND T1.secondary_description = 'POCKET-PICKING' GROUP BY T2.community_area_no ORDER BY T2.case_number DESC LIMIT 1\n```"}]}, {"id": "train-8614", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who was the alderman of the legislative district where case No. JB103470 took place? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.alderman_first_name, T1.alderman_last_name FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.case_number = 'JB103470'\n```"}]}, {"id": "train-8615", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the neighborhood name of West Englewood community."}, {"from": "gpt", "value": "```sql\nSELECT T1.neighborhood_name FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no WHERE T2.community_area_name = 'West Englewood'\n```"}]}, {"id": "train-8616", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different neighborhoods are there in Roseland community?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.community_area_name = 'Roseland' THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no\n```"}]}, {"id": "train-8617", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the FBI code description of case No.JB134191."}, {"from": "gpt", "value": "```sql\nSELECT description FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.case_number = 'JB134191'\n```"}]}, {"id": "train-8618", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the number of cases with arrests in North Lawndale community."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.community_area_name = 'North Lawndale' THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T2.arrest = 'TRUE'\n```"}]}, {"id": "train-8619", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of under $500 thefts among all cases that happened in West Englewood?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.secondary_description = '$500 AND UNDER' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.case_number) FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no INNER JOIN Community_Area AS T3 ON T1.community_area_no = T3.community_area_no WHERE T2.primary_description = 'THEFT' AND T3.community_area_name = 'West Englewood'\n```"}]}, {"id": "train-8620", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of larceny cases among all cases that happened in Edgewater community?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T3.title = 'Larceny' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.case_number) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no WHERE T1.community_area_name = 'Edgewater'\n```"}]}, {"id": "train-8621", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crimes were committed at 018XX S KOMENSKY AVEin May 2018?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN date LIKE '5/%/2018%' THEN 1 ELSE 0 END) FROM Crime WHERE block = '018XX S KOMENSKY AVE'\n```"}]}, {"id": "train-8622", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the community with the highest population?"}, {"from": "gpt", "value": "```sql\nSELECT community_area_name FROM Community_Area ORDER BY population DESC LIMIT 1\n```"}]}, {"id": "train-8623", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many incidents of domestic violence occurred in an abandoned building in 2018?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN location_description = 'ABANDONED BUILDING' THEN 1 ELSE 0 END) FROM Crime WHERE date LIKE '%2018%' AND domestic = 'TRUE'\n```"}]}, {"id": "train-8624", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the population of the district with the least population?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(population) FROM Community_Area GROUP BY side ORDER BY SUM(population) LIMIT 1\n```"}]}, {"id": "train-8625", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many arrests were made in 2018 in an animal hospital under FBI code 08B?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN arrest = 'TRUE' THEN 1 ELSE 0 END) FROM Crime WHERE date LIKE '%2018%' AND location_description = 'ANIMAL HOSPITAL' AND fbi_code_no = '08B'\n```"}]}, {"id": "train-8626", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the detailed description of all the crimes against society."}, {"from": "gpt", "value": "```sql\nSELECT description FROM FBI_Code WHERE crime_against = 'Society'\n```"}]}, {"id": "train-8627", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the commanding officer in the district with the highest number of disorderly conduct?"}, {"from": "gpt", "value": "```sql\nSELECT T1.commander FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no WHERE T3.title = 'Disorderly Conduct' AND T2.fbi_code_no = 24 GROUP BY T2.fbi_code_no ORDER BY COUNT(T1.district_no) DESC LIMIT 1\n```"}]}, {"id": "train-8628", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which crime was committed the most by criminals?"}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no ORDER BY T2.fbi_code_no DESC LIMIT 1\n```"}]}, {"id": "train-8629", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In Albany Park, how many arrests were made in an apartment due to criminal sexual abuse?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.title = 'Criminal Sexual Abuse' THEN 1 ELSE 0 END) FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no WHERE T1.district_name = 'Albany Park' AND T2.arrest = 'TRUE' AND T2.location_description = 'APARTMENT'\n```"}]}, {"id": "train-8630", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the precise location or coordinate where most of the robberies in Rogers Park occurred?"}, {"from": "gpt", "value": "```sql\nSELECT T2.latitude, T2.longitude FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no WHERE T1.community_area_name = 'Rogers Park' AND T3.title = 'Robbery' AND T3.fbi_code_no = 3\n```"}]}, {"id": "train-8631", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many solicit on public way prostitution crimes were arrested in West Garfield Park?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN IUCR AS T3 ON T2.iucr_no = T3.iucr_no WHERE T1.community_area_name = 'West Garfield Park' AND T3.secondary_description = 'SOLICIT ON PUBLIC WAY' AND T3.primary_description = 'PROSTITUTION'\n```"}]}, {"id": "train-8632", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the most populated ward, how many incidents of domestic violence were reported in a bar or tavern?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.report_no) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.domestic = 'TRUE' AND T2.location_description = 'BAR OR TAVERN' ORDER BY T1.Population DESC LIMIT 1\n```"}]}, {"id": "train-8633", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many neighborhoods are there in Near North Side?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.community_area_name = 'Near North Side' THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no\n```"}]}, {"id": "train-8634", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Out of all the incidents of domestic violence reported at the ward represented by alderman Walter Burnett Jr., how many were arrested?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T1.alderman_first_name = 'Walter' AND T1.alderman_last_name = 'Burnett' AND alderman_name_suffix = 'Jr.' AND T2.domestic = 'TRUE'\n```"}]}, {"id": "train-8635", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the short description of the crime committed the most by criminals in the least populated community?"}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no GROUP BY T3.title ORDER BY T1.population ASC, T3.fbi_code_no DESC LIMIT 1\n```"}]}, {"id": "train-8636", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the legislative district's office address where 010XX W LAKE ST is located?"}, {"from": "gpt", "value": "```sql\nSELECT T1.ward_office_address FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.block = '010XX W LAKE ST' GROUP BY T1.ward_office_address\n```"}]}, {"id": "train-8637", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the community that has the highest number of crimes related to prostitution?"}, {"from": "gpt", "value": "```sql\nSELECT T3.community_area_name FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no INNER JOIN Community_Area AS T3 ON T1.community_area_no = T3.community_area_no WHERE T2.primary_description = 'PROSTITUTION' GROUP BY T1.iucr_no ORDER BY T1.case_number DESC LIMIT 1\n```"}]}, {"id": "train-8638", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many vandalisms were arrested in the ward represented by Edward Burke?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.alderman_last_name = 'Burke' THEN 1 ELSE 0 END) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no INNER JOIN FBI_Code AS T3 ON T2.fbi_code_no = T3.fbi_code_no WHERE T3.title = 'Vandalism' AND T2.arrest = 'TRUE' AND T1.alderman_first_name = 'Edward'\n```"}]}, {"id": "train-8639", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many domestic violence cases were reported in May 2018?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Crime WHERE date LIKE '5/%/2018%' AND domestic = 'TRUE'\n```"}]}, {"id": "train-8640", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the IUCR numbers and index status of homicide incidents."}, {"from": "gpt", "value": "```sql\nSELECT index_code FROM IUCR WHERE primary_description = 'HOMICIDE'\n```"}]}, {"id": "train-8641", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the responsible person and his/her email address of Chicago Lawn."}, {"from": "gpt", "value": "```sql\nSELECT commander, email FROM District WHERE district_name = 'Chicago Lawn'\n```"}]}, {"id": "train-8642", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the alderman's full name of the most crowded ward?"}, {"from": "gpt", "value": "```sql\nSELECT alderman_name_suffix, alderman_first_name, alderman_last_name FROM Ward ORDER BY population DESC LIMIT 1\n```"}]}, {"id": "train-8644", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the titles and descriptions of the crimes cases against persons."}, {"from": "gpt", "value": "```sql\nSELECT title, description FROM FBI_Code WHERE crime_against = 'Persons'\n```"}]}, {"id": "train-8645", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the specific description and case locations under IUCR 142."}, {"from": "gpt", "value": "```sql\nSELECT T1.secondary_description, T2.latitude, T2.longitude FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.iucr_no = 142\n```"}]}, {"id": "train-8646", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crimes were handled by Brendan Reilly on 7th October 2018?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.alderman_last_name = 'Reilly' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN Ward AS T2 ON T1.ward_no = T2.ward_no WHERE T2.alderman_name_suffix IS NULL AND T2.alderman_first_name = 'Brendan' AND date LIKE '10/7/2018%'\n```"}]}, {"id": "train-8647", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cases have been arrested among the crimes that happened in the restaurant of Englewood?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T2.district_name = 'Englewood' AND T1.location_description = 'RESTAURANT'\n```"}]}, {"id": "train-8648", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide case numbers, aldermen's full names, and district names of the crimes that happened in 0000X N FRANCISCO AVE."}, {"from": "gpt", "value": "```sql\nSELECT T2.case_number, T3.alderman_first_name, T3.alderman_last_name, T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no INNER JOIN Ward AS T3 ON T2.ward_no = T3.ward_no WHERE T2.block = '0000X N FRANCISCO AVE' GROUP BY T2.case_number, T3.alderman_first_name, T3.alderman_last_name, T1.district_name\n```"}]}, {"id": "train-8649", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crimes were Misc Non-Index Offense?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.title = 'Misc Non-Index Offense' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no\n```"}]}, {"id": "train-8650", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the neighborhood areas of Douglas."}, {"from": "gpt", "value": "```sql\nSELECT T2.neighborhood_name FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'Douglas'\n```"}]}, {"id": "train-8651", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average crime rate per month in the highest populous area."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.report_no) AS REAL) / 12 FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no GROUP BY T1.community_area_no HAVING COUNT(T1.population) ORDER BY COUNT(T1.population) LIMIT 1\n```"}]}, {"id": "train-8652", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the crimes in the Central, calculate the percentage of larceny incidents."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T3.title = 'Larceny' THEN T2.report_no END) AS REAL) * 100 / COUNT(T2.report_no) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no INNER JOIN FBI_Code AS T3 ON T3.fbi_code_no = T2.fbi_code_no WHERE T1.side = 'Central'\n```"}]}, {"id": "train-8653", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the location descriptions and aldermen's full names of the arson by explosive."}, {"from": "gpt", "value": "```sql\nSELECT T2.location_description, T1.alderman_first_name, T1.alderman_last_name, T1.alderman_name_suffix FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no INNER JOIN IUCR AS T3 ON T3.iucr_no = T2.iucr_no WHERE T3.primary_description = 'ARSON' AND T3.secondary_description = 'BY EXPLOSIVE'\n```"}]}, {"id": "train-8654", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the occurrence date and location of the deceptive practice due to the unlawful use of recorded sound."}, {"from": "gpt", "value": "```sql\nSELECT T2.date, T2.latitude, T2.longitude FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no WHERE T1.primary_description = 'DECEPTIVE PRACTICE' AND T1.secondary_description = 'UNLAWFUL USE OF RECORDED SOUND'\n```"}]}, {"id": "train-8655", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the criminal sexual assaults in the district of Adnardo Gutierrez, how many cases happened in the residence?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.report_no) FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no INNER JOIN FBI_Code AS T3 ON T3.fbi_code_no = T2.fbi_code_no WHERE T3.title = 'Criminal Sexual Assault' AND T1.commander = 'Adnardo Gutierrez' AND T2.location_description = 'RESIDENCE'\n```"}]}, {"id": "train-8656", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of domestic violence cases were arrested in West Pullman?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.arrest = 'TRUE' THEN T2.report_no END) AS REAL) * 100 / COUNT(T2.report_no) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'West Pullman' AND T2.domestic = 'TRUE'\n```"}]}, {"id": "train-8657", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of the domestic violence cases handled by Christopher Taliaferro. Among them, list report numbers of cases that happened in the bank."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.domestic = 'TRUE' THEN T1.report_no END) AS REAL) * 100 / COUNT(T1.report_no), COUNT(CASE WHEN T1.domestic = 'TRUE' AND T1.location_description = 'BANK' THEN T1.report_no END) AS \"number\" FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T2.alderman_first_name = 'Christopher' AND T2.alderman_last_name = 'Taliaferro'\n```"}]}, {"id": "train-8658", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many aldermen have \"James\" as their first name?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Ward WHERE alderman_first_name = 'James'\n```"}]}, {"id": "train-8659", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crimes are commited on January 1, 2018?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Crime WHERE date LIKE '1/1/2018%'\n```"}]}, {"id": "train-8660", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average population of community areas in the West side."}, {"from": "gpt", "value": "```sql\nSELECT AVG(population) FROM Community_Area WHERE side = 'West '\n```"}]}, {"id": "train-8661", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the cases reported in the ward with Edward Burke as the alderman and happened in the community area with the highest population, provide the report number of the crime with the highest beat."}, {"from": "gpt", "value": "```sql\nSELECT T2.report_no FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no INNER JOIN Community_Area AS T3 ON T3.community_area_no = T2.community_area_no WHERE T1.alderman_first_name = 'Edward' AND T1.alderman_last_name = 'Burke' ORDER BY T2.beat DESC, T3.population DESC LIMIT 1\n```"}]}, {"id": "train-8662", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the crimes that happened in the street have FBI title \"Homicide 1st & 2nd Degree\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.location_description = 'STREET' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no WHERE T1.title = 'Homicide 1st & 2nd Degree'\n```"}]}, {"id": "train-8663", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the alderman in the ward associated with the crime with report number 23769?"}, {"from": "gpt", "value": "```sql\nSELECT T2.alderman_first_name, T2.alderman_last_name FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T1.report_no = 23769\n```"}]}, {"id": "train-8664", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the case numbers of domestic violence crimes reported in Lincoln Square."}, {"from": "gpt", "value": "```sql\nSELECT T2.case_number FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'Lincoln Square' AND T2.domestic = 'TRUE'\n```"}]}, {"id": "train-8665", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the crimes reported to the ward located at 1958 N. Milwaukee Ave., list down the report number of the crimes happened inside the apartment."}, {"from": "gpt", "value": "```sql\nSELECT T1.case_number FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T1.location_description = 'APARTMENT' AND T2.ward_office_address = '1958 N. Milwaukee Ave.'\n```"}]}, {"id": "train-8666", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of crimes that happened in Bridgeport with beat less than 1000?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.beat < 1000 THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'Bridgeport'\n```"}]}, {"id": "train-8667", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the report number of crimes reported in a community area in the far north side with a population greater than 60,000."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.population > 60000 THEN 1 ELSE 0 END) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.side = 'Far North '\n```"}]}, {"id": "train-8668", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the report number of crimes against property happened in Riverdale."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.crime_against = 'Property' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no INNER JOIN Community_Area AS T3 ON T3.community_area_no = T2.community_area_no WHERE T3.community_area_name = 'Riverdale'\n```"}]}, {"id": "train-8669", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many domestic violence cases were brought in the ward that uses \"ward13@cityofchicago.org\"?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.domestic = 'TRUE' THEN 1 ELSE 0 END) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no WHERE T1.ward_email = 'ward13@cityofchicago.org'\n```"}]}, {"id": "train-8670", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the district address associated with the case JB107731?"}, {"from": "gpt", "value": "```sql\nSELECT T1.address FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no WHERE T2.case_number = 'JB107731'\n```"}]}, {"id": "train-8671", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total beat of the crimes reported in a community area in the central side with population of 50,000 and above."}, {"from": "gpt", "value": "```sql\nSELECT 1.0 * SUM(CASE WHEN T1.population > 50000 THEN T2.beat ELSE 0 END) AS sum FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.side = 'Central'\n```"}]}, {"id": "train-8672", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the case number of crimes against society that happened in June 2018."}, {"from": "gpt", "value": "```sql\nSELECT T2.case_number FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no WHERE T2.date LIKE '6/%/2018%' AND T1.crime_against = 'Society'\n```"}]}, {"id": "train-8673", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the crimes located in the community area with the highest population, what is the percentage of domestic violence?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.domestic = 'TRUE' THEN T2.domestic END) AS REAL) * 100 / COUNT(T2.domestic) FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no GROUP BY T1.community_area_no HAVING COUNT(T1.population) ORDER BY COUNT(T1.population) DESC LIMIT 1\n```"}]}, {"id": "train-8674", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the case number of the crimes in wards with population below 52000 that have beat greater than the 90% of the average beat of all crimes."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.report_no) FROM Crime AS T1 INNER JOIN Ward AS T2 ON T1.ward_no = T2.ward_no WHERE T2.Population < 52000 AND T1.beat > ( SELECT AVG(T1.beat) * 0.9 FROM Crime AS T1 INNER JOIN Ward AS T2 ON T1.ward_no = T2.ward_no WHERE T2.Population < 52000 )\n```"}]}, {"id": "train-8675", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the area name of the communities in the Far north side, which has a population of more than 50000 but less than 70000."}, {"from": "gpt", "value": "```sql\nSELECT community_area_name, side FROM Community_Area WHERE side = 'Far North ' AND population BETWEEN 50000 AND 70000\n```"}]}, {"id": "train-8676", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the coordinate of the alleys where a crime was reported and an arrest was made."}, {"from": "gpt", "value": "```sql\nSELECT latitude, longitude FROM Crime WHERE location_description = 'ALLEY' AND arrest = 'TRUE' GROUP BY latitude, longitude\n```"}]}, {"id": "train-8677", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the commander's name, email address, and phone number of the Ogden district."}, {"from": "gpt", "value": "```sql\nSELECT commander, email, phone FROM District WHERE district_name = 'Ogden'\n```"}]}, {"id": "train-8678", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the FBI code and definition of Gambling?"}, {"from": "gpt", "value": "```sql\nSELECT fbi_code_no, description FROM FBI_Code WHERE title = 'Gambling'\n```"}]}, {"id": "train-8679", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the crimes, what percentage are severe?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN index_code = 'I' THEN iucr_no ELSE NULL END) AS REAL) * 100 / COUNT(iucr_no) FROM IUCR\n```"}]}, {"id": "train-8680", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What kind of location in Austin reported the most number of crimes?"}, {"from": "gpt", "value": "```sql\nSELECT T2.location_description FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no WHERE T1.district_name = 'Austin' GROUP BY T2.location_description ORDER BY COUNT(T2.case_number) DESC LIMIT 1\n```"}]}, {"id": "train-8681", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On average, how many community areas are there in a side?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.ward_no) AS REAL) / COUNT(DISTINCT T3.side) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no INNER JOIN Community_Area AS T3 ON T3.community_area_no = T2.community_area_no\n```"}]}, {"id": "train-8682", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which community area has the highest number of crimes reported on the street?"}, {"from": "gpt", "value": "```sql\nSELECT T1.community_area_no FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T2.location_description = 'STREET' GROUP BY T1.community_area_no ORDER BY COUNT(T2.location_description) DESC LIMIT 1\n```"}]}, {"id": "train-8683", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of reckless homicides that happened in a district?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.report_no) AS REAL) / COUNT(DISTINCT T1.district_name) FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no INNER JOIN IUCR AS T3 ON T3.iucr_no = T2.iucr_no WHERE T3.secondary_description = 'RECKLESS HOMICIDE'\n```"}]}, {"id": "train-8684", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the ward office's address and phone number of the ward where the most crimes without arrest occurred."}, {"from": "gpt", "value": "```sql\nSELECT T2.ward_office_address, T2.ward_office_phone FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T1.arrest = 'FALSE' GROUP BY T2.ward_office_address, T2.ward_office_phone ORDER BY COUNT(T1.arrest) DESC LIMIT 1\n```"}]}, {"id": "train-8685", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the case number and coordinates of the places where child abduction is reported."}, {"from": "gpt", "value": "```sql\nSELECT T1.case_number, T1.latitude, T1.longitude FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T2.iucr_no = T1.iucr_no WHERE T2.secondary_description = 'CHILD ABDUCTION'\n```"}]}, {"id": "train-8686", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most reported crime in the Northwest side?"}, {"from": "gpt", "value": "```sql\nSELECT T3.secondary_description FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no INNER JOIN IUCR AS T3 ON T3.iucr_no = T2.iucr_no WHERE T1.side = 'Northwest ' GROUP BY T3.secondary_description ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-8687", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the community area where the least number of domestic crimes happened."}, {"from": "gpt", "value": "```sql\nSELECT T2.community_area_no FROM Crime AS T1 INNER JOIN Community_Area AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.domestic = 'TRUE' GROUP BY T2.community_area_no ORDER BY COUNT(T2.community_area_no) ASC LIMIT 1\n```"}]}, {"id": "train-8688", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In drug abuse crimes, what percentage is related to cannabis?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T1.secondary_description LIKE '%CANNABIS%' THEN T1.secondary_description END) AS REAL) * 100 / COUNT(T1.secondary_description) FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN FBI_Code AS T3 ON T3.fbi_code_no = T2.fbi_code_no WHERE T3.title = 'Drug Abuse'\n```"}]}, {"id": "train-8689", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of less severe crimes reported a day in February of 2018?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T2.case_number) AS REAL) / 28 FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no WHERE T2.date LIKE '2/%/2018%' AND T1.index_code = 'N'\n```"}]}, {"id": "train-8690", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name and population of the communities where more than average solicit for prostitutes were reported."}, {"from": "gpt", "value": "```sql\nSELECT T2.community_area_name, T2.population FROM Crime AS T1 INNER JOIN Community_Area AS T2 ON T2.community_area_no = T1.community_area_no INNER JOIN IUCR AS T3 ON T3.iucr_no = T1.iucr_no WHERE T3.iucr_no = ( SELECT iucr_no FROM IUCR WHERE secondary_description = 'SOLICIT FOR PROSTITUTE' GROUP BY iucr_no HAVING COUNT(iucr_no) > ( SELECT SUM(CASE WHEN secondary_description = 'SOLICIT FOR PROSTITUTE' THEN 1.0 ELSE 0 END) / COUNT(iucr_no) AS average FROM IUCR ) )\n```"}]}, {"id": "train-8691", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the incidents reported in Harrison, what percentage are disorderly conduct?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN T3.title = 'Disorderly Conduct' THEN T2.report_no END) * 100.0 / COUNT(T2.report_no) AS per FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no INNER JOIN FBI_Code AS T3 ON T3.fbi_code_no = T2.fbi_code_no WHERE T1.district_name = 'Harrison'\n```"}]}, {"id": "train-8692", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference in the average number of vehicular hijackings and aggravated vehicular hijackings in the districts."}, {"from": "gpt", "value": "```sql\nSELECT ROUND(CAST(COUNT(CASE WHEN T1.secondary_description = 'VEHICULAR HIJACKING' THEN T1.iucr_no END) AS REAL) / CAST(COUNT(DISTINCT CASE WHEN T1.secondary_description = 'VEHICULAR HIJACKING' THEN T3.district_name END) AS REAL) - CAST(COUNT(CASE WHEN T1.secondary_description = 'AGGRAVATED VEHICULAR HIJACKING' THEN T1.iucr_no END) AS REAL) / CAST(COUNT(DISTINCT CASE WHEN T1.secondary_description = 'AGGRAVATED VEHICULAR HIJACKING' THEN T3.district_name END) AS REAL), 4) AS \"difference\" FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN District AS T3 ON T3.district_no = T2.district_no\n```"}]}, {"id": "train-8693", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crimes happened in longitude -8772658001?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Crime WHERE longitude = '-87.72658001'\n```"}]}, {"id": "train-8694", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the crimes of the narcotic type that exist."}, {"from": "gpt", "value": "```sql\nSELECT secondary_description FROM IUCR WHERE primary_description = 'NARCOTICS' GROUP BY secondary_description\n```"}]}, {"id": "train-8695", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the first name of the aldermen of wards with more than 50,000 inhabitants?"}, {"from": "gpt", "value": "```sql\nSELECT alderman_first_name FROM Ward WHERE Population > 50000\n```"}]}, {"id": "train-8696", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List crimes that the FBI has classified as Drug Abuse by their report number."}, {"from": "gpt", "value": "```sql\nSELECT T2.report_no FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no WHERE T1.title = 'Drug Abuse'\n```"}]}, {"id": "train-8697", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many weapons violation crimes have occurred in the Calumet district?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.district_name = 'Calumet' THEN 1 ELSE 0 END) FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN District AS T3 ON T3.district_no = T2.district_no WHERE T1.primary_description = 'WEAPONS VIOLATION'\n```"}]}, {"id": "train-8698", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the exact location of the crimes that occurred in the Belmont Cragin community?"}, {"from": "gpt", "value": "```sql\nSELECT T2.latitude, T2.longitude FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'Belmont Cragin' GROUP BY T2.latitude, T2.longitude\n```"}]}, {"id": "train-8699", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different types of crimes, according to the primary description, have occurred in the Hermosa neighborhood?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T4.neighborhood_name = 'Hermosa' THEN 1 ELSE 0 END) FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN Community_Area AS T3 ON T3.community_area_no = T2.community_area_no INNER JOIN Neighborhood AS T4 ON T4.community_area_no = T3.community_area_no\n```"}]}, {"id": "train-8700", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many domestic crime cases has Commander Ronald A. Pontecore Jr. been responsible for investigating?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.domestic = 'TRUE' THEN 1 ELSE 0 END) FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no WHERE T1.commander = 'Ronald A. Pontecore Jr.'\n```"}]}, {"id": "train-8701", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crimes against society happened in the Wentworth district according to the FBI?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.crime_against = 'Society' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no INNER JOIN District AS T3 ON T3.district_no = T2.district_no WHERE T3.district_name = 'Wentworth'\n```"}]}, {"id": "train-8702", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What phone number does alderman Emma Mitts have to call if she wants to speak to the commander in charge of the investigation of the crimes that have occurred in her ward?"}, {"from": "gpt", "value": "```sql\nSELECT T3.phone FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no INNER JOIN District AS T3 ON T3.district_no = T2.district_no WHERE T1.alderman_first_name = 'Emma' AND T1.alderman_last_name = 'Mitts'\n```"}]}, {"id": "train-8703", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crimes described as 'The theft of a motor vehicle' by the FBI have taken place in the Lake View community?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.community_area_name = 'Lake View' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T2.fbi_code_no = T1.fbi_code_no INNER JOIN Community_Area AS T3 ON T3.community_area_no = T2.community_area_no WHERE T1.description = 'The theft of a motor vehicle.'\n```"}]}, {"id": "train-8704", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which district have there been more intimidation-type crimes?"}, {"from": "gpt", "value": "```sql\nSELECT T3.district_name FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN District AS T3 ON T3.district_no = T2.district_no WHERE T1.primary_description = 'INTIMIDATION' GROUP BY T3.district_name ORDER BY COUNT(T1.primary_description) DESC LIMIT 1\n```"}]}, {"id": "train-8705", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What types of domestic crimes have occurred the most in the North Lawndale community?"}, {"from": "gpt", "value": "```sql\nSELECT T2.domestic FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'North Lawndale' AND T2.domestic = 'TRUE' GROUP BY T2.domestic ORDER BY COUNT(T2.domestic) DESC LIMIT 1\n```"}]}, {"id": "train-8706", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which ward of more than 55,000 inhabitants are there more crimes of intimidation with extortion?"}, {"from": "gpt", "value": "```sql\nSELECT T3.ward_no FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN Ward AS T3 ON T3.ward_no = T2.ward_no WHERE T1.primary_description = 'INTIMIDATION' AND T1.secondary_description = 'EXTORTION' AND T3.Population > 55000 GROUP BY T3.ward_no ORDER BY COUNT(T3.ward_no) DESC LIMIT 1\n```"}]}, {"id": "train-8707", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which commander has had to deal with more cases of criminal sexual abuse?"}, {"from": "gpt", "value": "```sql\nSELECT T3.commander FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN District AS T3 ON T3.district_no = T2.district_no WHERE T1.secondary_description = 'CRIMINAL SEXUAL ABUSE' GROUP BY T3.commander ORDER BY COUNT(T1.secondary_description) DESC LIMIT 1\n```"}]}, {"id": "train-8708", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of non-domestic crimes have occurred in the Jefferson Park district?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(CASE WHEN T2.domestic = 'FALSE' THEN T2.case_number END) AS REAL) * 100 / COUNT(T2.case_number) FROM District AS T1 INNER JOIN Crime AS T2 ON T2.district_no = T1.district_no WHERE T1.district_name = 'Jefferson Park'\n```"}]}, {"id": "train-8709", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average population of the wards where apartment crimes have been reported without arrests?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.Population) FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T1.location_description = 'APARTMENT' AND T1.arrest = 'FALSE'\n```"}]}, {"id": "train-8710", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the full names of the top 5 most crowded ward aldermen?"}, {"from": "gpt", "value": "```sql\nSELECT alderman_first_name, alderman_last_name FROM Ward ORDER BY Population DESC LIMIT 5\n```"}]}, {"id": "train-8711", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crime against property are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) AS cnt FROM FBI_Code WHERE crime_against = 'Property'\n```"}]}, {"id": "train-8712", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many districts are there in the police district building with a zip code of 60608?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) AS cnt FROM District WHERE zip_code = 60608\n```"}]}, {"id": "train-8713", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the crime against criminal sexual abuse?"}, {"from": "gpt", "value": "```sql\nSELECT crime_against FROM FBI_Code WHERE title = 'Criminal Sexual Abuse'\n```"}]}, {"id": "train-8714", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which community has the highest number of neighborhoods?"}, {"from": "gpt", "value": "```sql\nSELECT T1.community_area_name FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no ORDER BY T2.community_area_no DESC LIMIT 1\n```"}]}, {"id": "train-8715", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many severe crime incidents were reported at coordinate 41.64820151, -87.54430496?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.longitude = '-87.54430496' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.report_no = T2.iucr_no WHERE T2.index_code = 'I' AND T1.latitude = '41.64820251'\n```"}]}, {"id": "train-8716", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the commanding officer in the district with the highest number of reported crimes where no arrest has been made?"}, {"from": "gpt", "value": "```sql\nSELECT T2.commander FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.arrest = 'FALSE' GROUP BY T2.commander ORDER BY COUNT(T1.report_no) DESC LIMIT 1\n```"}]}, {"id": "train-8717", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the general and specific descriptions of the most common crime incidents that happened in an aircraft?"}, {"from": "gpt", "value": "```sql\nSELECT T2.primary_description, T2.secondary_description FROM Crime AS T1 INNER JOIN IUCR AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.location_description = 'AIRCRAFT' GROUP BY T1.iucr_no ORDER BY COUNT(T1.iucr_no) DESC LIMIT 1\n```"}]}, {"id": "train-8718", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between Deering and Near West districts, which district reported the most number of crime incidents that happened in a library?"}, {"from": "gpt", "value": "```sql\nSELECT T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.district_name IN ('Deering', 'Near West') AND T2.location_description = 'LIBRARY' GROUP BY T1.district_name ORDER BY COUNT(T2.district_no) DESC LIMIT 1\n```"}]}, {"id": "train-8719", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many arrests have been made due to forcible entry burglary that took place in a day care center?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.location_description = 'DAY CARE CENTER' AND T1.secondary_description = 'FORCIBLE ENTRY' AND T1.primary_description = 'BURGLARY'\n```"}]}, {"id": "train-8720", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the district with the highest number of domestic violence cases?"}, {"from": "gpt", "value": "```sql\nSELECT T2.district_name FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.domestic = 'TRUE' GROUP BY T2.district_name ORDER BY COUNT(T1.district_no) DESC LIMIT 1\n```"}]}, {"id": "train-8721", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the least populated community, what is the most common location of all the reported crime incidents?"}, {"from": "gpt", "value": "```sql\nSELECT T2.location_description FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.population = ( SELECT MIN(population) FROM Community_Area ) AND T2.location_description IS NOT NULL GROUP BY T2.location_description\n```"}]}, {"id": "train-8722", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many violation of laws are there where no arrest has been made?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.description LIKE '%The violation of laws%' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T2.Arrest = 'FALSE'\n```"}]}, {"id": "train-8723", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the precise coordinate of the location where simple assault incidents happened the most in Chatham?"}, {"from": "gpt", "value": "```sql\nSELECT T2.latitude, T2.longitude FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T1.title = 'Simple Assault' AND T3.community_area_name = 'Chatham' AND T3.community_area_no = 44 ORDER BY T2.latitude DESC, T2.longitude DESC LIMIT 1\n```"}]}, {"id": "train-8725", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crime against society were reported in Englewood?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T3.community_area_name = 'Englewood' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T1.crime_against = 'Society'\n```"}]}, {"id": "train-8726", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the weekly average number of fraud incidents that were reported in January 2018? Provide the description of the location where the majority of fraud incidents occurred in the said month."}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(T1.fbi_code_no) AS REAL) / 4 FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018'\n```"}]}, {"id": "train-8727", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three community areas with a population of more than 50,000."}, {"from": "gpt", "value": "```sql\nSELECT community_area_name FROM Community_Area WHERE population > 50000 LIMIT 3\n```"}]}, {"id": "train-8728", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the communities that are grouped together on the central side?"}, {"from": "gpt", "value": "```sql\nSELECT community_area_name FROM Community_Area WHERE side = 'Central'\n```"}]}, {"id": "train-8729", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference between the number of communities that are located on the north and south sides with a population of more than 30,000?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN side = 'South ' THEN 1 ELSE 0 END) - SUM(CASE WHEN side = 'North' THEN 1 ELSE 0 END) AS DIFF FROM Community_Area WHERE population > 300000\n```"}]}, {"id": "train-8730", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list all of the contact information for the police district Near West."}, {"from": "gpt", "value": "```sql\nSELECT phone, fax, tty, twitter FROM District WHERE district_name = 'Near West'\n```"}]}, {"id": "train-8731", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is responsible for crime cases in district Lincoln?"}, {"from": "gpt", "value": "```sql\nSELECT commander FROM District WHERE district_name = 'Lincoln'\n```"}]}, {"id": "train-8732", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the general and specific description of incident 275?"}, {"from": "gpt", "value": "```sql\nSELECT primary_description, secondary_description FROM IUCR WHERE iucr_no = 275\n```"}]}, {"id": "train-8733", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of severe cases that are related to sexual assault?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN primary_description = 'CRIM SEXUAL ASSAULT' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM IUCR WHERE index_code = 'I'\n```"}]}, {"id": "train-8734", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the neighborhoods that are located in the North Center community area?"}, {"from": "gpt", "value": "```sql\nSELECT T2.neighborhood_name FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.community_area_name = 'North Center'\n```"}]}, {"id": "train-8735", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many neighborhoods can be found in the Forest Glen community area?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.community_area_name = 'Forest Glen' THEN 1 ELSE 0 END) FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no\n```"}]}, {"id": "train-8736", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total population of the neighborhoods Avondale Gardens, Irving Park, Kilbourn Park, Merchant Park, Old Irving Park, and The Villa?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.population) AS sum FROM Neighborhood AS T1 INNER JOIN Community_Area AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.neighborhood_name = 'Avondale Gardens' OR T1.neighborhood_name = 'Irving Park' OR T1.neighborhood_name = 'Kilbourn Park' OR T1.neighborhood_name = 'Merchant Park' OR T1.neighborhood_name = 'Old Irving Park' OR T1.neighborhood_name = 'The Villa'\n```"}]}, {"id": "train-8737", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many crime cases have been classified as \"Weapons Violation\" by the FBI?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.title = 'Weapons Violation' THEN 1 ELSE 0 END) FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no\n```"}]}, {"id": "train-8738", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list any three criminal sexual assault cases against persons where the criminals have been arrested."}, {"from": "gpt", "value": "```sql\nSELECT T2.case_number FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.title = 'Criminal Sexual Assault' AND T2.arrest = 'TRUE' AND T1.crime_against = 'Persons' LIMIT 3\n```"}]}, {"id": "train-8739", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please state the district name where incident number JB106545 took place."}, {"from": "gpt", "value": "```sql\nSELECT T1.case_number FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T2.title = 'Criminal Sexual Assault' AND T2.crime_against = 'Persons' AND T1.arrest = 'TRUE' LIMIT 3\n```"}]}, {"id": "train-8740", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the general description for case number JB106010?"}, {"from": "gpt", "value": "```sql\nSELECT T1.primary_description FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.case_number = 'JB106010'\n```"}]}, {"id": "train-8741", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please name three communities that experience the fraud incident."}, {"from": "gpt", "value": "```sql\nSELECT T3.community_area_name FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T1.title = 'Criminal Sexual Assault' LIMIT 3\n```"}]}, {"id": "train-8742", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the major type of crime that happened in the Rogers Park community area?"}, {"from": "gpt", "value": "```sql\nSELECT T1.fbi_code_no, T1.title FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no INNER JOIN Community_Area AS T3 ON T2.community_area_no = T3.community_area_no WHERE T3.community_area_name = 'Rogers Park' GROUP BY T1.fbi_code_no, T1.title\n```"}]}, {"id": "train-8743", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: At which district did the multiple homicide case number JB120039 occurred?"}, {"from": "gpt", "value": "```sql\nSELECT T1.district_no, T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.case_number = 'JB120039' GROUP BY T1.district_no, T1.district_name\n```"}]}, {"id": "train-8744", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of crime cases that have been classified as \"drug abuse\" by the FBI and happened on the street?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.title = 'Drug Abuse' AND T1.location_description = 'STREET' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.fbi_code_no) FROM Crime AS T1 INNER JOIN FBI_Code AS T2 ON T1.fbi_code_no = T2.fbi_code_no\n```"}]}, {"id": "train-8745", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ward number with the highest population."}, {"from": "gpt", "value": "```sql\nSELECT ward_no FROM Ward ORDER BY Population DESC LIMIT 1\n```"}]}, {"id": "train-8746", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the beat and location description of the case JB112212?"}, {"from": "gpt", "value": "```sql\nSELECT beat, location_description FROM Crime WHERE case_number = 'JB112212'\n```"}]}, {"id": "train-8747", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the FBI code for the crime described by \"The killing of one human being by another.\""}, {"from": "gpt", "value": "```sql\nSELECT fbi_code_no FROM FBI_Code WHERE description = 'The killing of one human being by another.'\n```"}]}, {"id": "train-8748", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide at least 5 ward office addresses associated with the crimes that happened in the community of Montclare."}, {"from": "gpt", "value": "```sql\nSELECT T3.ward_office_address FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN Ward AS T3 ON T2.ward_no = T3.ward_no WHERE T1.community_area_name = 'Montclare' GROUP BY T3.ward_office_address LIMIT 5\n```"}]}, {"id": "train-8749", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the district's commander associated with the crime that happened at the yard and has a beat of 532."}, {"from": "gpt", "value": "```sql\nSELECT T2.address, T2.commander FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T1.location_description = 'YARD' AND T1.beat = 532\n```"}]}, {"id": "train-8750", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the neighborhood name in the community area of Lake View?"}, {"from": "gpt", "value": "```sql\nSELECT T2.neighborhood_name FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T1.community_area_no = T2.community_area_no WHERE T1.community_area_name = 'Lake View'\n```"}]}, {"id": "train-8751", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the neighborhood of the community area in crime with report number 23843?"}, {"from": "gpt", "value": "```sql\nSELECT T3.neighborhood_name FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN Neighborhood AS T3 ON T2.community_area_no = T3.community_area_no WHERE T2.report_no = 23778\n```"}]}, {"id": "train-8752", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the FBI description of the crime for report number 23778?"}, {"from": "gpt", "value": "```sql\nSELECT T1.description FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T2.report_no = 23843\n```"}]}, {"id": "train-8753", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the report number of crimes associated with the district commander named Jill M. Stevens."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.commander = 'Jill M. Stevens' THEN 1 ELSE 0 END) FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no\n```"}]}, {"id": "train-8754", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the crimes happened in the neighborhood called \"Avalon Park\", what is the percentage of crimes that happened inside the house?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.location_description = 'HOUSE' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.location_description) AS persent FROM Community_Area AS T1 INNER JOIN Crime AS T2 ON T1.community_area_no = T2.community_area_no INNER JOIN Neighborhood AS T3 ON T2.community_area_no = T3.community_area_no WHERE T3.neighborhood_name = 'Avalon Park'\n```"}]}, {"id": "train-8755", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the alderman of ward no.21?"}, {"from": "gpt", "value": "```sql\nSELECT alderman_first_name, alderman_last_name, alderman_name_suffix FROM Ward WHERE ward_no = 21\n```"}]}, {"id": "train-8756", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ward ID of the most crowded ward?"}, {"from": "gpt", "value": "```sql\nSELECT ward_no FROM Ward ORDER BY Population DESC LIMIT 1\n```"}]}, {"id": "train-8757", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many incidents have the general description of \"ASSAULT\" in the IUCR classification?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM IUCR WHERE primary_description = 'ASSAULT'\n```"}]}, {"id": "train-8758", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many incidents are considered \"severe\" in the IUCR classification?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM IUCR WHERE index_code = 'I'\n```"}]}, {"id": "train-8759", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the crimes with no arrest made, how many of them happened in the ward represented by alderman Pat Dowell?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T1.alderman_last_name = 'Dowell' THEN 1 ELSE 0 END) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.arrest = 'FALSE' AND T1.alderman_first_name = 'Pat'\n```"}]}, {"id": "train-8760", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which alderman represents the ward with the most number of crimes in January, 2018? Please give his or her full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.ward_no, T1.alderman_first_name, T1.alderman_last_name, T1.alderman_name_suffix FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018' GROUP BY T1.ward_no ORDER BY COUNT(T1.ward_no) DESC LIMIT 1\n```"}]}, {"id": "train-8761", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the crimes in the ward with the most population, how many of them are cases of domestic violence?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ward_no) AS num FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.domestic = 'TRUE' ORDER BY T1.Population = ( SELECT Population FROM Ward ORDER BY Population DESC LIMIT 1 )\n```"}]}, {"id": "train-8762", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the location coordinates of all the incidents that had happened in the ward represented by alderman Pat Dowell."}, {"from": "gpt", "value": "```sql\nSELECT T2.latitude, T2.longitude FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T1.alderman_first_name = 'Pat' AND T1.alderman_last_name = 'Dowell' AND T2.latitude IS NOT NULL AND T2.longitude IS NOT NULL\n```"}]}, {"id": "train-8763", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The ward represented by which alderman had more incidents in January, 2018, Pat Dowell or Sophia King?"}, {"from": "gpt", "value": "```sql\nSELECT T1.alderman_first_name, T1.alderman_last_name, COUNT(T1.ward_no) AS num FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE (SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018' AND T1.alderman_first_name = 'Pat' AND T1.alderman_last_name = 'Dowell') OR (T1.alderman_first_name = 'Sophia' AND T1.alderman_last_name = 'King') GROUP BY T1.ward_no\n```"}]}, {"id": "train-8764", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the case numbers of all the incidents with the generic description of \"BATTERY\" in the IUCR classification."}, {"from": "gpt", "value": "```sql\nSELECT T2.case_number FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.primary_description = 'BATTERY'\n```"}]}, {"id": "train-8765", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the incidents with the generic description of \"BATTERY\" in the IUCR classification, how many of them do not have arrests made?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN T2.arrest = 'FALSE' THEN 1 ELSE 0 END) FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T1.primary_description = 'BATTERY'\n```"}]}, {"id": "train-8766", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the case numbers of all the crimes whose short description of the kind of crime is \"Homicide 1st & 2nd Degree\" in the FBI classification."}, {"from": "gpt", "value": "```sql\nSELECT T2.case_number FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.title = 'Homicide 1st & 2nd Degree'\n```"}]}, {"id": "train-8767", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the incidents in January, 2018, how many of them were stated \"against Property\" in the FBI classification?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN SUBSTR(T2.date, 5, 4) = '2018' THEN 1 ELSE 0 END) FROM FBI_Code AS T1 INNER JOIN Crime AS T2 ON T1.fbi_code_no = T2.fbi_code_no WHERE T1.crime_against = 'Property' AND SUBSTR(T2.date, 1, 1) = '1'\n```"}]}, {"id": "train-8768", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: District commander Robert A. Rubio was responsible for how many incidents in January, 2018?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN SUBSTR(T2.date, 5, 4) = '2018' THEN 1 ELSE 0 END) FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.commander = 'Robert A. Rubio' AND SUBSTR(T2.date, 1, 1) = '1'\n```"}]}, {"id": "train-8769", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which district commander was responsible for more incidents in January, 2018, Robert A. Rubio or Glenn White?"}, {"from": "gpt", "value": "```sql\nSELECT T1.commander FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.commander IN ('Robert A. Rubio', 'Glenn White') AND SUBSTR(T2.date, 1, 1) = '1' AND SUBSTR(T2.date, 5, 4) = '2018' GROUP BY T1.commander\n```"}]}, {"id": "train-8770", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the blocks where all the incidents in the district commanded by Robert A. Rubio took place."}, {"from": "gpt", "value": "```sql\nSELECT T2.block FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T1.commander = 'Robert A. Rubio'\n```"}]}, {"id": "train-8771", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of incidents per month in 2018 in the ward with the most population?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.ward_no) / 12 AS average FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.date LIKE '%2018%' AND T1.Population = ( SELECT MAX(T1.Population) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.date LIKE '%2018%' )\n```"}]}, {"id": "train-8772", "db_id": "chicago_crime", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the incidents with no arrest made, what is the percentage of them having a generic description of \"BATTERY\" in the IUCR classification?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.primary_description = 'BATTERY' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*)FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T1.iucr_no = T2.iucr_no WHERE T2.arrest = 'FALSE'\n```"}]}, {"id": "train-8773", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restaurants' owners are in California?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(owner_state) FROM businesses WHERE owner_state = 'CA'\n```"}]}, {"id": "train-8774", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many restaurants have met all requirements in the inspection?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(score) FROM inspections WHERE score = 100\n```"}]}, {"id": "train-8775", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the inspections carried out in 2016, how many of them are routine?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(`date`) FROM inspections WHERE STRFTIME('%Y', `date`) = '2016' AND type = 'Routine - Unscheduled'\n```"}]}, {"id": "train-8776", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the restaurants that have met all requirements in one inspection."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100\n```"}]}, {"id": "train-8777", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the restaurants being inspected in 2016, how many of them are in San Francisco?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2016' AND T2.city IN ('San Francisco', 'SAN FRANCISCO', 'SF', 'S.F.')\n```"}]}, {"id": "train-8778", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the type of inspection Tiramisu Kitchen had on 2014/1/14?"}, {"from": "gpt", "value": "```sql\nSELECT T1.type FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2014-01-14' AND T2.name = 'Tiramisu Kitchen'\n```"}]}, {"id": "train-8779", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many low risk violations were found in the inspection on 2014/1/14 for Tiramisu Kitchen?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2014-01-14' AND T2.name = 'Tiramisu Kitchen' AND T1.risk_category = 'Low Risk'\n```"}]}, {"id": "train-8780", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of the restaurants that had a low risk violation in inspections in 2014."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2014' AND T1.risk_category = 'Low Risk'\n```"}]}, {"id": "train-8781", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description of the low risk violation of Tiramisu Kitchen on 2014/1/14?"}, {"from": "gpt", "value": "```sql\nSELECT T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2014-01-14' AND T2.name = 'Tiramisu Kitchen' AND T1.risk_category = 'Low Risk'\n```"}]}, {"id": "train-8782", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the descriptions of all the high risk violations of Tiramisu Kitchen."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T2.name = 'Tiramisu Kitchen'\n```"}]}, {"id": "train-8783", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many routine inspections did Tiramisu Kitchen have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.type = 'Routine - Unscheduled' AND T2.name = 'Tiramisu Kitchen'\n```"}]}, {"id": "train-8784", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the routine inspections of Tiramisu Kitchen, how many of them have a score of over 70?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Tiramisu Kitchen' AND T1.type = 'Routine - Unscheduled' AND T1.score > 70\n```"}]}, {"id": "train-8785", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which restaurant had more low risk violation in inspections, Tiramisu Kitchen or OMNI S.F. Hotel - 2nd Floor Pantry?"}, {"from": "gpt", "value": "```sql\nSELECT CASE WHEN SUM(CASE WHEN T2.name = 'OMNI S.F. Hotel - 2nd Floor Pantry' THEN 1 ELSE 0 END) > SUM(CASE WHEN T2.name = 'Tiramisu Kitchen' THEN 1 ELSE 0 END) THEN 'OMNI S.F. Hotel - 2nd Floor Pantry' ELSE 'Tiramisu Kitchen' END AS result FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'Low Risk'\n```"}]}, {"id": "train-8786", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many high risk violations do the restaurants in San Francisco have in total?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.city IN ('San Francisco', 'SF', 'S.F.', 'SAN FRANCISCO') AND T1.risk_category = 'High Risk'\n```"}]}, {"id": "train-8787", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which restaurant has the highest total number of high risk violations?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' GROUP BY T2.name ORDER BY COUNT(T2.name) DESC LIMIT 1\n```"}]}, {"id": "train-8788", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average scores of Tiramisu Kitchen in all inspections?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Tiramisu Kitchen'\n```"}]}, {"id": "train-8789", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which business had the most number of inspections? Give the Id number for that business."}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM inspections GROUP BY business_id ORDER BY COUNT(business_id) DESC LIMIT 1\n```"}]}, {"id": "train-8790", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the Id number of the business with the most number of violations."}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM violations GROUP BY business_id ORDER BY COUNT(business_id) DESC LIMIT 1\n```"}]}, {"id": "train-8791", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the business which met all the required standards during the unscheduled routine inspection on 2016/9/28."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100 AND T1.`date` = '2016-09-28' AND T1.type = 'Routine - Unscheduled'\n```"}]}, {"id": "train-8792", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which business had the most number of high risk violations? Give the name of the business."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' GROUP BY T2.name ORDER BY COUNT(T2.name) DESC LIMIT 1\n```"}]}, {"id": "train-8793", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many kinds of violations did \"Stacks Restaurant\" have on 2016/10/4?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T1.violation_type_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Stacks Restaurant' AND T1.`date` = '2016-10-04'\n```"}]}, {"id": "train-8794", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the description of the moderate risk violation which \"Chez Fayala, Inc.\" had on 2016/7/1."}, {"from": "gpt", "value": "```sql\nSELECT T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Chez Fayala, Inc.' AND T1.`date` = '2016-07-01' AND T1.risk_category = 'Moderate Risk'\n```"}]}, {"id": "train-8795", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which business had the lowest score for the unscheduled routine inspection on 2016/9/26? Give the name of the business."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE score = ( SELECT MIN(score) FROM inspections WHERE `date` = '2016-09-26' AND type = 'Routine - Unscheduled' ) AND T1.`date` = '2016-09-26' AND T1.type = 'Routine - Unscheduled'\n```"}]}, {"id": "train-8796", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the name of the business which had the most number of inspections because of complaint."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.type = 'Complaint' GROUP BY T2.name ORDER BY COUNT(T1.business_id) DESC LIMIT 1\n```"}]}, {"id": "train-8797", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many unscheduled routine inspections did \"Soma Restaurant And Bar\" have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Soma Restaurant And Bar' AND T1.type = 'Routine - Unscheduled'\n```"}]}, {"id": "train-8798", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the address of the business with the most number of the low risk violations."}, {"from": "gpt", "value": "```sql\nSELECT T2.address FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'Low Risk' GROUP BY T2.address ORDER BY COUNT(T1.business_id) DESC LIMIT 1\n```"}]}, {"id": "train-8799", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which business was the first one to get a low risk violation because of \"Permit license or inspection report not posted\"? Give the name of the business."}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = ( SELECT MIN(`date`) FROM violations WHERE risk_category = 'Low Risk' AND description = 'Permit license or inspection report not posted' ) AND T1.risk_category = 'Low Risk' AND T1.description = 'Permit license or inspection report not posted'\n```"}]}, {"id": "train-8800", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the business which got the most number of violations, how many inspections did it have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id GROUP BY T1.business_id ORDER BY COUNT(T1.business_id) DESC LIMIT 1\n```"}]}, {"id": "train-8801", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the business whose business certificate number is 304977, how many violations did it have on 2013/10/7?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.business_certificate = '304977' AND T1.`date` = '2013-10-07'\n```"}]}, {"id": "train-8802", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average score for \"Chairman Bao\" in all its unscheduled routine inspections?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.name = 'Chairman Bao' THEN T1.score ELSE 0 END) AS REAL) / COUNT(CASE WHEN T1.type = 'Routine - Unscheduled' THEN T1.score ELSE 0 END) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id\n```"}]}, {"id": "train-8803", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of the violations for \"Melody Lounge\" are moderate risks?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.risk_category = 'Moderate Risk' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.business_id) FROM businesses AS T1 INNER JOIN violations AS T2 ON T1.business_id = T2.business_id WHERE T1.name = 'Melody Lounge'\n```"}]}, {"id": "train-8804", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many eateries are located in Hayward?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM businesses WHERE city = 'HAYWARD'\n```"}]}, {"id": "train-8805", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many establishments have an inspection score of no more than 50?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT business_id) FROM inspections WHERE score < 50\n```"}]}, {"id": "train-8806", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many eateries applied in 2012?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM businesses WHERE STRFTIME('%Y', application_date) = '2012'\n```"}]}, {"id": "train-8807", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many foodborne illness investigations were done in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM inspections WHERE STRFTIME('%Y', `date`) = '2014' AND type = 'Foodborne Illness Investigation'\n```"}]}, {"id": "train-8808", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many owners have 5 or more establishments?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.owner_name) FROM ( SELECT owner_name FROM businesses GROUP BY owner_name HAVING COUNT(owner_name) > 5 ) T1\n```"}]}, {"id": "train-8809", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the establishments that met all of the required standards in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2013' AND T1.score = 100\n```"}]}, {"id": "train-8810", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2016, which city has the highest number of establishments with the highest health and safety hazards?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2016' AND T1.risk_category = 'High Risk' GROUP BY T2.city ORDER BY COUNT(T2.city) DESC LIMIT 1\n```"}]}, {"id": "train-8811", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the establishment with the lowest inspection score of all time?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = ( SELECT MIN(score) FROM inspections )\n```"}]}, {"id": "train-8812", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many high risks violations did the Tiramisu Kitchen violate?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'Tiramisu Kitchen' AND T1.risk_category = 'High Risk'\n```"}]}, {"id": "train-8813", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many establishments with the tax code H24 have complaint inspections of 5 or more?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM ( SELECT T1.business_id FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.tax_code = 'H24' AND T1.type = 'Complaint' GROUP BY T1.business_id HAVING COUNT(T1.business_id) > 5 ) T3\n```"}]}, {"id": "train-8814", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2013, what are the names of the establishments with contaminated or adulterated food?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2013' AND T1.description = 'Contaminated or adulterated food'\n```"}]}, {"id": "train-8815", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the establishments with a postal code of 94102, how many establishments have a score of 90 or more in 2015?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id INNER JOIN inspections AS T3 ON T2.business_id = T3.business_id WHERE STRFTIME('%Y', T1.`date`) = '2015' AND T2.postal_code = '94102' AND T3.score > 90\n```"}]}, {"id": "train-8816", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the establishments that met all the required standards for 4 consecutive years?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T4.name FROM ( SELECT T3.name, T3.years, row_number() OVER (PARTITION BY T3.name ORDER BY T3.years) AS rowNumber FROM ( SELECT DISTINCT name, STRFTIME('%Y', `date`) AS years FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100 ) AS T3 ) AS T4 GROUP BY T4.name, date(T4.years || '-01-01', '-' || (T4.rowNumber - 1) || ' years') HAVING COUNT(T4.years) = 4\n```"}]}, {"id": "train-8817", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Between 2014 to 2016, what is the average inpsection score of the establishment owned by Yiu Tim Chan in 808 Pacific Ave, San Francisco?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) BETWEEN '2014' AND '2016' AND T2.owner_name = 'Yiu Tim Chan' AND T2.address = '808 Pacific Ave' AND T2.city = 'San Francisco'\n```"}]}, {"id": "train-8818", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average score of the establishments owned by the owner with the highest number of establishments?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id GROUP BY T2.owner_name ORDER BY COUNT(T2.business_id) DESC LIMIT 1\n```"}]}, {"id": "train-8819", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the establishment with the highest number of low risk violations in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2014' AND T1.risk_category = 'Low Risk' GROUP BY T2.name ORDER BY COUNT(T2.business_id) DESC LIMIT 1\n```"}]}, {"id": "train-8820", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the top 5 owners with highest number of establishments, which owner has the highest number of high risk violations? Give the name of the owner."}, {"from": "gpt", "value": "```sql\nSELECT T4.owner_name FROM violations AS T3 INNER JOIN businesses AS T4 ON T3.business_id = T4.business_id INNER JOIN ( SELECT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id GROUP BY T2.owner_name ORDER BY COUNT(T1.business_id) DESC LIMIT 5 ) AS T5 ON T4.owner_name = T5.owner_name WHERE T3.risk_category = 'High Risk' GROUP BY T4.owner_name ORDER BY COUNT(T3.risk_category) DESC LIMIT 1\n```"}]}, {"id": "train-8821", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which establishment has the highest number of inspections done? Give the name of the establishment and calculate for its average score per inspection."}, {"from": "gpt", "value": "```sql\nSELECT T2.name, AVG(T1.score) FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id GROUP BY T2.name ORDER BY COUNT(T2.business_id) DESC LIMIT 1\n```"}]}, {"id": "train-8822", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many eateries got highest inspection in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT business_id) FROM inspections WHERE STRFTIME('%Y', `date`) = '2013' AND score = ( SELECT MAX(score) FROM inspections WHERE STRFTIME('%Y', `date`) = '2013' )\n```"}]}, {"id": "train-8823", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the eateries' IDs with structural inspection type in February 2016."}, {"from": "gpt", "value": "```sql\nSELECT business_id FROM inspections WHERE type = 'Structural Inspection' AND `date` LIKE '2016-02%'\n```"}]}, {"id": "train-8824", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many eateries had low risk for violation with unpermitted food facility description?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT business_id) FROM violations WHERE risk_category = 'Low Risk' AND description = 'Unpermitted food facility'\n```"}]}, {"id": "train-8825", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide eateries' IDs, risk categories and descriptions with violation ID of 103101."}, {"from": "gpt", "value": "```sql\nSELECT business_id, risk_category, description FROM violations WHERE violation_type_id = '103101'\n```"}]}, {"id": "train-8826", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When did eateries from San Bruno city get highest score in inspection?"}, {"from": "gpt", "value": "```sql\nSELECT T1.`date` FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.city = 'SAN BRUNO' ORDER BY T1.score DESC LIMIT 1\n```"}]}, {"id": "train-8828", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the violation type ID and description of high risk category for STARBUCKS."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.violation_type_id, T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'STARBUCKS' AND T1.risk_category = 'High Risk'\n```"}]}, {"id": "train-8829", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the inspection dates, scores and inspection types for the eateries with tax code AA."}, {"from": "gpt", "value": "```sql\nSELECT T1.`date`, T1.score, T1.type FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.tax_code = 'AA'\n```"}]}, {"id": "train-8830", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide eateries' IDs, names and addresses which were inspected on 30th July, 2016."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.business_id, T2.name, T2.address FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.date = '2016-07-30'\n```"}]}, {"id": "train-8831", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the violation dates, risk categories, descriptions and names of the eateries under Jade Chocolates LLC."}, {"from": "gpt", "value": "```sql\nSELECT T1.`date`, T1.risk_category, T1.description, T2.name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_name = 'Jade Chocolates LLC'\n```"}]}, {"id": "train-8832", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the names, risk categories and descriptions for the eateries with violation type ID of 103111."}, {"from": "gpt", "value": "```sql\nSELECT T2.name, T1.risk_category, T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.violation_type_id = '103111'\n```"}]}, {"id": "train-8833", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among violations on 3rd June, 2014, describe any 5 names, located cities and tax codes of the eateries with high risk category."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.name, T2.city, T2.tax_code FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T1.`date` = '2014-06-03' LIMIT 5\n```"}]}, {"id": "train-8834", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the inspection type when El Aji Peruvian Restaurant got highest inspection score?"}, {"from": "gpt", "value": "```sql\nSELECT T1.type FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.name = 'El Aji Peruvian Restaurant' ORDER BY T1.score DESC LIMIT 1\n```"}]}, {"id": "train-8835", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who were the owners of eateries which had highest health hazard by improper cooking time or temperatures?"}, {"from": "gpt", "value": "```sql\nSELECT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T1.description = 'Improper cooking time or temperatures'\n```"}]}, {"id": "train-8836", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the eateries' names and addresses which had reinspection on 2nd February, 2015."}, {"from": "gpt", "value": "```sql\nSELECT T2.name, T2.address FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.`date` = '2015-02-02' AND T1.type = 'Reinspection/Followup'\n```"}]}, {"id": "train-8837", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names and business certificates of the eateries which got inspection score under 50."}, {"from": "gpt", "value": "```sql\nSELECT T2.name, T2.business_id FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score < 50\n```"}]}, {"id": "train-8838", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the businesses are located at 1825 POST St #223, San Francisco?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(business_id) FROM businesses WHERE address = '1825 POST St #223' AND city = 'SAN FRANCISCO'\n```"}]}, {"id": "train-8839", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the owner's name with a zip code 94104."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT owner_name FROM businesses WHERE owner_zip = '94104'\n```"}]}, {"id": "train-8840", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of businesses with a tax code H25?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(tax_code) FROM businesses WHERE tax_code = 'H25'\n```"}]}, {"id": "train-8841", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the violations in 2014, how many of them have a low risk category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(risk_category) FROM violations WHERE STRFTIME('%Y', `date`) = '2014' AND risk_category = 'Low Risk'\n```"}]}, {"id": "train-8843", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List owner's name of businesses with a 100 score."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.owner_name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100\n```"}]}, {"id": "train-8844", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses within the postal code 94117, what is total number of businesses with a high risk category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT T2.business_id) FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.postal_code = 94117 AND T1.risk_category = 'High Risk'\n```"}]}, {"id": "train-8845", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the businesses with score that ranges from 70 to 80, list their violation type ID and risk category."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.violation_type_id, T1.risk_category FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id INNER JOIN inspections AS T3 ON T2.business_id = T3.business_id WHERE T3.score BETWEEN 70 AND 80\n```"}]}, {"id": "train-8846", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the tax code and inspection type of the business named \"Rue Lepic\"."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.tax_code, T2.type FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T3.name = 'Rue Lepic'\n```"}]}, {"id": "train-8847", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In businesses that violates 103157 on May 27, 2016 , what is the name of the business that has an unscheduled inspection?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T3.name FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T1.`date` = '2016-05-27' AND T1.violation_type_id = 103157 AND T2.type = 'Routine - Unscheduled'\n```"}]}, {"id": "train-8848", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the owner of the business that has a high risk violation of 103109 and described as unclean or unsanitary food contact surfaces?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.risk_category = 'High Risk' AND T1.violation_type_id = 103109 AND T1.description = 'Unclean or unsanitary food contact surfaces'\n```"}]}, {"id": "train-8849", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the owners from Cameron Park, what is the business name of the business with a score of 100?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.name FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T2.owner_city = 'Cameron Park' AND T1.score = 100\n```"}]}, {"id": "train-8851", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the owner's name of the of the business that violates 103156 on June 12, 2014?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.owner_name FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.violation_type_id = 103156 AND T1.`date` = '2014-06-12'\n```"}]}, {"id": "train-8853", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the violations in 2016, how many of them have unscheduled inspections?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.business_id) FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id WHERE STRFTIME('%Y', T1.`date`) = '2016' AND T2.type = 'Routine - Unscheduled'\n```"}]}, {"id": "train-8854", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the business' name and risk category of businesses with a score greater than the 80% of average score of all businesses."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.name, T3.risk_category FROM businesses AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN violations AS T3 ON T1.business_id = T3.business_id WHERE T2.score > 0.8 * ( SELECT AVG(score) FROM inspections )\n```"}]}, {"id": "train-8855", "db_id": "food_inspection", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In businesses with a score lower than 95 and located around the postal code of 94110, what is the percentage of businesses with a risk category of low risk?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.risk_category = 'Low Risk' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.risk_category) FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T2.score < 95 AND T3.postal_code = 94110\n```"}]}, {"id": "train-8856", "db_id": "craftbeer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which distinct state makes beer that has the least amount of bitterness?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.state, T1.ibu FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T1.ibu IS NOT NULL AND T1.ibu = ( SELECT MIN(ibu) FROM beers )\n```"}]}, {"id": "train-8857", "db_id": "craftbeer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where in New York can you locate the brewery that makes the bitterest beer? List both the brewery's name and the name of the city."}, {"from": "gpt", "value": "```sql\nSELECT T2.name, T2.city FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T2.state = 'NY' ORDER BY T1.ibu DESC LIMIT 1\n```"}]}, {"id": "train-8858", "db_id": "craftbeer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average alcohol content per 12-ounce beer bottle produced by Boston Beer Company?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.abv) FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T2.name = 'Boston Beer Company' AND T1.ounces = 12\n```"}]}, {"id": "train-8859", "db_id": "craftbeer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of all the beer styles produced by Stevens Point Brewery, how many percent do they allot for American Adjunct Lager?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.style = 'American Adjunct Lager', 1, 0)) AS REAL) * 100 / COUNT(T1.brewery_id) FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T2.name = 'Stevens Point Brewery'\n```"}]}, {"id": "train-8860", "db_id": "craftbeer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city and state produces the most and least bitter beer, and what is the difference in bitterness between the two? List also the names of the beer."}, {"from": "gpt", "value": "```sql\nSELECT T1.state, T1.city, T2.name, T2.ibu FROM breweries AS T1 INNER JOIN beers AS T2 ON T1.id = T2.brewery_id GROUP BY T1.state, T1.city, T2.name, T2.ibu HAVING MAX(ibu) AND MIN(ibu) LIMIT 2\n```"}]}, {"id": "train-8861", "db_id": "craftbeer", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When compared to the total number of breweries in the US producing American Blonde Ale, how many in the state of Wisconsin produces American Blonde Ale? Indicate your answer in percentage (%)."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.state = 'WI', 1, 0)) AS REAL) * 100 / COUNT(T1.id) FROM beers AS T1 INNER JOIN breweries AS T2 ON T1.brewery_id = T2.id WHERE T1.style = 'American Blonde Ale'\n```"}]}, {"id": "train-8862", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the recipe that is most likely to gain weight?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.total_fat DESC LIMIT 1\n```"}]}, {"id": "train-8863", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the unsaturated fat content in the recipe \"Raspberry Chiffon Pie\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.total_fat - T2.sat_fat FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie'\n```"}]}, {"id": "train-8864", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the recipes that are salt/sodium-free."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.sodium < 5\n```"}]}, {"id": "train-8865", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the recipes that may lead to constipation, feeling sick or stomach pain."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20\n```"}]}, {"id": "train-8866", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which recipe is more beneficial in wound healing, \"Raspberry Chiffon Pie\" or \"Fresh Apricot Bavarian\"?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT CASE WHEN CASE WHEN T2.title = 'Raspberry Chiffon Pie' THEN T1.vitamin_c END > CASE WHEN T2.title = 'Fresh Apricot Bavarian' THEN T1.vitamin_c END THEN 'Raspberry Chiffon Pie' ELSE 'Fresh Apricot Bavarian' END AS \"vitamin_c is higher\" FROM Nutrition T1 INNER JOIN Recipe T2 ON T2.recipe_id = T1.recipe_id\n```"}]}, {"id": "train-8867", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the recipes that take more than 10 minutes to prepare, what is the title of the one with the most calories?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.prep_min > 10 ORDER BY T2.calories DESC LIMIT 1\n```"}]}, {"id": "train-8868", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many calories does the recipe \"Raspberry Chiffon Pie\" contain?"}, {"from": "gpt", "value": "```sql\nSELECT T2.calories FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie'\n```"}]}, {"id": "train-8869", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is the ingredient \"graham cracker crumbs\" optional in the recipe \"Raspberry Chiffon Pie\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.optional FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry Chiffon Pie' AND T3.name = 'graham cracker crumbs'\n```"}]}, {"id": "train-8870", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many ingredients must be rationed in the recipe \"Raspberry Chiffon Pie\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie' AND T2.max_qty = T2.min_qty\n```"}]}, {"id": "train-8871", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the names of all the ingredients needed for the recipe \"Raspberry Chiffon Pie\" that do not need preprocessing."}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry Chiffon Pie' AND T2.preparation IS NULL\n```"}]}, {"id": "train-8872", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many recipes include the ingredient \"graham cracker crumbs\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = 'graham cracker crumbs'\n```"}]}, {"id": "train-8873", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: At least how many cups of graham cracker crumbs does the recipe \"Raspberry Chiffon Pie\" need?"}, {"from": "gpt", "value": "```sql\nSELECT T2.min_qty FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry Chiffon Pie' AND T3.name = 'graham cracker crumbs'\n```"}]}, {"id": "train-8874", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many calories from fat are there in the recipe \"Raspberry Chiffon Pie\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.calories * T2.pcnt_cal_fat FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie'\n```"}]}, {"id": "train-8875", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many calories on average does a recipe that comes from \"Produce for Better Health Foundation and 5 a Day\" contain?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.calories) FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.source = 'Produce for Better Health Foundation and 5 a Day'\n```"}]}, {"id": "train-8876", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many calories does the turkey tenderloin bundles recipe have?"}, {"from": "gpt", "value": "```sql\nSELECT T2.calories FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Turkey Tenderloin Bundles'\n```"}]}, {"id": "train-8877", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cups of 1% lowfat milk should be added to no.1436 recipe?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = '1% lowfat milk' AND T2.unit = 'cup(s)' AND T2.recipe_id = 1436\n```"}]}, {"id": "train-8878", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which recipe in the database contains the most total fat? Give its title."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.total_fat DESC LIMIT 1\n```"}]}, {"id": "train-8879", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times do seedless red grapes appear in the recipes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.name = 'seedless red grapes'\n```"}]}, {"id": "train-8880", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of the optional ingredient of no.1397 recipe."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T2.recipe_id = 1397 AND T2.optional = 'TRUE'\n```"}]}, {"id": "train-8881", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which recipe needs the most frozen raspberries in light syrup? State its title."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.name = 'frozen raspberries in light syrup' AND T2.max_qty = T2.min_qty\n```"}]}, {"id": "train-8882", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the most widely used ingredient."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id GROUP BY T1.name ORDER BY COUNT(T1.name) DESC LIMIT 1\n```"}]}, {"id": "train-8883", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What kind of preparation is needed for apple juice to make a raspberry-pear couscous cake?"}, {"from": "gpt", "value": "```sql\nSELECT T2.preparation FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry-Pear Couscous Cake' AND T3.name = 'apple juice'\n```"}]}, {"id": "train-8884", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cups of almonds do you need for a chicken pocket sandwich?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Chicken Pocket Sandwich' AND T3.name = 'almonds' AND T2.unit = 'cup(s)'\n```"}]}, {"id": "train-8885", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the recipe with the most Vitamin C."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.vitamin_c DESC LIMIT 1\n```"}]}, {"id": "train-8886", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much Vitamin A is in Sherry beef?"}, {"from": "gpt", "value": "```sql\nSELECT T2.vitamin_a FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Sherried Beef'\n```"}]}, {"id": "train-8887", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the title of the recipe with most kinds of ingredients."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id GROUP BY T1.title ORDER BY COUNT(title) DESC LIMIT 1\n```"}]}, {"id": "train-8888", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times is the sodium content in Lasagne-Spinach Spirals to Beef and Spinach Pita Pockets?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.title = 'Lasagne-Spinach Spirals' THEN T2.sodium ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T1.title = 'Beef and Spinach Pita Pockets' THEN T2.sodium ELSE 0 END) FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id\n```"}]}, {"id": "train-8889", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average calorie count for all recipes using coarsely ground black pepper?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.calories) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T2.ingredient_id = T1.ingredient_id INNER JOIN Nutrition AS T3 ON T3.recipe_id = T2.recipe_id WHERE T1.name = 'coarsely ground black pepper'\n```"}]}, {"id": "train-8890", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the recipes that will cause stomach pain?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20\n```"}]}, {"id": "train-8891", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many ingredients are there in Apricot Yogurt Parfaits?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Apricot Yogurt Parfaits'\n```"}]}, {"id": "train-8892", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the ingredients that need to be cook in beef broth?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T2.preparation = 'cooked in beef broth'\n```"}]}, {"id": "train-8893", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many ingredients are there in the recipe that is best in helping your body's natural defence against illness and infection?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Nutrition AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.vitamin_a > 0\n```"}]}, {"id": "train-8894", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the names of the top 5 recipes that are best for wound healing?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.vitamin_c DESC LIMIT 5\n```"}]}, {"id": "train-8895", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which ingredient appeared the least in recipes?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id GROUP BY T2.ingredient_id ORDER BY COUNT(T2.ingredient_id) ASC LIMIT 1\n```"}]}, {"id": "train-8896", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many baking product ingredients are there in the No-Bake Chocolate Cheesecake?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.category = 'baking products' AND T1.title = 'No-Bake Chocolate Cheesecake'\n```"}]}, {"id": "train-8897", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the ingredients for Strawberry Sorbet."}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Strawberry Sorbet'\n```"}]}, {"id": "train-8898", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the optional ingredients for Warm Chinese Chicken Salad?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Warm Chinese Chicken Salad' AND T2.optional = 'TRUE'\n```"}]}, {"id": "train-8899", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the recipes with alcohol content over 10, which recipe takes the longest to prepare?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.alcohol > 10 ORDER BY T1.prep_min DESC LIMIT 1\n```"}]}, {"id": "train-8900", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many servings does the recipe with the highest unsaturated fat have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.title) FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.total_fat - T2.sat_fat DESC LIMIT 1\n```"}]}, {"id": "train-8901", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the recipes whose source is the National Potato Board, which recipe has the highest calories?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.source = 'National Potato Board' ORDER BY T2.calories DESC LIMIT 1\n```"}]}, {"id": "train-8902", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which recipe has the highest number of ingredients? Calculate the said recipe's total time of cooking."}, {"from": "gpt", "value": "```sql\nSELECT T2.recipe_id, T1.prep_min + T1.cook_min + T1.stnd_min FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id GROUP BY T2.recipe_id ORDER BY COUNT(T2.ingredient_id) DESC LIMIT 1\n```"}]}, {"id": "train-8903", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which ingredient appeared the most in recipes? Calculate its amount of appearance in percentage."}, {"from": "gpt", "value": "```sql\nSELECT T1.name, CAST(COUNT(T2.ingredient_id) AS FLOAT) * 100 / ( SELECT COUNT(T2.ingredient_id) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T2.ingredient_id = T1.ingredient_id ) AS \"percentage\" FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T2.ingredient_id = T1.ingredient_id GROUP BY T2.ingredient_id ORDER BY COUNT(T2.ingredient_id) DESC LIMIT 1\n```"}]}, {"id": "train-8904", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the title and total time of the recipe which has the highest possibility of gaining weight."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T1.prep_min + T1.cook_min + T1.stnd_min FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.total_fat DESC LIMIT 1\n```"}]}, {"id": "train-8905", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which recipes contain almond extract?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.name = 'almond extract'\n```"}]}, {"id": "train-8906", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ingredients in Tomato-Cucumber Relish."}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Tomato-Cucumber Relish'\n```"}]}, {"id": "train-8907", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many ingredients are needed to prepare Idaho Potato Supreme?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Idaho Potato Supreme'\n```"}]}, {"id": "train-8908", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ingredients that are rationed in the recipe with the highest carbohydrate content."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id INNER JOIN Nutrition AS T3 ON T3.recipe_id = T2.recipe_id WHERE T2.max_qty = T2.min_qty ORDER BY T3.carbo DESC LIMIT 1\n```"}]}, {"id": "train-8909", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the recipes which can lead to constipation."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20\n```"}]}, {"id": "train-8910", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the ingredients in the recipe with the highest vitamin that helps vision in dim light."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id INNER JOIN Nutrition AS T3 ON T3.recipe_id = T2.recipe_id ORDER BY T3.vitamin_a DESC LIMIT 1\n```"}]}, {"id": "train-8911", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the ingredients and maximum quantities of the recipe which can serve 7 people."}, {"from": "gpt", "value": "```sql\nSELECT T3.name, T2.max_qty FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.servings = 7\n```"}]}, {"id": "train-8912", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the recipes from The California Tree Fruit Agreement, calculate the percentage of sodium-free recipes."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.sodium < 5 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'\n```"}]}, {"id": "train-8913", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the ingredients which measure in slices."}, {"from": "gpt", "value": "```sql\nSELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T2.unit = 'slice(s)'\n```"}]}, {"id": "train-8914", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many recipes can be made with canned dairy?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id WHERE T1.category = 'canned dairy'\n```"}]}, {"id": "train-8915", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the title and total time of the recipe which can be made with only lima beans."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T1.prep_min + T1.cook_min + T1.stnd_min FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.name = 'lima beans'\n```"}]}, {"id": "train-8916", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the recipes with sea bass, how many percent of recipes can serve 10 people and above?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.servings >= 10 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.name = 'sea bass steak'\n```"}]}, {"id": "train-8917", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much fat does the Raspberry Chiffon Pie have?"}, {"from": "gpt", "value": "```sql\nSELECT T2.total_fat FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie'\n```"}]}, {"id": "train-8918", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage calories protein of Raspberry Chiffon Pie?"}, {"from": "gpt", "value": "```sql\nSELECT pcnt_cal_prot FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie'\n```"}]}, {"id": "train-8919", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many ingredients are required to make the Raspberry Chiffon Pie?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Raspberry Chiffon Pie'\n```"}]}, {"id": "train-8920", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of alcohol free recipes."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.alcohol = 0\n```"}]}, {"id": "train-8921", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average vitamin C amount of all cakes?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.vitamin_c) FROM Nutrition AS T1 INNER JOIN Recipe AS T2 ON T2.recipe_id = T1.recipe_id WHERE T2.title LIKE '%cake%'\n```"}]}, {"id": "train-8922", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many dairy recipes can serve more than 10 people?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T3.category = 'dairy' AND T1.servings > 10\n```"}]}, {"id": "train-8923", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of recipes that can lead to constipation."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.iron > 20\n```"}]}, {"id": "train-8924", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which recipe has the highest calories?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id ORDER BY T2.calories DESC LIMIT 1\n```"}]}, {"id": "train-8925", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many recipes are non-dairy?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.recipe_id) FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T2.ingredient_id = T1.ingredient_id INNER JOIN Nutrition AS T3 ON T3.recipe_id = T2.recipe_id WHERE T1.category NOT LIKE '%dairy%'\n```"}]}, {"id": "train-8926", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the ingredients of Apricot Yogurt Parfaits."}, {"from": "gpt", "value": "```sql\nSELECT T3.name, T3.category FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id WHERE T1.title = 'Apricot Yogurt Parfaits'\n```"}]}, {"id": "train-8927", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify recipes with different maximum and minimum quantities."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id WHERE T2.max_qty <> T2.min_qty\n```"}]}, {"id": "train-8928", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What ingredients does the longest cooking time recipe have?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id ORDER BY T1.cook_min DESC LIMIT 1\n```"}]}, {"id": "train-8929", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of recipes with no cholesterol included and have a cooking time less than 20 minutes among all recipes."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.cook_min < 20 AND T2.cholestrl = 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\n```"}]}, {"id": "train-8930", "db_id": "cookbook", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all recipes containing cheese, what is the percentage of recipes with calories greater than 200?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T4.calories > 200 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id INNER JOIN Ingredient AS T3 ON T3.ingredient_id = T2.ingredient_id INNER JOIN Nutrition AS T4 ON T4.recipe_id = T1.recipe_id WHERE T3.category = 'cheese'\n```"}]}, {"id": "train-8931", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which employee has the highest salary? Please give his or her full name."}, {"from": "gpt", "value": "```sql\nSELECT firstname, lastname FROM employee ORDER BY salary DESC LIMIT 1\n```"}]}, {"id": "train-8932", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many emplyees have a good job performance?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee WHERE performance = 'Good'\n```"}]}, {"id": "train-8933", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the social security numbers of the male employees with a salary of over $70,000 a year."}, {"from": "gpt", "value": "```sql\nSELECT ssn FROM employee WHERE gender = 'M' AND CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) > 70000\n```"}]}, {"id": "train-8934", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the required education for the position of regional manager?"}, {"from": "gpt", "value": "```sql\nSELECT educationrequired FROM position WHERE positiontitle = 'Regional Manager'\n```"}]}, {"id": "train-8935", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which position has a lower minimum salary, Account Representative or Trainee?"}, {"from": "gpt", "value": "```sql\nSELECT positiontitle FROM position WHERE positiontitle = 'Account Representative' OR positiontitle = 'Trainee' ORDER BY minsalary ASC LIMIT 1\n```"}]}, {"id": "train-8936", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city's office does Sandy Adams work at?"}, {"from": "gpt", "value": "```sql\nSELECT T2.locationcity FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.lastname = 'Adams' AND T1.firstname = 'Sandy'\n```"}]}, {"id": "train-8937", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees working at the office in New York, how many of them have a good job performance?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.state = 'NY' AND T1.performance = 'Good'\n```"}]}, {"id": "train-8938", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the office phone number of the location at which Sandy Adams works?"}, {"from": "gpt", "value": "```sql\nSELECT T2.officephone FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.lastname = 'Adams' AND T1.firstname = 'Sandy'\n```"}]}, {"id": "train-8939", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male employees work at the address 450 Peachtree Rd?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.address = '450 Peachtree Rd' AND T1.gender = 'M'\n```"}]}, {"id": "train-8940", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees work as an Account Representative?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Account Representative'\n```"}]}, {"id": "train-8941", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much higher is James Johnson's salary from the minimum salary of his title?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) - CAST(REPLACE(SUBSTR(T2.minsalary, 4), ',', '') AS REAL) AS diff FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.lastname = 'Johnson' AND T1.firstname = 'James'\n```"}]}, {"id": "train-8942", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees who are Trainees, how many of them work in New York?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Trainee' AND T2.state = 'NY'\n```"}]}, {"id": "train-8943", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of the employees who are working as a Trainee."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstname, T1.lastname FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'\n```"}]}, {"id": "train-8944", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which employee's job position requires a higher education level, Jose Rodriguez or Sandy Adams?"}, {"from": "gpt", "value": "```sql\nSELECT T1.firstname, T1.lastname FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE (T1.lastname = 'Adams' AND T1.firstname = 'Sandy') OR (T1.lastname = 'Rodriguez' AND T1.firstname = 'Jose') ORDER BY T2.educationrequired DESC LIMIT 1\n```"}]}, {"id": "train-8945", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the zip codes of the offices where all the male employees with a good job performance work at."}, {"from": "gpt", "value": "```sql\nSELECT T2.zipcode FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.gender = 'M' AND T1.performance = 'Good'\n```"}]}, {"id": "train-8947", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees who work as a Trainee, how many of them have a salary of over &20,000 a year?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) > 20000 AND T2.positiontitle = 'Trainee'\n```"}]}, {"id": "train-8948", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average salary of the employees who work as a Trainee?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) AS avg FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'\n```"}]}, {"id": "train-8949", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: By what percentage is the average salary of Trainees higher than the minimum salary of this postion?"}, {"from": "gpt", "value": "```sql\nSELECT 100 * (AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) - CAST(REPLACE(SUBSTR(T2.minsalary, 4), ',', '') AS REAL)) / CAST(REPLACE(SUBSTR(T2.minsalary, 4), ',', '') AS REAL) AS per FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'\n```"}]}, {"id": "train-8950", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of female employees."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee WHERE gender = 'F'\n```"}]}, {"id": "train-8951", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of the city where Jose Rodriguez works."}, {"from": "gpt", "value": "```sql\nSELECT T2.locationcity FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.firstname = 'Jose' AND T1.lastname = 'Rodriguez'\n```"}]}, {"id": "train-8952", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which state does Emily Wood work?"}, {"from": "gpt", "value": "```sql\nSELECT T2.state FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.firstname = 'Emily' AND T1.lastname = 'Wood'\n```"}]}, {"id": "train-8953", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the education required for David Whitehead to reach his current position?"}, {"from": "gpt", "value": "```sql\nSELECT T2.educationrequired FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'David' AND T1.lastname = 'Whitehead' AND T1.gender = 'M'\n```"}]}, {"id": "train-8954", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees are there in the \"Miami\" office?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.locationcity = 'Miami'\n```"}]}, {"id": "train-8955", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the highest paid employee in \"Boston\"? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstname, T1.lastname FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.locationcity = 'Boston' ORDER BY T1.salary DESC LIMIT 1\n```"}]}, {"id": "train-8956", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the employee in \u201cNew York City\u201d with a good performance? Give the social security number of the employee."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstname, T1.lastname, T1.ssn FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.locationcity = 'New York City' AND T1.performance = 'Good'\n```"}]}, {"id": "train-8957", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many \"account representatives\" are there in Chicago with a good performance?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Account Representative' AND T2.locationcity = 'Chicago' AND T1.performance = 'Good'\n```"}]}, {"id": "train-8958", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is Kenneth Charles's position title?"}, {"from": "gpt", "value": "```sql\nSELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Kenneth' AND T1.lastname = 'Charles'\n```"}]}, {"id": "train-8959", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full address of the office of the highest paid manager."}, {"from": "gpt", "value": "```sql\nSELECT T2.address FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Manager' ORDER BY T1.salary DESC LIMIT 1\n```"}]}, {"id": "train-8960", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the max salary for 'Tracy Coulter' if he/she stays on his/her position?"}, {"from": "gpt", "value": "```sql\nSELECT T2.maxsalary FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Tracy' AND T1.lastname = 'Coulter'\n```"}]}, {"id": "train-8961", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: If Jose Rodriguez tried his best, how many percentage can his salary raise without changing his position?"}, {"from": "gpt", "value": "```sql\nSELECT 100 * (CAST(REPLACE(SUBSTR(T2.maxsalary, 4), ',', '') AS REAL) - CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) / CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) AS per FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Jose' AND T1.lastname = 'Rodriguez'\n```"}]}, {"id": "train-8962", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many employees whose performance is poor have a salary of over $50,000 per year?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee WHERE performance = 'Poor' AND CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) > 50000\n```"}]}, {"id": "train-8963", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the employee with the highest salary? Specify his/her full name."}, {"from": "gpt", "value": "```sql\nSELECT firstname, lastname FROM employee WHERE CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL)) FROM employee )\n```"}]}, {"id": "train-8964", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many positions have a maximum salary of no more than US$1000,000?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM position WHERE CAST(REPLACE(SUBSTR(maxsalary, 4), ',', '') AS REAL) < 100000\n```"}]}, {"id": "train-8965", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the salary of the first ever employee that was hired?"}, {"from": "gpt", "value": "```sql\nSELECT salary FROM employee ORDER BY hiredate ASC LIMIT 1\n```"}]}, {"id": "train-8966", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the minimum salary given to the position with the most complex work?"}, {"from": "gpt", "value": "```sql\nSELECT minsalary FROM position ORDER BY educationrequired DESC LIMIT 1\n```"}]}, {"id": "train-8967", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full office location address where most of the employees work at?"}, {"from": "gpt", "value": "```sql\nSELECT T2.address, T2.locationcity, T2.state, T2.zipcode FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID GROUP BY T2.address, T2.locationcity, T2.state, T2.zipcode ORDER BY COUNT(*) DESC LIMIT 1\n```"}]}, {"id": "train-8968", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average salary of all employees with a 2 year degree position?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.educationrequired = '2 year degree'\n```"}]}, {"id": "train-8969", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many male Regional Managers are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Regional Manager' AND T1.gender = 'M'\n```"}]}, {"id": "train-8970", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which position has the highest amount of poor performing employees?"}, {"from": "gpt", "value": "```sql\nSELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Poor' GROUP BY T2.positiontitle ORDER BY COUNT(T2.positiontitle) DESC LIMIT 1\n```"}]}, {"id": "train-8971", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which position has the highest number of female employees with a 2 year degree?"}, {"from": "gpt", "value": "```sql\nSELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.educationrequired = '2 year degree' AND T1.gender = 'F' GROUP BY T2.positiontitle ORDER BY COUNT(T2.positiontitle) DESC LIMIT 1\n```"}]}, {"id": "train-8972", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Account Representatives are there in Illinois with satisfying performance?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Account Representative' AND T1.performance = 'Good' AND T2.state = 'IL'\n```"}]}, {"id": "train-8973", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average salary of the worst performing managers?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Poor' AND T2.positiontitle = 'Manager'\n```"}]}, {"id": "train-8974", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which state can you find the highest amount of good performing Account Representatives?"}, {"from": "gpt", "value": "```sql\nSELECT T2.state FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Account Representative' AND T1.performance = 'Good' GROUP BY T2.state ORDER BY COUNT(T2.state) DESC LIMIT 1\n```"}]}, {"id": "train-8975", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the employee's full name and performance status who got the lowest in salary per year."}, {"from": "gpt", "value": "```sql\nSELECT firstname, lastname, performance FROM employee ORDER BY salary ASC LIMIT 1\n```"}]}, {"id": "train-8976", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the location cities in the Western states."}, {"from": "gpt", "value": "```sql\nSELECT locationcity FROM location WHERE state IN ('CO', 'UT', 'CA')\n```"}]}, {"id": "train-8977", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city and address has zip code of above 90000?"}, {"from": "gpt", "value": "```sql\nSELECT locationcity, address FROM location WHERE zipcode > 90000\n```"}]}, {"id": "train-8978", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which positions are suitable with 4 years degree education?"}, {"from": "gpt", "value": "```sql\nSELECT positiontitle FROM position WHERE educationrequired = '4 year degree'\n```"}]}, {"id": "train-8979", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the maximum salary of position \"Trainer\"?"}, {"from": "gpt", "value": "```sql\nSELECT maxsalary FROM position WHERE positiontitle = 'Trainee'\n```"}]}, {"id": "train-8980", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full name and social security number of the account representative with average performance."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstname, T1.lastname, T1.ssn FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Average'\n```"}]}, {"id": "train-8981", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was Emily Wood hired? Mention her position and salary."}, {"from": "gpt", "value": "```sql\nSELECT T1.hiredate, T2.positiontitle, T1.salary FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Emily' AND T1.lastname = 'Wood'\n```"}]}, {"id": "train-8982", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the maximum and minimum salary range and position title of Bill Marlin?"}, {"from": "gpt", "value": "```sql\nSELECT T2.maxsalary, T2.minsalary, T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Bill' AND T1.lastname = 'Marlin'\n```"}]}, {"id": "train-8983", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full names, gender and positions who's location is in New York city."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstname, T1.lastname, T1.gender, T3.positiontitle FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T2.locationcity = 'New York City'\n```"}]}, {"id": "train-8984", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the full name, hired date and performance status of the employee whose location is in Utah state."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstname, T1.lastname, T1.hiredate, T1.performance FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T2.state = 'UT'\n```"}]}, {"id": "train-8985", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the employees with poor performance, provide the managers' full names, location city, address and its zip code."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstname, T1.lastname, T2.locationcity, T2.address, T2.zipcode FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Manager' AND T1.performance = 'Poor'\n```"}]}, {"id": "train-8986", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the education required to be account representative? Mention account representative full name and salary who got poor in performance status."}, {"from": "gpt", "value": "```sql\nSELECT T2.educationrequired, T1.firstname, T1.lastname, T1.salary FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Poor' AND T2.positiontitle = 'Account Representative'\n```"}]}, {"id": "train-8987", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the full name, performance status and located city of the employee who's social security number is \"767-74-7373\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstname, T1.lastname, T2.state, T2.locationcity FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID WHERE T1.ssn = '767-74-7373'\n```"}]}, {"id": "train-8988", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the employees' full name, positions, located city and office phone number within Colorado state."}, {"from": "gpt", "value": "```sql\nSELECT T1.firstname, T1.lastname, T3.positiontitle, T2.locationcity, T2.officephone FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T2.state = 'CO'\n```"}]}, {"id": "train-8989", "db_id": "human_resources", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the monthly average salary of the employee with highest salary. Mention his name, position title and location city."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) / 12 AS avg, T1.firstname, T1.lastname , T2.positiontitle, T3.locationcity FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID INNER JOIN location AS T3 ON T1.locationID = T3.locationID WHERE CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID INNER JOIN location AS T3 ON T1.locationID = T3.locationID )\n```"}]}, {"id": "train-8990", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which trip had the longest duration? State the start and end station."}, {"from": "gpt", "value": "```sql\nSELECT start_station_name, end_station_name FROM trip WHERE duration = ( SELECT MAX(duration) FROM trip )\n```"}]}, {"id": "train-8991", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of the trip were done by a subscriber?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(COUNT(subscription_type) AS REAL) * 100 / ( SELECT COUNT(subscription_type) FROM trip ) FROM trip WHERE subscription_type = 'Subscriber'\n```"}]}, {"id": "train-8992", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the final station of bike id 13. Which city was it at?"}, {"from": "gpt", "value": "```sql\nSELECT T2.end_station_id, T1.city FROM station AS T1 INNER JOIN trip AS T2 ON T1.name = T2.end_station_name WHERE T2.bike_id = 13 ORDER BY T2.end_date DESC LIMIT 1\n```"}]}, {"id": "train-8993", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all the trips where the bike was borrowed and returned on a different day. State the city where the bike was returned."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.city FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name WHERE SUBSTR(CAST(T2.start_date AS TEXT), INSTR(T2.start_date, '/') + 1) - SUBSTR(CAST(T2.start_date AS TEXT), INSTR(T2.start_date, ' ') - 5) <> SUBSTR(CAST(T2.end_date AS TEXT), INSTR(T2.end_date, '/') + 1) - SUBSTR(CAST(T2.end_date AS TEXT), INSTR(T2.end_date, ' ') - 5)\n```"}]}, {"id": "train-8994", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which is the station where no bike could not be borrowed form on the 2013/11/03 02:01:01? State the location of the station."}, {"from": "gpt", "value": "```sql\nSELECT T1.name, T1.long FROM station AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.id WHERE T2.time = '2013/11/03 02:01:01' AND T2.bikes_available = 0\n```"}]}, {"id": "train-8995", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the station and city with the most borrowed bike."}, {"from": "gpt", "value": "```sql\nSELECT T2.start_station_name, T1.city FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name GROUP BY T2.start_station_name ORDER BY COUNT(T2.start_station_name) DESC LIMIT 1\n```"}]}, {"id": "train-8996", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the hottest temperature on the day of trip ID 4080?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T2.max_temperature_f) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.date = SUBSTR(CAST(T1.start_date AS TEXT), 1, INSTR(T1.start_date, ' ') - 1) WHERE T1.id = 4080\n```"}]}, {"id": "train-8997", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: At what date and time did San Jose Diridon Caltrain Station have most bikes available."}, {"from": "gpt", "value": "```sql\nSELECT T2.time FROM station AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.id WHERE T1.name = 'San Jose Diridon Caltrain Station' AND T2.bikes_available = ( SELECT MAX(T2.bikes_available) FROM station AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.id WHERE T1.name = 'San Jose Diridon Caltrain Station' )\n```"}]}, {"id": "train-8998", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name all the trip on the days when it rained. State the duration of the trip"}, {"from": "gpt", "value": "```sql\nSELECT T1.id, T1.duration FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.date = SUBSTR(CAST(T1.start_date AS TEXT), 1, INSTR(T1.start_date, ' ') - 1) WHERE T2.events LIKE '%Rain%' OR T2.events LIKE '%rain%'\n```"}]}, {"id": "train-8999", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all trips where bikes were returned at location 37.331415, -121.8932. State the date the bike was borrowed."}, {"from": "gpt", "value": "```sql\nSELECT T2.end_station_name, T2.start_date FROM station AS T1 INNER JOIN trip AS T2 ON T2.end_station_name = T1.name WHERE T1.lat = 37.331415 AND T1.long = -121.8932\n```"}]}, {"id": "train-9000", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the trips in August 2013, how many bikes were borrowed from Redwood City."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.start_date) FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name WHERE T2.start_date LIKE '8/%/2013%' AND T1.city = 'Redwood City'\n```"}]}, {"id": "train-9001", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT T1.start_station_name, T1.end_station_name, T2.mean_temperature_f FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.duration < 300\n```"}]}, {"id": "train-9002", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the trips, which day had the most bikes borrowed? What was the average coldest temperature on that day?"}, {"from": "gpt", "value": "```sql\nSELECT T2.date, AVG(T2.min_temperature_f) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code GROUP BY T2.date ORDER BY COUNT(T1.start_date) DESC LIMIT 1\n```"}]}, {"id": "train-9003", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average usage of each bike in the third quarter of year 2013. Find the average wind direction within the same period."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.duration), AVG(T2.wind_dir_degrees) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE SUBSTR(CAST(T2.date AS TEXT), 1, INSTR(T2.date, '/') - 1) IN ('7', '8', '9') AND SUBSTR(CAST(T2.date AS TEXT), -4) = '2013'\n```"}]}, {"id": "train-9004", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many bike stations were installed in San Jose in 2014? Indicate the names of the stations."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN city = 'San Jose' AND SUBSTR(installation_date, -4) = '2014' THEN 1 ELSE 0 END) FROM station UNION SELECT name FROM station WHERE city = 'San Jose' AND SUBSTR(installation_date, -4) = '2014'\n```"}]}, {"id": "train-9005", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the longest trip duration that started and ended August 29, 2013?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(duration) FROM trip WHERE start_date LIKE '8/29/2013%' AND end_date LIKE '8/29/2013%'\n```"}]}, {"id": "train-9006", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How long did it take for bike id 426 to reach 2nd at South Park from Market at 4th on 8/29/2013? Indicate the duration in minutes."}, {"from": "gpt", "value": "```sql\nSELECT CAST(duration AS REAL) / 60 FROM trip WHERE bike_id = 426 AND end_station_name = '2nd at South Park' AND start_station_name = 'Market at 4th' AND start_date LIKE '8/29/2013%' AND end_date LIKE '8/29/2013%'\n```"}]}, {"id": "train-9007", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On 8/29/2013, who took the longest to arrive in California Ave Caltrain Station from University and Emerson? Indicate the bike id."}, {"from": "gpt", "value": "```sql\nSELECT bike_id FROM trip WHERE start_date LIKE '8/29/2013%' AND end_date LIKE '8/29/2013%' AND end_station_name = 'California Ave Caltrain Station' AND start_station_name = 'University and Emerson' AND duration = ( SELECT MAX(duration) FROM trip WHERE start_date LIKE '8/29/2013%' AND end_date LIKE '8/29/2013%' AND end_station_name = 'California Ave Caltrain Station' AND start_station_name = 'University and Emerson' )\n```"}]}, {"id": "train-9008", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stations in San Francico can hold more than 20 bikes?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN city = 'San Francisco' AND dock_count > 20 THEN 1 ELSE 0 END) FROM station\n```"}]}, {"id": "train-9009", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the hottest temperature recorded? If there are multiple dates with the hottest temperature, indicate all of the dates."}, {"from": "gpt", "value": "```sql\nSELECT max_temperature_f, date FROM weather WHERE max_temperature_f = ( SELECT MAX(max_temperature_f) FROM weather WHERE max_temperature_f IS NOT NULL AND max_temperature_f IS NOT '' )\n```"}]}, {"id": "train-9010", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the maximum dew point in Fahrenheit degree on 7/15/2014 in the area with a zip code of 94301?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT CASE WHEN date = '7/15/2014' AND zip_code = 94301 THEN max_dew_point_f END FROM weather\n```"}]}, {"id": "train-9011", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year experienced the most rain?"}, {"from": "gpt", "value": "```sql\nSELECT SUBSTR(CAST(date AS TEXT), -4) FROM weather GROUP BY SUBSTR(CAST(date AS TEXT), -4) ORDER BY SUM(CASE WHEN events LIKE '%Rain%' OR events LIKE '%rain%' THEN 1 ELSE 0 END) DESC LIMIT 1\n```"}]}, {"id": "train-9012", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On 10/20/2014, what is the duration of the fastest trip which started from the station with latitude and longitudes of 37.789625 and -122.400811, respectively? Indicate the bike id."}, {"from": "gpt", "value": "```sql\nSELECT MIN(T2.duration), T2.bike_id FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name WHERE T2.start_date LIKE '10/20/2014%' AND T1.lat = 37.789625 AND T1.long = -122.400811\n```"}]}, {"id": "train-9013", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the subscribers who rented a bike from South Van Ness at Market on 12/1/2013, whose duration was the shortest and to which station was the bike returned to? Indicate South Van Ness's dock count."}, {"from": "gpt", "value": "```sql\nSELECT MIN(T2.duration), T2.end_station_name, COUNT(T2.start_station_name) FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name WHERE T2.start_date LIKE '12/1/2013%' AND T2.start_station_name = 'South Van Ness at Market' AND T2.subscription_type = 'Subscriber'\n```"}]}, {"id": "train-9014", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the maximum humidity in Powell Street BART when bike 496 was borrowed from the station on 8/29/2013?"}, {"from": "gpt", "value": "```sql\nSELECT T2.max_humidity FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.start_date LIKE '8/29/2013%' AND T1.bike_id = 496 AND T1.start_station_name = 'Powell Street BART'\n```"}]}, {"id": "train-9015", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT T2.date, COUNT(T1.start_station_name) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '11/%/2014%' AND T2.zip_code = 94301 AND T2.events = 'Fog' AND T1.subscription_type = 'Subscriber'\n```"}]}, {"id": "train-9016", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the station that is less used by customers who borrow bikes from? Indicate when was the station installed."}, {"from": "gpt", "value": "```sql\nSELECT T1.start_station_name, T2.installation_date FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.subscription_type = 'Customer' GROUP BY T1.start_station_name ORDER BY COUNT(T1.subscription_type) LIMIT 1\n```"}]}, {"id": "train-9017", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On 11/3/2013, which stations are often empty? Indicate the names of the stations."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.name FROM station AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.id WHERE T2.bikes_available = 0 AND T2.time LIKE '2013/11/03%'\n```"}]}, {"id": "train-9018", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average duration of bike trips in the city of Palo Alto?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.duration) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'Palo Alto'\n```"}]}, {"id": "train-9019", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the route that has the longest duration? Indicate the city of where the stations are located."}, {"from": "gpt", "value": "```sql\nSELECT T1.start_station_name, T1.end_station_name, T2.city FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.duration = ( SELECT MAX(T1.duration) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name )\n```"}]}, {"id": "train-9020", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of stations that were installed from 8/5/2013 to 12/31/2013. Indicate their installation date and city name."}, {"from": "gpt", "value": "```sql\nSELECT name, installation_date, city FROM station WHERE (SUBSTR(CAST(installation_date AS TEXT), 1, INSTR(installation_date, '/') - 1) = '5' AND SUBSTR(CAST(installation_date AS TEXT), INSTR(installation_date, '/') + 1, -6) >= '8' AND SUBSTR(CAST(installation_date AS TEXT), -4) = '2013') OR (SUBSTR(CAST(installation_date AS TEXT), 1, INSTR(installation_date, '/') - 1) IN ( '6', '7', '8', '9', '10', '11', '12' ) AND SUBSTR(CAST(installation_date AS TEXT), -4) = '2013')\n```"}]}, {"id": "train-9021", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average duration of trips which are started at Adobe on Almaden station to Ryland Park?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(duration) FROM trip WHERE start_station_name = 'Adobe on Almaden' AND end_station_name = 'Ryland Park'\n```"}]}, {"id": "train-9022", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the times when there is no available bike to borrow in a station. List down the stations name and location coordinate."}, {"from": "gpt", "value": "```sql\nSELECT T2.time, T1.name, T1.lat, T1.long FROM station AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.id WHERE T2.bikes_available = 0\n```"}]}, {"id": "train-9023", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the trips in which their start and end station are similar. Give me their trip IDs and location coordinates."}, {"from": "gpt", "value": "```sql\nSELECT 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\n```"}]}, {"id": "train-9024", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On 8/29/2013 at 6:14:01 PM, how many bikes were borrowed from San Jose Diridon Caltrain Station?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.dock_count - T2.bikes_available) FROM station AS T1 INNER JOIN status AS T2 ON T1.id = T2.station_id WHERE T1.name = 'San Jose Diridon Caltrain Station' AND T2.time = '2013/08/29 06:14:01'\n```"}]}, {"id": "train-9025", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the trip IDs when bike no. 10 was used by subscribers and the weather's mean temperature is no less than 62 degress Fahrenheit."}, {"from": "gpt", "value": "```sql\nSELECT T1.id FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.bike_id = 10 AND T2.mean_temperature_f > 62 AND T1.subscription_type = 'Subscriber'\n```"}]}, {"id": "train-9026", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What were the max gust speed and cloud clover when the customer using bike no. 10 recorded the 386 seconds duration of the trip from MLK Library to San Salvador at 1st?"}, {"from": "gpt", "value": "```sql\nSELECT T2.max_gust_speed_mph, T2.cloud_cover FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.date = SUBSTR(CAST(T1.start_date AS TEXT), 1, INSTR(T1.start_date, ' ') - 1) WHERE T1.bike_id = 10 AND T2.mean_temperature_f > 62 AND T1.subscription_type = 'Customer' AND T1.start_station_name = 'MLK Library' AND T1.end_station_name = 'San Salvador at 1st' AND T1.duration = 386\n```"}]}, {"id": "train-9027", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the subscriber, how many of them finished the 2nd at Folsom and Civic Center BART (7th at Market) as their start and end stations respectively for no more than 490 seconds under minimum visibility of 4 miles."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.subscription_type = 'Subscriber' AND T2.min_visibility_miles = 4 AND T1.duration < 490 AND T1.start_station_name = '2nd at Folsom' AND T1.end_station_name = 'Civic Center BART (7th at Market)'\n```"}]}, {"id": "train-9028", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many docks were available at the starting station of trip ID 912900?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.docks_available) FROM trip AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.start_station_id WHERE T1.zip_code = 912900\n```"}]}, {"id": "train-9029", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please write down the trip IDs which ended on the days when the minimum temperature is less than 45 degrees Fahrenheit."}, {"from": "gpt", "value": "```sql\nSELECT T1.id FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.min_temperature_f < 45\n```"}]}, {"id": "train-9030", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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? Give me the minimum temperature, maximum gust speed and weather event on that trip."}, {"from": "gpt", "value": "```sql\nSELECT MIN(T1.duration) , MIN(T1.duration) - AVG(T1.duration), T2.min_temperature_f FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.start_date = '1/1/2014 0:00' AND T1.end_date = '12/31/2014 11:59' AND T1.start_station_name = '2nd at Folsom' AND T1.end_station_name = '5th at Howard' AND T1.subscription_type = 'Subscriber'\n```"}]}, {"id": "train-9031", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the average ride time of the bikes that started at Steuart at Market station and ended at Embarcadero at Sansome station in July 2014."}, {"from": "gpt", "value": "```sql\nSELECT AVG(duration) FROM trip WHERE start_date = '7/1/2014%' AND end_date = '7/31/2014%' AND start_station_name = 'Steuart at Market' AND end_station_name = 'Embarcadero at Sansome'\n```"}]}, {"id": "train-9032", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the average maximum and minimum temperatures in May 2015 when the mean humidity is between 65 and 75?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(max_temperature_f), AVG(min_temperature_f) FROM weather WHERE date LIKE '5/%/2015' AND mean_humidity BETWEEN 65 AND 75\n```"}]}, {"id": "train-9033", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the difference between the number of customers and the number of subscribers who did the trip in June 2013."}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(subscription_type = 'Subscriber', 1, 0)) - SUM(IIF(subscription_type = 'Customer', 1, 0)) FROM trip WHERE start_date LIKE '6/%/2013%'\n```"}]}, {"id": "train-9034", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the days in 2013 when rain and fog occurred together and find the id of bikes borrowed on these days."}, {"from": "gpt", "value": "```sql\nSELECT T2.date, T1.bike_id FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE SUBSTR(CAST(T2.date AS TEXT), -4) = '2013' AND T2.events = 'Fog-Rain'\n```"}]}, {"id": "train-9035", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT T3.mean_visibility_miles, T3.mean_wind_speed_mph, T3.events, T1.lat, T1.long , T2.start_station_name, T2.end_station_name FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name INNER JOIN weather AS T3 ON T3.zip_code = T2.zip_code WHERE T3.events = 'Fog' ORDER BY T2.duration DESC LIMIT 1\n```"}]}, {"id": "train-9036", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For the rides that started at Market at 10th station and ended at South Van Ness at Market station in August of 2013, which day had the coldest temperature?"}, {"from": "gpt", "value": "```sql\nSELECT T1.start_date FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.date = SUBSTR(CAST(T1.start_date AS TEXT), 1, INSTR(T1.start_date, ' ') - 1) WHERE T2.date LIKE '8/%/2013' AND T1.start_station_name = 'Market at 10th' AND T1.end_station_name = 'South Van Ness at Market' AND T2.min_temperature_f = ( SELECT MIN(T2.min_temperature_f) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code AND T2.date = SUBSTR(CAST(T1.start_date AS TEXT), 1, INSTR(T1.start_date, ' ') - 1) WHERE T2.date LIKE '8/%/2013' AND T1.start_station_name = 'Market at 10th' AND T1.end_station_name = 'South Van Ness at Market' )\n```"}]}, {"id": "train-9037", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the rides during the rainy days, which ride was the longest? List the start station, end station, and duration of this ride."}, {"from": "gpt", "value": "```sql\nSELECT T1.start_station_name, T1.end_station_name, T1.duration FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.events = 'Rain' OR T2.events = 'rain' ORDER BY T1.duration DESC LIMIT 1\n```"}]}, {"id": "train-9038", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the average ride duration during the rain of more than 0.8 inches."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.duration) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE (T2.events = 'Rain' AND T2.precipitation_inches > 0.8) OR (T2.events = 'rain' AND T2.precipitation_inches > 0.8)\n```"}]}, {"id": "train-9039", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name and city of starting stations which has an above-average duration trips."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.start_station_name, T2.city FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.duration > ( SELECT AVG(T1.duration) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name )\n```"}]}, {"id": "train-9040", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stations in San Francisco are installed in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN city = 'San Francisco' AND SUBSTR(installation_date, -4) = '2014' THEN 1 ELSE 0 END) FROM station\n```"}]}, {"id": "train-9041", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2006, how many trips ended at stations in Mountain View?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.city) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.end_station_name WHERE T2.city = 'Mountain View' AND T1.start_date LIKE '%2006%'\n```"}]}, {"id": "train-9042", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which trip id had the longest duration and the start station is in Redwood City?"}, {"from": "gpt", "value": "```sql\nSELECT T1.id FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'Redwood City' AND T1.duration = ( SELECT MAX(T1.duration) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'Redwood City' )\n```"}]}, {"id": "train-9043", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list bikes id were used in trips which start station were installed in 2013."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.bike_id FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.installation_date LIKE '%2013'\n```"}]}, {"id": "train-9044", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many trips which subscription types were Subscriber and ended in San Jose city?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.subscription_type) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.end_station_name WHERE T1.subscription_type = 'Subscriber' AND T2.city = 'San Jose'\n```"}]}, {"id": "train-9045", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which trip had the shortest duration and started at the station that can hold 15 bikes?"}, {"from": "gpt", "value": "```sql\nSELECT T1.id FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.dock_count = 15 AND T1.duration = ( SELECT MIN(T1.duration) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.dock_count = 15 )\n```"}]}, {"id": "train-9046", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which year had the most number of trips that started at stations in San Francisco?"}, {"from": "gpt", "value": "```sql\nSELECT SUBSTR(CAST(T1.start_date AS TEXT), INSTR(T1.start_date, ' '), -4) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'San Francisco' GROUP BY T1.start_station_name ORDER BY COUNT(T1.id) DESC LIMIT 1\n```"}]}, {"id": "train-9047", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of trips that started in San Jose and durations were longer than 800 seconds?"}, {"from": "gpt", "value": "```sql\nSELECT 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'\n```"}]}, {"id": "train-9048", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many trips in 2013 had durations longer than 1000 seconds?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(duration) FROM trip WHERE start_date LIKE '%/%/2013%' AND duration > 1000\n```"}]}, {"id": "train-9049", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate the average duration of trips started at South Van Ness at Market in 2015."}, {"from": "gpt", "value": "```sql\nSELECT AVG(duration) FROM trip WHERE start_date LIKE '%2015%' AND start_station_name = 'South Van Ness at Market'\n```"}]}, {"id": "train-9050", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many trips which start station and end station are the same?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(start_station_id = end_station_id, 1, 0)) FROM trip\n```"}]}, {"id": "train-9051", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list trips id started on the hottest day."}, {"from": "gpt", "value": "```sql\nSELECT T1.id FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code ORDER BY T2.max_temperature_f DESC LIMIT 1\n```"}]}, {"id": "train-9052", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which were the trips that started at Mountain View City Hall and ended on a rainy day?"}, {"from": "gpt", "value": "```sql\nSELECT T1.id FROM trip AS T1 INNER JOIN weather AS T2 WHERE T2.events = 'Rain' AND T1.start_station_name = 'Mountain View City Hall'\n```"}]}, {"id": "train-9053", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average duration of trips that ended on a foggy day?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.duration) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.events = 'Fog'\n```"}]}, {"id": "train-9054", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was duration of the longest trip started on the day that has a maximum wind speed of 30 mph?"}, {"from": "gpt", "value": "```sql\nSELECT T1.duration FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.max_wind_Speed_mph = 30 ORDER BY T1.duration DESC LIMIT 1\n```"}]}, {"id": "train-9055", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please calculate the average temperature of those trips that started at Market at 4th in 2013."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.mean_temperature_f) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE SUBSTR(CAST(T2.date AS TEXT), -4) = '2013' AND T1.start_station_name = 'Market at 4th'\n```"}]}, {"id": "train-9056", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What was the mean humidity of a trip with id 4275?"}, {"from": "gpt", "value": "```sql\nSELECT T2.mean_humidity FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.id = 4275\n```"}]}, {"id": "train-9057", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2015, what percentage of trips that had the subscription type was Customer and ended on a rainy day?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T2.events = 'Rain' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.id) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE SUBSTR(CAST(T2.date AS TEXT), -4) = '2015' AND T1.subscription_type = 'Customer'\n```"}]}, {"id": "train-9058", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many bike stations are installed after August, 2013 in San Jose?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(installation_date) FROM station WHERE city = 'San Jose' AND (SUBSTR(CAST(installation_date AS TEXT), 1, INSTR(installation_date, '/') - 1) IN ('8', '9', '10', '11', '12') AND SUBSTR(CAST(installation_date AS TEXT), -4) = '2013') OR SUBSTR(CAST(installation_date AS TEXT), -4) > '2013'\n```"}]}, {"id": "train-9059", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the mean temperature in Fahrenheit on 8/29/2013 for the area where the zip code is 94107?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(zip_code = 94107 AND date = '8/29/2013', mean_temperature_f, 0)) FROM weather\n```"}]}, {"id": "train-9060", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference between the hottest temperature and the coldest temperature in in Fahrenheit on 8/29/2013 for the area where the zip code is 94107?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(zip_code = 94107 AND date = '8/29/2013', max_temperature_f - min_temperature_f, 0)) FROM weather\n```"}]}, {"id": "train-9061", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many bikes can be borrowed in San Jose Diridon Caltrain Station at 12:06:01 on 2013/8/29?"}, {"from": "gpt", "value": "```sql\nSELECT T2.bikes_available FROM station AS T1 INNER JOIN status AS T2 ON T1.id = T2.station_id WHERE T1.name = 'San Jose Diridon Caltrain Station' AND T2.time = '2013/08/29 12:06:01'\n```"}]}, {"id": "train-9062", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which city's station is a bike borrowed on trip ID4069?"}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.id = 4069\n```"}]}, {"id": "train-9063", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many bike trips started on the days in September, 2013 with the hottest temperature over 70 degrees Fahrenheit in the area where the zip code is 94107?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '9/%/2013' AND T2.zip_code = 94107 AND T2.max_temperature_f > 70\n```"}]}, {"id": "train-9064", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.start_station_name FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE SUBSTR(CAST(T2.date AS TEXT), -4) = '2013' AND T2.zip_code = 94107 AND T2.max_temperature_f > 80\n```"}]}, {"id": "train-9065", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many trips made by a subscriber started in August, 2013 from a station that can hold more than 20 bikes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.id) FROM station AS T1 INNER JOIN trip AS T2 ON T1.id = T2.start_station_id WHERE T2.subscription_type = 'Subscriber' AND T2.start_date LIKE '8/%/2013%' AND T1.dock_count > 20\n```"}]}, {"id": "train-9066", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the location coordinates of the bike station from which the bike for the trip that last the longest was borrowed?"}, {"from": "gpt", "value": "```sql\nSELECT T2.lat, T2.long FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.duration = ( SELECT MAX(T1.duration) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name )\n```"}]}, {"id": "train-9067", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many docks were left at the end station for trip ID4069?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.docks_available) FROM trip AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.end_station_id WHERE T1.ID = 4069\n```"}]}, {"id": "train-9068", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.start_station_name) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '%2013%' AND T2.events = 'Fog' AND T1.start_station_name = '2nd at Townsend' AND T2.zip_code = 94107\n```"}]}, {"id": "train-9069", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the longest duration for a bike trip starting on a day with a fog in 2013?"}, {"from": "gpt", "value": "```sql\nSELECT MAX(T1.duration) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '%2013%' AND T2.events = 'Fog' AND T2.zip_code = 94107\n```"}]}, {"id": "train-9070", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: When was the bike station from which the bike was borrowed on trip ID4069 installed?"}, {"from": "gpt", "value": "```sql\nSELECT T2.installation_date FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.id = 4069\n```"}]}, {"id": "train-9071", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many trips with a bike borrowed from the stations in San Francisco were made by a subscriber?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id) FROM trip AS T1 INNER JOIN station AS T2 ON T2.ID = T1.start_station_id WHERE T2.city = 'San Francisco' AND T1.subscription_type = 'Subscriber'\n```"}]}, {"id": "train-9072", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On the day with the hottest temperature ever in 2014, how many bike trips started from the station 2nd at Folsom?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.start_station_name) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '%2014%' AND T2.zip_code = 94107 AND T1.start_station_name = '2nd at Folsom' ORDER BY T2.max_temperature_f DESC LIMIT 1\n```"}]}, {"id": "train-9073", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average duration of a bike trip made on the day with the hottest temperature ever in 2014?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.duration) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '%2014%' AND T1.start_station_name = '2nd at Folsom' AND T2.max_temperature_f = ( SELECT max_temperature_f FROM weather ORDER BY max_temperature_f DESC LIMIT 1 )\n```"}]}, {"id": "train-9074", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out all end stations for a bicycle that were making a trip starting from 2nd at South Park station? Only retain the unique value."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT end_station_name FROM trip WHERE start_station_name = '2nd at South Park'\n```"}]}, {"id": "train-9075", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many rainy days were recorded in Mountain View?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(zip_code = 94041 AND events = 'Rain', 1, 0)) FROM weather\n```"}]}, {"id": "train-9076", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total number of bikes that can be hold in Redwood City before 2014."}, {"from": "gpt", "value": "```sql\nSELECT SUM(CASE WHEN city = 'Redwood City' AND SUBSTR(installation_date, -4) < '2014' THEN dock_count ELSE 0 END) NUM FROM station\n```"}]}, {"id": "train-9077", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the longest trip duration according? Convert the it to number of days."}, {"from": "gpt", "value": "```sql\nSELECT MAX(duration), CAST(MAX(duration) AS REAL) / 86400 FROM trip\n```"}]}, {"id": "train-9078", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Convert all temperature recorded at San Francisco city during August 2013 into degree Celsius."}, {"from": "gpt", "value": "```sql\nSELECT (max_temperature_f - 32) / 1.8000 , (mean_temperature_f - 32) / 1.8000 , (min_temperature_f - 32) / 1.8000 FROM weather WHERE SUBSTR(CAST(date AS TEXT), 1, INSTR(date, '/') - 1) = '8' AND SUBSTR(CAST(date AS TEXT), -4) = '2013' AND zip_code = 94107\n```"}]}, {"id": "train-9079", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio for subscriber to customer given that the starting and the ending stations is 2nd at South Park?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(subscription_type = 'Subscriber', 1, 0)) AS REAL) / SUM(IIF(subscription_type = 'Customer', 1, 0)) FROM trip WHERE start_station_name = '2nd at South Park' AND end_station_name = '2nd at South Park'\n```"}]}, {"id": "train-9080", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Are all stations with zip code 94107 located in San Francisco city?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.city FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.zip_code = 94107\n```"}]}, {"id": "train-9081", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List out all stations name that having a mean temperature 20 degree Celsius in year 2014."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.start_station_name, T2.end_station_name FROM weather AS T1 INNER JOIN trip AS T2 ON T1.zip_code = T2.zip_code WHERE T1.date LIKE '%2014' AND T1.mean_temperature_f = 20 * 1.8 + 32\n```"}]}, {"id": "train-9082", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many bicycle trip were made within San Jose city during August 2013?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.id) FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name WHERE T1.city = 'San Jose' AND T2.start_date LIKE '8/%/2013%' AND T2.start_station_name LIKE 'San Jose%' AND T2.end_station_name LIKE 'San Jose%'\n```"}]}, {"id": "train-9083", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Is there any intercity trip were made during 2014? If yes, list out the city name for the start and end station."}, {"from": "gpt", "value": "```sql\nSELECT T1.start_station_name, T1.end_station_name FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.start_date LIKE '%/%/2014%' AND T1.start_station_name != T1.end_station_name\n```"}]}, {"id": "train-9084", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Does the bike with Id number 16 making any intercity trip? If yes, calculate the total travel duration during all the intercity trip. Convert the duration to hour."}, {"from": "gpt", "value": "```sql\nSELECT T1.end_station_name, T2.city, CAST(SUM(T1.duration) AS REAL) / 3600 FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.bike_id = 16 AND T1.start_station_name != T1.end_station_name\n```"}]}, {"id": "train-9085", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the ratio of customer to subscriber that making a trip inside Mountain View city?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.subscription_type = 'Customer' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T1.subscription_type = 'Subscriber' THEN 1 ELSE 0 END) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'Mountain View'\n```"}]}, {"id": "train-9086", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total trip duration made within Palo Alto city? Convert the duration to hour."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(T1.duration) AS REAL) / 3600 FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'Palo Alto'\n```"}]}, {"id": "train-9087", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which bicycle is the least used bike. Check if the start and end station are from the same city and calculate the total duration travelled by the bicycle in hours for a trip made within the same city."}, {"from": "gpt", "value": "```sql\nSELECT T2.bike_id, T2.start_station_name, T2.end_station_name, T1.city , CAST(T2.duration AS REAL) / 3600 FROM station AS T1 INNER JOIN trip AS T2 ON T1.name = T2.start_station_name GROUP BY T2.bike_id ORDER BY COUNT(T2.id) DESC LIMIT 1\n```"}]}, {"id": "train-9088", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Count the number of subscribers who started their trips in Market at 4th."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(CASE WHEN subscription_type = 'Subscriber' AND start_station_name = 'Market at 4th' THEN id END) FROM trip\n```"}]}, {"id": "train-9089", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the stations within Mountain View that were installed on 12/31/2013."}, {"from": "gpt", "value": "```sql\nSELECT name FROM station WHERE installation_date = '12/31/2013' AND city = 'Mountain View'\n```"}]}, {"id": "train-9090", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city is Townsend at 7th Station located and how many bikes could it hold?"}, {"from": "gpt", "value": "```sql\nSELECT city, SUM(dock_count) FROM station WHERE name = 'Townsend at 7th'\n```"}]}, {"id": "train-9091", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many bikes could Evelyn Park and Ride hold and how many users who started on that station are subscribers?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.dock_count), COUNT(T1.subscription_type) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.name = 'Evelyn Park and Ride' AND T1.start_station_name = T2.name AND T1.subscription_type = 'Subscriber'\n```"}]}, {"id": "train-9092", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many subscribers are in the zip code of 94301 and what is the hottest temperature recorded on that zip code?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.zip_code), T3.max_temperature_f FROM trip AS T2 INNER JOIN weather AS T3 ON T3.zip_code = T2.zip_code WHERE T3.zip_code = 94301 AND T2.subscription_type = 'Subscriber' ORDER BY T3.max_temperature_f DESC LIMIT 1\n```"}]}, {"id": "train-9093", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage ration of customers to subscribers that started their trips within the city of San Francisco?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN T1.subscription_type = 'Customer' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T1.subscription_type = 'Subscriber' THEN 1 ELSE 0 END) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'San Francisco'\n```"}]}, {"id": "train-9094", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.duration), T2.lat, T2.long FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name LEFT JOIN station AS T3 ON T3.name = T1.end_station_name WHERE T1.start_station_name = 'Santa Clara at Almaden'\n```"}]}, {"id": "train-9095", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the shortest trip made starting from Franklin at Maple and what is the maximum wind speed at that date?"}, {"from": "gpt", "value": "```sql\nSELECT MIN(T1.duration), MAX(T2.max_wind_Speed_mph) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.start_station_name = 'Franklin at Maple' AND T2.date = '9/4/2013'\n```"}]}, {"id": "train-9096", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many bikes have been borrowed at San Jose Diridon Caltrain Station on the date and time of 10/20/2013 8:11:01 AM and indicate the station's coordinates."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.bikes_available), T1.long, T1.lat FROM station AS T1 INNER JOIN status AS T2 ON T2.station_id = T1.id WHERE T2.time = '2013/10/20 8:11:01' AND T1.name = 'San Jose Diridon Caltrain Station'\n```"}]}, {"id": "train-9097", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the city of the station that trip ID 585842 borrowed a bike and indicate when that station was first installed."}, {"from": "gpt", "value": "```sql\nSELECT T2.city, T2.installation_date FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.id = 585842\n```"}]}, {"id": "train-9098", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many stations were installed on the date of 8/16/2013 and how many users on those stations are classified as a customer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.name) , SUM(CASE WHEN T2.subscription_type = 'Customer' THEN 1 ELSE 0 END) FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name WHERE T1.installation_date = '8/16/2013' AND T2.subscription_type = 'Customer'\n```"}]}, {"id": "train-9099", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which station did the user who started at Market at 4th station ended their trip at the time of 12:45:00 PM and the date of 8/29/2013 and what is the location coordinates of the ending station?"}, {"from": "gpt", "value": "```sql\nSELECT T1.name, T1.lat, T1.long FROM station AS T1 INNER JOIN trip AS T2 ON T2.end_station_name = T1.name WHERE T2.start_station_name = 'Market at 4th' AND T2.end_date = '8/29/2013 12:45'\n```"}]}, {"id": "train-9100", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many subscribers have ended their trip at MLK Library and how many docks does that station have?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.id), T2.dock_count FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.end_station_name = 'MLK Library' AND T1.subscription_type = 'Subscriber' AND T2.dock_count = 19\n```"}]}, {"id": "train-9101", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average coldest temperature for the zip code of 94301 and what stations are within the zip code? Include the latitude and longitude as well."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.min_temperature_f), T1.long, T1.lat FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name INNER JOIN weather AS T3 ON T3.zip_code = T2.zip_code WHERE T3.zip_code = 94301\n```"}]}, {"id": "train-9102", "db_id": "bike_share_1", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average duration travelled by subscribers that both started and ended their trip in Mountain View City Hall and indicate the date when the station was first installed."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.duration), T2.installation_date FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.start_station_name = 'Mountain View City Hall' AND T1.subscription_type = 'Subscriber' AND T1.end_station_name = 'Mountain View City Hall'\n```"}]}, {"id": "train-9103", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description of the film ACADEMY DINOSAUR?"}, {"from": "gpt", "value": "```sql\nSELECT description FROM film WHERE title = 'ACADEMY DINOSAUR'\n```"}]}, {"id": "train-9104", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films have a rental duration of over 6 days?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(film_id) FROM film WHERE rental_duration > 6\n```"}]}, {"id": "train-9105", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of the films that are released in 2006 and have a rental rate of $2.99."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE release_year = 2006 AND rental_rate = 2.99\n```"}]}, {"id": "train-9106", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which film has the longest duration of film screening? Please give its title."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film ORDER BY length DESC LIMIT 1\n```"}]}, {"id": "train-9107", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which film has a higher replacement cost, ACE GOLDFINGER or ACADEMY DINOSAUR?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE title IN ('ACE GOLDFINGER', 'ACADEMY DINOSAUR') ORDER BY replacement_cost DESC LIMIT 1\n```"}]}, {"id": "train-9108", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the films that are released in 2006, how many of them are rated Adults Only in the Motion Picture Association Film Rating?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(film_id) FROM film WHERE rating = 'NC-17' AND release_year = 2006\n```"}]}, {"id": "train-9109", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films with the rental rate of $2.99 have the special feature of \"Deleted Scenes\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(film_id) FROM film WHERE rental_rate = 2.99 AND special_features = 'Deleted Scenes'\n```"}]}, {"id": "train-9110", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the films that have more than 2 special features."}, {"from": "gpt", "value": "```sql\nSELECT title FROM ( SELECT title, COUNT(special_features) AS num FROM film GROUP BY title ) AS T ORDER BY T.num > 2\n```"}]}, {"id": "train-9111", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the email address of the staff Jon Stephens?"}, {"from": "gpt", "value": "```sql\nSELECT email FROM staff WHERE first_name = 'Jon' AND last_name = 'Stephens'\n```"}]}, {"id": "train-9112", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the full names of all the active staff."}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM staff WHERE active = 1\n```"}]}, {"id": "train-9113", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which year was the film with the highest replacement cost released?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT release_year FROM film WHERE replacement_cost = ( SELECT MAX(replacement_cost) FROM film )\n```"}]}, {"id": "train-9114", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of the top 3 films with the highest replacement cost."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE replacement_cost = ( SELECT MAX(replacement_cost) FROM film ) LIMIT 3\n```"}]}, {"id": "train-9115", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the language of the film ACADEMY DINOSAUR?"}, {"from": "gpt", "value": "```sql\nSELECT T2.name FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'ACADEMY DINOSAUR'\n```"}]}, {"id": "train-9116", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films are in English?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.name = 'English'\n```"}]}, {"id": "train-9117", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the films starring the actor PENELOPE GUINESS."}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM film_actor AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T1.actor_id = T3.actor_id WHERE T3.first_name = 'PENELOPE' AND T3.last_name = 'GUINESS'\n```"}]}, {"id": "train-9118", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many actors have starred in the film ACADEMY DINOSAUR?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.actor_id) FROM film_actor AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id WHERE T2.title = 'ACADEMY DINOSAUR'\n```"}]}, {"id": "train-9119", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of all the actors that have starred in the film ACADEMY DINOSAUR."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'ACADEMY DINOSAUR'\n```"}]}, {"id": "train-9120", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the films starring PENELOPE GUINESS, how many of them are released in 2006?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.film_id) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.release_year = 2006 AND T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS'\n```"}]}, {"id": "train-9121", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the title of the film starring PENELOPE GUINESS and has the highest replacement cost."}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS' ORDER BY T3.replacement_cost DESC LIMIT 1\n```"}]}, {"id": "train-9122", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of all the actors that have starred in the film with the highest replacement cost."}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id ORDER BY T3.replacement_cost DESC LIMIT 1\n```"}]}, {"id": "train-9123", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the films starring PENELOPE GUINESS, how many of them are in English?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.film_id) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id INNER JOIN language AS T4 ON T3.language_id = T4.language_id WHERE T4.name = 'English' AND T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS'\n```"}]}, {"id": "train-9124", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the film with the longest duration time and stars PENELOPE GUINESS?"}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS' ORDER BY T3.length DESC LIMIT 1\n```"}]}, {"id": "train-9125", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the films in the category of \"Horror\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Horror'\n```"}]}, {"id": "train-9126", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films are there under the category of \"Horror\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id WHERE T2.name = 'Horror'\n```"}]}, {"id": "train-9127", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the films under the category of \"Horror\" and has a rental rate of $2.99."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Horror' AND T1.rental_rate = 2.99\n```"}]}, {"id": "train-9128", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how many times has the customer RUTH MARTINEZ rented a film?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.rental_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ'\n```"}]}, {"id": "train-9129", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of all the films that the customer RUTH MARTINEZ has rented."}, {"from": "gpt", "value": "```sql\nSELECT T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ'\n```"}]}, {"id": "train-9130", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the films that the customer RUTH MARTINEZ has rented, how many of them are released in 2006?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T4.release_year = 2006 AND T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ'\n```"}]}, {"id": "train-9131", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the films that the customer RUTH MARTINEZ has rented, what is the title of the one with the highest replacement cost?"}, {"from": "gpt", "value": "```sql\nSELECT T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ' ORDER BY T4.replacement_cost DESC LIMIT 1\n```"}]}, {"id": "train-9132", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of all the customers who have rented the film with the highest replacement cost."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id ORDER BY T4.replacement_cost DESC LIMIT 1\n```"}]}, {"id": "train-9133", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films rented to the customer RUTH MARTINEZ were returned in August, 2005?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ' AND STRFTIME('%m',T2.return_date) = '8' AND STRFTIME('%Y', T2.return_date) = '2005'\n```"}]}, {"id": "train-9134", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the full name of the customer that have rented the most films."}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, COUNT(T2.rental_id) AS num FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9135", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers who have rented the film ACADEMY DINOSAUR, how many of them are active?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.active = 1 AND T4.title = 'ACADEMY DINOSAUR'\n```"}]}, {"id": "train-9136", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which film is rented for the most times by the customers? Please give its title."}, {"from": "gpt", "value": "```sql\nSELECT T.title FROM ( SELECT T1.title, COUNT(T3.rental_id) AS num FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T1.title ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9137", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which customer has rented more movies, RUTH MARTINEZ or LINDA WILLIAMS?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, COUNT(T1.customer_id) AS num FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE (T1.first_name = 'RUTH' AND T1.last_name = 'MARTINEZ') OR (T1.first_name = 'LINDA' AND T1.last_name = 'WILLIAMS') GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9138", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the films starring PENELOPE GUINESS, what is the title of the one with the highest rental price per day?"}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS' ORDER BY T3.rental_rate / T3.rental_duration DESC LIMIT 1\n```"}]}, {"id": "train-9139", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average replacement cost of the films under the category of \"Horror\"?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.replacement_cost) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.name = 'Horror'\n```"}]}, {"id": "train-9140", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all films that the customer RUTH MARTINEZ has rented, what is the percentage of it being a Music film?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T3.name = 'Music', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id INNER JOIN inventory AS T4 ON T1.film_id = T4.film_id INNER JOIN customer AS T5 ON T4.store_id = T5.store_id INNER JOIN rental AS T6 ON T4.inventory_id = T6.inventory_id WHERE T5.first_name = 'RUTH' AND T5.last_name = 'MARTINEZ'\n```"}]}, {"id": "train-9141", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average duration time of the films starring PENELOPE GUINESS?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.length) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'PENELOPE' AND T1.last_name = 'GUINESS'\n```"}]}, {"id": "train-9142", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is Diane Collins' email address?"}, {"from": "gpt", "value": "```sql\nSELECT email FROM customer WHERE first_name = 'DIANE' AND last_name = 'COLLINS'\n```"}]}, {"id": "train-9143", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of inactive customers."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(customer_id) FROM customer WHERE active = 0\n```"}]}, {"id": "train-9144", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the owner of email address \"JEREMY.HURTADO@sakilacustomer.org\"? Give the full name."}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM customer WHERE email = 'JEREMY.HURTADO@sakilacustomer.org'\n```"}]}, {"id": "train-9145", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the postal code for the address No.65."}, {"from": "gpt", "value": "```sql\nSELECT postal_code FROM address WHERE address_id = 65\n```"}]}, {"id": "train-9146", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of addresses in the Nordrhein-Westfalen district."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(address_id) FROM address WHERE district = 'Nordrhein-Westfalen'\n```"}]}, {"id": "train-9147", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the phone number of address No.72?"}, {"from": "gpt", "value": "```sql\nSELECT phone FROM address WHERE address_id = '72'\n```"}]}, {"id": "train-9148", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the number of films that are 178 minutes long."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(film_id) FROM film WHERE length = '178'\n```"}]}, {"id": "train-9149", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell the special features of the film Uprising Uptown."}, {"from": "gpt", "value": "```sql\nSELECT special_features FROM film WHERE title = 'UPRISING UPTOWN'\n```"}]}, {"id": "train-9150", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description of the film Artist Coldblooded?"}, {"from": "gpt", "value": "```sql\nSELECT description FROM film WHERE title = 'ARTIST COLDBLOODED'\n```"}]}, {"id": "train-9151", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the detailed address for store No.2."}, {"from": "gpt", "value": "```sql\nSELECT T1.address, T1.address2, T1.district FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id WHERE T2.store_id = 2\n```"}]}, {"id": "train-9152", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which continent is the mother country of Clarksville city in?"}, {"from": "gpt", "value": "```sql\nSELECT T1.country FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id WHERE T2.city = 'Clarksville'\n```"}]}, {"id": "train-9153", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many actors played a role in the 2006 film whose rental duration is 7 days, rental rate is 4.99 and is 98 minutes duration?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.actor_id) FROM film_actor AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id WHERE T2.release_year = 2006 AND T2.rental_duration = 7 AND T2.rental_duration = 4.99 AND T2.length = 98\n```"}]}, {"id": "train-9154", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: The actor Dan Harris played in a 77 minute film with replacement cost of 9.99, what was the rating for that film?"}, {"from": "gpt", "value": "```sql\nSELECT T3.rating FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'DAN' AND T1.last_name = 'HARRIS' AND T3.length = 77 AND T3.replacement_cost = '9.99'\n```"}]}, {"id": "train-9155", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films did actor Daryl Wahlberg appear in?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id WHERE T2.first_name = 'DARYL' AND T2.last_name = 'WAHLBERG'\n```"}]}, {"id": "train-9157", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the manager staff for store No.1."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM staff AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id WHERE T2.store_id = 1\n```"}]}, {"id": "train-9158", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the address location of store No.1."}, {"from": "gpt", "value": "```sql\nSELECT T1.address, T1.address2, T1.district FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id WHERE T2.store_id = 1\n```"}]}, {"id": "train-9159", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where does the staff Jon Stephens live?"}, {"from": "gpt", "value": "```sql\nSELECT T1.address, T1.address2 FROM address AS T1 INNER JOIN staff AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'Jon' AND T2.last_name = 'Stephens'\n```"}]}, {"id": "train-9160", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many addresses are there in Woodridge city?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.address_id) FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city = 'Woodridge'\n```"}]}, {"id": "train-9161", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films are in English?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.name = 'English'\n```"}]}, {"id": "train-9162", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the address location of Heather Morris."}, {"from": "gpt", "value": "```sql\nSELECT T1.address FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'HEATHER' AND T2.last_name = 'MORRIS'\n```"}]}, {"id": "train-9163", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the email address of the person who lives in \"1411 Lillydale Drive\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.email FROM address AS T1 INNER JOIN staff AS T2 ON T1.address_id = T2.address_id WHERE T1.address = '1411 Lillydale Drive'\n```"}]}, {"id": "train-9165", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which category does the film Working Microcosmos belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.title = 'WORKING MICROCOSMOS'\n```"}]}, {"id": "train-9166", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the number of documentary films."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id WHERE T2.name = 'Documentary'\n```"}]}, {"id": "train-9167", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: State the name of the category which has the most number of films."}, {"from": "gpt", "value": "```sql\nSELECT T.name FROM ( SELECT T2.name, COUNT(T1.film_id) AS num FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T2.name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9168", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the name of the film for inventory No.3479."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.inventory_id = 3479\n```"}]}, {"id": "train-9169", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage more for the rental payment for store No.2 than store No.1?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(IIF(T2.store_id = 2, T1.amount, 0)) - SUM(IIF(T2.store_id = 1, T1.amount, 0))) AS REAL) * 100 / SUM(IIF(T2.store_id = 1, T1.amount, 0)) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN store AS T3 ON T2.store_id = T3.store_id\n```"}]}, {"id": "train-9170", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times is the number of Indian cities than Italian cities?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.country = 'India', 1, 0)) AS REAL) / SUM(IIF(T1.country = 'Italy', 1, 0)) FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id\n```"}]}, {"id": "train-9171", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times is the number of films Gina DeGeneres acted in than Penelope Guinness?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.first_name = 'GINA' AND T2.last_name = 'DEGENERES', 1, 0)) AS REAL) * 100 / SUM(IIF(T2.first_name = 'PENELOPE' AND T2.last_name = 'GUINESS', 1, 0)) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id\n```"}]}, {"id": "train-9172", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In 2006, how many restricted films were released?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(film_id) FROM film WHERE rating = 'R' AND release_year = 2006\n```"}]}, {"id": "train-9173", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many actors starred in the film id 508?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(actor_id) FROM film_actor WHERE film_id = 508\n```"}]}, {"id": "train-9174", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the special features for the film \"Smoochy Control\"?"}, {"from": "gpt", "value": "```sql\nSELECT special_features FROM film WHERE title = 'SMOOCHY CONTROL'\n```"}]}, {"id": "train-9175", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers paid over the amount of 10 on August 2005?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(customer_id) FROM payment WHERE SUBSTR(payment_date, 1, 7) LIKE '2005-08'\n```"}]}, {"id": "train-9176", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the films that are more than 180 minutes long."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE length > 180\n```"}]}, {"id": "train-9177", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much is the total rental payment for the first 10 rentals?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(amount) FROM payment WHERE rental_id BETWEEN 1 AND 10\n```"}]}, {"id": "train-9178", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the full names of all the active employees?"}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM staff WHERE active = 1\n```"}]}, {"id": "train-9179", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the staff manager in store id 2?"}, {"from": "gpt", "value": "```sql\nSELECT manager_staff_id FROM store WHERE store_id = 2\n```"}]}, {"id": "train-9180", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many rentals were returned on 5/27/2005?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(rental_id) FROM rental WHERE rental_date = '2005-05-27'\n```"}]}, {"id": "train-9182", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the name of the films that can only be found in store id 2."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.store_id = 2\n```"}]}, {"id": "train-9183", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the customer who rented movies for 7 consecutive days?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN ( SELECT customer_id, COUNT(*) AS num_days FROM ( SELECT *, date(days, '-' || rn || ' day') AS results FROM ( SELECT customer_id, days, row_number() OVER (PARTITION BY customer_id ORDER BY days) AS rn FROM ( SELECT DISTINCT customer_id, date(rental_date) AS days FROM rental ) ) ) GROUP BY customer_id, results HAVING num_days = 7 ) AS T2 ON T1.customer_id = T2.customer_id\n```"}]}, {"id": "train-9184", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films are categorized as horror?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id WHERE T2.name = 'Horror'\n```"}]}, {"id": "train-9185", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the most rented movie?"}, {"from": "gpt", "value": "```sql\nSELECT T.title FROM ( SELECT T1.title, COUNT(T3.rental_id) AS num FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id GROUP BY T1.title ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9187", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the actor who starred in most movies?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, COUNT(T1.film_id) AS num FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9188", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the films with a rental duration of 7 days, how many are comedies?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.rental_duration = 7 AND T3.name = 'Comedy'\n```"}]}, {"id": "train-9189", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the staff manager of the store with the most non-active customers?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T3.first_name, T3.last_name, COUNT(T1.customer_id) AS num FROM customer AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id INNER JOIN staff AS T3 ON T2.store_id = T3.store_id WHERE T1.active = 0 GROUP BY T3.first_name, T3.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9190", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the rental price per day of the most expensive children's film?"}, {"from": "gpt", "value": "```sql\nSELECT T1.rental_rate FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Children' ORDER BY T1.rental_rate / T1.rental_duration DESC LIMIT 1\n```"}]}, {"id": "train-9191", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the complete address of store id 1?"}, {"from": "gpt", "value": "```sql\nSELECT T3.address, T3.address2, T3.district FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id INNER JOIN address AS T3 ON T2.city_id = T3.city_id INNER JOIN store AS T4 ON T3.address_id = T4.address_id WHERE T4.store_id = 1\n```"}]}, {"id": "train-9192", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are from the city of Lethbridge?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.customer_id) FROM city AS T1 INNER JOIN address AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id WHERE T1.city = 'Lethbridge'\n```"}]}, {"id": "train-9193", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many cities are there in the United States?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.city) FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id WHERE T1.country = 'United States'\n```"}]}, {"id": "train-9194", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the names of the customers from India."}, {"from": "gpt", "value": "```sql\nSELECT T4.first_name, T4.last_name FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id INNER JOIN address AS T3 ON T2.city_id = T3.city_id INNER JOIN customer AS T4 ON T3.address_id = T4.address_id WHERE T1.country = 'India'\n```"}]}, {"id": "train-9195", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the classic movies, how many movies have a rental rate of less than 1?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.rental_rate < 1 AND T2.name = 'Classics'\n```"}]}, {"id": "train-9196", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the customer who rented the highest number of movies of all time?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, COUNT(T1.rental_id) AS num FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9197", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times was \"Blanket Beverly\" rented?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.rental_id) FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id WHERE T1.title = 'Blanket Beverly'\n```"}]}, {"id": "train-9198", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the actor who has the highest number of restricted films?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, COUNT(T2.film_id) AS num FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.rating = 'R' GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9199", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the top 5 actors with the highest number of films? List their full names and calculate the average number of films for each of the actors."}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name, num FROM ( SELECT T1.first_name, T1.last_name, COUNT(T2.film_id) AS num FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 5\n```"}]}, {"id": "train-9200", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the actors' IDs who have \"KILMER\" as last name."}, {"from": "gpt", "value": "```sql\nSELECT actor_id FROM actor WHERE last_name = 'KILMER'\n```"}]}, {"id": "train-9202", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the films with the longest duration, list any five title with their descriptions and special features."}, {"from": "gpt", "value": "```sql\nSELECT title, description, special_features FROM film WHERE length = ( SELECT MAX(length) FROM film ) LIMIT 5\n```"}]}, {"id": "train-9203", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films rented on 26th May, 2005 were returned on 30th May, 2005?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT rental_id) FROM rental WHERE date(rental_date) BETWEEN '2005-05-26' AND '2005-05-30'\n```"}]}, {"id": "train-9204", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average payment amount per customer."}, {"from": "gpt", "value": "```sql\nSELECT AVG(amount) FROM payment GROUP BY customer_id\n```"}]}, {"id": "train-9205", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name and email of the staff in store ID 2?"}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name, email FROM staff WHERE store_id = 2\n```"}]}, {"id": "train-9206", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many percent of customers were inactive?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(active = 0, 1, 0)) AS REAL) * 100 / COUNT(customer_id) FROM customer\n```"}]}, {"id": "train-9207", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the description and film title of ID 996?"}, {"from": "gpt", "value": "```sql\nSELECT description, title FROM film_text WHERE film_id = 996\n```"}]}, {"id": "train-9208", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate customers' total payment amount in August, 2005."}, {"from": "gpt", "value": "```sql\nSELECT SUM(amount) FROM payment WHERE SUBSTR(payment_date, 1, 7) = '2005-08'\n```"}]}, {"id": "train-9210", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the actors' full names who performed in \"CHOCOLATE DUCK\" film."}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name FROM film_actor AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T1.actor_id = T3.actor_id WHERE T2.title = 'CHOCOLATE DUCK'\n```"}]}, {"id": "train-9211", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films in the horror category were included in PG-13-rated?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Horror' AND T1.rating = 'PG-13'\n```"}]}, {"id": "train-9213", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down any five film names under the documentary category."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Documentary' LIMIT 5\n```"}]}, {"id": "train-9214", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Mention the language of Untouchables Sunrise film and calculate its rental cost per day."}, {"from": "gpt", "value": "```sql\nSELECT T2.name, T1.replacement_cost / T1.rental_duration AS cost FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'UNTOUCHABLES SUNRISE'\n```"}]}, {"id": "train-9215", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the films' titles which were rented on 24th May,2005."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id WHERE SUBSTR(T3.rental_date, 1, 10) = '2005-05-24'\n```"}]}, {"id": "train-9217", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Write down the inventories' IDs and actors' names of \"STREETCAR INTENTIONS\"."}, {"from": "gpt", "value": "```sql\nSELECT T4.inventory_id, T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id INNER JOIN inventory AS T4 ON T2.film_id = T4.film_id WHERE T3.title = 'STREETCAR INTENTIONS'\n```"}]}, {"id": "train-9219", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many rental IDs belong to Eleanor Hunt?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.rental_id) FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Eleanor' AND T2.last_name = 'Hunt'\n```"}]}, {"id": "train-9220", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Describe the full names and cities of the customers who rented \"DREAM PICKUP\"."}, {"from": "gpt", "value": "```sql\nSELECT T4.first_name, T4.last_name, T6.city FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN customer AS T4 ON T3.customer_id = T4.customer_id INNER JOIN address AS T5 ON T4.address_id = T5.address_id INNER JOIN city AS T6 ON T5.city_id = T6.city_id WHERE T1.title = 'DREAM PICKUP'\n```"}]}, {"id": "train-9221", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate how many percent of customers were located in India."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T1.country = 'India', 1, 0)) AS REAL) * 100 / COUNT(T4.customer_id) FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id INNER JOIN address AS T3 ON T2.city_id = T3.city_id INNER JOIN customer AS T4 ON T3.address_id = T4.address_id\n```"}]}, {"id": "train-9222", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much percentage of the film did Mary Keitel perform more than Angela Witherspoon?"}, {"from": "gpt", "value": "```sql\nSELECT CAST((SUM(IIF(T1.first_name = 'ANGELA' AND T1.last_name = 'WITHERSPOON', 1, 0)) - SUM(IIF(T1.first_name = 'MARY' AND T1.last_name = 'KEITEL', 1, 0))) AS REAL) * 100 / SUM(IIF(T1.first_name = 'MARY' AND T1.last_name = 'KEITEL', 1, 0)) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id\n```"}]}, {"id": "train-9225", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total payment amount by Diane Collins."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.amount) FROM customer AS T1 INNER JOIN payment AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Diane' AND T1.last_name = 'Collins'\n```"}]}, {"id": "train-9226", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the full names and emails of customers whose payments were greater than 70% of the average."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T2.first_name, T2.last_name, T2.email FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T2.address_id = T3.address_id WHERE T1.amount > ( SELECT AVG(amount) FROM payment ) * 0.7\n```"}]}, {"id": "train-9227", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films have a rental rate of 0.99?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(film_id) FROM film WHERE rental_rate = 0.99\n```"}]}, {"id": "train-9228", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the customers with customer ID of 100 and below, how many of them have Thomas as their last name?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(customer_id) FROM customer WHERE last_name = 'Thomas' AND customer_id < 100\n```"}]}, {"id": "train-9229", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: 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\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.description = 'A Thoughtful Drama of a Composer And a Feminist who must Meet a Secret Agent in The Canadian Rockies'\n```"}]}, {"id": "train-9231", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among films with store ID of 2, list the title of films with the highest rental rate."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.store_id = 2 ORDER BY rental_rate DESC LIMIT 1\n```"}]}, {"id": "train-9234", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In films with a length duration of 113 minutes, how many of the films are starred by Kirk Jovovich?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.actor_id) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.length = 113 AND T1.first_name = 'Kirk' AND T1.last_name = 'Jovovich'\n```"}]}, {"id": "train-9235", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In the film with an inventory ID between 20 to 60, how many of the films have a G rating?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.inventory_id BETWEEN 20 AND 60 AND T1.rating = 'G'\n```"}]}, {"id": "train-9236", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among films with a rental rate of 4.99, what is the total number of films starred by Bob Fawcett?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.actor_id) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.rental_rate = 4.99 AND T1.first_name = 'Bob' AND T1.last_name = 'Fawcett'\n```"}]}, {"id": "train-9238", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the store and inventory ID of the film with the longest duration?"}, {"from": "gpt", "value": "```sql\nSELECT T2.store_id, T2.inventory_id FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id ORDER BY T1.length DESC LIMIT 1\n```"}]}, {"id": "train-9241", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the store ID of the films with a rental rate greater than the 60% of average rental rate of all listed films."}, {"from": "gpt", "value": "```sql\nSELECT T2.store_id FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T1.rental_rate > ( SELECT AVG(T1.rental_rate) * 0.6 FROM film AS T1 )\n```"}]}, {"id": "train-9242", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the films starred by Nick Wahlberg, what is the percentage of the films with G rating?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T3.rating = 'G', 1, 0)) AS REAL) / COUNT(T3.film_id) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'Elvis' AND T1.last_name = 'Marx'\n```"}]}, {"id": "train-9243", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the address in Texas in the ascending order of city id."}, {"from": "gpt", "value": "```sql\nSELECT address FROM address WHERE district = 'Texas' AND city_id = ( SELECT MIN(city_id) FROM address WHERE district = 'Texas' )\n```"}]}, {"id": "train-9244", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find the full name and email address of inactive customers whose record was created in 2006."}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name, email FROM customer WHERE STRFTIME('%Y',create_date) = '2006' AND active = 0\n```"}]}, {"id": "train-9245", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of the movies are PG-13?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(rating = 'PG-13', 1, 0)) AS REAL) * 100 / COUNT(film_id) FROM film\n```"}]}, {"id": "train-9246", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the top ten movies with the most price per day in descending order of price per day."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film ORDER BY rental_rate / rental_duration DESC LIMIT 10\n```"}]}, {"id": "train-9247", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average rent amount paid by the customer with customer id 15."}, {"from": "gpt", "value": "```sql\nSELECT AVG(amount) FROM payment WHERE customer_id = 15\n```"}]}, {"id": "train-9248", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers rented for an above-average period?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(customer_id) FROM rental WHERE return_date - rental_date > ( SELECT AVG(return_date - rental_date) FROM rental )\n```"}]}, {"id": "train-9249", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the movies, what percentage are horror?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.name = 'horror', 1, 0)) AS REAL) * 100 / COUNT(T2.category_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id\n```"}]}, {"id": "train-9250", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name of the actor who acted in the most number of movies?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, COUNT(T1.film_id) AS num FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9251", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name of the actor who acted the most in drama movies?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, COUNT(T2.film_id) AS num FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film_category AS T3 ON T2.film_id = T3.film_id WHERE T3.category_id = 7 GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9252", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference in the average number of films rented each day in Australia and Canada?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(IIF(T4.country = 'Australia', 1, 0)) - AVG(IIF(T4.country = 'Canada', 1, 0)) AS diff FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id INNER JOIN city AS T3 ON T2.city_id = T3.city_id INNER JOIN country AS T4 ON T3.country_id = T4.country_id\n```"}]}, {"id": "train-9253", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Of the movies in which Reese Kilmer acted, what percentage are action movies?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T4.name = 'Action', 1, 0)) AS REAL) * 100 / COUNT(T1.actor_id) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film_category AS T3 ON T2.film_id = T3.film_id INNER JOIN category AS T4 ON T3.category_id = T4.category_id WHERE T1.first_name = 'Reese' AND T1.last_name = 'Kilmer'\n```"}]}, {"id": "train-9254", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the total amount of rent for the movie Clockwork Paradice."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN rental AS T2 ON T1.rental_id = T2.rental_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T4.title = 'CLOCKWORK PARADICE'\n```"}]}, {"id": "train-9255", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find and list the full name of customers who rented more than five types of movies."}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, COUNT(T1.customer_id) AS num FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id INNER JOIN film_category AS T5 ON T4.film_id = T5.film_id GROUP BY T1.first_name, T1.last_name ) AS T WHERE T.num > 5\n```"}]}, {"id": "train-9256", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average number of actors acted in comedy movies?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.actor_id) FROM film_actor AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id INNER JOIN actor AS T4 ON T4.actor_id = T1.actor_id WHERE T3.name = 'comedy'\n```"}]}, {"id": "train-9257", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In children's movies, which was rented the most?"}, {"from": "gpt", "value": "```sql\nSELECT T.title FROM ( SELECT T4.title, COUNT(T4.title) AS num FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id INNER JOIN film_category AS T5 ON T4.film_id = T5.film_id INNER JOIN category AS T6 ON T5.category_id = T6.category_id WHERE T6.name = 'Children' GROUP BY T4.title ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9258", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of customers who paid more than the average rent amount in store 1."}, {"from": "gpt", "value": "```sql\nSELECT CAST(( SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN payment AS T2 ON T1.customer_id = T2.customer_id WHERE T2.amount > ( SELECT AVG(amount) FROM payment ) ) AS REAL) * 100 / ( SELECT COUNT(customer_id) FROM customer )\n```"}]}, {"id": "train-9259", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Find and list the full name of customers who rented more family movies than Sci-Fi movies."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT IIF(SUM(IIF(T5.name = 'Family', 1, 0)) - SUM(IIF(T5.name = 'Sci-Fi', 1, 0)) > 0, T1.first_name, 0) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film_category AS T4 ON T4.film_id = T3.film_id INNER JOIN category AS T5 ON T4.category_id = T5.category_id GROUP BY T1.customer_id\n```"}]}, {"id": "train-9260", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the title of all the films rated as 'Adults Only'."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE rating = 'NC-17'\n```"}]}, {"id": "train-9261", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many actors with the surname Kilmer are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(actor_id) FROM actor WHERE last_name = 'Kilmer'\n```"}]}, {"id": "train-9262", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many movies have a length longer than 100?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(film_id) FROM film WHERE length > 100\n```"}]}, {"id": "train-9263", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many payments were made throughout the month of August 2005?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(amount) FROM payment WHERE payment_date LIKE '2005-08%'\n```"}]}, {"id": "train-9264", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: To which country does the address '1386 Nakhon Sawan Boulevard' belong?"}, {"from": "gpt", "value": "```sql\nSELECT T1.country FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id INNER JOIN address AS T3 ON T2.city_id = T3.city_id WHERE T3.address = '1386 Nakhon Sawan Boulevard'\n```"}]}, {"id": "train-9266", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the title of all the films that are in the Classics category."}, {"from": "gpt", "value": "```sql\nSELECT T2.title FROM film_category AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T1.category_id = T3.category_id WHERE T3.name = 'Classics'\n```"}]}, {"id": "train-9267", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many rentals did Ella Oliver hire in June 2016?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.rental_id) FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'ELLA' AND T2.last_name = 'ELLA' AND date(T1.rental_date) BETWEEN '2005-06-01' AND '2005-06-30'\n```"}]}, {"id": "train-9268", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many different clients have rented materials from Jon Stephens?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.customer_id) FROM rental AS T1 INNER JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Jon' AND T2.last_name = 'Stephens'\n```"}]}, {"id": "train-9269", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total amount paid for rentals made on July 29, 2005?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T2.amount) FROM rental AS T1 INNER JOIN payment AS T2 ON T1.rental_id = T2.rental_id WHERE date(T1.rental_date) = '2005-07-29%'\n```"}]}, {"id": "train-9270", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the first name of the customers whose address is in the postal code that begins with 76?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id WHERE SUBSTR(T2.postal_code, 1, 2) = '76'\n```"}]}, {"id": "train-9271", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: On what date was the rented material for the movie BLOOD ARGONAUTS returned?"}, {"from": "gpt", "value": "```sql\nSELECT T1.rental_date FROM rental AS T1 INNER JOIN inventory AS T2 ON T1.inventory_id = T2.inventory_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'BLOOD ARGONAUTS'\n```"}]}, {"id": "train-9273", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many actors acted in movies in the Music category?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.actor_id) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id INNER JOIN film_category AS T4 ON T3.film_id = T4.film_id INNER JOIN category AS T5 ON T4.category_id = T5.category_id WHERE T5.name = 'Music'\n```"}]}, {"id": "train-9274", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the full name of the actor who has acted the most times in comedy films?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T4.first_name, T4.last_name, COUNT(T2.actor_id) AS num FROM film_category AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T1.category_id = T3.category_id INNER JOIN actor AS T4 ON T2.actor_id = T4.actor_id WHERE T3.name = 'Comedy' GROUP BY T4.first_name, T4.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9275", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers did not rent material at Mike's store?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id INNER JOIN staff AS T3 ON T2.manager_staff_id = T3.staff_id WHERE T3.first_name != 'Mike'\n```"}]}, {"id": "train-9276", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the name of the actors of the films rated as 'Parents Strongly Precautioned' with the highest replacement cost."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.rating = 'PG-13' ORDER BY T3.replacement_cost DESC LIMIT 1\n```"}]}, {"id": "train-9277", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the name of the client who has the largest quantity of rented material without returning it?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name FROM ( SELECT T2.first_name, COUNT(T1.rental_date) AS num FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.first_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9278", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers live in the city of Miyakonojo?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T3.customer_id) FROM city AS T1 INNER JOIN address AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id WHERE T1.city = 'Miyakonojo'\n```"}]}, {"id": "train-9279", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many non-active clients have not returned the rented material?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.customer_id) FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.active = 0\n```"}]}, {"id": "train-9280", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the animated films that have the shortest length?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id ORDER BY T1.length LIMIT 1\n```"}]}, {"id": "train-9281", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In which country is the store where Hector Poinexter rents equipment located?"}, {"from": "gpt", "value": "```sql\nSELECT T5.country FROM customer AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id INNER JOIN address AS T3 ON T2.address_id = T3.address_id INNER JOIN city AS T4 ON T3.city_id = T4.city_id INNER JOIN country AS T5 ON T4.country_id = T5.country_id WHERE T1.first_name = 'HECTOR' AND T1.last_name = 'POINDEXTER'\n```"}]}, {"id": "train-9282", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rental payment in Horror movies?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T5.amount) FROM category AS T1 INNER JOIN film_category AS T2 ON T1.category_id = T2.category_id INNER JOIN inventory AS T3 ON T2.film_id = T3.film_id INNER JOIN rental AS T4 ON T3.inventory_id = T4.inventory_id INNER JOIN payment AS T5 ON T4.rental_id = T5.rental_id WHERE T1.name = 'Horror'\n```"}]}, {"id": "train-9283", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average amount of rent that Christy Vargas paid?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T2.amount) FROM customer AS T1 INNER JOIN payment AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'CHRISTY' AND T1.Last_name = 'VARGAS'\n```"}]}, {"id": "train-9284", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of films with a length of less than 100 belong to the Drama category?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.length < 100 AND T3.name = 'Drama', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T1.category_id = T3.category_id\n```"}]}, {"id": "train-9286", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the address numbers that are located in Gansu district?"}, {"from": "gpt", "value": "```sql\nSELECT address_id FROM address WHERE district = 'Gansu'\n```"}]}, {"id": "train-9287", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list three types of film along with their IDs and the latest update."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT name, category_id, last_update FROM category LIMIT 3\n```"}]}, {"id": "train-9288", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of any three inactive customers."}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM customer WHERE active = 0 LIMIT 3\n```"}]}, {"id": "train-9289", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the rental price per day for Airplane Sierra?"}, {"from": "gpt", "value": "```sql\nSELECT rental_rate / rental_duration AS result FROM film WHERE title = 'AIRPLANE SIERRA'\n```"}]}, {"id": "train-9290", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where is store number 2 located?"}, {"from": "gpt", "value": "```sql\nSELECT T1.address, T1.address2, T1.district FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id WHERE T2.store_id = 2\n```"}]}, {"id": "train-9291", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which city does the address 1623 Kingstown Drive belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM city AS T1 INNER JOIN address AS T2 ON T2.city_id = T1.city_id WHERE T2.address = '1623 Kingstown Drive'\n```"}]}, {"id": "train-9292", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please name three cities that belong to Algeria."}, {"from": "gpt", "value": "```sql\nSELECT T2.city FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id WHERE T1.country = 'Algeria'\n```"}]}, {"id": "train-9293", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the category of the film Agent Truman?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.title = 'AGENT TRUMAN'\n```"}]}, {"id": "train-9294", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the titles of any three action films."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Action' LIMIT 3\n```"}]}, {"id": "train-9295", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the difference between the number of children's films and action films?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T2.name = 'Children', 1, 0)) - SUM(IIF(T2.name = 'Action', 1, 0)) AS diff FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id\n```"}]}, {"id": "train-9297", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the customer that is active and lives at 1795 Santiago de Compostela Way, Texas?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T2.address = '1795 Santiago de Compostela Way' AND T1.active = 1\n```"}]}, {"id": "train-9298", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many English films have a duration of over 50 minutes and the cost of replacement are under 10.99?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.name = 'English' AND T1.length > 50 AND T1.replacement_cost < 10.99\n```"}]}, {"id": "train-9299", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the actors that act in the ACADEMY DINOSAUR film?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'ACADEMY DINOSAUR'\n```"}]}, {"id": "train-9301", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of documentary films?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.name = 'Documentary', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id\n```"}]}, {"id": "train-9302", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films in English are for adults only?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.name = 'English' AND T1.rating = 'NC-17'\n```"}]}, {"id": "train-9303", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which film has the longest duration?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE length = ( SELECT MAX(length) FROM film )\n```"}]}, {"id": "train-9304", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many of the actors are named \"Dan\"?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(actor_id) FROM actor WHERE first_name = 'Dan'\n```"}]}, {"id": "train-9305", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the most common first name among the customers?"}, {"from": "gpt", "value": "```sql\nSELECT first_name FROM customer GROUP BY first_name ORDER BY COUNT(first_name) DESC LIMIT 1\n```"}]}, {"id": "train-9306", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the ratings of the film featuring behind the scenes?"}, {"from": "gpt", "value": "```sql\nSELECT rating FROM film WHERE special_features LIKE '%Behind the Scenes%'\n```"}]}, {"id": "train-9307", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the largest number of films rented per customer?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(rental_id) FROM rental GROUP BY customer_id ORDER BY COUNT(rental_id) DESC LIMIT 1\n```"}]}, {"id": "train-9308", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the films with the word \"Lacklusture\" in their description."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film_text WHERE description LIKE '%Lacklusture%'\n```"}]}, {"id": "train-9309", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films did a customer named Francis Sikes rent?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'FRANCIS' AND T1.last_name = 'SIKES'\n```"}]}, {"id": "train-9310", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the manager of the store with the largest collection of films?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T3.first_name, T3.last_name, COUNT(T1.film_id) AS num FROM inventory AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id INNER JOIN staff AS T3 ON T2.manager_staff_id = T3.staff_id GROUP BY T3.first_name, T3.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9311", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the addresses of the inactive customers?"}, {"from": "gpt", "value": "```sql\nSELECT T2.address FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.active = 0\n```"}]}, {"id": "train-9312", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which category is the most common?"}, {"from": "gpt", "value": "```sql\nSELECT T.name FROM ( SELECT T2.name, COUNT(T2.name) AS num FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T2.name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9313", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the cast for the film \"Jason trap\"."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'JASON TRAP'\n```"}]}, {"id": "train-9314", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who is the customer with the largest payment for rental films?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, SUM(T2.amount) AS num FROM customer AS T1 INNER JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9315", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the top 5 most-rented films."}, {"from": "gpt", "value": "```sql\nSELECT T.title FROM ( SELECT T3.title, COUNT(T2.inventory_id) AS num FROM rental AS T1 INNER JOIN inventory AS T2 ON T1.inventory_id = T2.inventory_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id GROUP BY T3.title ) AS T ORDER BY T.num DESC LIMIT 5\n```"}]}, {"id": "train-9316", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country does Sasebo belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T1.country FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id WHERE T2.city = 'Sasebo'\n```"}]}, {"id": "train-9317", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the addresses for the stores?"}, {"from": "gpt", "value": "```sql\nSELECT T2.address FROM store AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id\n```"}]}, {"id": "train-9318", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the animation titles."}, {"from": "gpt", "value": "```sql\nSELECT T3.title AS per FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.name = 'Animation'\n```"}]}, {"id": "train-9319", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the city with the most customers?"}, {"from": "gpt", "value": "```sql\nSELECT T.city FROM ( SELECT T1.city, COUNT(T3.customer_id) AS num FROM city AS T1 INNER JOIN address AS T2 ON T2.city_id = T1.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id GROUP BY T1.city ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9320", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which actor acted in the most films?"}, {"from": "gpt", "value": "```sql\nSELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, SUM(T1.film_id) AS num FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9321", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What percentage of films are horror films?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.name = 'Horror', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id\n```"}]}, {"id": "train-9322", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please indicate the full name of actor id 5."}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM actor WHERE actor_id = 5\n```"}]}, {"id": "train-9323", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many id movies have category id 11?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(film_id) FROM film_category WHERE category_id = 11\n```"}]}, {"id": "train-9324", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which category does BABY HALL film belong to?"}, {"from": "gpt", "value": "```sql\nSELECT T3.`name` FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.title = 'BABY HALL'\n```"}]}, {"id": "train-9325", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give the full name of the actor with the highest rental rate."}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T3.film_id = T2.film_id ORDER BY T3.rental_rate DESC LIMIT 1\n```"}]}, {"id": "train-9327", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the full names of customers who have paid more than 10$."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.amount > 10\n```"}]}, {"id": "train-9328", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the address of the customer whose first name is SUSAN with the postal code 77948."}, {"from": "gpt", "value": "```sql\nSELECT T1.address FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'SUSAN' AND T1.postal_code = 77948\n```"}]}, {"id": "train-9329", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers have an address in Abu Dhabi city? List those customer names."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.city_id) FROM city AS T1 INNER JOIN address AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id WHERE T1.city = 'Abu Dhabi'\n```"}]}, {"id": "train-9330", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please provide the full name of the customer at 692 Joliet Street."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T1.address = '692 Joliet Street'\n```"}]}, {"id": "train-9332", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which actor acted in ANONYMOUS HUMAN?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T3.film_id = T2.film_id WHERE T3.title = 'ANONYMOUS HUMAN'\n```"}]}, {"id": "train-9333", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which movie title has the lowest movie rental in the horror category?"}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Horror' ORDER BY T1.rental_rate LIMIT 1\n```"}]}, {"id": "train-9334", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List the descriptions of movies under the category Travel."}, {"from": "gpt", "value": "```sql\nSELECT T1.description FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Travel'\n```"}]}, {"id": "train-9335", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total payment amount of customers in Nagasaki district."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id WHERE T3.district = 'Nagasaki'\n```"}]}, {"id": "train-9336", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of total payment of MARGARET MOORE customers."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T2.first_name = 'MARGARET' AND T2.last_name = 'MOORE', T1.amount, 0)) AS REAL) * 100 / SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id\n```"}]}, {"id": "train-9337", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the percentage of movie titles with a screen length of more than 120 minutes that have a category of horror movies."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T3.`name` = 'Horror', 1, 0)) * 100 / COUNT(T1.film_id) AS REAL) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.length > 120\n```"}]}, {"id": "train-9338", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many film titles were released in 2006?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(film_id) FROM film WHERE release_year = 2006\n```"}]}, {"id": "train-9339", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down film titles from id 1 to 10."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE film_id BETWEEN 1 AND 10\n```"}]}, {"id": "train-9340", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all of the film IDs with highest rental duration."}, {"from": "gpt", "value": "```sql\nSELECT film_id FROM film WHERE rental_duration = ( SELECT MAX(rental_duration) FROM film )\n```"}]}, {"id": "train-9341", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which film titles have the most expensive rental rate?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE rental_rate = ( SELECT MAX(rental_rate) FROM film )\n```"}]}, {"id": "train-9342", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all of the film titles that are rated for general audiences."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE rating = 'G'\n```"}]}, {"id": "train-9343", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the language for film titled \"CHILL LUCK\"?"}, {"from": "gpt", "value": "```sql\nSELECT T2.`name` FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'CHILL LUCK'\n```"}]}, {"id": "train-9344", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the last updated date for English film titles that were released in 2006?"}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.last_update FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T2.`name` = 'English' AND T1.release_year = 2006\n```"}]}, {"id": "train-9345", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many Italian film titles were special featured with deleted scenes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T2.`name` = 'Italian' AND T1.special_features = 'deleted scenes'\n```"}]}, {"id": "train-9346", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many animation film titles are rated for adults only?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.title) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'animation' AND T1.rating = 'NC-17'\n```"}]}, {"id": "train-9350", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the category of film titled \"BLADE POLISH\"?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.title = 'BLADE POLISH'\n```"}]}, {"id": "train-9351", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is Mary Smith's rental ID?"}, {"from": "gpt", "value": "```sql\nSELECT T2.rental_id FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'MARY' AND T1.last_name = 'SMITH'\n```"}]}, {"id": "train-9352", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all of the customers' first name who were attended by staff with ID 1."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.staff_id = 1\n```"}]}, {"id": "train-9353", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down email address of customers who were attended by staff with ID 2."}, {"from": "gpt", "value": "```sql\nSELECT DISTINCT T1.email FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.staff_id = 2\n```"}]}, {"id": "train-9354", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down the actor IDs of film titled \"BOUND CHEAPER\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.actor_id FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id WHERE T1.title = 'BOUND CHEAPER'\n```"}]}, {"id": "train-9355", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the inventory ID of Karen Jackson?"}, {"from": "gpt", "value": "```sql\nSELECT T2.inventory_id FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'KAREN' AND T1.last_name = 'JACKSON'\n```"}]}, {"id": "train-9356", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List down all film titles starred by Jane Jackman."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T2.actor_id = T3.actor_id WHERE T3.first_name = 'JANE' AND T3.last_name = 'JACKMAN'\n```"}]}, {"id": "train-9357", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the actors of film titled \"BIRD INDEPENDENCE\"?"}, {"from": "gpt", "value": "```sql\nSELECT T3.first_name, T3.last_name FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T2.actor_id = T3.actor_id WHERE T1.title = 'BIRD INDEPENDENCE'\n```"}]}, {"id": "train-9358", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total rental rate for animation film titles."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.rental_rate) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Animation'\n```"}]}, {"id": "train-9359", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rental rate of sci-fi film titles?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T1.rental_rate) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T3.`name` = 'Sci-Fi'\n```"}]}, {"id": "train-9360", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the percentage of horror film titles in English film titles?"}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(IIF(T3.name = 'Horror', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T1.category_id = T3.category_id INNER JOIN language AS T4 ON T2.language_id = T4.language_id WHERE T4.name = 'English'\n```"}]}, {"id": "train-9361", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the adult films, how many of them have a rental duration of fewer than 4 days?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(film_id) FROM film WHERE rating = 'NC-17' AND rental_duration < 4\n```"}]}, {"id": "train-9362", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the title of the restricted film, whose length is 71 minutes and whose replacement cost is $29.99?"}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE replacement_cost = 29.99 AND rating = 'R' AND length = 71\n```"}]}, {"id": "train-9364", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Compute the total payment made by Sarah Lewis for film rentals so far."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T3.amount) FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN payment AS T3 ON T1.rental_id = T3.rental_id WHERE T2.first_name = 'SARAH' AND T2.last_name = 'LEWIS'\n```"}]}, {"id": "train-9365", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: From 5/30/2005 at 3:43:54 AM to 7/31/2005 at 10:08:29 PM, how many times did Susan Wilson pay for film rentals?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_date BETWEEN '2005-05-30 03:43:54' AND '2005-07-31 10:08:29'\n```"}]}, {"id": "train-9366", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tally the full names of actors in the film \"Alabama Devil.\""}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name 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 WHERE T3.title = 'ALABAMA DEVIL'\n```"}]}, {"id": "train-9367", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Tell me the title of the film in which Sandra Kilmer is one of the actors."}, {"from": "gpt", "value": "```sql\nSELECT T3.title 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 WHERE T2.first_name = 'SANDRA' AND T2.last_name = 'KILMER'\n```"}]}, {"id": "train-9368", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many documentary films are rated PG-13?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Documentary' AND T1.rating = 'PG-13'\n```"}]}, {"id": "train-9369", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Give me the title and category name of films whose price per day is more than $30. Please include their special features."}, {"from": "gpt", "value": "```sql\nSELECT T1.title, T3.name, T1.special_features FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.rental_duration * T1.rental_rate > 30\n```"}]}, {"id": "train-9370", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the cast members of the movie 'African Egg'."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name 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 WHERE T3.title = 'AFRICAN EGG'\n```"}]}, {"id": "train-9371", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the number of movies rented by Maria Miller."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.rental_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Maria' AND T1.last_name = 'Miller'\n```"}]}, {"id": "train-9372", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the most recent movie rented by Dorothy Taylor."}, {"from": "gpt", "value": "```sql\nSELECT T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'DOROTHY' AND T1.last_name = 'TAYLOR' ORDER BY T2.rental_date DESC LIMIT 1\n```"}]}, {"id": "train-9373", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Determine the number of action movies available for rent."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.film_id) FROM category AS T1 INNER JOIN film_category AS T2 ON T1.category_id = T2.category_id WHERE T1.name = 'Action'\n```"}]}, {"id": "train-9374", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Where can you rent the movie 'Wyoming Storm'? Identify the address of the rental store and the rental rate."}, {"from": "gpt", "value": "```sql\nSELECT T2.store_id, T1.address, T4.rental_rate FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id INNER JOIN inventory AS T3 ON T2.store_id = T3.store_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T4.title = 'WYOMING STORM'\n```"}]}, {"id": "train-9376", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the number of movies that starred Nick Stallone."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id AND T2.first_name = 'NICK' AND T2.last_name = 'STALLONE'\n```"}]}, {"id": "train-9377", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Name the movie with the highest rental revenue among the shortest films."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE length = ( SELECT MIN(length) FROM film ) ORDER BY rental_duration * rental_rate DESC LIMIT 1\n```"}]}, {"id": "train-9378", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the total amount paid by Stephanie Mitchell for film rentals in June 2005."}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'STEPHANIE' AND T2.last_name = 'MITCHELL' AND SUBSTR(T1.payment_date, 1, 7) = '2005-06'\n```"}]}, {"id": "train-9379", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average replacement cost for the movies with a rental rate of 4.99?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(replacement_cost) FROM film WHERE rental_rate = 4.99\n```"}]}, {"id": "train-9380", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average rental rate for PG-13 rated movies?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(rental_rate) FROM film WHERE rating = 'PG-13'\n```"}]}, {"id": "train-9381", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Indicate the percentage of inactive customers at store no.1."}, {"from": "gpt", "value": "```sql\nSELECT CAST(SUM(CASE WHEN active = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(customer_id) FROM customer WHERE store_id = 1\n```"}]}, {"id": "train-9382", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: For how long can you rent the movie 'Dirty Ace'?"}, {"from": "gpt", "value": "```sql\nSELECT rental_duration FROM film WHERE title = 'DIRTY ACE'\n```"}]}, {"id": "train-9383", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Identify the full name of the customer, who has the following email address: SHEILA.WELLS@sakilacustomer.org."}, {"from": "gpt", "value": "```sql\nSELECT first_name, last_name FROM customer WHERE email = 'SHEILA.WELLS@sakilacustomer.org'\n```"}]}, {"id": "train-9384", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the list of the longest movies. Arrange these titles in alphabetical order."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE length = ( SELECT MAX(length) FROM film )\n```"}]}, {"id": "train-9385", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many film categories are there?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(DISTINCT category_id) FROM category\n```"}]}, {"id": "train-9386", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many titles did Mary Smith rent in 2005? Determine the percentage of titles rented in June 2005."}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.rental_id) , CAST(SUM(IIF(STRFTIME('%m',T2.rental_date) = '7', 1, 0)) AS REAL) * 100 / COUNT(T2.rental_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Maria' AND T1.last_name = 'Miller' AND STRFTIME('%Y',T2.rental_date) = '2005'\n```"}]}, {"id": "train-9387", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are still active?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(customer_id) FROM customer WHERE active = 1\n```"}]}, {"id": "train-9388", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the films that are rated as PG-13."}, {"from": "gpt", "value": "```sql\nSELECT title FROM film WHERE rating = 'PG-13'\n```"}]}, {"id": "train-9389", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 10 films that the customers can rent for more than 5 days."}, {"from": "gpt", "value": "```sql\nSELECT T.title FROM ( SELECT T1.title, COUNT(T3.customer_id) AS num FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id WHERE T1.rental_duration > 5 GROUP BY T1.title ) AS T WHERE T.num > 10\n```"}]}, {"id": "train-9390", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the cities that belong to United Arab Emirates."}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'United Arab Emirates'\n```"}]}, {"id": "train-9391", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 5 customers who paid greater than $10. Provide the full name of the customers."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.amount > 10\n```"}]}, {"id": "train-9392", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What films did Burt Dukakis got star in?"}, {"from": "gpt", "value": "```sql\nSELECT T3.title 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 WHERE T2.first_name = 'BURT' AND T2.last_name = 'DUKAKIS'\n```"}]}, {"id": "train-9393", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Provide the full name of all the actors of the film \"Ending Crowds\"."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name 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 WHERE T3.title = 'ENDING CROWDS'\n```"}]}, {"id": "train-9394", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who are the actors starred in the film \"Bound Cheaper\"?"}, {"from": "gpt", "value": "```sql\nSELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'BOUND CHEAPER'\n```"}]}, {"id": "train-9395", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the films that Karl Berr starred in and rated as PG."}, {"from": "gpt", "value": "```sql\nSELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'KARL' AND T1.last_name = 'BERRY' AND T3.rating = 'PG'\n```"}]}, {"id": "train-9396", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 3 cities under the country of Philippines."}, {"from": "gpt", "value": "```sql\nSELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'Philippines'\n```"}]}, {"id": "train-9397", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What are the films that are least rented by the customers?"}, {"from": "gpt", "value": "```sql\nSELECT T.title FROM ( SELECT T3.title, COUNT(T1.customer_id) AS num FROM rental AS T1 INNER JOIN inventory AS T2 ON T1.inventory_id = T2.inventory_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id GROUP BY T3.title ) AS T ORDER BY T.num DESC LIMIT 1\n```"}]}, {"id": "train-9398", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List all the description of the films starring Lucille Tracy?"}, {"from": "gpt", "value": "```sql\nSELECT T1.film_id FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id WHERE T2.first_name = 'LUCILLE' AND T2.last_name = 'TRACY'\n```"}]}, {"id": "train-9399", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which category is the film \"Beach Heartbreakers\" falls into?"}, {"from": "gpt", "value": "```sql\nSELECT T3.name FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.title = 'BEACH HEARTBREAKERS'\n```"}]}, {"id": "train-9400", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: List at least 10 films that falls into the Horror category."}, {"from": "gpt", "value": "```sql\nSELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Horror'\n```"}]}, {"id": "train-9401", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Who among the actors starred in a NC-17 rated film? Provide only the last name of the actors."}, {"from": "gpt", "value": "```sql\nSELECT T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.rating = 'NC-17'\n```"}]}, {"id": "train-9402", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Calculate the average rate of renting the film that Lucille Tracy got starred."}, {"from": "gpt", "value": "```sql\nSELECT AVG(T3.rental_rate) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'LUCILLE' AND T1.last_name = 'TRACY'\n```"}]}, {"id": "train-9403", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many films have a duration between 100 to 110 minutes?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(film_id) FROM film WHERE length BETWEEN 100 AND 110\n```"}]}, {"id": "train-9405", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the active customers, how many of them have Nina as their first name?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(customer_id) FROM customer WHERE first_name = 'Nina' AND active = 1\n```"}]}, {"id": "train-9406", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In store ID 2, how many of the films are R rating?\n"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.store_id = 2 AND T1.rating = 'R'\n```"}]}, {"id": "train-9411", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: In films with a rental rate of 2.99, how many of the films are starred by Nina Soto?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.film_id) 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 WHERE T3.rental_rate = 2.99 AND T2.first_name = 'Nina' AND T2.last_name = 'Soto'\n```"}]}, {"id": "train-9412", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the films starred by Reese West, what is the difference between the films that have store ID of 1 and store ID of 2?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(IIF(T4.film_id = 1, 1, 0)) - SUM(IIF(T4.film_id = 2, 1, 0)) AS diff 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 INNER JOIN inventory AS T4 ON T3.film_id = T4.film_id WHERE T2.first_name = 'Reese' AND T2.last_name = 'West'\n```"}]}, {"id": "train-9413", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the postal code of the address 692 Joliet Street?"}, {"from": "gpt", "value": "```sql\nSELECT postal_code FROM address WHERE address = '692 Joliet Street'\n```"}]}, {"id": "train-9414", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many customers are active?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(customer_id) FROM customer WHERE active = 1\n```"}]}, {"id": "train-9415", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the customers of store no.1, how many of them are active?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(customer_id) FROM customer WHERE active = 1 AND store_id = 1\n```"}]}, {"id": "train-9416", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the address of Mary Smith?"}, {"from": "gpt", "value": "```sql\nSELECT T1.address FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'\n```"}]}, {"id": "train-9417", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among all the active customers, how many of them live in Arlington?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T2.customer_id) FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id INNER JOIN city AS T3 ON T1.city_id = T3.city_id WHERE T2.active = 1 AND T3.city = 'Arlington'\n```"}]}, {"id": "train-9418", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please list the full names of all the customers who live in Italy."}, {"from": "gpt", "value": "```sql\nSELECT T4.first_name, T4.last_name FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id WHERE T3.country = 'Italy'\n```"}]}, {"id": "train-9419", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Which country does Mary Smith live in?"}, {"from": "gpt", "value": "```sql\nSELECT T3.country FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id WHERE T4.first_name = 'MARY' AND T4.last_name = 'SMITH'\n```"}]}, {"id": "train-9420", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the biggest amount of payment for a rental made by Mary Smith?"}, {"from": "gpt", "value": "```sql\nSELECT T1.amount FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' ORDER BY T1.amount DESC LIMIT 1\n```"}]}, {"id": "train-9421", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How many times has Mary Smith rented a film?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'\n```"}]}, {"id": "train-9422", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the total amount of money Mary Smith has spent on film rentals?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'\n```"}]}, {"id": "train-9423", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the times Mary Smith had rented a movie, how many of them happened in June, 2005?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' AND STRFTIME('%Y',T1.payment_date) = '2005' AND STRFTIME('%Y', T1.payment_date) = '6'\n```"}]}, {"id": "train-9424", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Please give the full name of the customer who had made the biggest amount of payment in one single film rental."}, {"from": "gpt", "value": "```sql\nSELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.amount DESC LIMIT 1\n```"}]}, {"id": "train-9425", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: How much in total had the customers in Italy spent on film rentals?"}, {"from": "gpt", "value": "```sql\nSELECT SUM(T5.amount) FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id INNER JOIN payment AS T5 ON T4.customer_id = T5.customer_id WHERE T3.country = 'Italy'\n```"}]}, {"id": "train-9426", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: Among the payments made by Mary Smith, how many of them are over 4.99?"}, {"from": "gpt", "value": "```sql\nSELECT COUNT(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' AND T1.amount > 4.99\n```"}]}, {"id": "train-9427", "db_id": "movie_3", "conversations": [{"from": "human", "value": "Write one SQLite query that answers the question. Reply with only the query in a ```sql block.\n\nQuestion: What is the average amount of money spent by a customer in Italy on a single film rental?"}, {"from": "gpt", "value": "```sql\nSELECT AVG(T5.amount) FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id INNER JOIN payment AS T5 ON T4.customer_id = T5.customer_id WHERE T3.country = 'Italy'\n```"}]}]